From a1d9a9bbc9b17650c31c857e70d9b2e36eb08c95 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sat, 12 Oct 2024 11:54:16 +0300 Subject: [PATCH 01/44] updated go deps and the min Go version in the README --- CONTRIBUTING.md | 2 +- README.md | 2 +- go.mod | 12 ++++++------ go.sum | 8 ++++++++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20aa0118dd..6f83240f66 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ This document describes how to prepare a PR for a change in the main repository. ## Prerequisites -- Go 1.21+ (for making changes in the Go code) +- Go 1.22+ (for making changes in the Go code) - Node 18+ (for making changes in the Admin UI) If you haven't already, you can fork the main repository and clone your fork so that you can work locally: diff --git a/README.md b/README.md index 3b7c8bbf33..4959abb355 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ your own custom app specific business logic and still have a single portable exe Here is a minimal example: -0. [Install Go 1.21+](https://go.dev/doc/install) (_if you haven't already_) +0. [Install Go 1.22+](https://go.dev/doc/install) (_if you haven't already_) 1. Create a new project directory with the following `main.go` file inside it: ```go diff --git a/go.mod b/go.mod index 6e8f1883f7..ef41abd3e5 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/aws/smithy-go v1.20.4 github.com/disintegration/imaging v1.6.2 github.com/domodwyer/mailyak/v3 v3.6.2 - github.com/dop251/goja v0.0.0-20240822155948-fa6d1ed5e4b6 + github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3 github.com/dop251/goja_nodejs v0.0.0-20240728170619-29b559befffc github.com/fatih/color v1.17.0 github.com/fsnotify/fsnotify v1.7.0 @@ -28,8 +28,8 @@ require ( github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 gocloud.dev v0.39.0 - golang.org/x/crypto v0.26.0 - golang.org/x/net v0.28.0 + golang.org/x/crypto v0.28.0 + golang.org/x/net v0.30.0 golang.org/x/oauth2 v0.22.0 golang.org/x/sync v0.8.0 modernc.org/sqlite v1.32.0 @@ -71,9 +71,9 @@ require ( go.opencensus.io v0.24.0 // indirect golang.org/x/image v0.19.0 // indirect golang.org/x/mod v0.19.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect diff --git a/go.sum b/go.sum index 3e6c803c6a..d12eb23845 100644 --- a/go.sum +++ b/go.sum @@ -80,6 +80,8 @@ github.com/domodwyer/mailyak/v3 v3.6.2 h1:x3tGMsyFhTCaxp6ycgR0FE/bu5QiNp+hetUuCO github.com/domodwyer/mailyak/v3 v3.6.2/go.mod h1:lOm/u9CyCVWHeaAmHIdF4RiKVxKUT/H5XX10lIKAL6c= github.com/dop251/goja v0.0.0-20240822155948-fa6d1ed5e4b6 h1:0x8Sh2rKCTVUQnRTJFIwtRWAp91VMsnATQEsMAg14kM= github.com/dop251/goja v0.0.0-20240822155948-fa6d1ed5e4b6/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= +github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3 h1:MXsAuToxwsTn5BEEYm2DheqIiC4jWGmkEJ1uy+KFhvQ= +github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= github.com/dop251/goja_nodejs v0.0.0-20240728170619-29b559befffc h1:MKYt39yZJi0Z9xEeRmDX2L4ocE0ETKcHKw6MVL3R+co= github.com/dop251/goja_nodejs v0.0.0-20240728170619-29b559befffc/go.mod h1:VULptt4Q/fNzQUJlqY/GP3qHyU7ZH46mFkBZe0ZTokU= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -235,6 +237,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.19.0 h1:D9FX4QWkLfkeqaC62SonffIIuYdOk/UE2XKUBgRIBIQ= @@ -257,6 +260,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -279,10 +284,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -290,6 +297,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From e92d3cccd0fdeaa9b277ac8248d2edb6c729ae3a Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 14:23:38 +0300 Subject: [PATCH 02/44] updated jsvm types --- go.mod | 8 +- go.sum | 28 +- .../jsvm/internal/types/generated/types.d.ts | 38506 +++++++++++++--- 3 files changed, 31840 insertions(+), 6702 deletions(-) diff --git a/go.mod b/go.mod index ef41abd3e5..b22ea8de96 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/pocketbase/pocketbase -go 1.22 +go 1.22.0 require ( github.com/AlecAivazis/survey/v2 v2.3.7 @@ -24,7 +24,7 @@ require ( github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 github.com/mattn/go-sqlite3 v1.14.22 github.com/pocketbase/dbx v1.10.1 - github.com/pocketbase/tygoja v0.0.0-20240113091827-17918475d342 + github.com/pocketbase/tygoja v0.0.0-20241015175937-d6ff411a0f75 github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 gocloud.dev v0.39.0 @@ -70,12 +70,12 @@ require ( github.com/valyala/fasttemplate v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/image v0.19.0 // indirect - golang.org/x/mod v0.19.0 // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.23.0 // indirect + golang.org/x/tools v0.26.0 // indirect golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect google.golang.org/api v0.194.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect diff --git a/go.sum b/go.sum index d12eb23845..965ec0ec24 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,6 @@ github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yA github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/domodwyer/mailyak/v3 v3.6.2 h1:x3tGMsyFhTCaxp6ycgR0FE/bu5QiNp+hetUuCOBXMn8= github.com/domodwyer/mailyak/v3 v3.6.2/go.mod h1:lOm/u9CyCVWHeaAmHIdF4RiKVxKUT/H5XX10lIKAL6c= -github.com/dop251/goja v0.0.0-20240822155948-fa6d1ed5e4b6 h1:0x8Sh2rKCTVUQnRTJFIwtRWAp91VMsnATQEsMAg14kM= -github.com/dop251/goja v0.0.0-20240822155948-fa6d1ed5e4b6/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3 h1:MXsAuToxwsTn5BEEYm2DheqIiC4jWGmkEJ1uy+KFhvQ= github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= github.com/dop251/goja_nodejs v0.0.0-20240728170619-29b559befffc h1:MKYt39yZJi0Z9xEeRmDX2L4ocE0ETKcHKw6MVL3R+co= @@ -189,8 +187,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pocketbase/dbx v1.10.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA= github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs= -github.com/pocketbase/tygoja v0.0.0-20240113091827-17918475d342 h1:OcAwewen3hs/zY8i0syt8CcMTGBJhQwQRVDLcoQVXVk= -github.com/pocketbase/tygoja v0.0.0-20240113091827-17918475d342/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI= +github.com/pocketbase/tygoja v0.0.0-20241015175937-d6ff411a0f75 h1:XSbmekxgmbI2uPrre/nkCz7y8VsV652TPb3hAYzPb74= +github.com/pocketbase/tygoja v0.0.0-20241015175937-d6ff411a0f75/go.mod h1:hKJWPGFqavk3cdTa47Qvs8g37lnfI57OYdVVbIqW5aE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -235,8 +233,7 @@ gocloud.dev v0.39.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -246,8 +243,8 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -258,8 +255,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -282,21 +277,18 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -307,8 +299,8 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk= diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index dac56c6171..9c1ad8cbb7 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -1,4 +1,4 @@ -// 1710682789 +// 1729250457 // GENERATED CODE - DO NOT MODIFY BY HAND // ------------------------------------------------------------------- @@ -1148,9 +1148,9 @@ type _TygojaAny = any * functionality. The design is Unix-like, although the error handling is * Go-like; failing calls return values of type error rather than error numbers. * Often, more information is available within the error. For example, - * if a call that takes a file name fails, such as Open or Stat, the error + * if a call that takes a file name fails, such as [Open] or [Stat], the error * will include the failing file name when printed and will be of type - * *PathError, which may be unpacked for more information. + * [*PathError], which may be unpacked for more information. * * The os interface is intended to be uniform across all operating systems. * Features not generally available appear in the system-specific package syscall. @@ -1182,22 +1182,26 @@ type _TygojaAny = any * fmt.Printf("read %d bytes: %q\n", count, data[:count]) * ``` * - * Note: The maximum number of concurrent operations on a File may be limited by - * the OS or the system. The number should be high, but exceeding it may degrade - * performance or cause other issues. + * # Concurrency + * + * The methods of [File] correspond to file system operations. All are + * safe for concurrent use. The maximum number of concurrent + * operations on a File may be limited by the OS or the system. The + * number should be high, but exceeding it may degrade performance or + * cause other issues. */ namespace os { interface readdirMode extends Number{} interface File { /** * Readdir reads the contents of the directory associated with file and - * returns a slice of up to n FileInfo values, as would be returned - * by Lstat, in directory order. Subsequent calls on the same file will yield + * returns a slice of up to n [FileInfo] values, as would be returned + * by [Lstat], in directory order. Subsequent calls on the same file will yield * further FileInfos. * * If n > 0, Readdir returns at most n FileInfo structures. In this case, if * Readdir returns an empty slice, it will return a non-nil error - * explaining why. At the end of a directory, the error is io.EOF. + * explaining why. At the end of a directory, the error is [io.EOF]. * * If n <= 0, Readdir returns all the FileInfo from the directory in * a single slice. In this case, if Readdir succeeds (reads all @@ -1219,7 +1223,7 @@ namespace os { * * If n > 0, Readdirnames returns at most n names. In this case, if * Readdirnames returns an empty slice, it will return a non-nil error - * explaining why. At the end of a directory, the error is io.EOF. + * explaining why. At the end of a directory, the error is [io.EOF]. * * If n <= 0, Readdirnames returns all the names from the directory in * a single slice. In this case, if Readdirnames succeeds (reads all @@ -1232,18 +1236,18 @@ namespace os { } /** * A DirEntry is an entry read from a directory - * (using the ReadDir function or a File's ReadDir method). + * (using the [ReadDir] function or a [File.ReadDir] method). */ interface DirEntry extends fs.DirEntry{} interface File { /** * ReadDir reads the contents of the directory associated with the file f - * and returns a slice of DirEntry values in directory order. + * and returns a slice of [DirEntry] values in directory order. * Subsequent calls on the same file will yield later DirEntry records in the directory. * * If n > 0, ReadDir returns at most n DirEntry records. * In this case, if ReadDir returns an empty slice, it will return an error explaining why. - * At the end of a directory, the error is io.EOF. + * At the end of a directory, the error is [io.EOF]. * * If n <= 0, ReadDir returns all the DirEntry records remaining in the directory. * When it succeeds, it returns a nil error (not io.EOF). @@ -1260,6 +1264,28 @@ namespace os { */ (name: string): Array } + interface copyFS { + /** + * CopyFS copies the file system fsys into the directory dir, + * creating dir if necessary. + * + * Files are created with mode 0o666 plus any execute permissions + * from the source, and directories are created with mode 0o777 + * (before umask). + * + * CopyFS will not overwrite existing files. If a file name in fsys + * already exists in the destination, CopyFS will return an error + * such that errors.Is(err, fs.ErrExist) will be true. + * + * Symbolic links in fsys are not supported. A *PathError with Err set + * to ErrInvalid is returned when copying from a symbolic link. + * + * Symbolic links in dir are followed. + * + * Copying stops at and returns the first error encountered. + */ + (dir: string, fsys: fs.FS): void + } /** * Auxiliary information if the File describes a directory */ @@ -1268,7 +1294,7 @@ namespace os { interface expand { /** * Expand replaces ${var} or $var in the string based on the mapping function. - * For example, os.ExpandEnv(s) is equivalent to os.Expand(s, os.Getenv). + * For example, [os.ExpandEnv](s) is equivalent to [os.Expand](s, [os.Getenv]). */ (s: string, mapping: (_arg0: string) => string): string } @@ -1284,7 +1310,7 @@ namespace os { /** * Getenv retrieves the value of the environment variable named by the key. * It returns the value, which will be empty if the variable is not present. - * To distinguish between an empty value and an unset value, use LookupEnv. + * To distinguish between an empty value and an unset value, use [LookupEnv]. */ (key: string): string } @@ -1353,7 +1379,7 @@ namespace os { } interface newSyscallError { /** - * NewSyscallError returns, as an error, a new SyscallError + * NewSyscallError returns, as an error, a new [SyscallError] * with the given system call name and error details. * As a convenience, if err is nil, NewSyscallError returns nil. */ @@ -1361,53 +1387,55 @@ namespace os { } interface isExist { /** - * IsExist returns a boolean indicating whether the error is known to report - * that a file or directory already exists. It is satisfied by ErrExist as + * IsExist returns a boolean indicating whether its argument is known to report + * that a file or directory already exists. It is satisfied by [ErrExist] as * well as some syscall errors. * - * This function predates errors.Is. It only supports errors returned by + * This function predates [errors.Is]. It only supports errors returned by * the os package. New code should use errors.Is(err, fs.ErrExist). */ (err: Error): boolean } interface isNotExist { /** - * IsNotExist returns a boolean indicating whether the error is known to + * IsNotExist returns a boolean indicating whether its argument is known to * report that a file or directory does not exist. It is satisfied by - * ErrNotExist as well as some syscall errors. + * [ErrNotExist] as well as some syscall errors. * - * This function predates errors.Is. It only supports errors returned by + * This function predates [errors.Is]. It only supports errors returned by * the os package. New code should use errors.Is(err, fs.ErrNotExist). */ (err: Error): boolean } interface isPermission { /** - * IsPermission returns a boolean indicating whether the error is known to - * report that permission is denied. It is satisfied by ErrPermission as well + * IsPermission returns a boolean indicating whether its argument is known to + * report that permission is denied. It is satisfied by [ErrPermission] as well * as some syscall errors. * - * This function predates errors.Is. It only supports errors returned by + * This function predates [errors.Is]. It only supports errors returned by * the os package. New code should use errors.Is(err, fs.ErrPermission). */ (err: Error): boolean } interface isTimeout { /** - * IsTimeout returns a boolean indicating whether the error is known + * IsTimeout returns a boolean indicating whether its argument is known * to report that a timeout occurred. * - * This function predates errors.Is, and the notion of whether an + * This function predates [errors.Is], and the notion of whether an * error indicates a timeout can be ambiguous. For example, the Unix * error EWOULDBLOCK sometimes indicates a timeout and sometimes does not. * New code should use errors.Is with a value appropriate to the call - * returning the error, such as os.ErrDeadlineExceeded. + * returning the error, such as [os.ErrDeadlineExceeded]. */ (err: Error): boolean } interface syscallErrorType extends syscall.Errno{} + interface processMode extends Number{} + interface processStatus extends Number{} /** - * Process stores the information about a process created by StartProcess. + * Process stores the information about a process created by [StartProcess]. */ interface Process { pid: number @@ -1473,7 +1501,7 @@ namespace os { /** * FindProcess looks for a running process by its pid. * - * The Process it returns can be used to obtain information + * The [Process] it returns can be used to obtain information * about the underlying operating system process. * * On Unix systems, FindProcess always succeeds and returns a Process @@ -1486,32 +1514,32 @@ namespace os { interface startProcess { /** * StartProcess starts a new process with the program, arguments and attributes - * specified by name, argv and attr. The argv slice will become os.Args in the + * specified by name, argv and attr. The argv slice will become [os.Args] in the * new process, so it normally starts with the program name. * * If the calling goroutine has locked the operating system thread - * with runtime.LockOSThread and modified any inheritable OS-level + * with [runtime.LockOSThread] and modified any inheritable OS-level * thread state (for example, Linux or Plan 9 name spaces), the new * process will inherit the caller's thread state. * - * StartProcess is a low-level interface. The os/exec package provides + * StartProcess is a low-level interface. The [os/exec] package provides * higher-level interfaces. * - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. */ (name: string, argv: Array, attr: ProcAttr): (Process) } interface Process { /** - * Release releases any resources associated with the Process p, + * Release releases any resources associated with the [Process] p, * rendering it unusable in the future. - * Release only needs to be called if Wait is not. + * Release only needs to be called if [Process.Wait] is not. */ release(): void } interface Process { /** - * Kill causes the Process to exit immediately. Kill does not wait until + * Kill causes the [Process] to exit immediately. Kill does not wait until * the Process has actually exited. This only kills the Process itself, * not any other processes it may have started. */ @@ -1519,7 +1547,7 @@ namespace os { } interface Process { /** - * Wait waits for the Process to exit, and then returns a + * Wait waits for the [Process] to exit, and then returns a * ProcessState describing its status and an error, if any. * Wait releases any resources associated with the Process. * On most operating systems, the Process must be a child @@ -1529,8 +1557,8 @@ namespace os { } interface Process { /** - * Signal sends a signal to the Process. - * Sending Interrupt on Windows is not implemented. + * Signal sends a signal to the [Process]. + * Sending [Interrupt] on Windows is not implemented. */ signal(sig: Signal): void } @@ -1565,7 +1593,7 @@ namespace os { /** * Sys returns system-dependent exit information about * the process. Convert it to the appropriate underlying - * type, such as syscall.WaitStatus on Unix, to access its contents. + * type, such as [syscall.WaitStatus] on Unix, to access its contents. */ sys(): any } @@ -1573,7 +1601,7 @@ namespace os { /** * SysUsage returns system-dependent resource usage information about * the exited process. Convert it to the appropriate underlying - * type, such as *syscall.Rusage on Unix, to access its contents. + * type, such as [*syscall.Rusage] on Unix, to access its contents. * (On Unix, *syscall.Rusage matches struct rusage as defined in the * getrusage(2) manual page.) */ @@ -1607,7 +1635,7 @@ namespace os { * pointing to the correct executable. If a symlink was used to start * the process, depending on the operating system, the result might * be the symlink or the path it pointed to. If a stable result is - * needed, path/filepath.EvalSymlinks might help. + * needed, [path/filepath.EvalSymlinks] might help. * * Executable returns an absolute path unless an error occurred. * @@ -1619,6 +1647,8 @@ namespace os { interface File { /** * Name returns the name of the file as presented to Open. + * + * It is safe to call Name after [Close]. */ name(): string } @@ -1679,8 +1709,8 @@ namespace os { * than ReadFrom. This is used to permit ReadFrom to call io.Copy * without leading to a recursive call to ReadFrom. */ - type _subezgYh = noReadFrom&File - interface fileWithoutReadFrom extends _subezgYh { + type _subomlSs = noReadFrom&File + interface fileWithoutReadFrom extends _subomlSs { } interface File { /** @@ -1724,8 +1754,8 @@ namespace os { * than WriteTo. This is used to permit WriteTo to call io.Copy * without leading to a recursive call to WriteTo. */ - type _subJsbVf = noWriteTo&File - interface fileWithoutWriteTo extends _subJsbVf { + type _subTMSnU = noWriteTo&File + interface fileWithoutWriteTo extends _subTMSnU { } interface File { /** @@ -1771,7 +1801,7 @@ namespace os { interface create { /** * Create creates or truncates the named file. If the file already exists, - * it is truncated. If the file does not exist, it is created with mode 0666 + * it is truncated. If the file does not exist, it is created with mode 0o666 * (before umask). If successful, methods on the returned File can * be used for I/O; the associated file descriptor has mode O_RDWR. * If there is an error, it will be of type *PathError. @@ -1884,11 +1914,11 @@ namespace os { * On Unix, the mode's permission bits, ModeSetuid, ModeSetgid, and * ModeSticky are used. * - * On Windows, only the 0200 bit (owner writable) of mode is used; it + * On Windows, only the 0o200 bit (owner writable) of mode is used; it * controls whether the file's read-only attribute is set or cleared. * The other bits are currently unused. For compatibility with Go 1.12 - * and earlier, use a non-zero mode. Use mode 0400 for a read-only - * file and 0600 for a readable+writable file. + * and earlier, use a non-zero mode. Use mode 0o400 for a read-only + * file and 0o600 for a readable+writable file. * * On Plan 9, the mode's permission bits, ModeAppend, ModeExclusive, * and ModeTemporary are used. @@ -2022,9 +2052,9 @@ namespace os { } interface File { /** - * Close closes the File, rendering it unusable for I/O. - * On files that support SetDeadline, any pending I/O operations will - * be canceled and return immediately with an ErrClosed error. + * Close closes the [File], rendering it unusable for I/O. + * On files that support [File.SetDeadline], any pending I/O operations will + * be canceled and return immediately with an [ErrClosed] error. * Close will return an error if it has already been called. */ close(): void @@ -2034,9 +2064,9 @@ namespace os { * Chown changes the numeric uid and gid of the named file. * If the file is a symbolic link, it changes the uid and gid of the link's target. * A uid or gid of -1 means to not change that value. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. * - * On Windows or Plan 9, Chown always returns the syscall.EWINDOWS or + * On Windows or Plan 9, Chown always returns the [syscall.EWINDOWS] or * EPLAN9 error, wrapped in *PathError. */ (name: string, uid: number, gid: number): void @@ -2045,9 +2075,9 @@ namespace os { /** * Lchown changes the numeric uid and gid of the named file. * If the file is a symbolic link, it changes the uid and gid of the link itself. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. * - * On Windows, it always returns the syscall.EWINDOWS error, wrapped + * On Windows, it always returns the [syscall.EWINDOWS] error, wrapped * in *PathError. */ (name: string, uid: number, gid: number): void @@ -2055,9 +2085,9 @@ namespace os { interface File { /** * Chown changes the numeric uid and gid of the named file. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. * - * On Windows, it always returns the syscall.EWINDOWS error, wrapped + * On Windows, it always returns the [syscall.EWINDOWS] error, wrapped * in *PathError. */ chown(uid: number, gid: number): void @@ -2066,7 +2096,7 @@ namespace os { /** * Truncate changes the size of the file. * It does not change the I/O offset. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. */ truncate(size: number): void } @@ -2082,11 +2112,11 @@ namespace os { /** * Chtimes changes the access and modification times of the named * file, similar to the Unix utime() or utimes() functions. - * A zero time.Time value will leave the corresponding file time unchanged. + * A zero [time.Time] value will leave the corresponding file time unchanged. * * The underlying filesystem may truncate or round the values to a * less precise time unit. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. */ (name: string, atime: time.Time, mtime: time.Time): void } @@ -2094,7 +2124,7 @@ namespace os { /** * Chdir changes the current working directory to the file, * which must be a directory. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. */ chdir(): void } @@ -2111,11 +2141,11 @@ namespace os { * Fd returns the integer Unix file descriptor referencing the open file. * If f is closed, the file descriptor becomes invalid. * If f is garbage collected, a finalizer may close the file descriptor, - * making it invalid; see runtime.SetFinalizer for more information on when - * a finalizer might be run. On Unix systems this will cause the SetDeadline + * making it invalid; see [runtime.SetFinalizer] for more information on when + * a finalizer might be run. On Unix systems this will cause the [File.SetDeadline] * methods to stop working. * Because file descriptors can be reused, the returned file descriptor may - * only be closed through the Close method of f, or by its finalizer during + * only be closed through the [File.Close] method of f, or by its finalizer during * garbage collection. Otherwise, during garbage collection the finalizer * may close an unrelated file descriptor with the same (reused) number. * @@ -2216,7 +2246,7 @@ namespace os { * It removes everything it can but returns the first error * it encounters. If the path does not exist, RemoveAll * returns nil (no error). - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. */ (path: string): void } @@ -2269,7 +2299,7 @@ namespace os { /** * Getgroups returns a list of the numeric ids of groups that the caller belongs to. * - * On Windows, it returns syscall.EWINDOWS. See the os/user package + * On Windows, it returns [syscall.EWINDOWS]. See the [os/user] package * for a possible alternative. */ (): Array @@ -2300,17 +2330,17 @@ namespace os { } interface stat { /** - * Stat returns a FileInfo describing the named file. - * If there is an error, it will be of type *PathError. + * Stat returns a [FileInfo] describing the named file. + * If there is an error, it will be of type [*PathError]. */ (name: string): FileInfo } interface lstat { /** - * Lstat returns a FileInfo describing the named file. + * Lstat returns a [FileInfo] describing the named file. * If the file is a symbolic link, the returned FileInfo * describes the symbolic link. Lstat makes no attempt to follow the link. - * If there is an error, it will be of type *PathError. + * If there is an error, it will be of type [*PathError]. * * On Windows, if the file is a reparse point that is a surrogate for another * named entity (such as a symbolic link or mounted folder), the returned @@ -2320,8 +2350,8 @@ namespace os { } interface File { /** - * Stat returns the FileInfo structure describing file. - * If there is an error, it will be of type *PathError. + * Stat returns the [FileInfo] structure describing file. + * If there is an error, it will be of type [*PathError]. */ stat(): FileInfo } @@ -2337,7 +2367,8 @@ namespace os { * opens the file for reading and writing, and returns the resulting file. * The filename is generated by taking pattern and adding a random string to the end. * If pattern includes a "*", the random string replaces the last "*". - * If dir is the empty string, CreateTemp uses the default directory for temporary files, as returned by TempDir. + * The file is created with mode 0o600 (before umask). + * If dir is the empty string, CreateTemp uses the default directory for temporary files, as returned by [TempDir]. * Multiple programs or goroutines calling CreateTemp simultaneously will not choose the same file. * The caller can use the file's Name method to find the pathname of the file. * It is the caller's responsibility to remove the file when it is no longer needed. @@ -2350,6 +2381,7 @@ namespace os { * and returns the pathname of the new directory. * The new directory's name is generated by adding a random string to the end of pattern. * If pattern includes a "*", the random string replaces the last "*" instead. + * The directory is created with mode 0o700 (before umask). * If dir is the empty string, MkdirTemp uses the default directory for temporary files, as returned by TempDir. * Multiple programs or goroutines calling MkdirTemp simultaneously will not choose the same directory. * It is the caller's responsibility to remove the directory when it is no longer needed. @@ -2364,12 +2396,14 @@ namespace os { } /** * File represents an open file descriptor. + * + * The methods of File are safe for concurrent use. */ - type _subzNURo = file - interface File extends _subzNURo { + type _subOKBJQ = file + interface File extends _subOKBJQ { } /** - * A FileInfo describes a file and is returned by Stat and Lstat. + * A FileInfo describes a file and is returned by [Stat] and [Lstat]. */ interface FileInfo extends fs.FileInfo{} /** @@ -2377,7 +2411,7 @@ namespace os { * The bits have the same definition on all systems, so that * information about files can be moved from one system * to another portably. Not all bits apply to all systems. - * The only required bit is ModeDir for directories. + * The only required bit is [ModeDir] for directories. */ interface FileMode extends fs.FileMode{} interface fileStat { @@ -2392,7 +2426,7 @@ namespace os { * For example, on Unix this means that the device and inode fields * of the two underlying structures are identical; on other systems * the decision may be based on the path names. - * SameFile only applies to results returned by this package's Stat. + * SameFile only applies to results returned by this package's [Stat]. * It returns false in other cases. */ (fi1: FileInfo, fi2: FileInfo): boolean @@ -2470,14 +2504,6 @@ namespace filepath { */ (pattern: string): Array } - /** - * A lazybuf is a lazily constructed path buffer. - * It supports append, reading previously appended bytes, - * and retrieving the final string. It does not allocate a buffer - * to hold the output until that output diverges from s. - */ - interface lazybuf { - } interface clean { /** * Clean returns the shortest path name equivalent to path @@ -2535,6 +2561,19 @@ namespace filepath { */ (path: string): boolean } + interface localize { + /** + * Localize converts a slash-separated path into an operating system path. + * The input path must be a valid path as reported by [io/fs.ValidPath]. + * + * Localize returns an error if the path cannot be represented by the operating system. + * For example, the path a\b is rejected on Windows, on which \ is a separator + * character and cannot be part of a filename. + * + * The path returned by Localize will always be local, as reported by IsLocal. + */ + (path: string): string + } interface toSlash { /** * ToSlash returns the result of replacing each separator character @@ -2548,6 +2587,9 @@ namespace filepath { * FromSlash returns the result of replacing each slash ('/') character * in path with a separator character. Multiple slashes are replaced * by multiple separators. + * + * See also the Localize function, which converts a slash-separated path + * as used by the io/fs package to an operating system path. */ (path: string): string } @@ -2568,7 +2610,7 @@ namespace filepath { * and file set to path. * The returned values have the property that path = dir+file. */ - (path: string): string + (path: string): [string, string] } interface join { /** @@ -2601,6 +2643,12 @@ namespace filepath { */ (path: string): string } + interface isAbs { + /** + * IsAbs reports whether the path is absolute. + */ + (path: string): boolean + } interface abs { /** * Abs returns an absolute representation of path. @@ -2733,12 +2781,6 @@ namespace filepath { */ (path: string): string } - interface isAbs { - /** - * IsAbs reports whether the path is absolute. - */ - (path: string): boolean - } interface hasPrefix { /** * HasPrefix exists for historical compatibility and should not be used. @@ -2761,7 +2803,7 @@ namespace filepath { * pipelines, or redirections typically done by shells. The package * behaves more like C's "exec" family of functions. To expand glob * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the path/filepath package's Glob function. + * dangerous input, or use the [path/filepath] package's Glob function. * To expand environment variables, use package os's ExpandEnv. * * Note that the examples in this package assume a Unix system. @@ -2770,7 +2812,7 @@ namespace filepath { * * # Executables in the current directory * - * The functions Command and LookPath look for a program + * The functions [Command] and [LookPath] look for a program * in the directories listed in the current path, following the * conventions of the host operating system. * Operating systems have for decades included the current @@ -2781,10 +2823,10 @@ namespace filepath { * * To avoid those security problems, as of Go 1.19, this package will not resolve a program * using an implicit or explicit path entry relative to the current directory. - * That is, if you run exec.LookPath("go"), it will not successfully return + * That is, if you run [LookPath]("go"), it will not successfully return * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying errors.Is(err, ErrDot). + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). * * For example, consider these two program snippets: * @@ -2849,12 +2891,12 @@ namespace filepath { namespace exec { interface command { /** - * Command returns the Cmd struct to execute the named program with + * Command returns the [Cmd] struct to execute the named program with * the given arguments. * * It sets only the Path and Args in the returned structure. * - * If name contains no path separators, Command uses LookPath to + * If name contains no path separators, Command uses [LookPath] to * resolve name to a complete path if possible. Otherwise it uses name * directly as Path. * @@ -3101,8 +3143,8 @@ namespace filesystem { */ open(): io.ReadSeekCloser } - type _subRtcDW = bytes.Reader - interface bytesReadSeekCloser extends _subRtcDW { + type _subShExs = bytes.Reader + interface bytesReadSeekCloser extends _subShExs { } interface bytesReadSeekCloser { /** @@ -3201,6 +3243,8 @@ namespace filesystem { interface System { /** * DeletePrefix deletes everything starting with the specified prefix. + * + * The prefix could be subpath (ex. "/a/b/") or filename prefix (ex. "/a/b/file_"). */ deletePrefix(prefix: string): Array } @@ -3234,110 +3278,254 @@ namespace filesystem { import smithyhttp = http interface ignoredHeadersKey { } -} - -/** - * Package template is a thin wrapper around the standard html/template - * and text/template packages that implements a convenient registry to - * load and cache templates on the fly concurrently. - * - * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. - * - * Example: - * - * ``` - * registry := template.NewRegistry() - * - * html1, err := registry.LoadFiles( - * // the files set wil be parsed only once and then cached - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "John"}) - * - * html2, err := registry.LoadFiles( - * // reuse the already parsed and cached files set - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "Jane"}) - * ``` - */ -namespace template { - interface newRegistry { + // @ts-ignore + import awsv2 = aws + // @ts-ignore + import awsv2cfg = config + // @ts-ignore + import s3managerv2 = manager + // @ts-ignore + import s3v2 = s3 + // @ts-ignore + import typesv2 = types + interface hexEscape { /** - * NewRegistry creates and initializes a new templates registry with - * some defaults (eg. global "raw" template function for unescaped HTML). + * HexEscape returns s, with all runes for which shouldEscape returns true + * escaped to "__0xXXX__", where XXX is the hex representation of the rune + * value. For example, " " would escape to "__0x20__". * - * Use the Registry.Load* methods to load templates into the registry. + * Non-UTF-8 strings will have their non-UTF-8 characters escaped to + * unicode.ReplacementChar; the original value is lost. Please file an + * issue if you need non-UTF8 support. + * + * Note: shouldEscape takes the whole string as a slice of runes and an + * index. Passing it a single byte or a single rune doesn't provide + * enough context for some escape decisions; for example, the caller might + * want to escape the second "/" in "//" but not the first one. + * We pass a slice of runes instead of the string or a slice of bytes + * because some decisions will be made on a rune basis (e.g., encode + * all non-ASCII runes). */ - (): (Registry) + (s: string, shouldEscape: (s: Array, i: number) => boolean): string } - /** - * Registry defines a templates registry that is safe to be used by multiple goroutines. - * - * Use the Registry.Load* methods to load templates into the registry. - */ - interface Registry { + interface hexUnescape { + /** + * HexUnescape reverses HexEscape. + */ + (s: string): string } - interface Registry { + interface urlEscape { /** - * AddFuncs registers new global template functions. + * URLEscape uses url.PathEscape to escape s. + */ + (s: string): string + } + interface urlUnescape { + /** + * URLUnescape reverses URLEscape using url.PathUnescape. If the unescape + * returns an error, it returns s. + */ + (s: string): string + } + interface useV2 { + /** + * UseV2 returns true iff the URL parameters indicate that the provider + * should use the AWS SDK v2. * - * The key of each map entry is the function name that will be used in the templates. - * If a function with the map entry name already exists it will be replaced with the new one. + * "awssdk=v1" will force V1. + * "awssdk=v2" will force V2. + * No "awssdk" parameter (or any other value) will return the default, currently V1. + * Note that the default may change in the future. + */ + (q: url.Values): boolean + } + interface newDefaultV2Config { + /** + * NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options. + */ + (ctx: context.Context): awsv2.Config + } + interface v2ConfigFromURLParams { + /** + * V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL + * parameters in q. It is intended to be used by URLOpeners for AWS services if + * UseV2 returns true. * - * The value of each map entry is a function that must have either a - * single return value, or two return values of which the second has type error. + * https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config * - * Example: + * It returns an error if q contains any unknown query parameters; callers + * should remove any query parameters they know about from q before calling + * V2ConfigFromURLParams. * - * r.AddFuncs(map[string]any{ + * The following query options are supported: * ``` - * "toUpper": func(str string) string { - * return strings.ToUppser(str) - * }, - * ... + * - region: The AWS region for requests; sets WithRegion. + * - profile: The shared config profile to use; sets SharedConfigProfile. + * - endpoint: The AWS service endpoint to send HTTP request. * ``` - * }) */ - addFuncs(funcs: _TygojaDict): (Registry) + (ctx: context.Context, q: url.Values): awsv2.Config } - interface Registry { + interface urlSessionOpener { + } + interface urlSessionOpener { + openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) + } + /** + * URLOpener opens S3 URLs like "s3://mybucket". + * + * The URL host is used as the bucket name. + * + * Use "awssdk=v1" to force using AWS SDK v1, "awssdk=v2" to force using AWS SDK v2, + * or anything else to accept the default. + * + * For V1, see gocloud.dev/aws/ConfigFromURLParams for supported query parameters + * for overriding the aws.Session from the URL. + * For V2, see gocloud.dev/aws/V2ConfigFromURLParams. + */ + interface URLOpener { /** - * LoadFiles caches (if not already) the specified filenames set as a - * single template and returns a ready to use Renderer instance. - * - * There must be at least 1 filename specified. + * UseV2 indicates whether the AWS SDK V2 should be used. */ - loadFiles(...filenames: string[]): (Renderer) + useV2: boolean + /** + * Options specifies the options to pass to OpenBucket. + */ + options: Options } - interface Registry { + interface URLOpener { /** - * LoadString caches (if not already) the specified inline string as a - * single template and returns a ready to use Renderer instance. + * OpenBucketURL opens a blob.Bucket based on u. */ - loadString(text: string): (Renderer) + openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) } - interface Registry { + /** + * Options sets options for constructing a *blob.Bucket backed by fileblob. + */ + interface Options { /** - * LoadFS caches (if not already) the specified fs and globPatterns - * pair as single template and returns a ready to use Renderer instance. - * - * There must be at least 1 file matching the provided globPattern(s) - * (note that most file names serves as glob patterns matching themselves). + * UseLegacyList forces the use of ListObjects instead of ListObjectsV2. + * Some S3-compatible services (like CEPH) do not currently support + * ListObjectsV2. */ - loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer) + useLegacyList: boolean + } + interface openBucketV2 { + /** + * OpenBucketV2 returns a *blob.Bucket backed by S3, using AWS SDK v2. + */ + (ctx: context.Context, client: s3v2.Client, bucketName: string, opts: Options): (blob.Bucket) } /** - * Renderer defines a single parsed template. + * reader reads an S3 object. It implements io.ReadCloser. */ - interface Renderer { + interface reader { } - interface Renderer { + interface reader { + read(p: string|Array): number + } + interface reader { /** - * Render executes the template with the specified data as the dot object - * and returns the result as plain string. + * Close closes the reader itself. It must be called when done reading. */ - render(data: any): string + close(): void + } + interface reader { + as(i: { + }): boolean + } + interface reader { + attributes(): (any) + } + /** + * writer writes an S3 object, it implements io.WriteCloser. + */ + interface writer { + } + interface writer { + /** + * Write appends p to w.pw. User must call Close to close the w after done writing. + */ + write(p: string|Array): number + } + interface writer { + /** + * Upload reads from r. Per the driver, it is guaranteed to be the only + * write call for this writer. + */ + upload(r: io.Reader): void + } + interface writer { + /** + * Close completes the writer and closes it. Any error occurring during write + * will be returned. If a writer is closed before any Write is called, Close + * will create an empty file at the given key. + */ + close(): void + } + /** + * bucket represents an S3 bucket and handles read, write and delete operations. + */ + interface bucket { + } + interface bucket { + close(): void + } + interface bucket { + errorCode(err: Error): gcerrors.ErrorCode + } + interface bucket { + /** + * ListPaged implements driver.ListPaged. + */ + listPaged(ctx: context.Context, opts: any): (any) + } + interface bucket { + /** + * As implements driver.As. + */ + as(i: { + }): boolean + } + interface bucket { + /** + * As implements driver.ErrorAs. + */ + errorAs(err: Error, i: { + }): boolean + } + interface bucket { + /** + * Attributes implements driver.Attributes. + */ + attributes(ctx: context.Context, key: string): (any) + } + interface bucket { + /** + * NewRangeReader implements driver.NewRangeReader. + */ + newRangeReader(ctx: context.Context, key: string, offset: number, length: number, opts: any): any + } + interface bucket { + /** + * NewTypedWriter implements driver.NewTypedWriter. + */ + newTypedWriter(ctx: context.Context, key: string, contentType: string, opts: any): any + } + interface bucket { + /** + * Copy implements driver.Copy. + */ + copy(ctx: context.Context, dstKey: string, srcKey: string, opts: any): void + } + interface bucket { + /** + * Delete implements driver.Delete. + */ + delete(ctx: context.Context, key: string): void + } + interface bucket { + signedURL(ctx: context.Context, key: string, opts: any): string } } @@ -3714,14 +3902,14 @@ namespace dbx { /** * MssqlBuilder is the builder for SQL Server databases. */ - type _subrFKDD = BaseBuilder - interface MssqlBuilder extends _subrFKDD { + type _subHvLxi = BaseBuilder + interface MssqlBuilder extends _subHvLxi { } /** * MssqlQueryBuilder is the query builder for SQL Server databases. */ - type _submHtvV = BaseQueryBuilder - interface MssqlQueryBuilder extends _submHtvV { + type _subVtFMi = BaseQueryBuilder + interface MssqlQueryBuilder extends _subVtFMi { } interface newMssqlBuilder { /** @@ -3792,8 +3980,8 @@ namespace dbx { /** * MysqlBuilder is the builder for MySQL databases. */ - type _subIVLoN = BaseBuilder - interface MysqlBuilder extends _subIVLoN { + type _subcGgwD = BaseBuilder + interface MysqlBuilder extends _subcGgwD { } interface newMysqlBuilder { /** @@ -3868,14 +4056,14 @@ namespace dbx { /** * OciBuilder is the builder for Oracle databases. */ - type _subfiTVV = BaseBuilder - interface OciBuilder extends _subfiTVV { + type _subPThpx = BaseBuilder + interface OciBuilder extends _subPThpx { } /** * OciQueryBuilder is the query builder for Oracle databases. */ - type _subrSBRI = BaseQueryBuilder - interface OciQueryBuilder extends _subrSBRI { + type _subNOiLF = BaseQueryBuilder + interface OciQueryBuilder extends _subNOiLF { } interface newOciBuilder { /** @@ -3938,8 +4126,8 @@ namespace dbx { /** * PgsqlBuilder is the builder for PostgreSQL databases. */ - type _subtFJti = BaseBuilder - interface PgsqlBuilder extends _subtFJti { + type _subwdQYB = BaseBuilder + interface PgsqlBuilder extends _subwdQYB { } interface newPgsqlBuilder { /** @@ -4006,8 +4194,8 @@ namespace dbx { /** * SqliteBuilder is the builder for SQLite databases. */ - type _subrBNop = BaseBuilder - interface SqliteBuilder extends _subrBNop { + type _subuwoLq = BaseBuilder + interface SqliteBuilder extends _subuwoLq { } interface newSqliteBuilder { /** @@ -4106,8 +4294,8 @@ namespace dbx { /** * StandardBuilder is the builder that is used by DB for an unknown driver. */ - type _subesQFA = BaseBuilder - interface StandardBuilder extends _subesQFA { + type _subQKHka = BaseBuilder + interface StandardBuilder extends _subQKHka { } interface newStandardBuilder { /** @@ -4173,8 +4361,8 @@ namespace dbx { * DB enhances sql.DB by providing a set of DB-agnostic query building methods. * DB allows easier query building and population of data into Go variables. */ - type _subkWabA = Builder - interface DB extends _subkWabA { + type _subDKzjR = Builder + interface DB extends _subDKzjR { /** * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ @@ -4978,8 +5166,8 @@ namespace dbx { * Rows enhances sql.Rows by providing additional data query methods. * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. */ - type _subrMzGi = sql.Rows - interface Rows extends _subrMzGi { + type _subnAbdX = sql.Rows + interface Rows extends _subnAbdX { } interface Rows { /** @@ -5337,8 +5525,8 @@ namespace dbx { }): string } interface structInfo { } - type _subSCEkW = structInfo - interface structValue extends _subSCEkW { + type _subxLLPJ = structInfo + interface structValue extends _subxLLPJ { } interface fieldInfo { } @@ -5377,8 +5565,8 @@ namespace dbx { /** * Tx enhances sql.Tx with additional querying methods. */ - type _subXvIkD = Builder - interface Tx extends _subXvIkD { + type _subqhOLL = Builder + interface Tx extends _subqhOLL { } interface Tx { /** @@ -5459,6 +5647,14 @@ namespace mails { */ (app: CoreApp, admin: models.Admin): void } + interface sendRecordPasswordLoginAlert { + /** + * @todo remove after the refactoring + * + * SendRecordPasswordLoginAlert sends a OAuth2 password login alert to the specified auth record. + */ + (app: CoreApp, authRecord: models.Record, ...providerNames: string[]): void + } interface sendRecordPasswordReset { /** * SendRecordPasswordReset sends a password reset request email to the specified user. @@ -6396,8 +6592,8 @@ namespace forms { /** * SettingsUpsert is a [settings.Settings] upsert (create/update) form. */ - type _subxZPsK = settings.Settings - interface SettingsUpsert extends _subxZPsK { + type _subIwjtv = settings.Settings + interface SettingsUpsert extends _subIwjtv { } interface newSettingsUpsert { /** @@ -6719,7 +6915,7 @@ namespace apis { codeChallenge: string codeChallengeMethod: string } - interface oauth2EventMessage { + interface oauth2RedirectData { state: string code: string error: string @@ -6828,8 +7024,8 @@ namespace pocketbase { /** * appWrapper serves as a private CoreApp instance wrapper. */ - type _subXbotK = CoreApp - interface appWrapper extends _subXbotK { + type _subRaHzg = CoreApp + interface appWrapper extends _subRaHzg { } /** * PocketBase defines a PocketBase app launcher. @@ -6837,8 +7033,8 @@ namespace pocketbase { * It implements [CoreApp] via embedding and all of the app interface methods * could be accessed directly through the instance (eg. PocketBase.DataDir()). */ - type _subYRHBu = appWrapper - interface PocketBase extends _subYRHBu { + type _subNtXmf = appWrapper + interface PocketBase extends _subNtXmf { /** * RootCmd is the main console command */ @@ -6922,23 +7118,128 @@ namespace pocketbase { } /** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. + * Package template is a thin wrapper around the standard html/template + * and text/template packages that implements a convenient registry to + * load and cache templates on the fly concurrently. * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. + * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. + * + * Example: + * + * ``` + * registry := template.NewRegistry() + * + * html1, err := registry.LoadFiles( + * // the files set wil be parsed only once and then cached + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "John"}) + * + * html2, err := registry.LoadFiles( + * // reuse the already parsed and cached files set + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "Jane"}) + * ``` */ -namespace io { - /** - * Reader is the interface that wraps the basic Read method. - * - * Read reads up to len(p) bytes into p. It returns the number of bytes - * read (0 <= n <= len(p)) and any error encountered. Even if Read - * returns n < len(p), it may use all of p as scratch space during the call. - * If some data is available but not len(p) bytes, Read conventionally +namespace template { + interface newRegistry { + /** + * NewRegistry creates and initializes a new templates registry with + * some defaults (eg. global "raw" template function for unescaped HTML). + * + * Use the Registry.Load* methods to load templates into the registry. + */ + (): (Registry) + } + /** + * Registry defines a templates registry that is safe to be used by multiple goroutines. + * + * Use the Registry.Load* methods to load templates into the registry. + */ + interface Registry { + } + interface Registry { + /** + * AddFuncs registers new global template functions. + * + * The key of each map entry is the function name that will be used in the templates. + * If a function with the map entry name already exists it will be replaced with the new one. + * + * The value of each map entry is a function that must have either a + * single return value, or two return values of which the second has type error. + * + * Example: + * + * r.AddFuncs(map[string]any{ + * ``` + * "toUpper": func(str string) string { + * return strings.ToUppser(str) + * }, + * ... + * ``` + * }) + */ + addFuncs(funcs: _TygojaDict): (Registry) + } + interface Registry { + /** + * LoadFiles caches (if not already) the specified filenames set as a + * single template and returns a ready to use Renderer instance. + * + * There must be at least 1 filename specified. + */ + loadFiles(...filenames: string[]): (Renderer) + } + interface Registry { + /** + * LoadString caches (if not already) the specified inline string as a + * single template and returns a ready to use Renderer instance. + */ + loadString(text: string): (Renderer) + } + interface Registry { + /** + * LoadFS caches (if not already) the specified fs and globPatterns + * pair as single template and returns a ready to use Renderer instance. + * + * There must be at least 1 file matching the provided globPattern(s) + * (note that most file names serves as glob patterns matching themselves). + */ + loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer) + } + /** + * Renderer defines a single parsed template. + */ + interface Renderer { + } + interface Renderer { + /** + * Render executes the template with the specified data as the dot object + * and returns the result as plain string. + */ + render(data: any): string + } +} + +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * Reader is the interface that wraps the basic Read method. + * + * Read reads up to len(p) bytes into p. It returns the number of bytes + * read (0 <= n <= len(p)) and any error encountered. Even if Read + * returns n < len(p), it may use all of p as scratch space during the call. + * If some data is available but not len(p) bytes, Read conventionally * returns what is available instead of waiting for more. * * When Read encounters an error or end-of-file condition after @@ -6999,8 +7300,8 @@ namespace io { */ namespace bytes { /** - * A Reader implements the io.Reader, io.ReaderAt, io.WriterTo, io.Seeker, - * io.ByteScanner, and io.RuneScanner interfaces by reading from + * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], + * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from * a byte slice. * Unlike a [Buffer], a Reader is read-only and supports seeking. * The zero value for Reader operates like a Reader of an empty slice. @@ -7072,7 +7373,7 @@ namespace bytes { } interface Reader { /** - * Reset resets the [Reader.Reader] to be reading from b. + * Reset resets the [Reader] to be reading from b. */ reset(b: string|Array): void } @@ -7093,7 +7394,7 @@ namespace bytes { * the manuals for the appropriate operating system. * These calls return err == nil to indicate success; otherwise * err is an operating system error describing the failure. - * On most systems, that error has type syscall.Errno. + * On most systems, that error has type [Errno]. * * NOTE: Most of the functions, types, and constants defined in * this package are also available in the [golang.org/x/sys] package. @@ -7193,6 +7494,8 @@ namespace syscall { */ write(f: (fd: number) => boolean): void } + // @ts-ignore + import runtimesyscall = syscall /** * An Errno is an unsigned number describing an error condition. * It implements the error interface. The zero Errno is by convention @@ -7205,7 +7508,7 @@ namespace syscall { * } * ``` * - * Errno values can be tested against error values using errors.Is. + * Errno values can be tested against error values using [errors.Is]. * For example: * * ``` @@ -7240,7 +7543,7 @@ namespace syscall { * changes for clock synchronization, and a “monotonic clock,” which is * not. The general rule is that the wall clock is for telling time and * the monotonic clock is for measuring time. Rather than split the API, - * in this package the Time returned by time.Now contains both a wall + * in this package the Time returned by [time.Now] contains both a wall * clock reading and a monotonic clock reading; later time-telling * operations use the wall clock reading, but later time-measuring * operations, specifically comparisons and subtractions, use the @@ -7257,7 +7560,7 @@ namespace syscall { * elapsed := t.Sub(start) * ``` * - * Other idioms, such as time.Since(start), time.Until(deadline), and + * Other idioms, such as [time.Since](start), [time.Until](deadline), and * time.Now().Before(deadline), are similarly robust against wall clock * resets. * @@ -7282,23 +7585,26 @@ namespace syscall { * * On some systems the monotonic clock will stop if the computer goes to sleep. * On such a system, t.Sub(u) may not accurately reflect the actual - * time that passed between t and u. + * time that passed between t and u. The same applies to other functions and + * methods that subtract times, such as [Since], [Until], [Before], [After], + * [Add], [Sub], [Equal] and [Compare]. In some cases, you may need to strip + * the monotonic clock to get accurate results. * * Because the monotonic clock reading has no meaning outside * the current process, the serialized forms generated by t.GobEncode, * t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic * clock reading, and t.Format provides no format for it. Similarly, the - * constructors time.Date, time.Parse, time.ParseInLocation, and time.Unix, + * constructors [time.Date], [time.Parse], [time.ParseInLocation], and [time.Unix], * as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. * t.UnmarshalJSON, and t.UnmarshalText always create times with * no monotonic clock reading. * - * The monotonic clock reading exists only in Time values. It is not - * a part of Duration values or the Unix times returned by t.Unix and + * The monotonic clock reading exists only in [Time] values. It is not + * a part of [Duration] values or the Unix times returned by t.Unix and * friends. * * Note that the Go == operator compares not just the time instant but - * also the Location and the monotonic clock reading. See the + * also the [Location] and the monotonic clock reading. See the * documentation for the Time type for a discussion of equality * testing for Time values. * @@ -7308,10 +7614,11 @@ namespace syscall { * * # Timer Resolution * - * Timer resolution varies depending on the Go runtime, the operating system + * [Timer] resolution varies depending on the Go runtime, the operating system * and the underlying hardware. - * On Unix, the resolution is approximately 1ms. - * On Windows, the default resolution is approximately 16ms, but + * On Unix, the resolution is ~1ms. + * On Windows version 1803 and newer, the resolution is ~0.5ms. + * On older Windows versions, the default resolution is ~16ms, but * a higher resolution may be requested using [golang.org/x/sys/windows.TimeBeginPeriod]. */ namespace time { @@ -7335,7 +7642,7 @@ namespace time { } interface Time { /** - * GoString implements fmt.GoStringer and formats t to be printed in Go source + * GoString implements [fmt.GoStringer] and formats t to be printed in Go source * code. */ goString(): string @@ -7344,16 +7651,16 @@ namespace time { /** * Format returns a textual representation of the time value formatted according * to the layout defined by the argument. See the documentation for the - * constant called Layout to see how to represent the layout format. + * constant called [Layout] to see how to represent the layout format. * - * The executable example for Time.Format demonstrates the working + * The executable example for [Time.Format] demonstrates the working * of the layout string in detail and is a good reference. */ format(layout: string): string } interface Time { /** - * AppendFormat is like Format but appends the textual + * AppendFormat is like [Time.Format] but appends the textual * representation to b and returns the extended buffer. */ appendFormat(b: string|Array, layout: string): string|Array @@ -7363,27 +7670,27 @@ namespace time { * * Programs using times should typically store and pass them as values, * not pointers. That is, time variables and struct fields should be of - * type time.Time, not *time.Time. + * type [time.Time], not *time.Time. * * A Time value can be used by multiple goroutines simultaneously except - * that the methods GobDecode, UnmarshalBinary, UnmarshalJSON and - * UnmarshalText are not concurrency-safe. + * that the methods [Time.GobDecode], [Time.UnmarshalBinary], [Time.UnmarshalJSON] and + * [Time.UnmarshalText] are not concurrency-safe. * - * Time instants can be compared using the Before, After, and Equal methods. - * The Sub method subtracts two instants, producing a Duration. - * The Add method adds a Time and a Duration, producing a Time. + * Time instants can be compared using the [Time.Before], [Time.After], and [Time.Equal] methods. + * The [Time.Sub] method subtracts two instants, producing a [Duration]. + * The [Time.Add] method adds a Time and a Duration, producing a Time. * * The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. - * As this time is unlikely to come up in practice, the IsZero method gives + * As this time is unlikely to come up in practice, the [Time.IsZero] method gives * a simple way of detecting a time that has not been initialized explicitly. * - * Each time has an associated Location. The methods Local, UTC, and In return a + * Each time has an associated [Location]. The methods [Time.Local], [Time.UTC], and Time.In return a * Time with a specific Location. Changing the Location of a Time value with * these methods does not change the actual instant it represents, only the time * zone in which to interpret it. * - * Representations of a Time value saved by the GobEncode, MarshalBinary, - * MarshalJSON, and MarshalText methods store the Time.Location's offset, but not + * Representations of a Time value saved by the [Time.GobEncode], [Time.MarshalBinary], + * [Time.MarshalJSON], and [Time.MarshalText] methods store the [Time.Location]'s offset, but not * the location name. They therefore lose information about Daylight Saving Time. * * In addition to the required “wall clock” reading, a Time may contain an optional @@ -7476,13 +7783,13 @@ namespace time { * week 52 or 53 of year n-1, and Dec 29 to Dec 31 might belong to week 1 * of year n+1. */ - isoWeek(): number + isoWeek(): [number, number] } interface Time { /** * Clock returns the hour, minute, and second within the day specified by t. */ - clock(): number + clock(): [number, number, number] } interface Time { /** @@ -7579,7 +7886,7 @@ namespace time { * Round returns the result of rounding d to the nearest multiple of m. * The rounding behavior for halfway values is to round away from zero. * If the result exceeds the maximum (or minimum) - * value that can be stored in a Duration, + * value that can be stored in a [Duration], * Round returns the maximum (or minimum) duration. * If m <= 0, Round returns d unchanged. */ @@ -7588,7 +7895,7 @@ namespace time { interface Duration { /** * Abs returns the absolute value of d. - * As a special case, math.MinInt64 is converted to math.MaxInt64. + * As a special case, [math.MinInt64] is converted to [math.MaxInt64]. */ abs(): Duration } @@ -7601,7 +7908,7 @@ namespace time { interface Time { /** * Sub returns the duration t-u. If the result exceeds the maximum (or minimum) - * value that can be stored in a Duration, the maximum (or minimum) duration + * value that can be stored in a [Duration], the maximum (or minimum) duration * will be returned. * To compute t-d for a duration d, use t.Add(-d). */ @@ -7672,7 +7979,7 @@ namespace time { * If the zone goes on forever, end will be returned as a zero Time. * The Location of the returned times will be the same as t. */ - zoneBounds(): Time + zoneBounds(): [Time, Time] } interface Time { /** @@ -7742,7 +8049,7 @@ namespace time { } interface Time { /** - * MarshalJSON implements the json.Marshaler interface. + * MarshalJSON implements the [json.Marshaler] interface. * The time is a quoted string in the RFC 3339 format with sub-second precision. * If the timestamp cannot be represented as valid RFC 3339 * (e.g., the year is out of range), then an error is reported. @@ -7751,14 +8058,14 @@ namespace time { } interface Time { /** - * UnmarshalJSON implements the json.Unmarshaler interface. + * UnmarshalJSON implements the [json.Unmarshaler] interface. * The time must be a quoted string in the RFC 3339 format. */ unmarshalJSON(data: string|Array): void } interface Time { /** - * MarshalText implements the encoding.TextMarshaler interface. + * MarshalText implements the [encoding.TextMarshaler] interface. * The time is formatted in RFC 3339 format with sub-second precision. * If the timestamp cannot be represented as valid RFC 3339 * (e.g., the year is out of range), then an error is reported. @@ -7767,7 +8074,7 @@ namespace time { } interface Time { /** - * UnmarshalText implements the encoding.TextUnmarshaler interface. + * UnmarshalText implements the [encoding.TextUnmarshaler] interface. * The time must be in the RFC 3339 format. */ unmarshalText(data: string|Array): void @@ -8169,88 +8476,326 @@ namespace context { } /** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. + * Package url parses URLs and implements query escaping. */ -namespace sql { - /** - * TxOptions holds the transaction options to be used in [DB.BeginTx]. - */ - interface TxOptions { - /** - * Isolation is the transaction isolation level. - * If zero, the driver or database's default level is used. - */ - isolation: IsolationLevel - readOnly: boolean - } +namespace url { /** - * DB is a database handle representing a pool of zero or more - * underlying connections. It's safe for concurrent use by multiple - * goroutines. + * A URL represents a parsed URL (technically, a URI reference). * - * The sql package creates and frees connections automatically; it - * also maintains a free pool of idle connections. If the database has - * a concept of per-connection state, such state can be reliably observed - * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the - * returned [Tx] is bound to a single connection. Once [Tx.Commit] or - * [Tx.Rollback] is called on the transaction, that transaction's - * connection is returned to [DB]'s idle connection pool. The pool size - * can be controlled with [DB.SetMaxIdleConns]. + * The general form represented is: + * + * ``` + * [scheme:][//[userinfo@]host][/]path[?query][#fragment] + * ``` + * + * URLs that do not start with a slash after the scheme are interpreted as: + * + * ``` + * scheme:opaque[?query][#fragment] + * ``` + * + * The Host field contains the host and port subcomponents of the URL. + * When the port is present, it is separated from the host with a colon. + * When the host is an IPv6 address, it must be enclosed in square brackets: + * "[fe80::1]:80". The [net.JoinHostPort] function combines a host and port + * into a string suitable for the Host field, adding square brackets to + * the host when necessary. + * + * Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. + * A consequence is that it is impossible to tell which slashes in the Path were + * slashes in the raw URL and which were %2f. This distinction is rarely important, + * but when it is, the code should use the [URL.EscapedPath] method, which preserves + * the original encoding of Path. + * + * The RawPath field is an optional field which is only set when the default + * encoding of Path is different from the escaped path. See the EscapedPath method + * for more details. + * + * URL's String method uses the EscapedPath method to obtain the path. */ - interface DB { - } - interface DB { - /** - * PingContext verifies a connection to the database is still alive, - * establishing a connection if necessary. - */ - pingContext(ctx: context.Context): void + interface URL { + scheme: string + opaque: string // encoded opaque data + user?: Userinfo // username and password information + host: string // host or host:port (see Hostname and Port methods) + path: string // path (relative paths may omit leading slash) + rawPath: string // encoded path hint (see EscapedPath method) + omitHost: boolean // do not emit empty host (authority) + forceQuery: boolean // append a query ('?') even if RawQuery is empty + rawQuery: string // encoded query values, without '?' + fragment: string // fragment for references, without '#' + rawFragment: string // encoded fragment hint (see EscapedFragment method) } - interface DB { + interface URL { /** - * Ping verifies a connection to the database is still alive, - * establishing a connection if necessary. - * - * Ping uses [context.Background] internally; to specify the context, use - * [DB.PingContext]. + * EscapedPath returns the escaped form of u.Path. + * In general there are multiple possible escaped forms of any path. + * EscapedPath returns u.RawPath when it is a valid escaping of u.Path. + * Otherwise EscapedPath ignores u.RawPath and computes an escaped + * form on its own. + * The [URL.String] and [URL.RequestURI] methods use EscapedPath to construct + * their results. + * In general, code should call EscapedPath instead of + * reading u.RawPath directly. */ - ping(): void + escapedPath(): string } - interface DB { + interface URL { /** - * Close closes the database and prevents new queries from starting. - * Close then waits for all queries that have started processing on the server - * to finish. - * - * It is rare to Close a [DB], as the [DB] handle is meant to be - * long-lived and shared between many goroutines. + * EscapedFragment returns the escaped form of u.Fragment. + * In general there are multiple possible escaped forms of any fragment. + * EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. + * Otherwise EscapedFragment ignores u.RawFragment and computes an escaped + * form on its own. + * The [URL.String] method uses EscapedFragment to construct its result. + * In general, code should call EscapedFragment instead of + * reading u.RawFragment directly. */ - close(): void + escapedFragment(): string } - interface DB { + interface URL { /** - * SetMaxIdleConns sets the maximum number of connections in the idle - * connection pool. + * String reassembles the [URL] into a valid URL string. + * The general form of the result is one of: * - * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, - * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. + * ``` + * scheme:opaque?query#fragment + * scheme://userinfo@host/path?query#fragment + * ``` * - * If n <= 0, no idle connections are retained. + * If u.Opaque is non-empty, String uses the first form; + * otherwise it uses the second form. + * Any non-ASCII characters in host are escaped. + * To obtain the path, String uses u.EscapedPath(). * - * The default max idle connections is currently 2. This may change in - * a future release. + * In the second form, the following rules apply: + * ``` + * - if u.Scheme is empty, scheme: is omitted. + * - if u.User is nil, userinfo@ is omitted. + * - if u.Host is empty, host/ is omitted. + * - if u.Scheme and u.Host are empty and u.User is nil, + * the entire scheme://userinfo@host/ is omitted. + * - if u.Host is non-empty and u.Path begins with a /, + * the form host/path does not add its own /. + * - if u.RawQuery is empty, ?query is omitted. + * - if u.Fragment is empty, #fragment is omitted. + * ``` */ - setMaxIdleConns(n: number): void + string(): string + } + interface URL { + /** + * Redacted is like [URL.String] but replaces any password with "xxxxx". + * Only the password in u.User is redacted. + */ + redacted(): string + } + /** + * Values maps a string key to a list of values. + * It is typically used for query parameters and form values. + * Unlike in the http.Header map, the keys in a Values map + * are case-sensitive. + */ + interface Values extends _TygojaDict{} + interface Values { + /** + * Get gets the first value associated with the given key. + * If there are no values associated with the key, Get returns + * the empty string. To access multiple values, use the map + * directly. + */ + get(key: string): string + } + interface Values { + /** + * Set sets the key to value. It replaces any existing + * values. + */ + set(key: string, value: string): void + } + interface Values { + /** + * Add adds the value to key. It appends to any existing + * values associated with key. + */ + add(key: string, value: string): void + } + interface Values { + /** + * Del deletes the values associated with key. + */ + del(key: string): void + } + interface Values { + /** + * Has checks whether a given key is set. + */ + has(key: string): boolean + } + interface Values { + /** + * Encode encodes the values into “URL encoded” form + * ("bar=baz&foo=quux") sorted by key. + */ + encode(): string + } + interface URL { + /** + * IsAbs reports whether the [URL] is absolute. + * Absolute means that it has a non-empty scheme. + */ + isAbs(): boolean + } + interface URL { + /** + * Parse parses a [URL] in the context of the receiver. The provided URL + * may be relative or absolute. Parse returns nil, err on parse + * failure, otherwise its return value is the same as [URL.ResolveReference]. + */ + parse(ref: string): (URL) + } + interface URL { + /** + * ResolveReference resolves a URI reference to an absolute URI from + * an absolute base URI u, per RFC 3986 Section 5.2. The URI reference + * may be relative or absolute. ResolveReference always returns a new + * [URL] instance, even if the returned URL is identical to either the + * base or reference. If ref is an absolute URL, then ResolveReference + * ignores base and returns a copy of ref. + */ + resolveReference(ref: URL): (URL) + } + interface URL { + /** + * Query parses RawQuery and returns the corresponding values. + * It silently discards malformed value pairs. + * To check errors use [ParseQuery]. + */ + query(): Values + } + interface URL { + /** + * RequestURI returns the encoded path?query or opaque?query + * string that would be used in an HTTP request for u. + */ + requestURI(): string + } + interface URL { + /** + * Hostname returns u.Host, stripping any valid port number if present. + * + * If the result is enclosed in square brackets, as literal IPv6 addresses are, + * the square brackets are removed from the result. + */ + hostname(): string + } + interface URL { + /** + * Port returns the port part of u.Host, without the leading colon. + * + * If u.Host doesn't contain a valid numeric port, Port returns an empty string. + */ + port(): string + } + interface URL { + marshalBinary(): string|Array + } + interface URL { + unmarshalBinary(text: string|Array): void + } + interface URL { + /** + * JoinPath returns a new [URL] with the provided path elements joined to + * any existing path and the resulting path cleaned of any ./ or ../ elements. + * Any sequences of multiple / characters will be reduced to a single /. + */ + joinPath(...elem: string[]): (URL) + } +} + +/** + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. + * + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. + * + * Drivers that do not support context cancellation will not return until + * after the query is completed. + * + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. + */ +namespace sql { + /** + * TxOptions holds the transaction options to be used in [DB.BeginTx]. + */ + interface TxOptions { + /** + * Isolation is the transaction isolation level. + * If zero, the driver or database's default level is used. + */ + isolation: IsolationLevel + readOnly: boolean + } + /** + * DB is a database handle representing a pool of zero or more + * underlying connections. It's safe for concurrent use by multiple + * goroutines. + * + * The sql package creates and frees connections automatically; it + * also maintains a free pool of idle connections. If the database has + * a concept of per-connection state, such state can be reliably observed + * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the + * returned [Tx] is bound to a single connection. Once [Tx.Commit] or + * [Tx.Rollback] is called on the transaction, that transaction's + * connection is returned to [DB]'s idle connection pool. The pool size + * can be controlled with [DB.SetMaxIdleConns]. + */ + interface DB { + } + interface DB { + /** + * PingContext verifies a connection to the database is still alive, + * establishing a connection if necessary. + */ + pingContext(ctx: context.Context): void + } + interface DB { + /** + * Ping verifies a connection to the database is still alive, + * establishing a connection if necessary. + * + * Ping uses [context.Background] internally; to specify the context, use + * [DB.PingContext]. + */ + ping(): void + } + interface DB { + /** + * Close closes the database and prevents new queries from starting. + * Close then waits for all queries that have started processing on the server + * to finish. + * + * It is rare to Close a [DB], as the [DB] handle is meant to be + * long-lived and shared between many goroutines. + */ + close(): void + } + interface DB { + /** + * SetMaxIdleConns sets the maximum number of connections in the idle + * connection pool. + * + * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, + * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. + * + * If n <= 0, no idle connections are retained. + * + * The default max idle connections is currently 2. This may change in + * a future release. + */ + setMaxIdleConns(n: number): void } interface DB { /** @@ -8823,8 +9368,8 @@ namespace sql { * To protect against malicious inputs, this package sets limits on the size * of the MIME data it processes. * - * Reader.NextPart and Reader.NextRawPart limit the number of headers in a - * part to 10000 and Reader.ReadForm limits the total number of headers in all + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all * FileHeaders to 10000. * These limits may be adjusted with the GODEBUG=multipartmaxheaders= * setting. @@ -8833,11 +9378,6 @@ namespace sql { * This limit may be adjusted with the GODEBUG=multipartmaxparts= * setting. */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. - */ namespace multipart { /** * A FileHeader describes a file part of a multipart request. @@ -8849,7 +9389,7 @@ namespace multipart { } interface FileHeader { /** - * Open opens and returns the FileHeader's associated File. + * Open opens and returns the [FileHeader]'s associated File. */ open(): File } @@ -9222,6 +9762,11 @@ namespace http { * redirects. */ response?: Response + /** + * Pattern is the [ServeMux] pattern that matched the request. + * It is empty if the request was not matched against a pattern. + */ + pattern: string } interface Request { /** @@ -9258,6 +9803,8 @@ namespace http { * Clone returns a deep copy of r with its context changed to ctx. * The provided ctx must be non-nil. * + * Clone only makes a shallow copy of the Body field. + * * For an outgoing client request, the context controls the entire * lifetime of a request and its response: obtaining a connection, * sending the request, and reading the response headers and body. @@ -9283,6 +9830,13 @@ namespace http { */ cookies(): Array<(Cookie | undefined)> } + interface Request { + /** + * CookiesNamed parses and returns the named HTTP cookies sent with the request + * or an empty slice if none matched. + */ + cookiesNamed(name: string): Array<(Cookie | undefined)> + } interface Request { /** * Cookie returns the named cookie provided in the request or @@ -9363,7 +9917,7 @@ namespace http { * Authorization header, if the request uses HTTP Basic Authentication. * See RFC 2617, Section 2. */ - basicAuth(): [string, boolean] + basicAuth(): [string, string, boolean] } interface Request { /** @@ -9586,9 +10140,9 @@ namespace http { * ReadHeaderTimeout is the amount of time allowed to read * request headers. The connection's read deadline is reset * after reading the headers and the Handler can decide what - * is considered too slow for the body. If ReadHeaderTimeout - * is zero, the value of ReadTimeout is used. If both are - * zero, there is no timeout. + * is considered too slow for the body. If zero, the value of + * ReadTimeout is used. If negative, or if zero and ReadTimeout + * is zero or negative, there is no timeout. */ readHeaderTimeout: time.Duration /** @@ -9601,9 +10155,9 @@ namespace http { writeTimeout: time.Duration /** * IdleTimeout is the maximum amount of time to wait for the - * next request when keep-alives are enabled. If IdleTimeout - * is zero, the value of ReadTimeout is used. If both are - * zero, there is no timeout. + * next request when keep-alives are enabled. If zero, the value + * of ReadTimeout is used. If negative, or if zero and ReadTimeout + * is zero or negative, there is no timeout. */ idleTimeout: time.Duration /** @@ -9741,7 +10295,8 @@ namespace http { * * Files containing a certificate and matching private key for the * server must be provided if neither the [Server]'s - * TLSConfig.Certificates nor TLSConfig.GetCertificate are populated. + * TLSConfig.Certificates, TLSConfig.GetCertificate nor + * config.GetConfigForClient are populated. * If the certificate is signed by a certificate authority, the * certFile should be the concatenation of the server's certificate, * any intermediates, and the CA's certificate. @@ -9783,45 +10338,297 @@ namespace http { } /** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the path/filepath package's Glob function. - * To expand environment variables, use package os's ExpandEnv. + * # Value and Pointer Conversion Utilities * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. * - * # Executables in the current directory + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. * - * The functions Command and LookPath look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run exec.LookPath("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying errors.Is(err, ErrDot). + * ``` + * var strPtr *string * - * For example, consider these two program snippets: + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str * + * // With the SDK's conversion functions + * strPtr = aws.String("my string") + * + * // Convert *string to string value + * str = aws.ToString(strPtr) * ``` - * path, err := exec.LookPath("prog") + * + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. + * + * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} + * + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) + * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) + * ``` + * + * # SDK Default HTTP Client + * + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. + * + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. + */ +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + // @ts-ignore + import smithybearer = bearer + /** + * A Config provides service configuration for service clients. + */ + interface Config { + /** + * The region to send requests to. This parameter is required and must + * be configured globally or on a per-client basis unless otherwise + * noted. A full list of regions is found in the "Regions and Endpoints" + * document. + * + * See http://docs.aws.amazon.com/general/latest/gr/rande.html for + * information on AWS regions. + */ + region: string + /** + * The credentials object to use when signing requests. + * Use the LoadDefaultConfig to load configuration from all the SDK's supported + * sources, and resolve credentials using the SDK's default credential chain. + */ + credentials: CredentialsProvider + /** + * The Bearer Authentication token provider to use for authenticating API + * operation calls with a Bearer Authentication token. The API clients and + * operation must support Bearer Authentication scheme in order for the + * token provider to be used. API clients created with NewFromConfig will + * automatically be configured with this option, if the API client support + * Bearer Authentication. + * + * The SDK's config.LoadDefaultConfig can automatically populate this + * option for external configuration options such as SSO session. + * https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html + */ + bearerAuthTokenProvider: smithybearer.TokenProvider + /** + * The HTTP Client the SDK's API clients will use to invoke HTTP requests. + * The SDK defaults to a BuildableClient allowing API clients to create + * copies of the HTTP Client for service specific customizations. + * + * Use a (*http.Client) for custom behavior. Using a custom http.Client + * will prevent the SDK from modifying the HTTP client. + */ + httpClient: HTTPClient + /** + * An endpoint resolver that can be used to provide or override an endpoint + * for the given service and region. + * + * See the `aws.EndpointResolver` documentation for additional usage + * information. + * + * Deprecated: See Config.EndpointResolverWithOptions + */ + endpointResolver: EndpointResolver + /** + * An endpoint resolver that can be used to provide or override an endpoint + * for the given service and region. + * + * When EndpointResolverWithOptions is specified, it will be used by a + * service client rather than using EndpointResolver if also specified. + * + * See the `aws.EndpointResolverWithOptions` documentation for additional + * usage information. + * + * Deprecated: with the release of endpoint resolution v2 in API clients, + * EndpointResolver and EndpointResolverWithOptions are deprecated. + * Providing a value for this field will likely prevent you from using + * newer endpoint-related service features. See API client options + * EndpointResolverV2 and BaseEndpoint. + */ + endpointResolverWithOptions: EndpointResolverWithOptions + /** + * RetryMaxAttempts specifies the maximum number attempts an API client + * will call an operation that fails with a retryable error. + * + * API Clients will only use this value to construct a retryer if the + * Config.Retryer member is not nil. This value will be ignored if + * Retryer is not nil. + */ + retryMaxAttempts: number + /** + * RetryMode specifies the retry model the API client will be created with. + * + * API Clients will only use this value to construct a retryer if the + * Config.Retryer member is not nil. This value will be ignored if + * Retryer is not nil. + */ + retryMode: RetryMode + /** + * Retryer is a function that provides a Retryer implementation. A Retryer + * guides how HTTP requests should be retried in case of recoverable + * failures. When nil the API client will use a default retryer. + * + * In general, the provider function should return a new instance of a + * Retryer if you are attempting to provide a consistent Retryer + * configuration across all clients. This will ensure that each client will + * be provided a new instance of the Retryer implementation, and will avoid + * issues such as sharing the same retry token bucket across services. + * + * If not nil, RetryMaxAttempts, and RetryMode will be ignored by API + * clients. + */ + retryer: () => Retryer + /** + * ConfigSources are the sources that were used to construct the Config. + * Allows for additional configuration to be loaded by clients. + */ + configSources: Array<{ + }> + /** + * APIOptions provides the set of middleware mutations modify how the API + * client requests will be handled. This is useful for adding additional + * tracing data to a request, or changing behavior of the SDK's client. + */ + apiOptions: Array<(_arg0: middleware.Stack) => void> + /** + * The logger writer interface to write logging messages to. Defaults to + * standard error. + */ + logger: logging.Logger + /** + * Configures the events that will be sent to the configured logger. This + * can be used to configure the logging of signing, retries, request, and + * responses of the SDK clients. + * + * See the ClientLogMode type documentation for the complete set of logging + * modes and available configuration. + */ + clientLogMode: ClientLogMode + /** + * The configured DefaultsMode. If not specified, service clients will + * default to legacy. + * + * Supported modes are: auto, cross-region, in-region, legacy, mobile, + * standard + */ + defaultsMode: DefaultsMode + /** + * The RuntimeEnvironment configuration, only populated if the DefaultsMode + * is set to DefaultsModeAuto and is initialized by + * `config.LoadDefaultConfig`. You should not populate this structure + * programmatically, or rely on the values here within your applications. + */ + runtimeEnvironment: RuntimeEnvironment + /** + * AppId is an optional application specific identifier that can be set. + * When set it will be appended to the User-Agent header of every request + * in the form of App/{AppId}. This variable is sourced from environment + * variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id. + * See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for + * more information on environment variables and shared config settings. + */ + appID: string + /** + * BaseEndpoint is an intermediary transfer location to a service specific + * BaseEndpoint on a service's Options. + */ + baseEndpoint?: string + /** + * DisableRequestCompression toggles if an operation request could be + * compressed or not. Will be set to false by default. This variable is sourced from + * environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute + * disable_request_compression + */ + disableRequestCompression: boolean + /** + * RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be + * compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively. + * This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or + * the shared config profile attribute request_min_compression_size_bytes + */ + requestMinCompressSizeBytes: number + /** + * Controls how a resolved AWS account ID is handled for endpoint routing. + */ + accountIDEndpointMode: AccountIDEndpointMode + } + interface Config { + /** + * Copy will return a shallow copy of the Config object. + */ + copy(): Config + } + // @ts-ignore + import sdkrand = rand +} + +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions [Command] and [LookPath] look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run [LookPath]("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") * if err != nil { * log.Fatal(err) * } @@ -9882,7 +10689,7 @@ namespace exec { /** * Cmd represents an external command being prepared or run. * - * A Cmd cannot be reused after calling its Run, Output or CombinedOutput + * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] * methods. */ interface Cmd { @@ -10053,10 +10860,10 @@ namespace exec { * status. * * If the command starts but does not complete successfully, the error is of - * type *ExitError. Other error types may be returned for other situations. + * type [*ExitError]. Other error types may be returned for other situations. * * If the calling goroutine has locked the operating system thread - * with runtime.LockOSThread and modified any inheritable OS-level + * with [runtime.LockOSThread] and modified any inheritable OS-level * thread state (for example, Linux or Plan 9 name spaces), the new * process will inherit the caller's thread state. */ @@ -10068,7 +10875,7 @@ namespace exec { * * If Start returns successfully, the c.Process field will be set. * - * After a successful call to Start the Wait method must be called in + * After a successful call to Start the [Cmd.Wait] method must be called in * order to release associated system resources. */ start(): void @@ -10078,28 +10885,28 @@ namespace exec { * Wait waits for the command to exit and waits for any copying to * stdin or copying from stdout or stderr to complete. * - * The command must have been started by Start. + * The command must have been started by [Cmd.Start]. * * The returned error is nil if the command runs, has no problems * copying stdin, stdout, and stderr, and exits with a zero exit * status. * * If the command fails to run or doesn't complete successfully, the - * error is of type *ExitError. Other error types may be + * error is of type [*ExitError]. Other error types may be * returned for I/O problems. * - * If any of c.Stdin, c.Stdout or c.Stderr are not an *os.File, Wait also waits + * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits * for the respective I/O loop copying to or from the process to complete. * - * Wait releases any resources associated with the Cmd. + * Wait releases any resources associated with the [Cmd]. */ wait(): void } interface Cmd { /** * Output runs the command and returns its standard output. - * Any returned error will usually be of type *ExitError. - * If c.Stderr was nil, Output populates ExitError.Stderr. + * Any returned error will usually be of type [*ExitError]. + * If c.Stderr was nil, Output populates [ExitError.Stderr]. */ output(): string|Array } @@ -10114,7 +10921,7 @@ namespace exec { /** * StdinPipe returns a pipe that will be connected to the command's * standard input when the command starts. - * The pipe will be closed automatically after Wait sees the command exit. + * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. * A caller need only call Close to force the pipe to close sooner. * For example, if the command being run will not exit until standard input * is closed, the caller must close the pipe. @@ -10126,10 +10933,10 @@ namespace exec { * StdoutPipe returns a pipe that will be connected to the command's * standard output when the command starts. * - * Wait will close the pipe after seeing the command exit, so most callers + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers * need not close the pipe themselves. It is thus incorrect to call Wait * before all reads from the pipe have completed. - * For the same reason, it is incorrect to call Run when using StdoutPipe. + * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. * See the example for idiomatic usage. */ stdoutPipe(): io.ReadCloser @@ -10139,10 +10946,10 @@ namespace exec { * StderrPipe returns a pipe that will be connected to the command's * standard error when the command starts. * - * Wait will close the pipe after seeing the command exit, so most callers + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers * need not close the pipe themselves. It is thus incorrect to call Wait * before all reads from the pipe have completed. - * For the same reason, it is incorrect to use Run when using StderrPipe. + * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. * See the StdoutPipe example for idiomatic usage. */ stderrPipe(): io.ReadCloser @@ -10157,2709 +10964,7800 @@ namespace exec { } /** - * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html - * - * See README.md for more info. + * Package s3 provides the API client, operations, and parameter types for Amazon + * Simple Storage Service. */ -namespace jwt { +namespace s3 { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import awshttp = http + // @ts-ignore + import internalauth = auth + // @ts-ignore + import internalauthsmithy = smithy + // @ts-ignore + import internalConfig = configsources + // @ts-ignore + import internalmiddleware = middleware + // @ts-ignore + import acceptencodingcust = accept_encoding + // @ts-ignore + import internalChecksum = checksum + // @ts-ignore + import presignedurlcust = presigned_url + // @ts-ignore + import s3sharedconfig = config + // @ts-ignore + import s3cust = customizations + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithyauth = auth + // @ts-ignore + import smithydocument = document + // @ts-ignore + import smithyhttp = http /** - * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. - * This is the default claims type if you don't supply one + * Client provides the API client to make operations call for Amazon Simple + * Storage Service. */ - interface MapClaims extends _TygojaDict{} - interface MapClaims { - /** - * VerifyAudience Compares the aud claim against cmp. - * If required is false, this method will return true if the value matches or is unset - */ - verifyAudience(cmp: string, req: boolean): boolean + interface Client { } - interface MapClaims { + interface Client { /** - * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). - * If req is false, it will return true, if exp is unset. + * Options returns a copy of the client configuration. + * + * Callers SHOULD NOT perform mutations on any inner structures within client + * config. Config overrides should instead be made on a per-operation basis through + * functional options. */ - verifyExpiresAt(cmp: number, req: boolean): boolean + options(): Options } - interface MapClaims { + interface Client { /** - * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). - * If req is false, it will return true, if iat is unset. + * This operation aborts a multipart upload. After a multipart upload is aborted, + * no additional parts can be uploaded using that upload ID. The storage consumed + * by any previously uploaded parts will be freed. However, if any part uploads are + * currently in progress, those part uploads might or might not succeed. As a + * result, it might be necessary to abort a given multipart upload multiple times + * in order to completely free all storage consumed by all parts. + * + * To verify that all parts have been removed and prevent getting charged for the + * part storage, you should call the [ListParts]API operation and ensure that the parts list + * is empty. + * + * ``` + * - Directory buckets - If multipart uploads in a directory bucket are in + * progress, you can't delete the bucket until all the in-progress multipart + * uploads are aborted or completed. To delete these in-progress multipart uploads, + * use the ListMultipartUploads operation to list the in-progress multipart + * uploads in the bucket and use the AbortMultupartUpload operation to abort all + * the in-progress multipart uploads. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. + * ``` + * + * Permissions + * + * ``` + * - General purpose bucket permissions - For information about permissions + * required to use the multipart upload, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to AbortMultipartUpload : + * + * [CreateMultipartUpload] + * + * [UploadPart] + * + * [CompleteMultipartUpload] + * + * [ListParts] + * + * [ListMultipartUploads] + * + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html */ - verifyIssuedAt(cmp: number, req: boolean): boolean + abortMultipartUpload(ctx: context.Context, params: AbortMultipartUploadInput, ...optFns: ((_arg0: Options) => void)[]): (AbortMultipartUploadOutput) } - interface MapClaims { + interface Client { /** - * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). - * If req is false, it will return true, if nbf is unset. + * Completes a multipart upload by assembling previously uploaded parts. + * + * You first initiate the multipart upload and then upload all parts using the [UploadPart] + * operation or the [UploadPartCopy]operation. After successfully uploading all relevant parts of + * an upload, you call this CompleteMultipartUpload operation to complete the + * upload. Upon receiving this request, Amazon S3 concatenates all the parts in + * ascending order by part number to create a new object. In the + * CompleteMultipartUpload request, you must provide the parts list and ensure that + * the parts list is complete. The CompleteMultipartUpload API operation + * concatenates the parts that you provide in the list. For each part in the list, + * you must provide the PartNumber value and the ETag value that are returned + * after that part was uploaded. + * + * The processing of a CompleteMultipartUpload request could take several minutes + * to finalize. After Amazon S3 begins processing the request, it sends an HTTP + * response header that specifies a 200 OK response. While processing is in + * progress, Amazon S3 periodically sends white space characters to keep the + * connection from timing out. A request could fail after the initial 200 OK + * response has been sent. This means that a 200 OK response can contain either a + * success or an error. The error response might be embedded in the 200 OK + * response. If you call this API operation directly, make sure to design your + * application to parse the contents of the response and handle it appropriately. + * If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect + * the embedded error and apply error handling per your configuration settings + * (including automatically retrying the request as appropriate). If the condition + * persists, the SDKs throw an exception (or, for the SDKs that don't use + * exceptions, they return an error). + * + * Note that if CompleteMultipartUpload fails, applications should be prepared to + * retry any failed requests (including 500 error responses). For more information, + * see [Amazon S3 Error Best Practices]. + * + * You can't use Content-Type: application/x-www-form-urlencoded for the + * CompleteMultipartUpload requests. Also, if you don't provide a Content-Type + * header, CompleteMultipartUpload can still return a 200 OK response. + * + * For more information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Zonal endpoint. These endpoints support virtual-hosted-style + * requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Permissions + * ``` + * - General purpose bucket permissions - For information about permissions + * required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. + * ``` + * + * If you provide an [additional checksum value]in your MultipartUpload requests and the object is encrypted + * + * ``` + * with Key Management Service, you must have permission to use the kms:Decrypt + * action for the CompleteMultipartUpload request to succeed. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * If the object is encrypted with SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * Special errors + * + * ``` + * - Error Code: EntityTooSmall + * + * - Description: Your proposed upload is smaller than the minimum allowed + * object size. Each part must be at least 5 MB in size, except the last part. + * + * - HTTP Status Code: 400 Bad Request + * + * - Error Code: InvalidPart + * + * - Description: One or more of the specified parts could not be found. The + * part might not have been uploaded, or the specified ETag might not have matched + * the uploaded part's ETag. + * + * - HTTP Status Code: 400 Bad Request + * + * - Error Code: InvalidPartOrder + * + * - Description: The list of parts was not in ascending order. The parts list + * must be specified in order by part number. + * + * - HTTP Status Code: 400 Bad Request + * + * - Error Code: NoSuchUpload + * + * - Description: The specified multipart upload does not exist. The upload ID + * might be invalid, or the multipart upload might have been aborted or completed. + * + * - HTTP Status Code: 404 Not Found + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to CompleteMultipartUpload : + * + * [CreateMultipartUpload] + * + * [UploadPart] + * + * [AbortMultipartUpload] + * + * [ListParts] + * + * [ListMultipartUploads] + * + * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html + * [Amazon S3 Error Best Practices]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [additional checksum value]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html + * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html */ - verifyNotBefore(cmp: number, req: boolean): boolean + completeMultipartUpload(ctx: context.Context, params: CompleteMultipartUploadInput, ...optFns: ((_arg0: Options) => void)[]): (CompleteMultipartUploadOutput) } - interface MapClaims { + interface Client { /** - * VerifyIssuer compares the iss claim against cmp. - * If required is false, this method will return true if the value matches or is unset + * Creates a copy of an object that is already stored in Amazon S3. + * + * You can store individual objects of up to 5 TB in Amazon S3. You create a copy + * of your object up to 5 GB in size in a single atomic action using this API. + * However, to copy an object greater than 5 GB, you must use the multipart upload + * Upload Part - Copy (UploadPartCopy) API. For more information, see [Copy Object Using the REST Multipart Upload API]. + * + * You can copy individual objects between general purpose buckets, between + * directory buckets, and between general purpose buckets and directory buckets. + * + * ``` + * - Amazon S3 supports copy operations using Multi-Region Access Points only as + * a destination when using the Multi-Region Access Point ARN. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. + * + * - VPC endpoints don't support cross-Region requests (including copies). If + * you're using VPC endpoints, your source and destination buckets should be in the + * same Amazon Web Services Region as your VPC endpoint. + * ``` + * + * Both the Region that you want to copy the object from and the Region that you + * want to copy the object to must be enabled for your account. For more + * information about how to enable a Region for your account, see [Enable or disable a Region for standalone accounts]in the Amazon + * Web Services Account Management Guide. + * + * Amazon S3 transfer acceleration does not support cross-Region copies. If you + * request a cross-Region copy using a transfer acceleration endpoint, you get a + * 400 Bad Request error. For more information, see [Transfer Acceleration]. + * + * Authentication and authorization All CopyObject requests must be authenticated + * and signed by using IAM credentials (access key ID and secret access key for the + * IAM identities). All headers with the x-amz- prefix, including x-amz-copy-source + * , must be signed. For more information, see [REST Authentication]. + * + * Directory buckets - You must use the IAM credentials to authenticate and + * authorize your access to the CopyObject API operation, instead of using the + * temporary security credentials through the CreateSession API operation. + * + * Amazon Web Services CLI or SDKs handles authentication and authorization on + * your behalf. + * + * Permissions You must have read access to the source object and write access to + * the destination bucket. + * + * ``` + * - General purpose bucket permissions - You must have permissions in an IAM + * policy based on the source and destination bucket types in a CopyObject + * operation. + * + * - If the source object is in a general purpose bucket, you must have + * s3:GetObject permission to read the source object that is being copied. + * + * - If the destination bucket is a general purpose bucket, you must have + * s3:PutObject permission to write the object copy to the destination bucket. + * + * - Directory bucket permissions - You must have permissions in a bucket policy + * or an IAM identity-based policy based on the source and destination bucket types + * in a CopyObject operation. + * + * - If the source object that you want to copy is in a directory bucket, you + * must have the s3express:CreateSession permission in the Action element of a + * policy to read the object. By default, the session is in the ReadWrite mode. + * If you want to restrict the access, you can explicitly set the + * s3express:SessionMode condition key to ReadOnly on the copy source bucket. + * + * - If the copy destination is a directory bucket, you must have the + * s3express:CreateSession permission in the Action element of a policy to write + * the object to the destination. The s3express:SessionMode condition key can't + * be set to ReadOnly on the copy destination bucket. + * ``` + * + * If the object is encrypted with SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. + * + * Response and special errors When the request is an HTTP 1.1 request, the + * response is chunk encoded. When the request is not an HTTP 1.1 request, the + * response would not contain the Content-Length . You always need to read the + * entire response body to check if the copy succeeds. + * + * ``` + * - If the copy is successful, you receive a response with information about + * the copied object. + * + * - A copy request might return an error when Amazon S3 receives the copy + * request or while Amazon S3 is copying the files. A 200 OK response can contain + * either a success or an error. + * + * - If the error occurs before the copy action starts, you receive a standard + * Amazon S3 error. + * + * - If the error occurs during the copy operation, the error response is + * embedded in the 200 OK response. For example, in a cross-region copy, you may + * encounter throttling and receive a 200 OK response. For more information, see [Resolve the Error 200 response when copying objects to Amazon S3] + * . The 200 OK status code means the copy was accepted, but it doesn't mean the + * copy is complete. Another example is when you disconnect from Amazon S3 before + * the copy is complete, Amazon S3 might cancel the copy and you may receive a + * 200 OK response. You must stay connected to Amazon S3 until the entire + * response is successfully received and processed. + * ``` + * + * If you call this API operation directly, make sure to design your application + * + * ``` + * to parse the content of the response and handle it appropriately. If you use + * Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the + * embedded error and apply error handling per your configuration settings + * (including automatically retrying the request as appropriate). If the condition + * persists, the SDKs throw an exception (or, for the SDKs that don't use + * exceptions, they return an error). + * ``` + * + * Charge The copy request charge is based on the storage class and Region that + * you specify for the destination object. The request can also result in a data + * retrieval charge for the source if the source storage class bills for data + * retrieval. If the copy source is in a different region, the data transfer is + * billed to the copy source account. For pricing information, see [Amazon S3 pricing]. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to CopyObject : + * + * [PutObject] + * + * [GetObject] + * + * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html + * [Resolve the Error 200 response when copying objects to Amazon S3]: https://repost.aws/knowledge-center/s3-resolve-200-internalerror + * [Copy Object Using the REST Multipart Upload API]: https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html + * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Enable or disable a Region for standalone accounts]: https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html#manage-acct-regions-enable-standalone + * [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [Amazon S3 pricing]: http://aws.amazon.com/s3/pricing/ */ - verifyIssuer(cmp: string, req: boolean): boolean + copyObject(ctx: context.Context, params: CopyObjectInput, ...optFns: ((_arg0: Options) => void)[]): (CopyObjectOutput) } - interface MapClaims { + interface Client { /** - * Valid validates time based claims "exp, iat, nbf". - * There is no accounting for clock skew. - * As well, if any of the above claims are not in the token, it will still - * be considered a valid claim. - */ - valid(): void - } -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Reader reads bytes from a blob. - * It implements io.ReadSeekCloser, and must be closed after - * reads are finished. - */ - interface Reader { - } - interface Reader { - /** - * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + * This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts + * bucket, see [CreateBucket]CreateBucket . + * + * Creates a new S3 bucket. To create a bucket, you must set up Amazon S3 and have + * a valid Amazon Web Services Access Key ID to authenticate requests. Anonymous + * requests are never allowed to create buckets. By creating the bucket, you become + * the bucket owner. + * + * There are two types of buckets: general purpose buckets and directory buckets. + * For more information about these bucket types, see [Creating, configuring, and working with Amazon S3 buckets]in the Amazon S3 User Guide. + * + * ``` + * - General purpose buckets - If you send your CreateBucket request to the + * s3.amazonaws.com global endpoint, the request goes to the us-east-1 Region. So + * the signature calculations in Signature Version 4 must use us-east-1 as the + * Region, even if the location constraint in the request specifies another Region + * where the bucket is to be created. If you create a bucket in a Region other than + * US East (N. Virginia), your application must be able to handle 307 redirect. For + * more information, see [Virtual hosting of buckets]in the Amazon S3 User Guide. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Regional endpoint. These endpoints support path-style + * requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. + * ``` + * + * Permissions + * + * ``` + * - General purpose bucket permissions - In addition to the s3:CreateBucket + * permission, the following permissions are required in a policy when your + * CreateBucket request includes specific headers: + * + * - Access control lists (ACLs) - In your CreateBucket request, if you specify + * an access control list (ACL) and set it to public-read , public-read-write , + * authenticated-read , or if you explicitly specify any other custom ACLs, both + * s3:CreateBucket and s3:PutBucketAcl permissions are required. In your + * CreateBucket request, if you set the ACL to private , or if you don't specify + * any ACLs, only the s3:CreateBucket permission is required. + * + * - Object Lock - In your CreateBucket request, if you set + * x-amz-bucket-object-lock-enabled to true, the + * s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning permissions are + * required. + * + * - S3 Object Ownership - If your CreateBucket request includes the + * x-amz-object-ownership header, then the s3:PutBucketOwnershipControls + * permission is required. + * ``` + * + * To set an ACL on a bucket as part of a CreateBucket request, you must explicitly + * + * ``` + * set S3 Object Ownership for the bucket to a different value than the default, + * BucketOwnerEnforced . Additionally, if your desired bucket ACL grants public + * access, you must first create the bucket (without the bucket ACL) and then + * explicitly disable Block Public Access on the bucket before using PutBucketAcl + * to set the ACL. If you try to create a bucket with a public ACL, the request + * will fail. + * ``` + * + * For the majority of modern use cases in S3, we recommend that you keep all + * + * ``` + * Block Public Access settings enabled and keep ACLs disabled. If you would like + * to share data with users outside of your account, you can use bucket policies as + * needed. For more information, see [Controlling ownership of objects and disabling ACLs for your bucket]and [Blocking public access to your Amazon S3 storage]in the Amazon S3 User Guide. + * + * - S3 Block Public Access - If your specific use case requires granting public + * access to your S3 resources, you can disable Block Public Access. Specifically, + * you can create a new bucket with Block Public Access enabled, then separately + * call the [DeletePublicAccessBlock]DeletePublicAccessBlock API. To use this operation, you must have the + * s3:PutBucketPublicAccessBlock permission. For more information about S3 Block + * Public Access, see [Blocking public access to your Amazon S3 storage]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - You must have the s3express:CreateBucket + * permission in an IAM identity-based policy instead of a bucket policy. + * Cross-account access to this API operation isn't supported. This operation can + * only be performed by the Amazon Web Services account that owns the resource. For + * more information about directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the + * Amazon S3 User Guide. + * ``` + * + * The permissions for ACLs, Object Lock, S3 Object Ownership, and S3 Block Public + * + * ``` + * Access are not supported for directory buckets. For directory buckets, all Block + * Public Access settings are enabled at the bucket level and S3 Object Ownership + * is set to Bucket owner enforced (ACLs disabled). These settings can't be + * modified. + * ``` + * + * For more information about permissions for creating and working with directory + * + * ``` + * buckets, see [Directory buckets]in the Amazon S3 User Guide. For more information about + * supported S3 features for directory buckets, see [Features of S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following operations are related to CreateBucket : + * + * [PutObject] + * + * [DeleteBucket] + * + * [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html + * [Virtual hosting of buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html + * + * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html + * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + * [Features of S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-one-zone.html#s3-express-features + * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * [Blocking public access to your Amazon S3 storage]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - read(p: string|Array): number + createBucket(ctx: context.Context, params: CreateBucketInput, ...optFns: ((_arg0: Options) => void)[]): (CreateBucketOutput) } - interface Reader { + interface Client { /** - * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + * This action initiates a multipart upload and returns an upload ID. This upload + * ID is used to associate all of the parts in the specific multipart upload. You + * specify this upload ID in each of your subsequent upload part requests (see [UploadPart]). + * You also include this upload ID in the final request to either complete or abort + * the multipart upload request. For more information about multipart uploads, see [Multipart Upload Overview] + * in the Amazon S3 User Guide. + * + * After you initiate a multipart upload and upload one or more parts, to stop + * being charged for storing the uploaded parts, you must either complete or abort + * the multipart upload. Amazon S3 frees up the space used to store the parts and + * stops charging you for storing them only after you either complete or abort a + * multipart upload. + * + * If you have configured a lifecycle rule to abort incomplete multipart uploads, + * the created multipart upload must be completed within the number of days + * specified in the bucket lifecycle configuration. Otherwise, the incomplete + * multipart upload becomes eligible for an abort action and Amazon S3 aborts the + * multipart upload. For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]. + * + * ``` + * - Directory buckets - S3 Lifecycle is not supported by directory buckets. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. + * ``` + * + * Request signing For request signing, multipart upload is just a series of + * regular requests. You initiate a multipart upload, send one or more requests to + * upload parts, and then complete the multipart upload process. You sign each + * request individually. There is nothing special about signing multipart upload + * requests. For more information about signing, see [Authenticating Requests (Amazon Web Services Signature Version 4)]in the Amazon S3 User Guide. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - To perform a multipart upload with + * encryption using an Key Management Service (KMS) KMS key, the requester must + * have permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. + * The requester must also have permissions for the kms:GenerateDataKey action + * for the CreateMultipartUpload API. Then, the requester needs permissions for + * the kms:Decrypt action on the UploadPart and UploadPartCopy APIs. These + * permissions are required because Amazon S3 must decrypt and read data from the + * encrypted file parts before it completes the multipart upload. For more + * information, see [Multipart upload API and permissions]and [Protecting data using server-side encryption with Amazon Web Services KMS]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * Encryption + * + * ``` + * - General purpose buckets - Server-side encryption is for data encryption at + * rest. Amazon S3 encrypts your data as it writes it to disks in its data centers + * and decrypts it when you access it. Amazon S3 automatically encrypts all new + * objects that are uploaded to an S3 bucket. When doing a multipart upload, if you + * don't specify encryption information in your request, the encryption setting of + * the uploaded parts is set to the default encryption configuration of the + * destination bucket. By default, all buckets have a base level of encryption + * configuration that uses server-side encryption with Amazon S3 managed keys + * (SSE-S3). If the destination bucket has a default encryption configuration that + * uses server-side encryption with an Key Management Service (KMS) key (SSE-KMS), + * or a customer-provided encryption key (SSE-C), Amazon S3 uses the corresponding + * KMS key, or a customer-provided key to encrypt the uploaded parts. When you + * perform a CreateMultipartUpload operation, if you want to use a different type + * of encryption setting for the uploaded parts, you can request that Amazon S3 + * encrypts the object with a different encryption key (such as an Amazon S3 + * managed key, a KMS key, or a customer-provided key). When the encryption setting + * in your request is different from the default encryption configuration of the + * destination bucket, the encryption setting in your request takes precedence. If + * you choose to provide your own encryption key, the request headers you provide + * in [UploadPart]and [UploadPartCopy]requests must match the headers you used in the CreateMultipartUpload + * request. + * + * - Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key ( + * aws/s3 ) and KMS customer managed keys stored in Key Management Service (KMS) + * – If you want Amazon Web Services to manage the keys used to encrypt data, + * specify the following headers in the request. + * + * - x-amz-server-side-encryption + * + * - x-amz-server-side-encryption-aws-kms-key-id + * + * - x-amz-server-side-encryption-context + * + * - If you specify x-amz-server-side-encryption:aws:kms , but don't provide + * x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web + * Services managed key ( aws/s3 key) in KMS to protect the data. + * + * - To perform a multipart upload with encryption by using an Amazon Web + * Services KMS key, the requester must have permission to the kms:Decrypt and + * kms:GenerateDataKey* actions on the key. These permissions are required + * because Amazon S3 must decrypt and read data from the encrypted file parts + * before it completes the multipart upload. For more information, see [Multipart upload API and permissions]and [Protecting data using server-side encryption with Amazon Web Services KMS]in + * the Amazon S3 User Guide. + * + * - If your Identity and Access Management (IAM) user or role is in the same + * Amazon Web Services account as the KMS key, then you must have these permissions + * on the key policy. If your IAM user or role is in a different account from the + * key, then you must have the permissions on both the key policy and your IAM user + * or role. + * + * - All GET and PUT requests for an object protected by KMS fail if you don't + * make them by using Secure Sockets Layer (SSL), Transport Layer Security (TLS), + * or Signature Version 4. For information about configuring any of the officially + * supported Amazon Web Services SDKs and Amazon Web Services CLI, see [Specifying the Signature Version in Request Authentication]in the + * Amazon S3 User Guide. + * ``` + * + * For more information about server-side encryption with KMS keys (SSE-KMS), see [Protecting Data Using Server-Side Encryption with KMS keys] + * + * ``` + * in the Amazon S3 User Guide. + * + * - Use customer-provided encryption keys (SSE-C) – If you want to manage your + * own encryption keys, provide all the following headers in the request. + * + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information about server-side encryption with customer-provided + * + * ``` + * encryption keys (SSE-C), see [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]in the Amazon S3 User Guide. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: server-side encryption with Amazon S3 + * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses + * the desired encryption configuration and you don't override the bucket default + * encryption in your CreateSession requests or PUT object requests. Then, new + * objects are automatically encrypted with the desired encryption settings. For + * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about + * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + * ``` + * + * In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the + * + * ``` + * encryption request headers must match the encryption settings that are specified + * in the CreateSession request. You can't override the values of the encryption + * settings ( x-amz-server-side-encryption , + * x-amz-server-side-encryption-aws-kms-key-id , + * x-amz-server-side-encryption-context , and + * x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the + * CreateSession request. You don't need to explicitly specify these encryption + * settings values in Zonal endpoint API calls, and Amazon S3 will use the + * encryption settings values from the CreateSession request to protect new + * objects in the directory bucket. + * ``` + * + * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the + * + * ``` + * session token refreshes automatically to avoid service interruptions when a + * session expires. The CLI or the Amazon Web Services SDKs use the bucket's + * default encryption configuration for the CreateSession request. It's not + * supported to override the encryption settings values in the CreateSession + * request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption + * request headers must match the default encryption configuration of the directory + * bucket. + * ``` + * + * For directory buckets, when you perform a CreateMultipartUpload operation and an + * + * ``` + * UploadPartCopy operation, the request headers you provide in the + * CreateMultipartUpload request must match the default encryption configuration + * of the destination bucket. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to CreateMultipartUpload : + * + * [UploadPart] + * + * [CompleteMultipartUpload] + * + * [AbortMultipartUpload] + * + * [ListParts] + * + * [ListMultipartUploads] + * + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Protecting Data Using Server-Side Encryption with KMS keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Specifying the Signature Version in Request Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [Authenticating Requests (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html + * [Protecting data using server-side encryption with Amazon Web Services KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html + * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html + * + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html */ - seek(offset: number, whence: number): number + createMultipartUpload(ctx: context.Context, params: CreateMultipartUploadInput, ...optFns: ((_arg0: Options) => void)[]): (CreateMultipartUploadOutput) } - interface Reader { + interface Client { /** - * Close implements io.Closer (https://golang.org/pkg/io/#Closer). - */ - close(): void + * Creates a session that establishes temporary security credentials to support + * fast authentication and authorization for the Zonal endpoint API operations on + * directory buckets. For more information about Zonal endpoint API operations that + * include the Availability Zone in the request endpoint, see [S3 Express One Zone APIs]in the Amazon S3 + * User Guide. + * + * To make Zonal endpoint API requests on a directory bucket, use the CreateSession + * API operation. Specifically, you grant s3express:CreateSession permission to a + * bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM + * credentials to make the CreateSession API request on the bucket, which returns + * temporary security credentials that include the access key ID, secret access + * key, session token, and expiration. These credentials have associated + * permissions to access the Zonal endpoint API operations. After the session is + * created, you don’t need to use other policies to grant permissions to each Zonal + * endpoint API individually. Instead, in your Zonal endpoint API requests, you + * sign your requests by applying the temporary security credentials of the session + * to the request headers and following the SigV4 protocol for authentication. You + * also apply the session token to the x-amz-s3session-token request header for + * authorization. Temporary security credentials are scoped to the bucket and + * expire after 5 minutes. After the expiration time, any calls that you make with + * those credentials will fail. You must use IAM credentials again to make a + * CreateSession API request that generates a new set of temporary credentials for + * use. Temporary credentials cannot be extended or refreshed beyond the original + * specified interval. + * + * If you use Amazon Web Services SDKs, SDKs handle the session token refreshes + * automatically to avoid service interruptions when a session expires. We + * recommend that you use the Amazon Web Services SDKs to initiate and manage + * requests to the CreateSession API. For more information, see [Performance guidelines and design patterns]in the Amazon S3 + * User Guide. + * + * ``` + * - You must make requests for this API operation to the Zonal endpoint. These + * endpoints support virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests + * are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User Guide. + * + * - CopyObject API operation - Unlike other Zonal endpoint API operations, the + * CopyObject API operation doesn't use the temporary security credentials + * returned from the CreateSession API operation for authentication and + * authorization. For information about authentication and authorization of the + * CopyObject API operation on directory buckets, see [CopyObject]. + * + * - HeadBucket API operation - Unlike other Zonal endpoint API operations, the + * HeadBucket API operation doesn't use the temporary security credentials + * returned from the CreateSession API operation for authentication and + * authorization. For information about authentication and authorization of the + * HeadBucket API operation on directory buckets, see [HeadBucket]. + * ``` + * + * Permissions To obtain temporary security credentials, you must create a bucket + * policy or an IAM identity-based policy that grants s3express:CreateSession + * permission to the bucket. In a policy, you can have the s3express:SessionMode + * condition key to control who can create a ReadWrite or ReadOnly session. For + * more information about ReadWrite or ReadOnly sessions, see [x-amz-create-session-mode] + * x-amz-create-session-mode . For example policies, see [Example bucket policies for S3 Express One Zone] and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone] in the Amazon S3 + * User Guide. + * + * To grant cross-account access to Zonal endpoint API operations, the bucket + * policy should also grant both accounts the s3express:CreateSession permission. + * + * If you want to encrypt objects with SSE-KMS, you must also have the + * kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based + * policies and KMS key policies for the target KMS key. + * + * Encryption For directory buckets, there are only two supported options for + * server-side encryption: server-side encryption with Amazon S3 managed keys + * (SSE-S3) ( AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms + * ). We recommend that the bucket's default encryption uses the desired encryption + * configuration and you don't override the bucket default encryption in your + * CreateSession requests or PUT object requests. Then, new objects are + * automatically encrypted with the desired encryption settings. For more + * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about the + * encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + * + * For [Zonal endpoint (object-level) API operations] except [CopyObject] and [UploadPartCopy], you authenticate and authorize requests through [CreateSession] for low + * latency. To encrypt new objects in a directory bucket with SSE-KMS, you must + * specify SSE-KMS as the directory bucket's default encryption configuration with + * a KMS key (specifically, a [customer managed key]). Then, when a session is created for Zonal + * endpoint API operations, new objects are automatically encrypted and decrypted + * with SSE-KMS and S3 Bucket Keys during the session. + * + * Only 1 [customer managed key] is supported per directory bucket for the lifetime of the bucket. [Amazon Web Services managed key] ( + * aws/s3 ) isn't supported. After you specify SSE-KMS as your bucket's default + * encryption configuration with a customer managed key, you can't change the + * customer managed key for the bucket's SSE-KMS configuration. + * + * In the Zonal endpoint API calls (except [CopyObject] and [UploadPartCopy]) using the REST API, you can't + * override the values of the encryption settings ( x-amz-server-side-encryption , + * x-amz-server-side-encryption-aws-kms-key-id , + * x-amz-server-side-encryption-context , and + * x-amz-server-side-encryption-bucket-key-enabled ) from the CreateSession + * request. You don't need to explicitly specify these encryption settings values + * in Zonal endpoint API calls, and Amazon S3 will use the encryption settings + * values from the CreateSession request to protect new objects in the directory + * bucket. + * + * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the + * session token refreshes automatically to avoid service interruptions when a + * session expires. The CLI or the Amazon Web Services SDKs use the bucket's + * default encryption configuration for the CreateSession request. It's not + * supported to override the encryption settings values in the CreateSession + * request. Also, in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), it's not + * supported to override the values of the encryption settings from the + * CreateSession request. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [Performance guidelines and design patterns]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-optimizing-performance-guidelines-design-patterns.html#s3-express-optimizing-performance-session-authentication + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [S3 Express One Zone APIs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-APIs.html + * [HeadBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html + * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [x-amz-create-session-mode]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html#API_CreateSession_RequestParameters + * [Zonal endpoint (object-level) API operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-differences.html#s3-express-differences-api-operations + */ + createSession(ctx: context.Context, params: CreateSessionInput, ...optFns: ((_arg0: Options) => void)[]): (CreateSessionOutput) } - interface Reader { + interface Client { /** - * ContentType returns the MIME type of the blob. + * Deletes the S3 bucket. All objects (including all object versions and delete + * markers) in the bucket must be deleted before the bucket itself can be deleted. + * + * ``` + * - Directory buckets - If multipart uploads in a directory bucket are in + * progress, you can't delete the bucket until all the in-progress multipart + * uploads are aborted or completed. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Regional endpoint. These endpoints support path-style + * requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. + * ``` + * + * Permissions + * + * ``` + * - General purpose bucket permissions - You must have the s3:DeleteBucket + * permission on the specified bucket in a policy. + * + * - Directory bucket permissions - You must have the s3express:DeleteBucket + * permission in an IAM identity-based policy instead of a bucket policy. + * Cross-account access to this API operation isn't supported. This operation can + * only be performed by the Amazon Web Services account that owns the resource. For + * more information about directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the + * Amazon S3 User Guide. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following operations are related to DeleteBucket : + * + * [CreateBucket] + * + * [DeleteObject] + * + * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - contentType(): string + deleteBucket(ctx: context.Context, params: DeleteBucketInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketOutput) } - interface Reader { + interface Client { /** - * ModTime returns the time the blob was last modified. + * This operation is not supported by directory buckets. + * + * Deletes an analytics configuration for the bucket (specified by the analytics + * configuration ID). + * + * To use this operation, you must have permissions to perform the + * s3:PutAnalyticsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about the Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis]. + * + * The following operations are related to DeleteBucketAnalyticsConfiguration : + * + * [GetBucketAnalyticsConfiguration] + * + * [ListBucketAnalyticsConfigurations] + * + * [PutBucketAnalyticsConfiguration] + * + * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html + * [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html + * [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - modTime(): time.Time + deleteBucketAnalyticsConfiguration(ctx: context.Context, params: DeleteBucketAnalyticsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketAnalyticsConfigurationOutput) } - interface Reader { + interface Client { /** - * Size returns the size of the blob content in bytes. + * This operation is not supported by directory buckets. + * + * Deletes the cors configuration information set for the bucket. + * + * To use this operation, you must have permission to perform the s3:PutBucketCORS + * action. The bucket owner has this permission by default and can grant this + * permission to others. + * + * For information about cors , see [Enabling Cross-Origin Resource Sharing] in the Amazon S3 User Guide. + * + * # Related Resources + * + * [PutBucketCors] + * + * [RESTOPTIONSobject] + * + * [PutBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html + * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html + * [RESTOPTIONSobject]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html */ - size(): number + deleteBucketCors(ctx: context.Context, params: DeleteBucketCorsInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketCorsOutput) } - interface Reader { + interface Client { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * This implementation of the DELETE action resets the default encryption for the + * bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). + * + * ``` + * - General purpose buckets - For information about the bucket default + * encryption feature, see [Amazon S3 Bucket Default Encryption]in the Amazon S3 User Guide. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: SSE-S3 and SSE-KMS. For information about + * the default encryption configuration in directory buckets, see [Setting default server-side encryption behavior for directory buckets]. + * ``` + * + * Permissions + * + * ``` + * - General purpose bucket permissions - The s3:PutEncryptionConfiguration + * permission is required in a policy. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * - Directory bucket permissions - To grant access to this API operation, you + * must have the s3express:PutEncryptionConfiguration permission in an IAM + * identity-based policy instead of a bucket policy. Cross-account access to this + * API operation isn't supported. This operation can only be performed by the + * Amazon Web Services account that owns the resource. For more information about + * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following operations are related to DeleteBucketEncryption : + * + * [PutBucketEncryption] + * + * [GetBucketEncryption] + * + * [GetBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html + * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html + * [Setting default server-side encryption behavior for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html + * [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - as(i: { - }): boolean + deleteBucketEncryption(ctx: context.Context, params: DeleteBucketEncryptionInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketEncryptionOutput) } - interface Reader { + interface Client { /** - * WriteTo reads from r and writes to w until there's no more data or - * an error occurs. - * The return value is the number of bytes written to w. + * This operation is not supported by directory buckets. * - * It implements the io.WriterTo interface. + * Deletes the S3 Intelligent-Tiering configuration from the specified bucket. + * + * The S3 Intelligent-Tiering storage class is designed to optimize storage costs + * by automatically moving data to the most cost-effective storage access tier, + * without performance impact or operational overhead. S3 Intelligent-Tiering + * delivers automatic cost savings in three low latency and high throughput access + * tiers. To get the lowest storage cost on data that can be accessed in minutes to + * hours, you can choose to activate additional archiving capabilities. + * + * The S3 Intelligent-Tiering storage class is the ideal storage class for data + * with unknown, changing, or unpredictable access patterns, independent of object + * size or retention period. If the size of an object is less than 128 KB, it is + * not monitored and not eligible for auto-tiering. Smaller objects can be stored, + * but they are always charged at the Frequent Access tier rates in the S3 + * Intelligent-Tiering storage class. + * + * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. + * + * Operations related to DeleteBucketIntelligentTieringConfiguration include: + * + * [GetBucketIntelligentTieringConfiguration] + * + * [PutBucketIntelligentTieringConfiguration] + * + * [ListBucketIntelligentTieringConfigurations] + * + * [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html + * [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html + * [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access */ - writeTo(w: io.Writer): number + deleteBucketIntelligentTieringConfiguration(ctx: context.Context, params: DeleteBucketIntelligentTieringConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketIntelligentTieringConfigurationOutput) } - /** - * Attributes contains attributes about a blob. - */ - interface Attributes { + interface Client { /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + * This operation is not supported by directory buckets. + * + * Deletes an inventory configuration (identified by the inventory ID) from the + * bucket. + * + * To use this operation, you must have permissions to perform the + * s3:PutInventoryConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory]. + * + * Operations related to DeleteBucketInventoryConfiguration include: + * + * [GetBucketInventoryConfiguration] + * + * [PutBucketInventoryConfiguration] + * + * [ListBucketInventoryConfigurations] + * + * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html + * [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html + * [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html */ - cacheControl: string + deleteBucketInventoryConfiguration(ctx: context.Context, params: DeleteBucketInventoryConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketInventoryConfigurationOutput) + } + interface Client { /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition - */ - contentDisposition: string - /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - */ - contentEncoding: string - /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language - */ - contentLanguage: string - /** - * ContentType is the MIME type of the blob. It will not be empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type - */ - contentType: string - /** - * Metadata holds key/value pairs associated with the blob. - * Keys are guaranteed to be in lowercase, even if the backend service - * has case-sensitive keys (although note that Metadata written via - * this package will always be lowercased). If there are duplicate - * case-insensitive keys (e.g., "foo" and "FOO"), only one value - * will be kept, and it is undefined which one. - */ - metadata: _TygojaDict - /** - * CreateTime is the time the blob was created, if available. If not available, - * CreateTime will be the zero time. - */ - createTime: time.Time - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string|Array - /** - * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + * This operation is not supported by directory buckets. + * + * Deletes the lifecycle configuration from the specified bucket. Amazon S3 + * removes all the lifecycle configuration rules in the lifecycle subresource + * associated with the bucket. Your objects never expire, and Amazon S3 no longer + * automatically deletes any objects on the basis of rules contained in the deleted + * lifecycle configuration. + * + * To use this operation, you must have permission to perform the + * s3:PutLifecycleConfiguration action. By default, the bucket owner has this + * permission and the bucket owner can grant this permission to others. + * + * There is usually some time lag before lifecycle configuration deletion is fully + * propagated to all the Amazon S3 systems. + * + * For more information about the object expiration, see [Elements to Describe Lifecycle Actions]. + * + * Related actions include: + * + * [PutBucketLifecycleConfiguration] + * + * [GetBucketLifecycleConfiguration] + * + * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html + * [Elements to Describe Lifecycle Actions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions + * [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html */ - eTag: string + deleteBucketLifecycle(ctx: context.Context, params: DeleteBucketLifecycleInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketLifecycleOutput) } - interface Attributes { + interface Client { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * This operation is not supported by directory buckets. + * + * Deletes a metrics configuration for the Amazon CloudWatch request metrics + * (specified by the metrics configuration ID) from the bucket. Note that this + * doesn't include the daily storage metrics. + * + * To use this operation, you must have permissions to perform the + * s3:PutMetricsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. + * + * The following operations are related to DeleteBucketMetricsConfiguration : + * + * [GetBucketMetricsConfiguration] + * + * [PutBucketMetricsConfiguration] + * + * [ListBucketMetricsConfigurations] + * + * [Monitoring Metrics with Amazon CloudWatch] + * + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html + * [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html + * [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html + * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - as(i: { - }): boolean + deleteBucketMetricsConfiguration(ctx: context.Context, params: DeleteBucketMetricsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketMetricsConfigurationOutput) } - /** - * ListObject represents a single blob returned from List. - */ - interface ListObject { - /** - * Key is the key for this blob. - */ - key: string - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number + interface Client { /** - * MD5 is an MD5 hash of the blob contents or nil if not available. + * This operation is not supported by directory buckets. + * + * Removes OwnershipControls for an Amazon S3 bucket. To use this operation, you + * must have the s3:PutBucketOwnershipControls permission. For more information + * about Amazon S3 permissions, see [Specifying Permissions in a Policy]. + * + * For information about Amazon S3 Object Ownership, see [Using Object Ownership]. + * + * The following operations are related to DeleteBucketOwnershipControls : + * + * # GetBucketOwnershipControls + * + * # PutBucketOwnershipControls + * + * [Using Object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html */ - md5: string|Array + deleteBucketOwnershipControls(ctx: context.Context, params: DeleteBucketOwnershipControlsInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketOwnershipControlsOutput) + } + interface Client { /** - * IsDir indicates that this result represents a "directory" in the - * hierarchical namespace, ending in ListOptions.Delimiter. Key can be - * passed as ListOptions.Prefix to list items in the "directory". - * Fields other than Key and IsDir will not be set if IsDir is true. + * Deletes the policy of a specified bucket. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Regional endpoint. These endpoints support path-style requests + * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. + * + * Permissions If you are using an identity other than the root user of the Amazon + * Web Services account that owns the bucket, the calling identity must both have + * the DeleteBucketPolicy permissions on the specified bucket and belong to the + * bucket owner's account in order to use this operation. + * + * If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 + * Access Denied error. If you have the correct permissions, but you're not using + * an identity that belongs to the bucket owner's account, Amazon S3 returns a 405 + * Method Not Allowed error. + * + * To ensure that bucket owners don't inadvertently lock themselves out of their + * own buckets, the root principal in a bucket owner's Amazon Web Services account + * can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API + * actions, even if their bucket policy explicitly denies the root principal's + * access. Bucket owner root principals can only be blocked from performing these + * API actions by VPC endpoint policies and Amazon Web Services Organizations + * policies. + * + * ``` + * - General purpose bucket permissions - The s3:DeleteBucketPolicy permission is + * required in a policy. For more information about general purpose buckets bucket + * policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation, you + * must have the s3express:DeleteBucketPolicy permission in an IAM identity-based + * policy instead of a bucket policy. Cross-account access to this API operation + * isn't supported. This operation can only be performed by the Amazon Web Services + * account that owns the resource. For more information about directory bucket + * policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * # The following operations are related to DeleteBucketPolicy + * + * [CreateBucket] + * + * [DeleteObject] + * + * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - isDir: boolean + deleteBucketPolicy(ctx: context.Context, params: DeleteBucketPolicyInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketPolicyOutput) } - interface ListObject { + interface Client { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * This operation is not supported by directory buckets. + * + * Deletes the replication configuration from the bucket. + * + * To use this operation, you must have permissions to perform the + * s3:PutReplicationConfiguration action. The bucket owner has these permissions by + * default and can grant it to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] + * and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * It can take a while for the deletion of a replication configuration to fully + * propagate. + * + * For information about replication configuration, see [Replication] in the Amazon S3 User + * Guide. + * + * The following operations are related to DeleteBucketReplication : + * + * [PutBucketReplication] + * + * [GetBucketReplication] + * + * [GetBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [PutBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - as(i: { - }): boolean + deleteBucketReplication(ctx: context.Context, params: DeleteBucketReplicationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketReplicationOutput) } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonArray defines a slice that is safe for json and db read/write. - */ - interface JsonArray extends Array{} - interface JsonArray { + interface Client { /** - * MarshalJSON implements the [json.Marshaler] interface. + * This operation is not supported by directory buckets. + * + * Deletes the tags from the bucket. + * + * To use this operation, you must have permission to perform the + * s3:PutBucketTagging action. By default, the bucket owner has this permission and + * can grant this permission to others. + * + * The following operations are related to DeleteBucketTagging : + * + * [GetBucketTagging] + * + * [PutBucketTagging] + * + * [GetBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html + * [PutBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html */ - marshalJSON(): string|Array + deleteBucketTagging(ctx: context.Context, params: DeleteBucketTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketTaggingOutput) } - interface JsonArray { + interface Client { /** - * Value implements the [driver.Valuer] interface. + * This operation is not supported by directory buckets. + * + * This action removes the website configuration for a bucket. Amazon S3 returns a + * 200 OK response upon successfully deleting a website configuration on the + * specified bucket. You will get a 200 OK response if the website configuration + * you are trying to delete does not exist on the bucket. Amazon S3 returns a 404 + * response if the bucket specified in the request does not exist. + * + * This DELETE action requires the S3:DeleteBucketWebsite permission. By default, + * only the bucket owner can delete the website configuration attached to a bucket. + * However, bucket owners can grant other users permission to delete the website + * configuration by writing a bucket policy granting them the + * S3:DeleteBucketWebsite permission. + * + * For more information about hosting websites, see [Hosting Websites on Amazon S3]. + * + * The following operations are related to DeleteBucketWebsite : + * + * [GetBucketWebsite] + * + * [PutBucketWebsite] + * + * [GetBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html + * [PutBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html + * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html */ - value(): any + deleteBucketWebsite(ctx: context.Context, params: DeleteBucketWebsiteInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketWebsiteOutput) } - interface JsonArray { + interface Client { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonArray[T] instance. + * Removes an object from a bucket. The behavior depends on the bucket's + * versioning state: + * + * ``` + * - If bucket versioning is not enabled, the operation permanently deletes the + * object. + * + * - If bucket versioning is enabled, the operation inserts a delete marker, + * which becomes the current version of the object. To permanently delete an object + * in a versioned bucket, you must include the object’s versionId in the request. + * For more information about versioning-enabled buckets, see [Deleting object versions from a versioning-enabled bucket]. + * + * - If bucket versioning is suspended, the operation removes the object that + * has a null versionId , if there is one, and inserts a delete marker that + * becomes the current version of the object. If there isn't an object with a null + * versionId , and all versions of the object have a versionId , Amazon S3 does + * not remove the object and only inserts a delete marker. To permanently delete an + * object that has a versionId , you must include the object’s versionId in the + * request. For more information about versioning-suspended buckets, see [Deleting objects from versioning-suspended buckets]. + * + * - Directory buckets - S3 Versioning isn't enabled and supported for directory + * buckets. For this API operation, only the null value of the version ID is + * supported by directory buckets. You can only specify null to the versionId + * query parameter in the request. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. + * ``` + * + * To remove a specific version, you must use the versionId query parameter. Using + * this query parameter permanently deletes the version. If the object deleted is a + * delete marker, Amazon S3 sets the response header x-amz-delete-marker to true. + * + * If the object you want to delete is in a bucket where the bucket versioning + * configuration is MFA Delete enabled, you must include the x-amz-mfa request + * header in the DELETE versionId request. Requests that include x-amz-mfa must + * use HTTPS. For more information about MFA Delete, see [Using MFA Delete]in the Amazon S3 User + * Guide. To see sample requests that use versioning, see [Sample Request]. + * + * Directory buckets - MFA delete is not supported by directory buckets. + * + * You can delete objects by explicitly calling DELETE Object or calling ([PutBucketLifecycle] ) to + * enable Amazon S3 to remove them for you. If you want to block users or accounts + * from removing or deleting objects from your bucket, you must deny them the + * s3:DeleteObject , s3:DeleteObjectVersion , and s3:PutLifeCycleConfiguration + * actions. + * + * Directory buckets - S3 Lifecycle is not supported by directory buckets. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - The following permissions are required + * in your policies when your DeleteObjects request includes specific headers. + * + * - s3:DeleteObject - To delete an object from a bucket, you must always have + * the s3:DeleteObject permission. + * + * - s3:DeleteObjectVersion - To delete a specific version of an object from a + * versioning-enabled bucket, you must have the s3:DeleteObjectVersion permission. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following action is related to DeleteObject : + * + * [PutObject] + * + * [Sample Request]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Deleting objects from versioning-suspended buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [Deleting object versions from a versioning-enabled bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html + * [Using MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html */ - scan(value: any): void + deleteObject(ctx: context.Context, params: DeleteObjectInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteObjectOutput) } - /** - * JsonMap defines a map that is safe for json and db read/write. - */ - interface JsonMap extends _TygojaDict{} - interface JsonMap { + interface Client { /** - * MarshalJSON implements the [json.Marshaler] interface. + * This operation is not supported by directory buckets. + * + * Removes the entire tag set from the specified object. For more information + * about managing object tags, see [Object Tagging]. + * + * To use this operation, you must have permission to perform the + * s3:DeleteObjectTagging action. + * + * To delete tags of a specific object version, add the versionId query parameter + * in the request. You will need permission for the s3:DeleteObjectVersionTagging + * action. + * + * The following operations are related to DeleteObjectTagging : + * + * [PutObjectTagging] + * + * [GetObjectTagging] + * + * [PutObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html + * [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html + * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html */ - marshalJSON(): string|Array + deleteObjectTagging(ctx: context.Context, params: DeleteObjectTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteObjectTaggingOutput) } - interface JsonMap { + interface Client { /** - * Get retrieves a single value from the current JsonMap. + * This operation enables you to delete multiple objects from a bucket using a + * single HTTP request. If you know the object keys that you want to delete, then + * this operation provides a suitable alternative to sending individual delete + * requests, reducing per-request overhead. * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + * The request can contain a list of up to 1000 keys that you want to delete. In + * the XML, you provide the object key names, and optionally, version IDs if you + * want to delete a specific version of the object from a versioning-enabled + * bucket. For each key, Amazon S3 performs a delete operation and returns the + * result of that delete, success or failure, in the response. Note that if the + * object specified in the request is not found, Amazon S3 returns the result as + * deleted. + * + * ``` + * - Directory buckets - S3 Versioning isn't enabled and supported for directory + * buckets. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. + * ``` + * + * The operation supports two modes for the response: verbose and quiet. By + * default, the operation uses verbose mode in which the response includes the + * result of deletion of each key in your request. In quiet mode the response + * includes only keys where the delete operation encountered an error. For a + * successful deletion in a quiet mode, the operation does not return any + * information about the delete in the response body. + * + * When performing this action on an MFA Delete enabled bucket, that attempts to + * delete any versioned objects, you must include an MFA token. If you do not + * provide one, the entire request will fail, even if there are non-versioned + * objects you are trying to delete. If you provide an invalid token, whether there + * are versioned keys in the request or not, the entire Multi-Object Delete request + * will fail. For information about MFA Delete, see [MFA Delete]in the Amazon S3 User Guide. + * + * Directory buckets - MFA delete is not supported by directory buckets. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - The following permissions are required + * in your policies when your DeleteObjects request includes specific headers. + * + * - s3:DeleteObject - To delete an object from a bucket, you must always specify + * the s3:DeleteObject permission. + * + * - s3:DeleteObjectVersion - To delete a specific version of an object from a + * versioning-enabled bucket, you must specify the s3:DeleteObjectVersion + * permission. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * Content-MD5 request header + * + * ``` + * - General purpose bucket - The Content-MD5 request header is required for all + * Multi-Object Delete requests. Amazon S3 uses the header value to ensure that + * your request body has not been altered in transit. + * + * - Directory bucket - The Content-MD5 request header or a additional checksum + * request header (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , + * x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is required for all + * Multi-Object Delete requests. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to DeleteObjects : + * + * [CreateMultipartUpload] + * + * [UploadPart] + * + * [CompleteMultipartUpload] + * + * [ListParts] + * + * [AbortMultipartUpload] + * + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html */ - get(key: string): any + deleteObjects(ctx: context.Context, params: DeleteObjectsInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteObjectsOutput) } - interface JsonMap { + interface Client { /** - * Set sets a single value in the current JsonMap. + * This operation is not supported by directory buckets. * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + * Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use + * this operation, you must have the s3:PutBucketPublicAccessBlock permission. For + * more information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * The following operations are related to DeletePublicAccessBlock : + * + * [Using Amazon S3 Block Public Access] + * + * [GetPublicAccessBlock] + * + * [PutPublicAccessBlock] + * + * [GetBucketPolicyStatus] + * + * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html + * [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [GetBucketPolicyStatus]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html */ - set(key: string, value: any): void + deletePublicAccessBlock(ctx: context.Context, params: DeletePublicAccessBlockInput, ...optFns: ((_arg0: Options) => void)[]): (DeletePublicAccessBlockOutput) } - interface JsonMap { + interface Client { /** - * Value implements the [driver.Valuer] interface. + * This operation is not supported by directory buckets. + * + * This implementation of the GET action uses the accelerate subresource to return + * the Transfer Acceleration state of a bucket, which is either Enabled or + * Suspended . Amazon S3 Transfer Acceleration is a bucket-level feature that + * enables you to perform faster data transfers to and from Amazon S3. + * + * To use this operation, you must have permission to perform the + * s3:GetAccelerateConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to your Amazon S3 Resources] in the Amazon S3 User Guide. + * + * You set the Transfer Acceleration state of an existing bucket to Enabled or + * Suspended by using the [PutBucketAccelerateConfiguration] operation. + * + * A GET accelerate request does not return a state value for a bucket that has no + * transfer acceleration state. A bucket has no Transfer Acceleration state if a + * state has never been set on the bucket. + * + * For more information about transfer acceleration, see [Transfer Acceleration] in the Amazon S3 User + * Guide. + * + * The following operations are related to GetBucketAccelerateConfiguration : + * + * [PutBucketAccelerateConfiguration] + * + * [PutBucketAccelerateConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Managing Access Permissions to your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html */ - value(): any + getBucketAccelerateConfiguration(ctx: context.Context, params: GetBucketAccelerateConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketAccelerateConfigurationOutput) } - interface JsonMap { + interface Client { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current `JsonMap` instance. + * This operation is not supported by directory buckets. + * + * This implementation of the GET action uses the acl subresource to return the + * access control list (ACL) of a bucket. To use GET to return the ACL of the + * bucket, you must have the READ_ACP access to the bucket. If READ_ACP permission + * is granted to the anonymous user, you can return the ACL of the bucket without + * using an authorization header. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, + * requests to read ACLs are still supported and return the + * bucket-owner-full-control ACL with the owner being the account that created the + * bucket. For more information, see [Controlling object ownership and disabling ACLs]in the Amazon S3 User Guide. + * + * The following operations are related to GetBucketAcl : + * + * [ListObjects] + * + * [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * [Controlling object ownership and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html */ - scan(value: any): void - } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * Schema defines a dynamic db schema as a slice of `SchemaField`s. - */ - interface Schema { + getBucketAcl(ctx: context.Context, params: GetBucketAclInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketAclOutput) } - interface Schema { + interface Client { /** - * Fields returns the registered schema fields. + * This operation is not supported by directory buckets. + * + * This implementation of the GET action returns an analytics configuration + * (identified by the analytics configuration ID) from the bucket. + * + * To use this operation, you must have permissions to perform the + * s3:GetAnalyticsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources] in the Amazon S3 User Guide. + * + * For information about Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis] in the Amazon S3 User + * Guide. + * + * The following operations are related to GetBucketAnalyticsConfiguration : + * + * [DeleteBucketAnalyticsConfiguration] + * + * [ListBucketAnalyticsConfigurations] + * + * [PutBucketAnalyticsConfiguration] + * + * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html + * [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html + * [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - fields(): Array<(SchemaField | undefined)> + getBucketAnalyticsConfiguration(ctx: context.Context, params: GetBucketAnalyticsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketAnalyticsConfigurationOutput) } - interface Schema { + interface Client { /** - * InitFieldsOptions calls `InitOptions()` for all schema fields. + * This operation is not supported by directory buckets. + * + * Returns the Cross-Origin Resource Sharing (CORS) configuration information set + * for the bucket. + * + * To use this operation, you must have permission to perform the s3:GetBucketCORS + * action. By default, the bucket owner has this permission and can grant it to + * others. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * For more information about CORS, see [Enabling Cross-Origin Resource Sharing]. + * + * The following operations are related to GetBucketCors : + * + * [PutBucketCors] + * + * [DeleteBucketCors] + * + * [PutBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html + * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * [DeleteBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html */ - initFieldsOptions(): void + getBucketCors(ctx: context.Context, params: GetBucketCorsInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketCorsOutput) } - interface Schema { + interface Client { /** - * Clone creates a deep clone of the current schema. + * Returns the default encryption configuration for an Amazon S3 bucket. By + * default, all buckets have a default encryption configuration that uses + * server-side encryption with Amazon S3 managed keys (SSE-S3). + * + * ``` + * - General purpose buckets - For information about the bucket default + * encryption feature, see [Amazon S3 Bucket Default Encryption]in the Amazon S3 User Guide. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: SSE-S3 and SSE-KMS. For information about + * the default encryption configuration in directory buckets, see [Setting default server-side encryption behavior for directory buckets]. + * ``` + * + * Permissions + * + * ``` + * - General purpose bucket permissions - The s3:GetEncryptionConfiguration + * permission is required in a policy. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * - Directory bucket permissions - To grant access to this API operation, you + * must have the s3express:GetEncryptionConfiguration permission in an IAM + * identity-based policy instead of a bucket policy. Cross-account access to this + * API operation isn't supported. This operation can only be performed by the + * Amazon Web Services account that owns the resource. For more information about + * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following operations are related to GetBucketEncryption : + * + * [PutBucketEncryption] + * + * [DeleteBucketEncryption] + * + * [DeleteBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html + * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html + * [Setting default server-side encryption behavior for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html + * [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - clone(): (Schema) + getBucketEncryption(ctx: context.Context, params: GetBucketEncryptionInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketEncryptionOutput) } - interface Schema { + interface Client { /** - * AsMap returns a map with all registered schema field. - * The returned map is indexed with each field name. + * This operation is not supported by directory buckets. + * + * Gets the S3 Intelligent-Tiering configuration from the specified bucket. + * + * The S3 Intelligent-Tiering storage class is designed to optimize storage costs + * by automatically moving data to the most cost-effective storage access tier, + * without performance impact or operational overhead. S3 Intelligent-Tiering + * delivers automatic cost savings in three low latency and high throughput access + * tiers. To get the lowest storage cost on data that can be accessed in minutes to + * hours, you can choose to activate additional archiving capabilities. + * + * The S3 Intelligent-Tiering storage class is the ideal storage class for data + * with unknown, changing, or unpredictable access patterns, independent of object + * size or retention period. If the size of an object is less than 128 KB, it is + * not monitored and not eligible for auto-tiering. Smaller objects can be stored, + * but they are always charged at the Frequent Access tier rates in the S3 + * Intelligent-Tiering storage class. + * + * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. + * + * Operations related to GetBucketIntelligentTieringConfiguration include: + * + * [DeleteBucketIntelligentTieringConfiguration] + * + * [PutBucketIntelligentTieringConfiguration] + * + * [ListBucketIntelligentTieringConfigurations] + * + * [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html + * [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + * [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html */ - asMap(): _TygojaDict + getBucketIntelligentTieringConfiguration(ctx: context.Context, params: GetBucketIntelligentTieringConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketIntelligentTieringConfigurationOutput) } - interface Schema { + interface Client { /** - * GetFieldById returns a single field by its id. + * This operation is not supported by directory buckets. + * + * Returns an inventory configuration (identified by the inventory configuration + * ID) from the bucket. + * + * To use this operation, you must have permissions to perform the + * s3:GetInventoryConfiguration action. The bucket owner has this permission by + * default and can grant this permission to others. For more information about + * permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory]. + * + * The following operations are related to GetBucketInventoryConfiguration : + * + * [DeleteBucketInventoryConfiguration] + * + * [ListBucketInventoryConfigurations] + * + * [PutBucketInventoryConfiguration] + * + * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html + * [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html */ - getFieldById(id: string): (SchemaField) + getBucketInventoryConfiguration(ctx: context.Context, params: GetBucketInventoryConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketInventoryConfigurationOutput) } - interface Schema { + interface Client { /** - * GetFieldByName returns a single field by its name. + * This operation is not supported by directory buckets. + * + * Bucket lifecycle configuration now supports specifying a lifecycle rule using + * an object key name prefix, one or more object tags, object size, or any + * combination of these. Accordingly, this section describes the latest API. The + * previous version of the API supported filtering based only on an object key name + * prefix, which is supported for backward compatibility. For the related API + * description, see [GetBucketLifecycle]. Accordingly, this section describes the latest API. The + * response describes the new filter element that you can use to specify a filter + * to select a subset of objects to which the rule applies. If you are using a + * previous version of the lifecycle configuration, it still works. For the earlier + * action, + * + * Returns the lifecycle configuration information set on the bucket. For + * information about lifecycle configuration, see [Object Lifecycle Management]. + * + * To use this operation, you must have permission to perform the + * s3:GetLifecycleConfiguration action. The bucket owner has this permission, by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * GetBucketLifecycleConfiguration has the following special error: + * + * ``` + * - Error code: NoSuchLifecycleConfiguration + * + * - Description: The lifecycle configuration does not exist. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * ``` + * + * The following operations are related to GetBucketLifecycleConfiguration : + * + * [GetBucketLifecycle] + * + * [PutBucketLifecycle] + * + * [DeleteBucketLifecycle] + * + * [GetBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html + * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html */ - getFieldByName(name: string): (SchemaField) + getBucketLifecycleConfiguration(ctx: context.Context, params: GetBucketLifecycleConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketLifecycleConfigurationOutput) } - interface Schema { + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import smithyio = io + interface Client { /** - * RemoveField removes a single schema field by its id. + * This operation is not supported by directory buckets. * - * This method does nothing if field with `id` doesn't exist. + * Returns the Region the bucket resides in. You set the bucket's Region using the + * LocationConstraint request parameter in a CreateBucket request. For more + * information, see [CreateBucket]. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * We recommend that you use [HeadBucket] to return the Region that a bucket resides in. For + * backward compatibility, Amazon S3 continues to support GetBucketLocation. + * + * The following operations are related to GetBucketLocation : + * + * [GetObject] + * + * [CreateBucket] + * + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [HeadBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html */ - removeField(id: string): void + getBucketLocation(ctx: context.Context, params: GetBucketLocationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketLocationOutput) } - interface Schema { + interface Client { /** - * AddField registers the provided newField to the current schema. + * This operation is not supported by directory buckets. * - * If field with `newField.Id` already exist, the existing field is - * replaced with the new one. + * Returns the logging status of a bucket and the permissions users have to view + * and modify that status. * - * Otherwise the new field is appended to the other schema fields. + * The following operations are related to GetBucketLogging : + * + * [CreateBucket] + * + * [PutBucketLogging] + * + * [PutBucketLogging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html */ - addField(newField: SchemaField): void + getBucketLogging(ctx: context.Context, params: GetBucketLoggingInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketLoggingOutput) } - interface Schema { + interface Client { /** - * Validate makes Schema validatable by implementing [validation.Validatable] interface. + * This operation is not supported by directory buckets. * - * Internally calls each individual field's validator and additionally - * checks for invalid renamed fields and field name duplications. + * Gets a metrics configuration (specified by the metrics configuration ID) from + * the bucket. Note that this doesn't include the daily storage metrics. + * + * To use this operation, you must have permissions to perform the + * s3:GetMetricsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. + * + * The following operations are related to GetBucketMetricsConfiguration : + * + * [PutBucketMetricsConfiguration] + * + * [DeleteBucketMetricsConfiguration] + * + * [ListBucketMetricsConfigurations] + * + * [Monitoring Metrics with Amazon CloudWatch] + * + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html + * [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html + * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + * [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - validate(): void + getBucketMetricsConfiguration(ctx: context.Context, params: GetBucketMetricsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketMetricsConfigurationOutput) } - interface Schema { + interface Client { /** - * MarshalJSON implements the [json.Marshaler] interface. + * This operation is not supported by directory buckets. + * + * Returns the notification configuration of a bucket. + * + * If notifications are not enabled on the bucket, the action returns an empty + * NotificationConfiguration element. + * + * By default, you must be the bucket owner to read the notification configuration + * of a bucket. However, the bucket owner can use a bucket policy to grant + * permission to other users to read this configuration with the + * s3:GetBucketNotification permission. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * For more information about setting and reading the notification configuration + * on a bucket, see [Setting Up Notification of Bucket Events]. For more information about bucket policies, see [Using Bucket Policies]. + * + * The following action is related to GetBucketNotification : + * + * [PutBucketNotification] + * + * [Using Bucket Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html + * [Setting Up Notification of Bucket Events]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * [PutBucketNotification]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html */ - marshalJSON(): string|Array + getBucketNotificationConfiguration(ctx: context.Context, params: GetBucketNotificationConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketNotificationConfigurationOutput) } - interface Schema { + interface Client { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * This operation is not supported by directory buckets. * - * On success, all schema field options are auto initialized. + * Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you + * must have the s3:GetBucketOwnershipControls permission. For more information + * about Amazon S3 permissions, see [Specifying permissions in a policy]. + * + * For information about Amazon S3 Object Ownership, see [Using Object Ownership]. + * + * The following operations are related to GetBucketOwnershipControls : + * + * # PutBucketOwnershipControls + * + * # DeleteBucketOwnershipControls + * + * [Using Object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html */ - unmarshalJSON(data: string|Array): void + getBucketOwnershipControls(ctx: context.Context, params: GetBucketOwnershipControlsInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketOwnershipControlsOutput) } - interface Schema { + interface Client { /** - * Value implements the [driver.Valuer] interface. + * Returns the policy of a specified bucket. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Regional endpoint. These endpoints support path-style requests + * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. + * + * Permissions If you are using an identity other than the root user of the Amazon + * Web Services account that owns the bucket, the calling identity must both have + * the GetBucketPolicy permissions on the specified bucket and belong to the + * bucket owner's account in order to use this operation. + * + * If you don't have GetBucketPolicy permissions, Amazon S3 returns a 403 Access + * Denied error. If you have the correct permissions, but you're not using an + * identity that belongs to the bucket owner's account, Amazon S3 returns a 405 + * Method Not Allowed error. + * + * To ensure that bucket owners don't inadvertently lock themselves out of their + * own buckets, the root principal in a bucket owner's Amazon Web Services account + * can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API + * actions, even if their bucket policy explicitly denies the root principal's + * access. Bucket owner root principals can only be blocked from performing these + * API actions by VPC endpoint policies and Amazon Web Services Organizations + * policies. + * + * ``` + * - General purpose bucket permissions - The s3:GetBucketPolicy permission is + * required in a policy. For more information about general purpose buckets bucket + * policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation, you + * must have the s3express:GetBucketPolicy permission in an IAM identity-based + * policy instead of a bucket policy. Cross-account access to this API operation + * isn't supported. This operation can only be performed by the Amazon Web Services + * account that owns the resource. For more information about directory bucket + * policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * Example bucket policies General purpose buckets example bucket policies - See [Bucket policy examples] + * in the Amazon S3 User Guide. + * + * Directory bucket example bucket policies - See [Example bucket policies for S3 Express One Zone] in the Amazon S3 User Guide. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following action is related to GetBucketPolicy : + * + * [GetObject] + * + * [Bucket policy examples]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html + * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - value(): any + getBucketPolicy(ctx: context.Context, params: GetBucketPolicyInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketPolicyOutput) } - interface Schema { + interface Client { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current Schema instance. + * This operation is not supported by directory buckets. + * + * Retrieves the policy status for an Amazon S3 bucket, indicating whether the + * bucket is public. In order to use this operation, you must have the + * s3:GetBucketPolicyStatus permission. For more information about Amazon S3 + * permissions, see [Specifying Permissions in a Policy]. + * + * For more information about when Amazon S3 considers a bucket public, see [The Meaning of "Public"]. + * + * The following operations are related to GetBucketPolicyStatus : + * + * [Using Amazon S3 Block Public Access] + * + * [GetPublicAccessBlock] + * + * [PutPublicAccessBlock] + * + * [DeletePublicAccessBlock] + * + * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html + * [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html + * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html + * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status */ - scan(value: any): void - } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - type _subxyKhr = BaseModel - interface Admin extends _subxyKhr { - avatar: number - email: string - tokenKey: string - passwordHash: string - lastResetSentAt: types.DateTime + getBucketPolicyStatus(ctx: context.Context, params: GetBucketPolicyStatusInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketPolicyStatusOutput) } - interface Admin { + interface Client { /** - * TableName returns the Admin model SQL table name. + * This operation is not supported by directory buckets. + * + * Returns the replication configuration of a bucket. + * + * It can take a while to propagate the put or delete a replication configuration + * to all Amazon S3 systems. Therefore, a get request soon after put or delete can + * return a wrong result. + * + * For information about replication configuration, see [Replication] in the Amazon S3 User + * Guide. + * + * This action requires permissions for the s3:GetReplicationConfiguration action. + * For more information about permissions, see [Using Bucket Policies and User Policies]. + * + * If you include the Filter element in a replication configuration, you must also + * include the DeleteMarkerReplication and Priority elements. The response also + * returns those elements. + * + * For information about GetBucketReplication errors, see [List of replication-related error codes] + * + * The following operations are related to GetBucketReplication : + * + * [PutBucketReplication] + * + * [DeleteBucketReplication] + * + * [PutBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html + * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html + * [List of replication-related error codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList + * [DeleteBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html */ - tableName(): string + getBucketReplication(ctx: context.Context, params: GetBucketReplicationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketReplicationOutput) } - interface Admin { + interface Client { /** - * ValidatePassword validates a plain password against the model's password. + * This operation is not supported by directory buckets. + * + * Returns the request payment configuration of a bucket. To use this version of + * the operation, you must be the bucket owner. For more information, see [Requester Pays Buckets]. + * + * The following operations are related to GetBucketRequestPayment : + * + * [ListObjects] + * + * [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html + * [Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html */ - validatePassword(password: string): boolean + getBucketRequestPayment(ctx: context.Context, params: GetBucketRequestPaymentInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketRequestPaymentOutput) } - interface Admin { + interface Client { /** - * SetPassword sets cryptographically secure string to `model.Password`. + * This operation is not supported by directory buckets. * - * Additionally this method also resets the LastResetSentAt and the TokenKey fields. + * Returns the tag set associated with the bucket. + * + * To use this operation, you must have permission to perform the + * s3:GetBucketTagging action. By default, the bucket owner has this permission and + * can grant this permission to others. + * + * GetBucketTagging has the following special error: + * + * ``` + * - Error code: NoSuchTagSet + * + * - Description: There is no tag set associated with the bucket. + * ``` + * + * The following operations are related to GetBucketTagging : + * + * [PutBucketTagging] + * + * [DeleteBucketTagging] + * + * [PutBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html + * [DeleteBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html */ - setPassword(password: string): void + getBucketTagging(ctx: context.Context, params: GetBucketTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketTaggingOutput) } - interface Admin { + interface Client { /** - * RefreshTokenKey generates and sets new random token key. - */ - refreshTokenKey(): void - } - // @ts-ignore - import validation = ozzo_validation - type _subUyFbk = BaseModel - interface Collection extends _subUyFbk { - name: string - type: string - system: boolean - schema: schema.Schema - indexes: types.JsonArray - /** - * rules - */ - listRule?: string - viewRule?: string - createRule?: string - updateRule?: string - deleteRule?: string - options: types.JsonMap - } - interface Collection { - /** - * TableName returns the Collection model SQL table name. - */ - tableName(): string - } - interface Collection { - /** - * BaseFilesPath returns the storage dir path used by the collection. - */ - baseFilesPath(): string - } - interface Collection { - /** - * IsBase checks if the current collection has "base" type. + * This operation is not supported by directory buckets. + * + * Returns the versioning state of a bucket. + * + * To retrieve the versioning state of a bucket, you must be the bucket owner. + * + * This implementation also returns the MFA Delete status of the versioning state. + * If the MFA Delete status is enabled , the bucket owner must use an + * authentication device to change the versioning state of the bucket. + * + * The following operations are related to GetBucketVersioning : + * + * [GetObject] + * + * [PutObject] + * + * [DeleteObject] + * + * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html */ - isBase(): boolean + getBucketVersioning(ctx: context.Context, params: GetBucketVersioningInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketVersioningOutput) } - interface Collection { + interface Client { /** - * IsAuth checks if the current collection has "auth" type. + * This operation is not supported by directory buckets. + * + * Returns the website configuration for a bucket. To host website on Amazon S3, + * you can configure a bucket as website by adding a website configuration. For + * more information about hosting websites, see [Hosting Websites on Amazon S3]. + * + * This GET action requires the S3:GetBucketWebsite permission. By default, only + * the bucket owner can read the bucket website configuration. However, bucket + * owners can allow other users to read the website configuration by writing a + * bucket policy granting them the S3:GetBucketWebsite permission. + * + * The following operations are related to GetBucketWebsite : + * + * [DeleteBucketWebsite] + * + * [PutBucketWebsite] + * + * [PutBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html + * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html + * [DeleteBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html */ - isAuth(): boolean + getBucketWebsite(ctx: context.Context, params: GetBucketWebsiteInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketWebsiteOutput) } - interface Collection { + interface Client { /** - * IsView checks if the current collection has "view" type. + * Retrieves an object from Amazon S3. + * + * In the GetObject request, specify the full key name for the object. + * + * General purpose buckets - Both the virtual-hosted-style requests and the + * path-style requests are supported. For a virtual hosted-style request example, + * if you have the object photos/2006/February/sample.jpg , specify the object key + * name as /photos/2006/February/sample.jpg . For a path-style request example, if + * you have the object photos/2006/February/sample.jpg in the bucket named + * examplebucket , specify the object key name as + * /examplebucket/photos/2006/February/sample.jpg . For more information about + * request types, see [HTTP Host Header Bucket Specification]in the Amazon S3 User Guide. + * + * Directory buckets - Only virtual-hosted-style requests are supported. For a + * virtual hosted-style request example, if you have the object + * photos/2006/February/sample.jpg in the bucket named + * examplebucket--use1-az5--x-s3 , specify the object key name as + * /photos/2006/February/sample.jpg . Also, when you make requests to this API + * operation, your requests are sent to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Permissions + * ``` + * - General purpose bucket permissions - You must have the required permissions + * in a policy. To use GetObject , you must have the READ access to the object + * (or version). If you grant READ access to the anonymous user, the GetObject + * operation returns the object without using an authorization header. For more + * information, see [Specifying permissions in a policy]in the Amazon S3 User Guide. + * ``` + * + * If you include a versionId in your request header, you must have the + * + * ``` + * s3:GetObjectVersion permission to access a specific version of an object. The + * s3:GetObject permission is not required in this scenario. + * ``` + * + * If you request the current version of an object without a specific versionId in + * + * ``` + * the request header, only the s3:GetObject permission is required. The + * s3:GetObjectVersion permission is not required in this scenario. + * ``` + * + * If the object that you request doesn’t exist, the error that Amazon S3 returns + * + * ``` + * depends on whether you also have the s3:ListBucket permission. + * + * - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an + * HTTP status code 404 Not Found error. + * + * - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP + * status code 403 Access Denied error. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * If the object is encrypted using SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * Storage classes If the object you are retrieving is stored in the S3 Glacier + * Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the + * S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep + * Archive Access tier, before you can retrieve the object you must first restore a + * copy using [RestoreObject]. Otherwise, this operation returns an InvalidObjectState error. For + * information about restoring archived objects, see [Restoring Archived Objects]in the Amazon S3 User Guide. + * + * Directory buckets - For directory buckets, only the S3 Express One Zone storage + * class is supported to store newly created objects. Unsupported storage class + * values won't write a destination object and will respond with the HTTP status + * code 400 Bad Request . + * + * Encryption Encryption request headers, like x-amz-server-side-encryption , + * should not be sent for the GetObject requests, if your object uses server-side + * encryption with Amazon S3 managed encryption keys (SSE-S3), server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer + * server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you + * include the header in your GetObject requests for the object that uses these + * types of keys, you’ll get an HTTP 400 Bad Request error. + * + * Directory buckets - For directory buckets, there are only two supported options + * for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more + * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. + * + * Overriding response header values through the request There are times when you + * want to override certain response header values of a GetObject response. For + * example, you might override the Content-Disposition response header value + * through your GetObject request. + * + * You can override values for a set of response headers. These modified response + * header values are included only in a successful response, that is, when the HTTP + * status code 200 OK is returned. The headers you can override using the + * following query parameters in the request are a subset of the headers that + * Amazon S3 accepts when you create an object. + * + * The response headers that you can override for the GetObject response are + * Cache-Control , Content-Disposition , Content-Encoding , Content-Language , + * Content-Type , and Expires . + * + * To override values for a set of response headers in the GetObject response, you + * can use the following query parameters in the request. + * + * ``` + * - response-cache-control + * + * - response-content-disposition + * + * - response-content-encoding + * + * - response-content-language + * + * - response-content-type + * + * - response-expires + * ``` + * + * When you use these parameters, you must sign the request by using either an + * Authorization header or a presigned URL. These parameters cannot be used with an + * unsigned (anonymous) request. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to GetObject : + * + * [ListBuckets] + * + * [GetObjectAcl] + * + * [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html + * [HTTP Host Header Bucket Specification]: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket + * [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html + * [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html + * [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html */ - isView(): boolean + getObject(ctx: context.Context, params: GetObjectInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectOutput) } - interface Collection { + interface Client { /** - * MarshalJSON implements the [json.Marshaler] interface. + * This operation is not supported by directory buckets. + * + * Returns the access control list (ACL) of an object. To use this operation, you + * must have s3:GetObjectAcl permissions or READ_ACP access to the object. For + * more information, see [Mapping of ACL permissions and access policy permissions]in the Amazon S3 User Guide + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * By default, GET returns ACL information about the current version of an object. + * To return ACL information about a different version, use the versionId + * subresource. + * + * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, + * requests to read ACLs are still supported and return the + * bucket-owner-full-control ACL with the owner being the account that created the + * bucket. For more information, see [Controlling object ownership and disabling ACLs]in the Amazon S3 User Guide. + * + * The following operations are related to GetObjectAcl : + * + * [GetObject] + * + * [GetObjectAttributes] + * + * [DeleteObject] + * + * [PutObject] + * + * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html + * [Mapping of ACL permissions and access policy permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [Controlling object ownership and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html */ - marshalJSON(): string|Array + getObjectAcl(ctx: context.Context, params: GetObjectAclInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectAclOutput) } - interface Collection { + interface Client { /** - * BaseOptions decodes the current collection options and returns them - * as new [CollectionBaseOptions] instance. + * Retrieves all the metadata from an object without returning the object itself. + * This operation is useful if you're interested only in an object's metadata. + * + * GetObjectAttributes combines the functionality of HeadObject and ListParts . All + * of the data returned with each of those individual calls can be returned with a + * single call to GetObjectAttributes . + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Zonal endpoint. These endpoints support virtual-hosted-style + * requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - To use GetObjectAttributes , you must + * have READ access to the object. The permissions that you need to use this + * operation depend on whether the bucket is versioned. If the bucket is versioned, + * you need both the s3:GetObjectVersion and s3:GetObjectVersionAttributes + * permissions for this operation. If the bucket is not versioned, you need the + * s3:GetObject and s3:GetObjectAttributes permissions. For more information, see [Specifying Permissions in a Policy] + * in the Amazon S3 User Guide. If the object that you request does not exist, the + * error Amazon S3 returns depends on whether you also have the s3:ListBucket + * permission. + * + * - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an + * HTTP status code 404 Not Found ("no such key") error. + * + * - If you don't have the s3:ListBucket permission, Amazon S3 returns an HTTP + * status code 403 Forbidden ("access denied") error. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * If the object is encrypted with SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * Encryption Encryption request headers, like x-amz-server-side-encryption , + * should not be sent for HEAD requests if your object uses server-side encryption + * with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side + * encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side + * encryption with Amazon S3 managed encryption keys (SSE-S3). The + * x-amz-server-side-encryption header is used when you PUT an object to S3 and + * want to specify the encryption method. If you include this header in a GET + * request for an object that uses these types of keys, you’ll get an HTTP 400 Bad + * Request error. It's because the encryption method can't be changed when you + * retrieve the object. + * + * If you encrypt an object by using server-side encryption with customer-provided + * encryption keys (SSE-C) when you store the object in Amazon S3, then when you + * retrieve the metadata from the object, you must use the following headers to + * provide the encryption key for the server to be able to retrieve the object's + * metadata. The headers are: + * + * ``` + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + * + * Directory bucket permissions - For directory buckets, there are only two + * supported options for server-side encryption: server-side encryption with Amazon + * S3 managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses + * the desired encryption configuration and you don't override the bucket default + * encryption in your CreateSession requests or PUT object requests. Then, new + * objects are automatically encrypted with the desired encryption settings. For + * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about + * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + * + * Versioning Directory buckets - S3 Versioning isn't enabled and supported for + * directory buckets. For this API operation, only the null value of the version + * ID is supported by directory buckets. You can only specify null to the versionId + * query parameter in the request. + * + * Conditional request headers Consider the following when using request headers: + * + * ``` + * - If both of the If-Match and If-Unmodified-Since headers are present in the + * request as follows, then Amazon S3 returns the HTTP status code 200 OK and the + * data requested: + * + * - If-Match condition evaluates to true . + * + * - If-Unmodified-Since condition evaluates to false . + * ``` + * + * For more information about conditional requests, see [RFC 7232]. + * + * ``` + * - If both of the If-None-Match and If-Modified-Since headers are present in + * the request as follows, then Amazon S3 returns the HTTP status code 304 Not + * Modified : + * + * - If-None-Match condition evaluates to false . + * + * - If-Modified-Since condition evaluates to true . + * ``` + * + * For more information about conditional requests, see [RFC 7232]. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following actions are related to GetObjectAttributes : + * + * [GetObject] + * + * [GetObjectAcl] + * + * [GetObjectLegalHold] + * + * [GetObjectLockConfiguration] + * + * [GetObjectRetention] + * + * [GetObjectTagging] + * + * [HeadObject] + * + * [ListParts] + * + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [GetObjectLegalHold]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + * [HeadObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html + * [GetObjectLockConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html + * [GetObjectRetention]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html */ - baseOptions(): CollectionBaseOptions + getObjectAttributes(ctx: context.Context, params: GetObjectAttributesInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectAttributesOutput) } - interface Collection { + interface Client { /** - * AuthOptions decodes the current collection options and returns them - * as new [CollectionAuthOptions] instance. + * This operation is not supported by directory buckets. + * + * Gets an object's current legal hold status. For more information, see [Locking Objects]. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * The following action is related to GetObjectLegalHold : + * + * [GetObjectAttributes] + * + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html */ - authOptions(): CollectionAuthOptions + getObjectLegalHold(ctx: context.Context, params: GetObjectLegalHoldInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectLegalHoldOutput) } - interface Collection { + interface Client { /** - * ViewOptions decodes the current collection options and returns them - * as new [CollectionViewOptions] instance. + * This operation is not supported by directory buckets. + * + * Gets the Object Lock configuration for a bucket. The rule specified in the + * Object Lock configuration will be applied by default to every new object placed + * in the specified bucket. For more information, see [Locking Objects]. + * + * The following action is related to GetObjectLockConfiguration : + * + * [GetObjectAttributes] + * + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html */ - viewOptions(): CollectionViewOptions + getObjectLockConfiguration(ctx: context.Context, params: GetObjectLockConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectLockConfigurationOutput) } - interface Collection { + interface Client { /** - * NormalizeOptions updates the current collection options with a - * new normalized state based on the collection type. + * This operation is not supported by directory buckets. + * + * Retrieves an object's retention settings. For more information, see [Locking Objects]. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * The following action is related to GetObjectRetention : + * + * [GetObjectAttributes] + * + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html */ - normalizeOptions(): void + getObjectRetention(ctx: context.Context, params: GetObjectRetentionInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectRetentionOutput) } - interface Collection { + interface Client { /** - * DecodeOptions decodes the current collection options into the - * provided "result" (must be a pointer). + * This operation is not supported by directory buckets. + * + * Returns the tag-set of an object. You send the GET request against the tagging + * subresource associated with the object. + * + * To use this operation, you must have permission to perform the + * s3:GetObjectTagging action. By default, the GET action returns information about + * current version of an object. For a versioned bucket, you can have multiple + * versions of an object in your bucket. To retrieve tags of any other version, use + * the versionId query parameter. You also need permission for the + * s3:GetObjectVersionTagging action. + * + * By default, the bucket owner has this permission and can grant this permission + * to others. + * + * For information about the Amazon S3 object tagging feature, see [Object Tagging]. + * + * The following actions are related to GetObjectTagging : + * + * [DeleteObjectTagging] + * + * [GetObjectAttributes] + * + * [PutObjectTagging] + * + * [DeleteObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html + * [PutObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html */ - decodeOptions(result: any): void + getObjectTagging(ctx: context.Context, params: GetObjectTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectTaggingOutput) } - interface Collection { + interface Client { /** - * SetOptions normalizes and unmarshals the specified options into m.Options. + * This operation is not supported by directory buckets. + * + * Returns torrent files from a bucket. BitTorrent can save you bandwidth when + * you're distributing large files. + * + * You can get torrent only for objects that are less than 5 GB in size, and that + * are not encrypted using server-side encryption with a customer-provided + * encryption key. + * + * To use GET, you must have READ access to the object. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * The following action is related to GetObjectTorrent : + * + * [GetObject] + * + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html */ - setOptions(typedOptions: any): void - } - type _subeDKbD = BaseModel - interface ExternalAuth extends _subeDKbD { - collectionId: string - recordId: string - provider: string - providerId: string - } - interface ExternalAuth { - tableName(): string + getObjectTorrent(ctx: context.Context, params: GetObjectTorrentInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectTorrentOutput) } - type _subkdarp = BaseModel - interface Record extends _subkdarp { - } - interface Record { + interface Client { /** - * TableName returns the table name associated to the current Record model. + * This operation is not supported by directory buckets. + * + * Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To use + * this operation, you must have the s3:GetBucketPublicAccessBlock permission. For + * more information about Amazon S3 permissions, see [Specifying Permissions in a Policy]. + * + * When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or an + * object, it checks the PublicAccessBlock configuration for both the bucket (or + * the bucket that contains the object) and the bucket owner's account. If the + * PublicAccessBlock settings are different between the bucket and the account, + * Amazon S3 uses the most restrictive combination of the bucket-level and + * account-level settings. + * + * For more information about when Amazon S3 considers a bucket or an object + * public, see [The Meaning of "Public"]. + * + * The following operations are related to GetPublicAccessBlock : + * + * [Using Amazon S3 Block Public Access] + * + * [PutPublicAccessBlock] + * + * [GetPublicAccessBlock] + * + * [DeletePublicAccessBlock] + * + * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html + * [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html + * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html + * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status */ - tableName(): string + getPublicAccessBlock(ctx: context.Context, params: GetPublicAccessBlockInput, ...optFns: ((_arg0: Options) => void)[]): (GetPublicAccessBlockOutput) } - interface Record { + // @ts-ignore + import smithytime = time + // @ts-ignore + import smithywaiter = waiter + interface Client { /** - * Collection returns the Collection model associated to the current Record model. + * You can use this operation to determine if a bucket exists and if you have + * permission to access it. The action returns a 200 OK if the bucket exists and + * you have permission to access it. + * + * If the bucket does not exist or you do not have permission to access it, the + * HEAD request returns a generic 400 Bad Request , 403 Forbidden or 404 Not Found + * code. A message body is not included, so you cannot determine the exception + * beyond these HTTP response codes. + * + * Authentication and authorization General purpose buckets - Request to public + * buckets that grant the s3:ListBucket permission publicly do not need to be + * signed. All other HeadBucket requests must be authenticated and signed by using + * IAM credentials (access key ID and secret access key for the IAM identities). + * All headers with the x-amz- prefix, including x-amz-copy-source , must be + * signed. For more information, see [REST Authentication]. + * + * Directory buckets - You must use IAM credentials to authenticate and authorize + * your access to the HeadBucket API operation, instead of using the temporary + * security credentials through the CreateSession API operation. + * + * Amazon Web Services CLI or SDKs handles authentication and authorization on + * your behalf. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - To use this operation, you must have + * permissions to perform the s3:ListBucket action. The bucket owner has this + * permission by default and can grant this permission to others. For more + * information about permissions, see [Managing access permissions to your Amazon S3 resources]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - You must have the s3express:CreateSession + * permission in the Action element of a policy. By default, the session is in + * the ReadWrite mode. If you want to restrict the access, you can explicitly set + * the s3express:SessionMode condition key to ReadOnly on the bucket. + * ``` + * + * For more information about example bucket policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 + * + * ``` + * User Guide. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * You must make requests for this API operation to the Zonal endpoint. These + * endpoints support virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests + * are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User Guide. + * + * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html + * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Managing access permissions to your Amazon S3 resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - collection(): (Collection) + headBucket(ctx: context.Context, params: HeadBucketInput, ...optFns: ((_arg0: Options) => void)[]): (HeadBucketOutput) } - interface Record { + interface Client { /** - * OriginalCopy returns a copy of the current record model populated - * with its ORIGINAL data state (aka. the initially loaded) and - * everything else reset to the defaults. - */ - originalCopy(): (Record) - } - interface Record { - /** - * CleanCopy returns a copy of the current record model populated only - * with its LATEST data state and everything else reset to the defaults. - */ - cleanCopy(): (Record) - } - interface Record { - /** - * Expand returns a shallow copy of the current Record model expand data. - */ - expand(): _TygojaDict - } - interface Record { - /** - * SetExpand shallow copies the provided data to the current Record model's expand. - */ - setExpand(expand: _TygojaDict): void - } - interface Record { - /** - * MergeExpand merges recursively the provided expand data into - * the current model's expand (if any). + * The HEAD operation retrieves metadata from an object without returning the + * object itself. This operation is useful if you're interested only in an object's + * metadata. * - * Note that if an expanded prop with the same key is a slice (old or new expand) - * then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). - * Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew). - */ - mergeExpand(expand: _TygojaDict): void - } - interface Record { - /** - * SchemaData returns a shallow copy ONLY of the defined record schema fields data. - */ - schemaData(): _TygojaDict - } - interface Record { - /** - * UnknownData returns a shallow copy ONLY of the unknown record fields data, - * aka. fields that are neither one of the base and special system ones, - * nor defined by the collection schema. - */ - unknownData(): _TygojaDict - } - interface Record { - /** - * IgnoreEmailVisibility toggles the flag to ignore the auth record email visibility check. - */ - ignoreEmailVisibility(state: boolean): void - } - interface Record { - /** - * WithUnknownData toggles the export/serialization of unknown data fields - * (false by default). - */ - withUnknownData(state: boolean): void - } - interface Record { - /** - * Set sets the provided key-value data pair for the current Record model. + * A HEAD request has the same options as a GET operation on an object. The + * response is identical to the GET response except that there is no response + * body. Because of this, if the HEAD request generates an error, it returns a + * generic code, such as 400 Bad Request , 403 Forbidden , 404 Not Found , 405 + * Method Not Allowed , 412 Precondition Failed , or 304 Not Modified . It's not + * possible to retrieve the exact exception of these error codes. * - * If the record collection has field with name matching the provided "key", - * the value will be further normalized according to the field rules. - */ - set(key: string, value: any): void - } - interface Record { - /** - * Get returns a normalized single record model data value for "key". + * Request headers are limited to 8 KB in size. For more information, see [Common Request Headers]. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - To use HEAD , you must have the + * s3:GetObject permission. You need the relevant read object (or version) + * permission for this operation. For more information, see [Actions, resources, and condition keys for Amazon S3]in the Amazon S3 + * User Guide. For more information about the permissions to S3 API operations by + * S3 resource types, see Required permissions for Amazon S3 API operationsin the Amazon S3 User Guide. + * ``` + * + * If the object you request doesn't exist, the error that Amazon S3 returns + * + * ``` + * depends on whether you also have the s3:ListBucket permission. + * + * - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an + * HTTP status code 404 Not Found error. + * + * - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP + * status code 403 Forbidden error. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * If you enable x-amz-checksum-mode in the request and the object is encrypted + * + * ``` + * with Amazon Web Services Key Management Service (Amazon Web Services KMS), you + * must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM + * identity-based policies and KMS key policies for the KMS key to retrieve the + * checksum of the object. + * ``` + * + * Encryption Encryption request headers, like x-amz-server-side-encryption , + * should not be sent for HEAD requests if your object uses server-side encryption + * with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side + * encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side + * encryption with Amazon S3 managed encryption keys (SSE-S3). The + * x-amz-server-side-encryption header is used when you PUT an object to S3 and + * want to specify the encryption method. If you include this header in a HEAD + * request for an object that uses these types of keys, you’ll get an HTTP 400 Bad + * Request error. It's because the encryption method can't be changed when you + * retrieve the object. + * + * If you encrypt an object by using server-side encryption with customer-provided + * encryption keys (SSE-C) when you store the object in Amazon S3, then when you + * retrieve the metadata from the object, you must use the following headers to + * provide the encryption key for the server to be able to retrieve the object's + * metadata. The headers are: + * + * ``` + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + * + * Directory bucket - For directory buckets, there are only two supported options + * for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more + * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. + * + * Versioning + * + * ``` + * - If the current version of the object is a delete marker, Amazon S3 behaves + * as if the object was deleted and includes x-amz-delete-marker: true in the + * response. + * + * - If the specified version is a delete marker, the response returns a 405 + * Method Not Allowed error and the Last-Modified: timestamp response header. + * + * - Directory buckets - Delete marker is not supported by directory buckets. + * + * - Directory buckets - S3 Versioning isn't enabled and supported for directory + * buckets. For this API operation, only the null value of the version ID is + * supported by directory buckets. You can only specify null to the versionId + * query parameter in the request. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * For directory buckets, you must make requests for this API operation to the + * Zonal endpoint. These endpoints support virtual-hosted-style requests in the + * format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon + * S3 User Guide. + * + * The following actions are related to HeadObject : + * + * [GetObject] + * + * [GetObjectAttributes] + * + * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [Actions, resources, and condition keys for Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [Common Request Headers]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html + * + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html */ - get(key: string): any + headObject(ctx: context.Context, params: HeadObjectInput, ...optFns: ((_arg0: Options) => void)[]): (HeadObjectOutput) } - interface Record { + interface Client { /** - * GetBool returns the data value for "key" as a bool. + * This operation is not supported by directory buckets. + * + * Lists the analytics configurations for the bucket. You can have up to 1,000 + * analytics configurations per bucket. + * + * This action supports list pagination and does not return more than 100 + * configurations at a time. You should always check the IsTruncated element in + * the response. If there are no more configurations to list, IsTruncated is set + * to false. If there are more configurations to list, IsTruncated is set to true, + * and there will be a value in NextContinuationToken . You use the + * NextContinuationToken value to continue the pagination of the list by passing + * the value in continuation-token in the request to GET the next page. + * + * To use this operation, you must have permissions to perform the + * s3:GetAnalyticsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis]. + * + * The following operations are related to ListBucketAnalyticsConfigurations : + * + * [GetBucketAnalyticsConfiguration] + * + * [DeleteBucketAnalyticsConfiguration] + * + * [PutBucketAnalyticsConfiguration] + * + * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html + * [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html + * [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - getBool(key: string): boolean + listBucketAnalyticsConfigurations(ctx: context.Context, params: ListBucketAnalyticsConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketAnalyticsConfigurationsOutput) } - interface Record { + interface Client { /** - * GetString returns the data value for "key" as a string. + * This operation is not supported by directory buckets. + * + * Lists the S3 Intelligent-Tiering configuration from the specified bucket. + * + * The S3 Intelligent-Tiering storage class is designed to optimize storage costs + * by automatically moving data to the most cost-effective storage access tier, + * without performance impact or operational overhead. S3 Intelligent-Tiering + * delivers automatic cost savings in three low latency and high throughput access + * tiers. To get the lowest storage cost on data that can be accessed in minutes to + * hours, you can choose to activate additional archiving capabilities. + * + * The S3 Intelligent-Tiering storage class is the ideal storage class for data + * with unknown, changing, or unpredictable access patterns, independent of object + * size or retention period. If the size of an object is less than 128 KB, it is + * not monitored and not eligible for auto-tiering. Smaller objects can be stored, + * but they are always charged at the Frequent Access tier rates in the S3 + * Intelligent-Tiering storage class. + * + * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. + * + * Operations related to ListBucketIntelligentTieringConfigurations include: + * + * [DeleteBucketIntelligentTieringConfiguration] + * + * [PutBucketIntelligentTieringConfiguration] + * + * [GetBucketIntelligentTieringConfiguration] + * + * [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html + * [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + * [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html */ - getString(key: string): string + listBucketIntelligentTieringConfigurations(ctx: context.Context, params: ListBucketIntelligentTieringConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketIntelligentTieringConfigurationsOutput) } - interface Record { + interface Client { /** - * GetInt returns the data value for "key" as an int. + * This operation is not supported by directory buckets. + * + * Returns a list of inventory configurations for the bucket. You can have up to + * 1,000 analytics configurations per bucket. + * + * This action supports list pagination and does not return more than 100 + * configurations at a time. Always check the IsTruncated element in the response. + * If there are no more configurations to list, IsTruncated is set to false. If + * there are more configurations to list, IsTruncated is set to true, and there is + * a value in NextContinuationToken . You use the NextContinuationToken value to + * continue the pagination of the list by passing the value in continuation-token + * in the request to GET the next page. + * + * To use this operation, you must have permissions to perform the + * s3:GetInventoryConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory] + * + * The following operations are related to ListBucketInventoryConfigurations : + * + * [GetBucketInventoryConfiguration] + * + * [DeleteBucketInventoryConfiguration] + * + * [PutBucketInventoryConfiguration] + * + * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html + * [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html */ - getInt(key: string): number + listBucketInventoryConfigurations(ctx: context.Context, params: ListBucketInventoryConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketInventoryConfigurationsOutput) } - interface Record { + interface Client { /** - * GetFloat returns the data value for "key" as a float64. + * This operation is not supported by directory buckets. + * + * Lists the metrics configurations for the bucket. The metrics configurations are + * only for the request metrics of the bucket and do not provide information on + * daily storage metrics. You can have up to 1,000 configurations per bucket. + * + * This action supports list pagination and does not return more than 100 + * configurations at a time. Always check the IsTruncated element in the response. + * If there are no more configurations to list, IsTruncated is set to false. If + * there are more configurations to list, IsTruncated is set to true, and there is + * a value in NextContinuationToken . You use the NextContinuationToken value to + * continue the pagination of the list by passing the value in continuation-token + * in the request to GET the next page. + * + * To use this operation, you must have permissions to perform the + * s3:GetMetricsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For more information about metrics configurations and CloudWatch request + * metrics, see [Monitoring Metrics with Amazon CloudWatch]. + * + * The following operations are related to ListBucketMetricsConfigurations : + * + * [PutBucketMetricsConfiguration] + * + * [GetBucketMetricsConfiguration] + * + * [DeleteBucketMetricsConfiguration] + * + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html + * [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html + * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + * [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - getFloat(key: string): number + listBucketMetricsConfigurations(ctx: context.Context, params: ListBucketMetricsConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketMetricsConfigurationsOutput) } - interface Record { + interface Client { /** - * GetTime returns the data value for "key" as a [time.Time] instance. + * This operation is not supported by directory buckets. + * + * Returns a list of all buckets owned by the authenticated sender of the request. + * To use this operation, you must have the s3:ListAllMyBuckets permission. + * + * For information about Amazon S3 buckets, see [Creating, configuring, and working with Amazon S3 buckets]. + * + * [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html */ - getTime(key: string): time.Time + listBuckets(ctx: context.Context, params: ListBucketsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketsOutput) } - interface Record { + interface Client { /** - * GetDateTime returns the data value for "key" as a DateTime instance. + * Returns a list of all Amazon S3 directory buckets owned by the authenticated + * sender of the request. For more information about directory buckets, see [Directory buckets]in the + * Amazon S3 User Guide. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Regional endpoint. These endpoints support path-style requests + * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. + * + * Permissions You must have the s3express:ListAllMyDirectoryBuckets permission in + * an IAM identity-based policy instead of a bucket policy. Cross-account access to + * this API operation isn't supported. This operation can only be performed by the + * Amazon Web Services account that owns the resource. For more information about + * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - getDateTime(key: string): types.DateTime + listDirectoryBuckets(ctx: context.Context, params: ListDirectoryBucketsInput, ...optFns: ((_arg0: Options) => void)[]): (ListDirectoryBucketsOutput) } - interface Record { + interface Client { /** - * GetStringSlice returns the data value for "key" as a slice of unique strings. + * This operation lists in-progress multipart uploads in a bucket. An in-progress + * multipart upload is a multipart upload that has been initiated by the + * CreateMultipartUpload request, but has not yet been completed or aborted. + * + * Directory buckets - If multipart uploads in a directory bucket are in progress, + * you can't delete the bucket until all the in-progress multipart uploads are + * aborted or completed. To delete these in-progress multipart uploads, use the + * ListMultipartUploads operation to list the in-progress multipart uploads in the + * bucket and use the AbortMultupartUpload operation to abort all the in-progress + * multipart uploads. + * + * The ListMultipartUploads operation returns a maximum of 1,000 multipart uploads + * in the response. The limit of 1,000 multipart uploads is also the default value. + * You can further limit the number of uploads in a response by specifying the + * max-uploads request parameter. If there are more than 1,000 multipart uploads + * that satisfy your ListMultipartUploads request, the response returns an + * IsTruncated element with the value of true , a NextKeyMarker element, and a + * NextUploadIdMarker element. To list the remaining multipart uploads, you need to + * make subsequent ListMultipartUploads requests. In these requests, include two + * query parameters: key-marker and upload-id-marker . Set the value of key-marker + * to the NextKeyMarker value from the previous response. Similarly, set the value + * of upload-id-marker to the NextUploadIdMarker value from the previous response. + * + * Directory buckets - The upload-id-marker element and the NextUploadIdMarker + * element aren't supported by directory buckets. To list the additional multipart + * uploads, you only need to set the value of key-marker to the NextKeyMarker + * value from the previous response. + * + * For more information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Zonal endpoint. These endpoints support virtual-hosted-style + * requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - For information about permissions + * required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * Sorting of multipart uploads in response + * + * ``` + * - General purpose bucket - In the ListMultipartUploads response, the multipart + * uploads are sorted based on two criteria: + * + * - Key-based sorting - Multipart uploads are initially sorted in ascending + * order based on their object keys. + * + * - Time-based sorting - For uploads that share the same object key, they are + * further sorted in ascending order based on the upload initiation time. Among + * uploads with the same key, the one that was initiated first will appear before + * the ones that were initiated later. + * + * - Directory bucket - In the ListMultipartUploads response, the multipart + * uploads aren't sorted lexicographically based on the object keys. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to ListMultipartUploads : + * + * [CreateMultipartUpload] + * + * [UploadPart] + * + * [CompleteMultipartUpload] + * + * [ListParts] + * + * [AbortMultipartUpload] + * + * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html */ - getStringSlice(key: string): Array + listMultipartUploads(ctx: context.Context, params: ListMultipartUploadsInput, ...optFns: ((_arg0: Options) => void)[]): (ListMultipartUploadsOutput) } - interface Record { + interface Client { /** - * ExpandedOne retrieves a single relation Record from the already - * loaded expand data of the current model. + * This operation is not supported by directory buckets. * - * If the requested expand relation is multiple, this method returns - * only first available Record from the expanded relation. + * Returns metadata about all versions of the objects in a bucket. You can also + * use request parameters as selection criteria to return metadata about a subset + * of all the object versions. * - * Returns nil if there is no such expand relation loaded. + * To use this operation, you must have permission to perform the + * s3:ListBucketVersions action. Be aware of the name difference. + * + * A 200 OK response can contain valid or invalid XML. Make sure to design your + * application to parse the contents of the response and handle it appropriately. + * + * To use this operation, you must have READ access to the bucket. + * + * The following operations are related to ListObjectVersions : + * + * [ListObjectsV2] + * + * [GetObject] + * + * [PutObject] + * + * [DeleteObject] + * + * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [ListObjectsV2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html */ - expandedOne(relField: string): (Record) + listObjectVersions(ctx: context.Context, params: ListObjectVersionsInput, ...optFns: ((_arg0: Options) => void)[]): (ListObjectVersionsOutput) } - interface Record { + interface Client { /** - * ExpandedAll retrieves a slice of relation Records from the already - * loaded expand data of the current model. + * This operation is not supported by directory buckets. * - * If the requested expand relation is single, this method normalizes - * the return result and will wrap the single model as a slice. + * Returns some or all (up to 1,000) of the objects in a bucket. You can use the + * request parameters as selection criteria to return a subset of the objects in a + * bucket. A 200 OK response can contain valid or invalid XML. Be sure to design + * your application to parse the contents of the response and handle it + * appropriately. * - * Returns nil slice if there is no such expand relation loaded. + * This action has been revised. We recommend that you use the newer version, [ListObjectsV2], + * when developing applications. For backward compatibility, Amazon S3 continues to + * support ListObjects . + * + * The following operations are related to ListObjects : + * + * [ListObjectsV2] + * + * [GetObject] + * + * [PutObject] + * + * [CreateBucket] + * + * [ListBuckets] + * + * [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [ListObjectsV2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html */ - expandedAll(relField: string): Array<(Record | undefined)> + listObjects(ctx: context.Context, params: ListObjectsInput, ...optFns: ((_arg0: Options) => void)[]): (ListObjectsOutput) } - interface Record { + interface Client { /** - * Retrieves the "key" json field value and unmarshals it into "result". + * Returns some or all (up to 1,000) of the objects in a bucket with each request. + * You can use the request parameters as selection criteria to return a subset of + * the objects in a bucket. A 200 OK response can contain valid or invalid XML. + * Make sure to design your application to parse the contents of the response and + * handle it appropriately. * - * Example + * For more information about listing objects, see [Listing object keys programmatically] in the Amazon S3 User Guide. + * To get a list of your buckets, see [ListBuckets]. * * ``` - * result := struct { - * FirstName string `json:"first_name"` - * }{} - * err := m.UnmarshalJSONField("my_field_name", &result) + * - General purpose bucket - For general purpose buckets, ListObjectsV2 doesn't + * return prefixes that are related only to in-progress multipart uploads. + * + * - Directory buckets - For directory buckets, ListObjectsV2 response includes + * the prefixes that are related only to in-progress multipart uploads. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. * ``` + * + * Permissions + * + * ``` + * - General purpose bucket permissions - To use this operation, you must have + * READ access to the bucket. You must have permission to perform the + * s3:ListBucket action. The bucket owner has this permission by default and can + * grant this permission to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] + * and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * Sorting order of returned objects + * + * ``` + * - General purpose bucket - For general purpose buckets, ListObjectsV2 returns + * objects in lexicographical order based on their key names. + * + * - Directory bucket - For directory buckets, ListObjectsV2 does not return + * objects in lexicographical order. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * This section describes the latest revision of this action. We recommend that + * you use this revised API operation for application development. For backward + * compatibility, Amazon S3 continues to support the prior version of this API + * operation, [ListObjects]. + * + * The following operations are related to ListObjectsV2 : + * + * [GetObject] + * + * [PutObject] + * + * [CreateBucket] + * + * [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Listing object keys programmatically]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html */ - unmarshalJSONField(key: string, result: any): void - } - interface Record { - /** - * BaseFilesPath returns the storage dir path used by the record. - */ - baseFilesPath(): string + listObjectsV2(ctx: context.Context, params: ListObjectsV2Input, ...optFns: ((_arg0: Options) => void)[]): (ListObjectsV2Output) } - interface Record { + interface Client { /** - * FindFileFieldByFile returns the first file type field for which - * any of the record's data contains the provided filename. - */ - findFileFieldByFile(filename: string): (schema.SchemaField) - } - interface Record { - /** - * Load bulk loads the provided data into the current Record model. - */ - load(data: _TygojaDict): void - } - interface Record { - /** - * ColumnValueMap implements [ColumnValueMapper] interface. - */ - columnValueMap(): _TygojaDict - } - interface Record { - /** - * PublicExport exports only the record fields that are safe to be public. + * Lists the parts that have been uploaded for a specific multipart upload. * - * For auth records, to force the export of the email field you need to set - * `m.IgnoreEmailVisibility(true)`. - */ - publicExport(): _TygojaDict - } - interface Record { - /** - * MarshalJSON implements the [json.Marshaler] interface. + * To use this operation, you must provide the upload ID in the request. You + * obtain this uploadID by sending the initiate multipart upload request through [CreateMultipartUpload]. * - * Only the data exported by `PublicExport()` will be serialized. - */ - marshalJSON(): string|Array - } - interface Record { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * The ListParts request returns a maximum of 1,000 uploaded parts. The limit of + * 1,000 parts is also the default value. You can restrict the number of parts in a + * response by specifying the max-parts request parameter. If your multipart + * upload consists of more than 1,000 parts, the response returns an IsTruncated + * field with the value of true , and a NextPartNumberMarker element. To list + * remaining uploaded parts, in subsequent ListParts requests, include the + * part-number-marker query string parameter and set its value to the + * NextPartNumberMarker field value from the previous response. + * + * For more information on multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Zonal endpoint. These endpoints support virtual-hosted-style + * requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Permissions + * ``` + * - General purpose bucket permissions - For information about permissions + * required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. + * ``` + * + * If the upload was created using server-side encryption with Key Management + * + * ``` + * Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon + * Web Services KMS keys (DSSE-KMS), you must have permission to the kms:Decrypt + * action for the ListParts request to succeed. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to ListParts : + * + * [CreateMultipartUpload] + * + * [UploadPart] + * + * [CompleteMultipartUpload] + * + * [AbortMultipartUpload] + * + * [GetObjectAttributes] + * + * [ListMultipartUploads] + * + * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html + * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html + * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html */ - unmarshalJSON(data: string|Array): void + listParts(ctx: context.Context, params: ListPartsInput, ...optFns: ((_arg0: Options) => void)[]): (ListPartsOutput) } - interface Record { + interface Client { /** - * ReplaceModifers returns a new map with applied modifier - * values based on the current record and the specified data. + * This operation is not supported by directory buckets. * - * The resolved modifier keys will be removed. + * Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer + * Acceleration is a bucket-level feature that enables you to perform faster data + * transfers to Amazon S3. * - * Multiple modifiers will be applied one after another, - * while reusing the previous base key value result (eg. 1; -5; +2 => -2). + * To use this operation, you must have permission to perform the + * s3:PutAccelerateConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. * - * Example usage: + * The Transfer Acceleration state of a bucket can be set to one of the following + * two values: * * ``` - * newData := record.ReplaceModifers(data) - * // record: {"field": 10} - * // data: {"field+": 5} - * // newData: {"field": 15} + * - Enabled – Enables accelerated data transfers to the bucket. + * + * - Suspended – Disables accelerated data transfers to the bucket. * ``` + * + * The [GetBucketAccelerateConfiguration] action returns the transfer acceleration state of a bucket. + * + * After setting the Transfer Acceleration state of a bucket to Enabled, it might + * take up to thirty minutes before the data transfer rates to the bucket increase. + * + * The name of the bucket used for Transfer Acceleration must be DNS-compliant and + * must not contain periods ("."). + * + * For more information about transfer acceleration, see [Transfer Acceleration]. + * + * The following operations are related to PutBucketAccelerateConfiguration : + * + * [GetBucketAccelerateConfiguration] + * + * [CreateBucket] + * + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html + * [GetBucketAccelerateConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html */ - replaceModifers(data: _TygojaDict): _TygojaDict + putBucketAccelerateConfiguration(ctx: context.Context, params: PutBucketAccelerateConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketAccelerateConfigurationOutput) } - interface Record { + interface Client { /** - * Username returns the "username" auth record data value. + * This operation is not supported by directory buckets. + * + * Sets the permissions on an existing bucket using access control lists (ACL). + * For more information, see [Using ACLs]. To set the ACL of a bucket, you must have the + * WRITE_ACP permission. + * + * You can use one of the following two ways to set a bucket's permissions: + * + * ``` + * - Specify the ACL in the request body + * + * - Specify permissions using request headers + * ``` + * + * You cannot specify access permission using both the body and the request + * headers. + * + * Depending on your application needs, you may choose to set the ACL on a bucket + * using either the request body or the headers. For example, if you have an + * existing application that updates a bucket ACL using the request body, then you + * can continue to use that approach. + * + * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, + * ACLs are disabled and no longer affect permissions. You must use policies to + * grant access to your bucket and the objects in it. Requests to set ACLs or + * update ACLs fail and return the AccessControlListNotSupported error code. + * Requests to read ACLs are still supported. For more information, see [Controlling object ownership]in the + * Amazon S3 User Guide. + * + * Permissions You can set access permissions by using one of the following + * methods: + * + * ``` + * - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports a + * set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined + * set of grantees and permissions. Specify the canned ACL name as the value of + * x-amz-acl . If you use this header, you cannot use other access + * control-specific headers in your request. For more information, see [Canned ACL]. + * + * - Specify access permissions explicitly with the x-amz-grant-read , + * x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control + * headers. When using these headers, you specify explicit access permissions and + * grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the + * permission. If you use these ACL-specific headers, you cannot use the + * x-amz-acl header to set a canned ACL. These parameters map to the set of + * permissions that Amazon S3 supports in an ACL. For more information, see [Access Control List (ACL) Overview]. + * ``` + * + * You specify each grantee as a type=value pair, where the type is one of the + * + * ``` + * following: + * + * - id – if the value specified is the canonical user ID of an Amazon Web + * Services account + * + * - uri – if you are granting permissions to a predefined group + * + * - emailAddress – if the value specified is the email address of an Amazon Web + * Services account + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * + * ``` + * Amazon Web Services General Reference. + * ``` + * + * For example, the following x-amz-grant-write header grants create, overwrite, + * + * ``` + * and delete objects permission to LogDelivery group predefined by Amazon S3 and + * two Amazon Web Services accounts identified by their email addresses. + * ``` + * + * x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", + * + * ``` + * id="111122223333", id="555566667777" + * ``` + * + * You can use either a canned ACL or specify access permissions explicitly. You + * cannot do both. + * + * Grantee Values You can specify the person (grantee) to whom you're assigning + * access rights (using request elements) in the following ways: + * + * ``` + * - By the person's ID: + * ``` + * + * <>ID<><>GranteesEmail<> + * + * DisplayName is optional and ignored in the request + * + * ``` + * - By URI: + * ``` + * + * <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> + * + * ``` + * - By Email address: + * ``` + * + * <>Grantees@email.com<>& + * + * The grantee is resolved to the CanonicalUser and, in a response to a GET Object + * + * ``` + * acl request, appears as the CanonicalUser. + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * + * ``` + * Amazon Web Services General Reference. + * ``` + * + * The following operations are related to PutBucketAcl : + * + * [CreateBucket] + * + * [DeleteBucket] + * + * [GetObjectAcl] + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + * [Controlling object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html + * [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html + * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + * [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html */ - username(): string + putBucketAcl(ctx: context.Context, params: PutBucketAclInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketAclOutput) } - interface Record { + interface Client { /** - * SetUsername sets the "username" auth record data value. + * This operation is not supported by directory buckets. * - * This method doesn't check whether the provided value is a valid username. + * Sets an analytics configuration for the bucket (specified by the analytics + * configuration ID). You can have up to 1,000 analytics configurations per bucket. * - * Returns an error if the record is not from an auth collection. + * You can choose to have storage class analysis export analysis reports sent to a + * comma-separated values (CSV) flat file. See the DataExport request element. + * Reports are updated daily and are based on the object filters that you + * configure. When selecting data export, you specify a destination bucket and an + * optional destination prefix where the file is written. You can export the data + * to a destination bucket in a different account. However, the destination bucket + * must be in the same Region as the bucket that you are making the PUT analytics + * configuration to. For more information, see [Amazon S3 Analytics – Storage Class Analysis]. + * + * You must create a bucket policy on the destination bucket where the exported + * file is written to grant permissions to Amazon S3 to write objects to the + * bucket. For an example policy, see [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]. + * + * To use this operation, you must have permissions to perform the + * s3:PutAnalyticsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * PutBucketAnalyticsConfiguration has the following special errors: + * + * ``` + * - HTTP Error: HTTP 400 Bad Request + * + * - Code: InvalidArgument + * + * - Cause: Invalid argument. + * + * - HTTP Error: HTTP 400 Bad Request + * + * - Code: TooManyConfigurations + * + * - Cause: You are attempting to create a new configuration but have already + * reached the 1,000-configuration limit. + * + * - HTTP Error: HTTP 403 Forbidden + * + * - Code: AccessDenied + * + * - Cause: You are not the owner of the specified bucket, or you do not have + * the s3:PutAnalyticsConfiguration bucket permission to set the configuration on + * the bucket. + * ``` + * + * The following operations are related to PutBucketAnalyticsConfiguration : + * + * [GetBucketAnalyticsConfiguration] + * + * [DeleteBucketAnalyticsConfiguration] + * + * [ListBucketAnalyticsConfigurations] + * + * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html + * [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 + * [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html + * [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - setUsername(username: string): void + putBucketAnalyticsConfiguration(ctx: context.Context, params: PutBucketAnalyticsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketAnalyticsConfigurationOutput) } - interface Record { + interface Client { /** - * Email returns the "email" auth record data value. + * This operation is not supported by directory buckets. + * + * Sets the cors configuration for your bucket. If the configuration exists, + * Amazon S3 replaces it. + * + * To use this operation, you must be allowed to perform the s3:PutBucketCORS + * action. By default, the bucket owner has this permission and can grant it to + * others. + * + * You set this configuration on a bucket so that the bucket can service + * cross-origin requests. For example, you might want to enable a request whose + * origin is http://www.example.com to access your Amazon S3 bucket at + * my.example.bucket.com by using the browser's XMLHttpRequest capability. + * + * To enable cross-origin resource sharing (CORS) on a bucket, you add the cors + * subresource to the bucket. The cors subresource is an XML document in which you + * configure rules that identify origins and the HTTP methods that can be executed + * on your bucket. The document is limited to 64 KB in size. + * + * When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS + * request) against a bucket, it evaluates the cors configuration on the bucket + * and uses the first CORSRule rule that matches the incoming browser request to + * enable a cross-origin request. For a rule to match, the following conditions + * must be met: + * + * ``` + * - The request's Origin header must match AllowedOrigin elements. + * + * - The request method (for example, GET, PUT, HEAD, and so on) or the + * Access-Control-Request-Method header in case of a pre-flight OPTIONS request + * must be one of the AllowedMethod elements. + * + * - Every header specified in the Access-Control-Request-Headers request header + * of a pre-flight request must match an AllowedHeader element. + * ``` + * + * For more information about CORS, go to [Enabling Cross-Origin Resource Sharing] in the Amazon S3 User Guide. + * + * The following operations are related to PutBucketCors : + * + * [GetBucketCors] + * + * [DeleteBucketCors] + * + * [RESTOPTIONSobject] + * + * [GetBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html + * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html + * [RESTOPTIONSobject]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html + * [DeleteBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html */ - email(): string + putBucketCors(ctx: context.Context, params: PutBucketCorsInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketCorsOutput) } - interface Record { + interface Client { /** - * SetEmail sets the "email" auth record data value. + * This operation configures default encryption and Amazon S3 Bucket Keys for an + * existing bucket. * - * This method doesn't check whether the provided value is a valid email. + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Regional endpoint. These endpoints support path-style requests + * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. * - * Returns an error if the record is not from an auth collection. + * By default, all buckets have a default encryption configuration that uses + * server-side encryption with Amazon S3 managed keys (SSE-S3). + * + * ``` + * - General purpose buckets + * + * - You can optionally configure default encryption for a bucket by using + * server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or + * dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). + * If you specify default encryption by using SSE-KMS, you can also configure [Amazon S3 Bucket Keys]. + * For information about the bucket default encryption feature, see [Amazon S3 Bucket Default Encryption]in the + * Amazon S3 User Guide. + * + * - If you use PutBucketEncryption to set your [default bucket encryption]to SSE-KMS, you should verify + * that your KMS key ID is correct. Amazon S3 doesn't validate the KMS key ID + * provided in PutBucketEncryption requests. + * + * - Directory buckets - You can optionally configure default encryption for a + * bucket by using server-side encryption with Key Management Service (KMS) keys + * (SSE-KMS). + * + * - We recommend that the bucket's default encryption uses the desired + * encryption configuration and you don't override the bucket default encryption in + * your CreateSession requests or PUT object requests. Then, new objects are + * automatically encrypted with the desired encryption settings. For more + * information about the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads] + * . + * + * - Your SSE-KMS configuration can only support 1 [customer managed key]per directory bucket for the + * lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * - S3 Bucket Keys are always enabled for GET and PUT operations in a directory + * bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy + * SSE-KMS encrypted objects from general purpose buckets to directory buckets, + * from directory buckets to general purpose buckets, or between directory buckets, + * through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a call to KMS every time a + * copy request is made for a KMS-encrypted object. + * + * - When you specify an [KMS customer managed key]for encryption in your directory bucket, only use the + * key ID or key ARN. The key alias format of the KMS key isn't supported. + * + * - For directory buckets, if you use PutBucketEncryption to set your [default bucket encryption]to + * SSE-KMS, Amazon S3 validates the KMS key ID provided in PutBucketEncryption + * requests. + * ``` + * + * If you're specifying a customer managed KMS key, we recommend using a fully + * qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the + * key within the requester’s account. This behavior can result in data that's + * encrypted with a KMS key that belongs to the requester, and not the bucket + * owner. + * + * Also, this action requires Amazon Web Services Signature Version 4. For more + * information, see [Authenticating Requests (Amazon Web Services Signature Version 4)]. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - The s3:PutEncryptionConfiguration + * permission is required in a policy. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation, you + * must have the s3express:PutEncryptionConfiguration permission in an IAM + * identity-based policy instead of a bucket policy. Cross-account access to this + * API operation isn't supported. This operation can only be performed by the + * Amazon Web Services account that owns the resource. For more information about + * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * To set a directory bucket default encryption with SSE-KMS, you must also have + * + * ``` + * the kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based + * policies and KMS key policies for the target KMS key. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following operations are related to PutBucketEncryption : + * + * [GetBucketEncryption] + * + * [DeleteBucketEncryption] + * + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + * [Authenticating Requests (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html + * [GetBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html + * [DeleteBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [default bucket encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html + * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops */ - setEmail(email: string): void + putBucketEncryption(ctx: context.Context, params: PutBucketEncryptionInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketEncryptionOutput) } - interface Record { + interface Client { /** - * Verified returns the "emailVisibility" auth record data value. + * This operation is not supported by directory buckets. + * + * Puts a S3 Intelligent-Tiering configuration to the specified bucket. You can + * have up to 1,000 S3 Intelligent-Tiering configurations per bucket. + * + * The S3 Intelligent-Tiering storage class is designed to optimize storage costs + * by automatically moving data to the most cost-effective storage access tier, + * without performance impact or operational overhead. S3 Intelligent-Tiering + * delivers automatic cost savings in three low latency and high throughput access + * tiers. To get the lowest storage cost on data that can be accessed in minutes to + * hours, you can choose to activate additional archiving capabilities. + * + * The S3 Intelligent-Tiering storage class is the ideal storage class for data + * with unknown, changing, or unpredictable access patterns, independent of object + * size or retention period. If the size of an object is less than 128 KB, it is + * not monitored and not eligible for auto-tiering. Smaller objects can be stored, + * but they are always charged at the Frequent Access tier rates in the S3 + * Intelligent-Tiering storage class. + * + * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. + * + * Operations related to PutBucketIntelligentTieringConfiguration include: + * + * [DeleteBucketIntelligentTieringConfiguration] + * + * [GetBucketIntelligentTieringConfiguration] + * + * [ListBucketIntelligentTieringConfigurations] + * + * You only need S3 Intelligent-Tiering enabled on a bucket if you want to + * automatically move objects stored in the S3 Intelligent-Tiering storage class to + * the Archive Access or Deep Archive Access tier. + * + * PutBucketIntelligentTieringConfiguration has the following special errors: + * + * HTTP 400 Bad Request Error Code: InvalidArgument + * + * Cause: Invalid Argument + * + * HTTP 400 Bad Request Error Code: TooManyConfigurations + * + * Cause: You are attempting to create a new configuration but have already + * reached the 1,000-configuration limit. + * + * HTTP 403 Forbidden Error Cause: You are not the owner of the specified bucket, + * or you do not have the s3:PutIntelligentTieringConfiguration bucket permission + * to set the configuration on the bucket. + * + * [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html + * [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + * [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html */ - emailVisibility(): boolean + putBucketIntelligentTieringConfiguration(ctx: context.Context, params: PutBucketIntelligentTieringConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketIntelligentTieringConfigurationOutput) } - interface Record { + interface Client { /** - * SetEmailVisibility sets the "emailVisibility" auth record data value. + * This operation is not supported by directory buckets. * - * Returns an error if the record is not from an auth collection. + * This implementation of the PUT action adds an inventory configuration + * (identified by the inventory ID) to the bucket. You can have up to 1,000 + * inventory configurations per bucket. + * + * Amazon S3 inventory generates inventories of the objects in the bucket on a + * daily or weekly basis, and the results are published to a flat file. The bucket + * that is inventoried is called the source bucket, and the bucket where the + * inventory flat file is stored is called the destination bucket. The destination + * bucket must be in the same Amazon Web Services Region as the source bucket. + * + * When you configure an inventory for a source bucket, you specify the + * destination bucket where you want the inventory to be stored, and whether to + * generate the inventory daily or weekly. You can also configure what object + * metadata to include and whether to inventory all object versions or only current + * versions. For more information, see [Amazon S3 Inventory]in the Amazon S3 User Guide. + * + * You must create a bucket policy on the destination bucket to grant permissions + * to Amazon S3 to write objects to the bucket in the defined location. For an + * example policy, see [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]. + * + * Permissions To use this operation, you must have permission to perform the + * s3:PutInventoryConfiguration action. The bucket owner has this permission by + * default and can grant this permission to others. + * + * The s3:PutInventoryConfiguration permission allows a user to create an [S3 Inventory] report + * that includes all object metadata fields available and to specify the + * destination bucket to store the inventory. A user with read access to objects in + * the destination bucket can also access all object metadata fields that are + * available in the inventory report. + * + * To restrict access to an inventory report, see [Restricting access to an Amazon S3 Inventory report] in the Amazon S3 User Guide. + * For more information about the metadata fields available in S3 Inventory, see [Amazon S3 Inventory lists] + * in the Amazon S3 User Guide. For more information about permissions, see [Permissions related to bucket subresource operations]and [Identity and access management in Amazon S3] + * in the Amazon S3 User Guide. + * + * PutBucketInventoryConfiguration has the following special errors: + * + * HTTP 400 Bad Request Error Code: InvalidArgument + * + * Cause: Invalid Argument + * + * HTTP 400 Bad Request Error Code: TooManyConfigurations + * + * Cause: You are attempting to create a new configuration but have already + * reached the 1,000-configuration limit. + * + * HTTP 403 Forbidden Error Cause: You are not the owner of the specified bucket, + * or you do not have the s3:PutInventoryConfiguration bucket permission to set + * the configuration on the bucket. + * + * The following operations are related to PutBucketInventoryConfiguration : + * + * [GetBucketInventoryConfiguration] + * + * [DeleteBucketInventoryConfiguration] + * + * [ListBucketInventoryConfigurations] + * + * [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 + * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html + * [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html + * [S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html + * [Permissions related to bucket subresource operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html + * [Identity and access management in Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Restricting access to an Amazon S3 Inventory report]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-10 + * [Amazon S3 Inventory lists]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html#storage-inventory-contents + * [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html */ - setEmailVisibility(visible: boolean): void + putBucketInventoryConfiguration(ctx: context.Context, params: PutBucketInventoryConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketInventoryConfigurationOutput) } - interface Record { + interface Client { /** - * Verified returns the "verified" auth record data value. + * This operation is not supported by directory buckets. + * + * Creates a new lifecycle configuration for the bucket or replaces an existing + * lifecycle configuration. Keep in mind that this will overwrite an existing + * lifecycle configuration, so if you want to retain any configuration details, + * they must be included in the new lifecycle configuration. For information about + * lifecycle configuration, see [Managing your storage lifecycle]. + * + * Rules You specify the lifecycle configuration in your request body. The + * lifecycle configuration is specified as XML consisting of one or more rules. An + * Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not + * adjustable. + * + * Bucket lifecycle configuration supports specifying a lifecycle rule using an + * object key name prefix, one or more object tags, object size, or any combination + * of these. Accordingly, this section describes the latest API. The previous + * version of the API supported filtering based only on an object key name prefix, + * which is supported for backward compatibility. For the related API description, + * see [PutBucketLifecycle]. + * + * A lifecycle rule consists of the following: + * + * ``` + * - A filter identifying a subset of objects to which the rule applies. The + * filter can be based on a key name prefix, object tags, object size, or any + * combination of these. + * + * - A status indicating whether the rule is in effect. + * + * - One or more lifecycle transition and expiration actions that you want + * Amazon S3 to perform on the objects identified by the filter. If the state of + * your bucket is versioning-enabled or versioning-suspended, you can have many + * versions of the same object (one current version and zero or more noncurrent + * versions). Amazon S3 provides predefined actions that you can specify for + * current and noncurrent object versions. + * ``` + * + * For more information, see [Object Lifecycle Management] and [Lifecycle Configuration Elements]. + * + * Permissions By default, all Amazon S3 resources are private, including buckets, + * objects, and related subresources (for example, lifecycle configuration and + * website configuration). Only the resource owner (that is, the Amazon Web + * Services account that created it) can access the resource. The resource owner + * can optionally grant access permissions to others by writing an access policy. + * For this operation, a user must get the s3:PutLifecycleConfiguration permission. + * + * You can also explicitly deny permissions. An explicit deny also supersedes any + * other permissions. If you want to block users or accounts from removing or + * deleting objects from your bucket, you must deny them permissions for the + * following actions: + * + * ``` + * - s3:DeleteObject + * + * - s3:DeleteObjectVersion + * + * - s3:PutLifecycleConfiguration + * ``` + * + * For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. + * + * The following operations are related to PutBucketLifecycleConfiguration : + * + * [Examples of Lifecycle Configuration] + * + * [GetBucketLifecycleConfiguration] + * + * [DeleteBucketLifecycle] + * + * [Examples of Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html + * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html + * [Lifecycle Configuration Elements]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html + * [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html + * [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html + * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html */ - verified(): boolean + putBucketLifecycleConfiguration(ctx: context.Context, params: PutBucketLifecycleConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketLifecycleConfigurationOutput) } - interface Record { + interface Client { /** - * SetVerified sets the "verified" auth record data value. + * This operation is not supported by directory buckets. * - * Returns an error if the record is not from an auth collection. + * Set the logging parameters for a bucket and to specify permissions for who can + * view and modify the logging parameters. All logs are saved to buckets in the + * same Amazon Web Services Region as the source bucket. To set the logging status + * of a bucket, you must be the bucket owner. + * + * The bucket owner is automatically granted FULL_CONTROL to all logs. You use the + * Grantee request element to grant access to other people. The Permissions + * request element specifies the kind of access the grantee has to the logs. + * + * If the target bucket for log delivery uses the bucket owner enforced setting + * for S3 Object Ownership, you can't use the Grantee request element to grant + * access to others. Permissions can only be granted using policies. For more + * information, see [Permissions for server access log delivery]in the Amazon S3 User Guide. + * + * Grantee Values You can specify the person (grantee) to whom you're assigning + * access rights (by using request elements) in the following ways: + * + * ``` + * - By the person's ID: + * ``` + * + * <>ID<><>GranteesEmail<> + * + * DisplayName is optional and ignored in the request. + * + * ``` + * - By Email address: + * ``` + * + * <>Grantees@email.com<> + * + * The grantee is resolved to the CanonicalUser and, in a response to a + * + * ``` + * GETObjectAcl request, appears as the CanonicalUser. + * + * - By URI: + * ``` + * + * <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> + * + * To enable logging, you use LoggingEnabled and its children request elements. To + * disable logging, you use an empty BucketLoggingStatus request element: + * + * For more information about server access logging, see [Server Access Logging] in the Amazon S3 User + * Guide. + * + * For more information about creating a bucket, see [CreateBucket]. For more information about + * returning the logging status of a bucket, see [GetBucketLogging]. + * + * The following operations are related to PutBucketLogging : + * + * [PutObject] + * + * [DeleteBucket] + * + * [CreateBucket] + * + * [GetBucketLogging] + * + * [Permissions for server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general + * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html + * [GetBucketLogging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [Server Access Logging]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html */ - setVerified(verified: boolean): void + putBucketLogging(ctx: context.Context, params: PutBucketLoggingInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketLoggingOutput) } - interface Record { + interface Client { /** - * TokenKey returns the "tokenKey" auth record data value. + * This operation is not supported by directory buckets. + * + * Sets a metrics configuration (specified by the metrics configuration ID) for + * the bucket. You can have up to 1,000 metrics configurations per bucket. If + * you're updating an existing metrics configuration, note that this is a full + * replacement of the existing metrics configuration. If you don't include the + * elements you want to keep, they are erased. + * + * To use this operation, you must have permissions to perform the + * s3:PutMetricsConfiguration action. The bucket owner has this permission by + * default. The bucket owner can grant this permission to others. For more + * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. + * + * The following operations are related to PutBucketMetricsConfiguration : + * + * [DeleteBucketMetricsConfiguration] + * + * [GetBucketMetricsConfiguration] + * + * [ListBucketMetricsConfigurations] + * + * PutBucketMetricsConfiguration has the following special error: + * + * ``` + * - Error code: TooManyConfigurations + * + * - Description: You are attempting to create a new configuration but have + * already reached the 1,000-configuration limit. + * + * - HTTP Status Code: HTTP 400 Bad Request + * ``` + * + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html + * [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html + * [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html + * [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - tokenKey(): string + putBucketMetricsConfiguration(ctx: context.Context, params: PutBucketMetricsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketMetricsConfigurationOutput) } - interface Record { + interface Client { /** - * SetTokenKey sets the "tokenKey" auth record data value. + * This operation is not supported by directory buckets. * - * Returns an error if the record is not from an auth collection. + * Enables notifications of specified events for a bucket. For more information + * about event notifications, see [Configuring Event Notifications]. + * + * Using this API, you can replace an existing notification configuration. The + * configuration is an XML file that defines the event types that you want Amazon + * S3 to publish and the destination where you want Amazon S3 to publish an event + * notification when it detects an event of the specified type. + * + * By default, your bucket has no event notifications configured. That is, the + * notification configuration will be an empty NotificationConfiguration . + * + * This action replaces the existing notification configuration with the + * configuration you include in the request body. + * + * After Amazon S3 receives this request, it first verifies that any Amazon Simple + * Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon SQS) + * destination exists, and that the bucket owner has permission to publish to it by + * sending a test notification. In the case of Lambda destinations, Amazon S3 + * verifies that the Lambda function permissions grant Amazon S3 permission to + * invoke the function from the Amazon S3 bucket. For more information, see [Configuring Notifications for Amazon S3 Events]. + * + * You can disable notifications by adding the empty NotificationConfiguration + * element. + * + * For more information about the number of event notification configurations that + * you can create per bucket, see [Amazon S3 service quotas]in Amazon Web Services General Reference. + * + * By default, only the bucket owner can configure notifications on a bucket. + * However, bucket owners can use a bucket policy to grant permission to other + * users to set this configuration with the required s3:PutBucketNotification + * permission. + * + * The PUT notification is an atomic operation. For example, suppose your + * notification configuration includes SNS topic, SQS queue, and Lambda function + * configurations. When you send a PUT request with this configuration, Amazon S3 + * sends test messages to your SNS topic. If the message fails, the entire PUT + * action will fail, and Amazon S3 will not add the configuration to your bucket. + * + * If the configuration in the request body includes only one TopicConfiguration + * specifying only the s3:ReducedRedundancyLostObject event type, the response + * will also include the x-amz-sns-test-message-id header containing the message + * ID of the test notification sent to the topic. + * + * The following action is related to PutBucketNotificationConfiguration : + * + * [GetBucketNotificationConfiguration] + * + * [Configuring Notifications for Amazon S3 Events]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + * [Amazon S3 service quotas]: https://docs.aws.amazon.com/general/latest/gr/s3.html#limits_s3 + * [GetBucketNotificationConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html + * [Configuring Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html */ - setTokenKey(key: string): void + putBucketNotificationConfiguration(ctx: context.Context, params: PutBucketNotificationConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketNotificationConfigurationOutput) } - interface Record { + interface Client { /** - * RefreshTokenKey generates and sets new random auth record "tokenKey". + * This operation is not supported by directory buckets. * - * Returns an error if the record is not from an auth collection. + * Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this + * operation, you must have the s3:PutBucketOwnershipControls permission. For more + * information about Amazon S3 permissions, see [Specifying permissions in a policy]. + * + * For information about Amazon S3 Object Ownership, see [Using object ownership]. + * + * The following operations are related to PutBucketOwnershipControls : + * + * # GetBucketOwnershipControls + * + * # DeleteBucketOwnershipControls + * + * [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-with-s3-actions.html + * [Using object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/about-object-ownership.html */ - refreshTokenKey(): void + putBucketOwnershipControls(ctx: context.Context, params: PutBucketOwnershipControlsInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketOwnershipControlsOutput) } - interface Record { + interface Client { /** - * LastResetSentAt returns the "lastResentSentAt" auth record data value. + * Applies an Amazon S3 bucket policy to an Amazon S3 bucket. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Regional endpoint. These endpoints support path-style requests + * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in + * the Amazon S3 User Guide. + * + * Permissions If you are using an identity other than the root user of the Amazon + * Web Services account that owns the bucket, the calling identity must both have + * the PutBucketPolicy permissions on the specified bucket and belong to the + * bucket owner's account in order to use this operation. + * + * If you don't have PutBucketPolicy permissions, Amazon S3 returns a 403 Access + * Denied error. If you have the correct permissions, but you're not using an + * identity that belongs to the bucket owner's account, Amazon S3 returns a 405 + * Method Not Allowed error. + * + * To ensure that bucket owners don't inadvertently lock themselves out of their + * own buckets, the root principal in a bucket owner's Amazon Web Services account + * can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API + * actions, even if their bucket policy explicitly denies the root principal's + * access. Bucket owner root principals can only be blocked from performing these + * API actions by VPC endpoint policies and Amazon Web Services Organizations + * policies. + * + * ``` + * - General purpose bucket permissions - The s3:PutBucketPolicy permission is + * required in a policy. For more information about general purpose buckets bucket + * policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation, you + * must have the s3express:PutBucketPolicy permission in an IAM identity-based + * policy instead of a bucket policy. Cross-account access to this API operation + * isn't supported. This operation can only be performed by the Amazon Web Services + * account that owns the resource. For more information about directory bucket + * policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * ``` + * + * Example bucket policies General purpose buckets example bucket policies - See [Bucket policy examples] + * in the Amazon S3 User Guide. + * + * Directory bucket example bucket policies - See [Example bucket policies for S3 Express One Zone] in the Amazon S3 User Guide. + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * s3express-control.region.amazonaws.com . + * + * The following operations are related to PutBucketPolicy : + * + * [CreateBucket] + * + * [DeleteBucket] + * + * [Bucket policy examples]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html + * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html + * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html */ - lastResetSentAt(): types.DateTime + putBucketPolicy(ctx: context.Context, params: PutBucketPolicyInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketPolicyOutput) } - interface Record { + interface Client { /** - * SetLastResetSentAt sets the "lastResentSentAt" auth record data value. + * This operation is not supported by directory buckets. * - * Returns an error if the record is not from an auth collection. + * Creates a replication configuration or replaces an existing one. For more + * information, see [Replication]in the Amazon S3 User Guide. + * + * Specify the replication configuration in the request body. In the replication + * configuration, you provide the name of the destination bucket or buckets where + * you want Amazon S3 to replicate objects, the IAM role that Amazon S3 can assume + * to replicate objects on your behalf, and other relevant information. You can + * invoke this request for a specific Amazon Web Services Region by using the [aws:RequestedRegion] + * aws:RequestedRegion condition key. + * + * A replication configuration must include at least one rule, and can contain a + * maximum of 1,000. Each rule identifies a subset of objects to replicate by + * filtering the objects in the source bucket. To choose additional subsets of + * objects to replicate, add a rule for each subset. + * + * To specify a subset of the objects in the source bucket to apply a replication + * rule to, add the Filter element as a child of the Rule element. You can filter + * objects based on an object key prefix, one or more object tags, or both. When + * you add the Filter element in the configuration, you must also add the following + * elements: DeleteMarkerReplication , Status , and Priority . + * + * If you are using an earlier version of the replication configuration, Amazon S3 + * handles replication of delete markers differently. For more information, see [Backward Compatibility]. + * + * For information about enabling versioning on a bucket, see [Using Versioning]. + * + * Handling Replication of Encrypted Objects By default, Amazon S3 doesn't + * replicate objects that are stored at rest using server-side encryption with KMS + * keys. To replicate Amazon Web Services KMS-encrypted objects, add the following: + * SourceSelectionCriteria , SseKmsEncryptedObjects , Status , + * EncryptionConfiguration , and ReplicaKmsKeyID . For information about + * replication configuration, see [Replicating Objects Created with SSE Using KMS keys]. + * + * For information on PutBucketReplication errors, see [List of replication-related error codes] + * + * Permissions To create a PutBucketReplication request, you must have + * s3:PutReplicationConfiguration permissions for the bucket. + * + * By default, a resource owner, in this case the Amazon Web Services account that + * created the bucket, can perform this operation. The resource owner can also + * grant others permissions to perform the operation. For more information about + * permissions, see [Specifying Permissions in a Policy]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * To perform this operation, the user or role performing the action must have the [iam:PassRole] + * permission. + * + * The following operations are related to PutBucketReplication : + * + * [GetBucketReplication] + * + * [DeleteBucketReplication] + * + * [iam:PassRole]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html + * [GetBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html + * [aws:RequestedRegion]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requestedregion + * [Replicating Objects Created with SSE Using KMS keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html + * [Using Versioning]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html + * [List of replication-related error codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList + * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations + * [DeleteBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html */ - setLastResetSentAt(dateTime: types.DateTime): void + putBucketReplication(ctx: context.Context, params: PutBucketReplicationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketReplicationOutput) } - interface Record { + interface Client { /** - * LastVerificationSentAt returns the "lastVerificationSentAt" auth record data value. + * This operation is not supported by directory buckets. + * + * Sets the request payment configuration for a bucket. By default, the bucket + * owner pays for downloads from the bucket. This configuration parameter enables + * the bucket owner (only) to specify that the person requesting the download will + * be charged for the download. For more information, see [Requester Pays Buckets]. + * + * The following operations are related to PutBucketRequestPayment : + * + * [CreateBucket] + * + * [GetBucketRequestPayment] + * + * [GetBucketRequestPayment]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html + * [Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html */ - lastVerificationSentAt(): types.DateTime + putBucketRequestPayment(ctx: context.Context, params: PutBucketRequestPaymentInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketRequestPaymentOutput) } - interface Record { + interface Client { /** - * SetLastVerificationSentAt sets an "lastVerificationSentAt" auth record data value. + * This operation is not supported by directory buckets. * - * Returns an error if the record is not from an auth collection. + * Sets the tags for a bucket. + * + * Use tags to organize your Amazon Web Services bill to reflect your own cost + * structure. To do this, sign up to get your Amazon Web Services account bill with + * tag key values included. Then, to see the cost of combined resources, organize + * your billing information according to resources with the same tag key values. + * For example, you can tag several resources with a specific application name, and + * then organize your billing information to see the total cost of that application + * across several services. For more information, see [Cost Allocation and Tagging]and [Using Cost Allocation in Amazon S3 Bucket Tags]. + * + * When this operation sets the tags for a bucket, it will overwrite any current + * tags the bucket already has. You cannot use this operation to add tags to an + * existing list of tags. + * + * To use this operation, you must have permissions to perform the + * s3:PutBucketTagging action. The bucket owner has this permission by default and + * can grant this permission to others. For more information about permissions, see + * [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. + * + * PutBucketTagging has the following special errors. For more Amazon S3 errors + * see, [Error Responses]. + * + * ``` + * - InvalidTag - The tag provided was not a valid tag. This error can occur if + * the tag did not pass input validation. For more information, see [Using Cost Allocation in Amazon S3 Bucket Tags]. + * + * - MalformedXML - The XML provided does not match the schema. + * + * - OperationAborted - A conflicting conditional action is currently in progress + * against this resource. Please try again. + * + * - InternalError - The service was unable to apply the provided tag to the + * bucket. + * ``` + * + * The following operations are related to PutBucketTagging : + * + * [GetBucketTagging] + * + * [DeleteBucketTagging] + * + * [Error Responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html + * [GetBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html + * [Cost Allocation and Tagging]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [DeleteBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html + * [Using Cost Allocation in Amazon S3 Bucket Tags]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html */ - setLastVerificationSentAt(dateTime: types.DateTime): void + putBucketTagging(ctx: context.Context, params: PutBucketTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketTaggingOutput) } - interface Record { + interface Client { /** - * PasswordHash returns the "passwordHash" auth record data value. + * This operation is not supported by directory buckets. + * + * When you enable versioning on a bucket for the first time, it might take a + * short amount of time for the change to be fully propagated. We recommend that + * you wait for 15 minutes after enabling versioning before issuing write + * operations ( PUT or DELETE ) on objects in the bucket. + * + * Sets the versioning state of an existing bucket. + * + * You can set the versioning state with one of the following values: + * + * Enabled—Enables versioning for the objects in the bucket. All objects added to + * the bucket receive a unique version ID. + * + * Suspended—Disables versioning for the objects in the bucket. All objects added + * to the bucket receive the version ID null. + * + * If the versioning state has never been set on a bucket, it has no versioning + * state; a [GetBucketVersioning]request does not return a versioning state value. + * + * In order to enable MFA Delete, you must be the bucket owner. If you are the + * bucket owner and want to enable MFA Delete in the bucket versioning + * configuration, you must include the x-amz-mfa request header and the Status and + * the MfaDelete request elements in a request to set the versioning state of the + * bucket. + * + * If you have an object expiration lifecycle configuration in your non-versioned + * bucket and you want to maintain the same permanent delete behavior when you + * enable versioning, you must add a noncurrent expiration policy. The noncurrent + * expiration lifecycle configuration will manage the deletes of the noncurrent + * object versions in the version-enabled bucket. (A version-enabled bucket + * maintains one current and zero or more noncurrent object versions.) For more + * information, see [Lifecycle and Versioning]. + * + * The following operations are related to PutBucketVersioning : + * + * [CreateBucket] + * + * [DeleteBucket] + * + * [GetBucketVersioning] + * + * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html + * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * [Lifecycle and Versioning]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config + * [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html */ - passwordHash(): string + putBucketVersioning(ctx: context.Context, params: PutBucketVersioningInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketVersioningOutput) } - interface Record { + interface Client { /** - * ValidatePassword validates a plain password against the auth record password. + * This operation is not supported by directory buckets. * - * Returns false if the password is incorrect or record is not from an auth collection. + * Sets the configuration of the website that is specified in the website + * subresource. To configure a bucket as a website, you can add this subresource on + * the bucket with website configuration information such as the file name of the + * index document and any redirect rules. For more information, see [Hosting Websites on Amazon S3]. + * + * This PUT action requires the S3:PutBucketWebsite permission. By default, only + * the bucket owner can configure the website attached to a bucket; however, bucket + * owners can allow other users to set the website configuration by writing a + * bucket policy that grants them the S3:PutBucketWebsite permission. + * + * To redirect all website requests sent to the bucket's website endpoint, you add + * a website configuration with the following elements. Because all requests are + * sent to another website, you don't need to provide index document name for the + * bucket. + * + * ``` + * - WebsiteConfiguration + * + * - RedirectAllRequestsTo + * + * - HostName + * + * - Protocol + * ``` + * + * If you want granular control over redirects, you can use the following elements + * to add routing rules that describe conditions for redirecting requests and + * information about the redirect destination. In this case, the website + * configuration must provide an index document for the bucket, because some + * requests might not be redirected. + * + * ``` + * - WebsiteConfiguration + * + * - IndexDocument + * + * - Suffix + * + * - ErrorDocument + * + * - Key + * + * - RoutingRules + * + * - RoutingRule + * + * - Condition + * + * - HttpErrorCodeReturnedEquals + * + * - KeyPrefixEquals + * + * - Redirect + * + * - Protocol + * + * - HostName + * + * - ReplaceKeyPrefixWith + * + * - ReplaceKeyWith + * + * - HttpRedirectCode + * ``` + * + * Amazon S3 has a limitation of 50 routing rules per website configuration. If + * you require more than 50 routing rules, you can use object redirect. For more + * information, see [Configuring an Object Redirect]in the Amazon S3 User Guide. + * + * The maximum request length is limited to 128 KB. + * + * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html + * [Configuring an Object Redirect]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html */ - validatePassword(password: string): boolean + putBucketWebsite(ctx: context.Context, params: PutBucketWebsiteInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketWebsiteOutput) } - interface Record { + interface Client { /** - * SetPassword sets cryptographically secure string to the auth record "password" field. - * This method also resets the "lastResetSentAt" and the "tokenKey" fields. + * Adds an object to a bucket. * - * Returns an error if the record is not from an auth collection or - * an empty password is provided. - */ - setPassword(password: string): void - } - /** - * RequestInfo defines a HTTP request data struct, usually used - * as part of the `@request.*` filter resolver. - */ - interface RequestInfo { - context: string - query: _TygojaDict - data: _TygojaDict - headers: _TygojaDict - authRecord?: Record - admin?: Admin - method: string - } - interface RequestInfo { - /** - * HasModifierDataKeys loosely checks if the current struct has any modifier Data keys. + * ``` + * - Amazon S3 never adds partial objects; if you receive a success response, + * Amazon S3 added the entire object to the bucket. You cannot use PutObject to + * only update a single piece of metadata for an existing object. You must put the + * entire object with updated metadata if you want to update some values. + * + * - If your bucket uses the bucket owner enforced setting for Object Ownership, + * ACLs are disabled and no longer affect permissions. All objects written to the + * bucket by any account will be owned by the bucket owner. + * + * - Directory buckets - For directory buckets, you must make requests for this + * API operation to the Zonal endpoint. These endpoints support + * virtual-hosted-style requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . + * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the + * Amazon S3 User Guide. + * ``` + * + * Amazon S3 is a distributed system. If it receives multiple write requests for + * the same object simultaneously, it overwrites all but the last object written. + * However, Amazon S3 provides features that can modify this behavior: + * + * ``` + * - S3 Object Lock - To prevent objects from being deleted or overwritten, you + * can use [Amazon S3 Object Lock]in the Amazon S3 User Guide. + * ``` + * + * This functionality is not supported for directory buckets. + * + * ``` + * - S3 Versioning - When you enable versioning for a bucket, if Amazon S3 + * receives multiple write requests for the same object simultaneously, it stores + * all versions of the objects. For each write request that is made to the same + * object, Amazon S3 automatically generates a unique version ID of that object + * being stored in Amazon S3. You can retrieve, replace, or delete any version of + * the object. For more information about versioning, see [Adding Objects to Versioning-Enabled Buckets]in the Amazon S3 User + * Guide. For information about returning the versioning state of a bucket, see [GetBucketVersioning] + * . + * ``` + * + * This functionality is not supported for directory buckets. + * + * Permissions + * + * ``` + * - General purpose bucket permissions - The following permissions are required + * in your policies when your PutObject request includes specific headers. + * + * - s3:PutObject - To successfully complete the PutObject request, you must + * always have the s3:PutObject permission on a bucket to add an object to it. + * + * - s3:PutObjectAcl - To successfully change the objects ACL of your PutObject + * request, you must have the s3:PutObjectAcl . + * + * - s3:PutObjectTagging - To successfully set the tag-set with your PutObject + * request, you must have the s3:PutObjectTagging . + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * If the object is encrypted with SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * Data integrity with Content-MD5 + * + * ``` + * - General purpose bucket - To ensure that data is not corrupted traversing + * the network, use the Content-MD5 header. When you use this header, Amazon S3 + * checks the object against the provided MD5 value and, if they do not match, + * Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 + * digest, you can calculate the MD5 while putting the object to Amazon S3 and + * compare the returned ETag to the calculated MD5 value. + * + * - Directory bucket - This functionality is not supported for directory + * buckets. + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * For more information about related Amazon S3 APIs, see the following: + * + * [CopyObject] + * + * [DeleteObject] + * + * [Amazon S3 Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html + * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Adding Objects to Versioning-Enabled Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html */ - hasModifierDataKeys(): boolean + putObject(ctx: context.Context, params: PutObjectInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectOutput) } -} - -/** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: - * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) - * - * // Routes - * e.GET("/", hello) - * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` - * - * Learn more at https://echo.labstack.com - */ -namespace echo { - /** - * Context represents the context of the current HTTP request. It holds request and - * response objects, path, path parameters, data and registered handler. - */ - interface Context { - [key:string]: any; - /** - * Request returns `*http.Request`. - */ - request(): (http.Request) - /** - * SetRequest sets `*http.Request`. - */ - setRequest(r: http.Request): void - /** - * SetResponse sets `*Response`. - */ - setResponse(r: Response): void - /** - * Response returns `*Response`. - */ - response(): (Response) - /** - * IsTLS returns true if HTTP connection is TLS otherwise false. - */ - isTLS(): boolean - /** - * IsWebSocket returns true if HTTP connection is WebSocket otherwise false. - */ - isWebSocket(): boolean + interface Client { /** - * Scheme returns the HTTP protocol scheme, `http` or `https`. + * This operation is not supported by directory buckets. + * + * Uses the acl subresource to set the access control list (ACL) permissions for a + * new or existing object in an S3 bucket. You must have the WRITE_ACP permission + * to set the ACL of an object. For more information, see [What permissions can I grant?]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * Depending on your application needs, you can choose to set the ACL on an object + * using either the request body or the headers. For example, if you have an + * existing application that updates a bucket ACL using the request body, you can + * continue to use that approach. For more information, see [Access Control List (ACL) Overview]in the Amazon S3 User + * Guide. + * + * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, + * ACLs are disabled and no longer affect permissions. You must use policies to + * grant access to your bucket and the objects in it. Requests to set ACLs or + * update ACLs fail and return the AccessControlListNotSupported error code. + * Requests to read ACLs are still supported. For more information, see [Controlling object ownership]in the + * Amazon S3 User Guide. + * + * Permissions You can set access permissions using one of the following methods: + * + * ``` + * - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports a + * set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined + * set of grantees and permissions. Specify the canned ACL name as the value of + * x-amz-ac l. If you use this header, you cannot use other access + * control-specific headers in your request. For more information, see [Canned ACL]. + * + * - Specify access permissions explicitly with the x-amz-grant-read , + * x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control + * headers. When using these headers, you specify explicit access permissions and + * grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the + * permission. If you use these ACL-specific headers, you cannot use x-amz-acl + * header to set a canned ACL. These parameters map to the set of permissions that + * Amazon S3 supports in an ACL. For more information, see [Access Control List (ACL) Overview]. + * ``` + * + * You specify each grantee as a type=value pair, where the type is one of the + * + * ``` + * following: + * + * - id – if the value specified is the canonical user ID of an Amazon Web + * Services account + * + * - uri – if you are granting permissions to a predefined group + * + * - emailAddress – if the value specified is the email address of an Amazon Web + * Services account + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * + * ``` + * Amazon Web Services General Reference. + * ``` + * + * For example, the following x-amz-grant-read header grants list objects + * + * ``` + * permission to the two Amazon Web Services accounts identified by their email + * addresses. + * ``` + * + * x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" + * + * You can use either a canned ACL or specify access permissions explicitly. You + * cannot do both. + * + * Grantee Values You can specify the person (grantee) to whom you're assigning + * access rights (using request elements) in the following ways: + * + * ``` + * - By the person's ID: + * ``` + * + * <>ID<><>GranteesEmail<> + * + * DisplayName is optional and ignored in the request. + * + * ``` + * - By URI: + * ``` + * + * <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> + * + * ``` + * - By Email address: + * ``` + * + * <>Grantees@email.com<>lt;/Grantee> + * + * The grantee is resolved to the CanonicalUser and, in a response to a GET Object + * + * ``` + * acl request, appears as the CanonicalUser. + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * + * ``` + * Amazon Web Services General Reference. + * ``` + * + * Versioning The ACL of an object is set at the object version level. By default, + * PUT sets the ACL of the current version of an object. To set the ACL of a + * different version, use the versionId subresource. + * + * The following operations are related to PutObjectAcl : + * + * [CopyObject] + * + * [GetObject] + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + * [Controlling object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [What permissions can I grant?]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html */ - scheme(): string + putObjectAcl(ctx: context.Context, params: PutObjectAclInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectAclOutput) + } + interface Client { /** - * RealIP returns the client's network address based on `X-Forwarded-For` - * or `X-Real-IP` request header. - * The behavior can be configured using `Echo#IPExtractor`. + * This operation is not supported by directory buckets. + * + * Applies a legal hold configuration to the specified object. For more + * information, see [Locking Objects]. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html */ - realIP(): string + putObjectLegalHold(ctx: context.Context, params: PutObjectLegalHoldInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectLegalHoldOutput) + } + interface Client { /** - * RouteInfo returns current request route information. Method, Path, Name and params if they exist for matched route. - * In case of 404 (route not found) and 405 (method not allowed) RouteInfo returns generic struct for these cases. + * This operation is not supported by directory buckets. + * + * Places an Object Lock configuration on the specified bucket. The rule specified + * in the Object Lock configuration will be applied by default to every new object + * placed in the specified bucket. For more information, see [Locking Objects]. + * + * ``` + * - The DefaultRetention settings require both a mode and a period. + * + * - The DefaultRetention period can be either Days or Years but you must select + * one. You cannot specify Days and Years at the same time. + * + * - You can enable Object Lock for new or existing buckets. For more + * information, see [Configuring Object Lock]. + * ``` + * + * [Configuring Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html + * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html */ - routeInfo(): RouteInfo + putObjectLockConfiguration(ctx: context.Context, params: PutObjectLockConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectLockConfigurationOutput) + } + interface Client { /** - * Path returns the registered path for the handler. + * This operation is not supported by directory buckets. + * + * Places an Object Retention configuration on an object. For more information, + * see [Locking Objects]. Users or accounts require the s3:PutObjectRetention permission in order + * to place an Object Retention configuration on objects. Bypassing a Governance + * Retention configuration requires the s3:BypassGovernanceRetention permission. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html */ - path(): string + putObjectRetention(ctx: context.Context, params: PutObjectRetentionInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectRetentionOutput) + } + interface Client { /** - * PathParam returns path parameter by name. + * This operation is not supported by directory buckets. + * + * Sets the supplied tag-set to an object that already exists in a bucket. A tag + * is a key-value pair. For more information, see [Object Tagging]. + * + * You can associate tags with an object by sending a PUT request against the + * tagging subresource that is associated with the object. You can retrieve tags by + * sending a GET request. For more information, see [GetObjectTagging]. + * + * For tagging-related restrictions related to characters and encodings, see [Tag Restrictions]. + * Note that Amazon S3 limits the maximum number of tags to 10 tags per object. + * + * To use this operation, you must have permission to perform the + * s3:PutObjectTagging action. By default, the bucket owner has this permission and + * can grant this permission to others. + * + * To put tags of any other version, use the versionId query parameter. You also + * need permission for the s3:PutObjectVersionTagging action. + * + * PutObjectTagging has the following special errors. For more Amazon S3 errors + * see, [Error Responses]. + * + * ``` + * - InvalidTag - The tag provided was not a valid tag. This error can occur if + * the tag did not pass input validation. For more information, see [Object Tagging]. + * + * - MalformedXML - The XML provided does not match the schema. + * + * - OperationAborted - A conflicting conditional action is currently in progress + * against this resource. Please try again. + * + * - InternalError - The service was unable to apply the provided tag to the + * object. + * ``` + * + * The following operations are related to PutObjectTagging : + * + * [GetObjectTagging] + * + * [DeleteObjectTagging] + * + * [Error Responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html + * [DeleteObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html + * [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html + * [Tag Restrictions]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html + * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html */ - pathParam(name: string): string + putObjectTagging(ctx: context.Context, params: PutObjectTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectTaggingOutput) + } + interface Client { /** - * PathParamDefault returns the path parameter or default value for the provided name. + * This operation is not supported by directory buckets. * - * Notes for DefaultRouter implementation: - * Path parameter could be empty for cases like that: - * * route `/release-:version/bin` and request URL is `/release-/bin` - * * route `/api/:version/image.jpg` and request URL is `/api//image.jpg` - * but not when path parameter is last part of route path - * * route `/download/file.:ext` will not match request `/download/file.` + * Creates or modifies the PublicAccessBlock configuration for an Amazon S3 + * bucket. To use this operation, you must have the s3:PutBucketPublicAccessBlock + * permission. For more information about Amazon S3 permissions, see [Specifying Permissions in a Policy]. + * + * When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or an + * object, it checks the PublicAccessBlock configuration for both the bucket (or + * the bucket that contains the object) and the bucket owner's account. If the + * PublicAccessBlock configurations are different between the bucket and the + * account, Amazon S3 uses the most restrictive combination of the bucket-level and + * account-level settings. + * + * For more information about when Amazon S3 considers a bucket or an object + * public, see [The Meaning of "Public"]. + * + * The following operations are related to PutPublicAccessBlock : + * + * [GetPublicAccessBlock] + * + * [DeletePublicAccessBlock] + * + * [GetBucketPolicyStatus] + * + * [Using Amazon S3 Block Public Access] + * + * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html + * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html + * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html + * [GetBucketPolicyStatus]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status */ - pathParamDefault(name: string, defaultValue: string): string + putPublicAccessBlock(ctx: context.Context, params: PutPublicAccessBlockInput, ...optFns: ((_arg0: Options) => void)[]): (PutPublicAccessBlockOutput) + } + interface Client { /** - * PathParams returns path parameter values. + * This operation is not supported by directory buckets. + * + * The SELECT job type for the RestoreObject operation is no longer available to + * new customers. Existing customers of Amazon S3 Select can continue to use the + * feature as usual. [Learn more] + * + * # Restores an archived copy of an object back into Amazon S3 + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * This action performs the following types of requests: + * + * ``` + * - restore an archive - Restore an archived object + * ``` + * + * For more information about the S3 structure in the request body, see the + * following: + * + * [PutObject] + * + * [Managing Access with ACLs] + * ``` + * - in the Amazon S3 User Guide + * ``` + * + * [Protecting Data Using Server-Side Encryption] + * ``` + * - in the Amazon S3 User Guide + * ``` + * + * Permissions To use this operation, you must have permissions to perform the + * s3:RestoreObject action. The bucket owner has this permission by default and can + * grant this permission to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] + * and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. + * + * Restoring objects Objects that you archive to the S3 Glacier Flexible Retrieval + * Flexible Retrieval or S3 Glacier Deep Archive storage class, and S3 + * Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep Archive tiers, are + * not accessible in real time. For objects in the S3 Glacier Flexible Retrieval + * Flexible Retrieval or S3 Glacier Deep Archive storage classes, you must first + * initiate a restore request, and then wait until a temporary copy of the object + * is available. If you want a permanent copy of the object, create a copy of it in + * the Amazon S3 Standard storage class in your S3 bucket. To access an archived + * object, you must restore the object for the duration (number of days) that you + * specify. For objects in the Archive Access or Deep Archive Access tiers of S3 + * Intelligent-Tiering, you must first initiate a restore request, and then wait + * until the object is moved into the Frequent Access tier. + * + * To restore a specific object version, you can provide a version ID. If you + * don't provide a version ID, Amazon S3 restores the current version. + * + * When restoring an archived object, you can specify one of the following data + * access tier options in the Tier element of the request body: + * + * ``` + * - Expedited - Expedited retrievals allow you to quickly access your data + * stored in the S3 Glacier Flexible Retrieval Flexible Retrieval storage class or + * S3 Intelligent-Tiering Archive tier when occasional urgent requests for + * restoring archives are required. For all but the largest archived objects (250 + * MB+), data accessed using Expedited retrievals is typically made available + * within 1–5 minutes. Provisioned capacity ensures that retrieval capacity for + * Expedited retrievals is available when you need it. Expedited retrievals and + * provisioned capacity are not available for objects stored in the S3 Glacier Deep + * Archive storage class or S3 Intelligent-Tiering Deep Archive tier. + * + * - Standard - Standard retrievals allow you to access any of your archived + * objects within several hours. This is the default option for retrieval requests + * that do not specify the retrieval option. Standard retrievals typically finish + * within 3–5 hours for objects stored in the S3 Glacier Flexible Retrieval + * Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. They + * typically finish within 12 hours for objects stored in the S3 Glacier Deep + * Archive storage class or S3 Intelligent-Tiering Deep Archive tier. Standard + * retrievals are free for objects stored in S3 Intelligent-Tiering. + * + * - Bulk - Bulk retrievals free for objects stored in the S3 Glacier Flexible + * Retrieval and S3 Intelligent-Tiering storage classes, enabling you to retrieve + * large amounts, even petabytes, of data at no cost. Bulk retrievals typically + * finish within 5–12 hours for objects stored in the S3 Glacier Flexible Retrieval + * Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. Bulk + * retrievals are also the lowest-cost retrieval option when restoring objects from + * S3 Glacier Deep Archive. They typically finish within 48 hours for objects + * stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering + * Deep Archive tier. + * ``` + * + * For more information about archive retrieval options and provisioned capacity + * for Expedited data access, see [Restoring Archived Objects] in the Amazon S3 User Guide. + * + * You can use Amazon S3 restore speed upgrade to change the restore speed to a + * faster speed while it is in progress. For more information, see [Upgrading the speed of an in-progress restore]in the Amazon + * S3 User Guide. + * + * To get the status of object restoration, you can send a HEAD request. + * Operations return the x-amz-restore header, which provides information about + * the restoration status, in the response. You can use Amazon S3 event + * notifications to notify you when a restore is initiated or completed. For more + * information, see [Configuring Amazon S3 Event Notifications]in the Amazon S3 User Guide. + * + * After restoring an archived object, you can update the restoration period by + * reissuing the request with a new period. Amazon S3 updates the restoration + * period relative to the current time and charges only for the request-there are + * no data transfer charges. You cannot update the restoration period when Amazon + * S3 is actively processing your current restore request for the object. + * + * If your bucket has a lifecycle configuration with a rule that includes an + * expiration action, the object expiration overrides the life span that you + * specify in a restore request. For example, if you restore an object copy for 10 + * days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the + * object in 3 days. For more information about lifecycle configuration, see [PutBucketLifecycleConfiguration]and [Object Lifecycle Management] + * in Amazon S3 User Guide. + * + * Responses A successful action returns either the 200 OK or 202 Accepted status + * code. + * + * ``` + * - If the object is not previously restored, then Amazon S3 returns 202 + * Accepted in the response. + * + * - If the object is previously restored, Amazon S3 returns 200 OK in the + * response. + * + * - Special errors: + * + * - Code: RestoreAlreadyInProgress + * + * - Cause: Object restore is already in progress. + * + * - HTTP Status Code: 409 Conflict + * + * - SOAP Fault Code Prefix: Client + * + * - Code: GlacierExpeditedRetrievalNotAvailable + * + * - Cause: expedited retrievals are currently not available. Try again later. + * (Returned if there is insufficient capacity to process the Expedited request. + * This error applies only to Expedited retrievals and not to S3 Standard or Bulk + * retrievals.) + * + * - HTTP Status Code: 503 + * + * - SOAP Fault Code Prefix: N/A + * ``` + * + * The following operations are related to RestoreObject : + * + * [PutBucketLifecycleConfiguration] + * + * [GetBucketNotificationConfiguration] + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html + * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html + * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources + * [Configuring Amazon S3 Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + * [Managing Access with ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html + * [Protecting Data Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html + * [GetBucketNotificationConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html + * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html + * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * [Upgrading the speed of an in-progress restore]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html */ - pathParams(): PathParams + restoreObject(ctx: context.Context, params: RestoreObjectInput, ...optFns: ((_arg0: Options) => void)[]): (RestoreObjectOutput) + } + // @ts-ignore + import smithysync = sync + interface Client { /** - * SetPathParams sets path parameters for current request. + * This operation is not supported by directory buckets. + * + * The SelectObjectContent operation is no longer available to new customers. + * Existing customers of Amazon S3 Select can continue to use the operation as + * usual. [Learn more] + * + * This action filters the contents of an Amazon S3 object based on a simple + * structured query language (SQL) statement. In the request, along with the SQL + * expression, you must also specify a data serialization format (JSON, CSV, or + * Apache Parquet) of the object. Amazon S3 uses this format to parse object data + * into records, and returns only records that match the specified SQL expression. + * You must also specify the data serialization format for the response. + * + * This functionality is not supported for Amazon S3 on Outposts. + * + * For more information about Amazon S3 Select, see [Selecting Content from Objects] and [SELECT Command] in the Amazon S3 User + * Guide. + * + * Permissions You must have the s3:GetObject permission for this operation. + * Amazon S3 Select does not support anonymous access. For more information about + * permissions, see [Specifying Permissions in a Policy]in the Amazon S3 User Guide. + * + * Object Data Formats You can use Amazon S3 Select to query objects that have the + * following format properties: + * + * ``` + * - CSV, JSON, and Parquet - Objects must be in CSV, JSON, or Parquet format. + * + * - UTF-8 - UTF-8 is the only encoding type Amazon S3 Select supports. + * + * - GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP or BZIP2. + * GZIP and BZIP2 are the only compression formats that Amazon S3 Select supports + * for CSV and JSON files. Amazon S3 Select supports columnar compression for + * Parquet using GZIP or Snappy. Amazon S3 Select does not support whole-object + * compression for Parquet objects. + * + * - Server-side encryption - Amazon S3 Select supports querying objects that + * are protected with server-side encryption. + * ``` + * + * For objects that are encrypted with customer-provided encryption keys (SSE-C), + * + * ``` + * you must use HTTPS, and you must use the headers that are documented in the [GetObject]. + * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)]in the Amazon S3 User Guide. + * ``` + * + * For objects that are encrypted with Amazon S3 managed keys (SSE-S3) and Amazon + * + * ``` + * Web Services KMS keys (SSE-KMS), server-side encryption is handled + * transparently, so you don't need to specify anything. For more information about + * server-side encryption, including SSE-S3 and SSE-KMS, see [Protecting Data Using Server-Side Encryption]in the Amazon S3 + * User Guide. + * ``` + * + * Working with the Response Body Given the response size is unknown, Amazon S3 + * Select streams the response as a series of messages and includes a + * Transfer-Encoding header with chunked as its value in the response. For more + * information, see [Appendix: SelectObjectContent Response]. + * + * GetObject Support The SelectObjectContent action does not support the following + * GetObject functionality. For more information, see [GetObject]. + * + * ``` + * - Range : Although you can specify a scan range for an Amazon S3 Select + * request (see [SelectObjectContentRequest - ScanRange]in the request parameters), you cannot specify the range of + * bytes of an object to return. + * + * - The GLACIER , DEEP_ARCHIVE , and REDUCED_REDUNDANCY storage classes, or the + * ARCHIVE_ACCESS and DEEP_ARCHIVE_ACCESS access tiers of the INTELLIGENT_TIERING + * storage class: You cannot query objects in the GLACIER , DEEP_ARCHIVE , or + * REDUCED_REDUNDANCY storage classes, nor objects in the ARCHIVE_ACCESS or + * DEEP_ARCHIVE_ACCESS access tiers of the INTELLIGENT_TIERING storage class. For + * more information about storage classes, see [Using Amazon S3 storage classes]in the Amazon S3 User Guide. + * ``` + * + * Special Errors For a list of special errors for this operation, see [List of SELECT Object Content Error Codes] + * + * The following operations are related to SelectObjectContent : + * + * [GetObject] + * + * [GetBucketLifecycleConfiguration] + * + * [PutBucketLifecycleConfiguration] + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [Selecting Content from Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html + * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html + * [List of SELECT Object Content Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList + * [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html + * [Using Amazon S3 storage classes]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html + * [SELECT Command]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-glacier-select-sql-reference-select.html + * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * [Appendix: SelectObjectContent Response]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html + * [SelectObjectContentRequest - ScanRange]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * + * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + * [Protecting Data Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html */ - setPathParams(params: PathParams): void + selectObjectContent(ctx: context.Context, params: SelectObjectContentInput, ...optFns: ((_arg0: Options) => void)[]): (SelectObjectContentOutput) + } + interface Client { /** - * QueryParam returns the query param for the provided name. + * Uploads a part in a multipart upload. + * + * In this operation, you provide new data as a part of an object in your request. + * However, you have an option to specify your existing Amazon S3 object as a data + * source for the part you are uploading. To upload a part from an existing object, + * you use the [UploadPartCopy]operation. + * + * You must initiate a multipart upload (see [CreateMultipartUpload]) before you can upload any part. In + * response to your initiate request, Amazon S3 returns an upload ID, a unique + * identifier that you must include in your upload part request. + * + * Part numbers can be any number from 1 to 10,000, inclusive. A part number + * uniquely identifies a part and also defines its position within the object being + * created. If you upload a new part using the same part number that was used with + * a previous part, the previously uploaded part is overwritten. + * + * For information about maximum and minimum part sizes and other multipart upload + * specifications, see [Multipart upload limits]in the Amazon S3 User Guide. + * + * After you initiate multipart upload and upload one or more parts, you must + * either complete or abort multipart upload in order to stop getting charged for + * storage of the uploaded parts. Only after you either complete or abort multipart + * upload, Amazon S3 frees up the parts storage and stops charging you for the + * parts storage. + * + * For more information on multipart uploads, go to [Multipart Upload Overview] in the Amazon S3 User Guide . + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Zonal endpoint. These endpoints support virtual-hosted-style + * requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Permissions + * ``` + * - General purpose bucket permissions - To perform a multipart upload with + * encryption using an Key Management Service key, the requester must have + * permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. The + * requester must also have permissions for the kms:GenerateDataKey action for + * the CreateMultipartUpload API. Then, the requester needs permissions for the + * kms:Decrypt action on the UploadPart and UploadPartCopy APIs. + * ``` + * + * These permissions are required because Amazon S3 must decrypt and read data + * + * ``` + * from the encrypted file parts before it completes the multipart upload. For more + * information about KMS permissions, see [Protecting data using server-side encryption with KMS]in the Amazon S3 User Guide. For + * information about the permissions required to use the multipart upload API, see [Multipart upload and permissions] + * and [Multipart upload API and permissions]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - To grant access to this API operation on a + * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation + * for session-based authorization. Specifically, you grant the + * s3express:CreateSession permission to the directory bucket in a bucket policy + * or an IAM identity-based policy. Then, you make the CreateSession API call on + * the bucket to obtain a session token. With the session token in your request + * header, you can make API requests to this operation. After the session token + * expires, you make another CreateSession API call to generate a new session + * token for use. Amazon Web Services CLI or SDKs create session and refresh the + * session token automatically to avoid service interruptions when a session + * expires. For more information about authorization, see [CreateSession]CreateSession . + * ``` + * + * If the object is encrypted with SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * Data integrity General purpose bucket - To ensure that data is not corrupted + * traversing the network, specify the Content-MD5 header in the upload part + * request. Amazon S3 checks the part data against the provided MD5 value. If they + * do not match, Amazon S3 returns an error. If the upload request is signed with + * Signature Version 4, then Amazon Web Services S3 uses the x-amz-content-sha256 + * header as a checksum instead of Content-MD5 . For more information see [Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)]. + * + * Directory buckets - MD5 is not supported by directory buckets. You can use + * checksum algorithms to check object integrity. + * + * Encryption + * ``` + * - General purpose bucket - Server-side encryption is for data encryption at + * rest. Amazon S3 encrypts your data as it writes it to disks in its data centers + * and decrypts it when you access it. You have mutually exclusive options to + * protect data using server-side encryption in Amazon S3, depending on how you + * choose to manage the encryption keys. Specifically, the encryption key options + * are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and + * Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side + * encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally + * tell Amazon S3 to encrypt data at rest using server-side encryption with other + * key options. The option you use depends on whether you want to use KMS keys + * (SSE-KMS) or provide your own encryption key (SSE-C). + * ``` + * + * Server-side encryption is supported by the S3 Multipart Upload operations. + * + * ``` + * Unless you are using a customer-provided encryption key (SSE-C), you don't need + * to specify the encryption parameters in each UploadPart request. Instead, you + * only need to specify the server-side encryption parameters in the initial + * Initiate Multipart request. For more information, see [CreateMultipartUpload]. + * ``` + * + * If you request server-side encryption using a customer-provided encryption key + * + * ``` + * (SSE-C) in your initiate multipart upload request, you must provide identical + * encryption information in each part upload using the following request headers. + * + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information, see [Using Server-Side Encryption]in the Amazon S3 User Guide. + * + * ``` + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: server-side encryption with Amazon S3 + * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + * (SSE-KMS) ( aws:kms ). + * ``` + * + * Special errors + * + * ``` + * - Error Code: NoSuchUpload + * + * - Description: The specified multipart upload does not exist. The upload ID + * might be invalid, or the multipart upload might have been aborted or completed. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to UploadPart : + * + * [CreateMultipartUpload] + * + * [CompleteMultipartUpload] + * + * [AbortMultipartUpload] + * + * [ListParts] + * + * [ListMultipartUploads] + * + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html + * [Multipart upload limits]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html + * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html + * + * [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html + * [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html + * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions */ - queryParam(name: string): string + uploadPart(ctx: context.Context, params: UploadPartInput, ...optFns: ((_arg0: Options) => void)[]): (UploadPartOutput) + } + interface Client { /** - * QueryParamDefault returns the query param or default value for the provided name. + * Uploads a part by copying data from an existing object as data source. To + * specify the data source, you add the request header x-amz-copy-source in your + * request. To specify a byte range, you add the request header + * x-amz-copy-source-range in your request. + * + * For information about maximum and minimum part sizes and other multipart upload + * specifications, see [Multipart upload limits]in the Amazon S3 User Guide. + * + * Instead of copying data from an existing object as part data, you might use the [UploadPart] + * action to upload new data as a part of an object in your request. + * + * You must initiate a multipart upload before you can upload any part. In + * response to your initiate request, Amazon S3 returns the upload ID, a unique + * identifier that you must include in your upload part request. + * + * For conceptual information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User + * Guide. For information about copying objects using a single atomic action vs. a + * multipart upload, see [Operations on Objects]in the Amazon S3 User Guide. + * + * Directory buckets - For directory buckets, you must make requests for this API + * operation to the Zonal endpoint. These endpoints support virtual-hosted-style + * requests in the format + * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style + * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User + * Guide. + * + * Authentication and authorization All UploadPartCopy requests must be + * authenticated and signed by using IAM credentials (access key ID and secret + * access key for the IAM identities). All headers with the x-amz- prefix, + * including x-amz-copy-source , must be signed. For more information, see [REST Authentication]. + * + * Directory buckets - You must use IAM credentials to authenticate and authorize + * your access to the UploadPartCopy API operation, instead of using the temporary + * security credentials through the CreateSession API operation. + * + * Amazon Web Services CLI or SDKs handles authentication and authorization on + * your behalf. + * + * Permissions You must have READ access to the source object and WRITE access to + * the destination bucket. + * + * ``` + * - General purpose bucket permissions - You must have the permissions in a + * policy based on the bucket types of your source bucket and destination bucket in + * an UploadPartCopy operation. + * + * - If the source object is in a general purpose bucket, you must have the + * s3:GetObject permission to read the source object that is being copied. + * + * - If the destination bucket is a general purpose bucket, you must have the + * s3:PutObject permission to write the object copy to the destination bucket. + * + * - To perform a multipart upload with encryption using an Key Management + * Service key, the requester must have permission to the kms:Decrypt and + * kms:GenerateDataKey actions on the key. The requester must also have + * permissions for the kms:GenerateDataKey action for the CreateMultipartUpload + * API. Then, the requester needs permissions for the kms:Decrypt action on the + * UploadPart and UploadPartCopy APIs. These permissions are required because + * Amazon S3 must decrypt and read data from the encrypted file parts before it + * completes the multipart upload. For more information about KMS permissions, see [Protecting data using server-side encryption with KMS] + * in the Amazon S3 User Guide. For information about the permissions required to + * use the multipart upload API, see [Multipart upload and permissions]and [Multipart upload API and permissions]in the Amazon S3 User Guide. + * + * - Directory bucket permissions - You must have permissions in a bucket policy + * or an IAM identity-based policy based on the source and destination bucket types + * in an UploadPartCopy operation. + * + * - If the source object that you want to copy is in a directory bucket, you + * must have the s3express:CreateSession permission in the Action element of a + * policy to read the object. By default, the session is in the ReadWrite mode. + * If you want to restrict the access, you can explicitly set the + * s3express:SessionMode condition key to ReadOnly on the copy source bucket. + * + * - If the copy destination is a directory bucket, you must have the + * s3express:CreateSession permission in the Action element of a policy to write + * the object to the destination. The s3express:SessionMode condition key cannot + * be set to ReadOnly on the copy destination. + * ``` + * + * If the object is encrypted with SSE-KMS, you must also have the + * + * ``` + * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies + * and KMS key policies for the KMS key. + * ``` + * + * For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. + * + * Encryption + * ``` + * - General purpose buckets - + * ``` + * + * For information about using server-side encryption with customer-provided + * + * ``` + * encryption keys with the UploadPartCopy operation, see [CopyObject]and [UploadPart]. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: server-side encryption with Amazon S3 + * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + * (SSE-KMS) ( aws:kms ). For more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. + * ``` + * + * For directory buckets, when you perform a CreateMultipartUpload operation and an + * + * ``` + * UploadPartCopy operation, + * ``` + * + * the request headers you provide in the CreateMultipartUpload request must match + * + * ``` + * the default encryption configuration of the destination bucket. + * ``` + * + * S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from + * + * ``` + * general purpose buckets + * ``` + * + * to directory buckets, from directory buckets to general purpose buckets, or + * + * ``` + * between directory buckets, through [UploadPartCopy]. In this case, Amazon S3 makes a call to + * KMS every time a copy request is made for a KMS-encrypted object. + * ``` + * + * Special errors + * + * ``` + * - Error Code: NoSuchUpload + * + * - Description: The specified multipart upload does not exist. The upload ID + * might be invalid, or the multipart upload might have been aborted or completed. + * + * - HTTP Status Code: 404 Not Found + * + * - Error Code: InvalidRequest + * + * - Description: The specified copy source is not supported as a byte-range + * copy source. + * + * - HTTP Status Code: 400 Bad Request + * ``` + * + * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is + * Bucket_name.s3express-az_id.region.amazonaws.com . + * + * The following operations are related to UploadPartCopy : + * + * [CreateMultipartUpload] + * + * [UploadPart] + * + * [CompleteMultipartUpload] + * + * [AbortMultipartUpload] + * + * [ListParts] + * + * [ListMultipartUploads] + * + * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html + * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html + * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html + * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html + * [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html + * [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions + * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html + * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * [Multipart upload limits]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html + * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html + * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html + * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html + * [Operations on Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html + * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html + * + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html */ - queryParamDefault(name: string, defaultValue: string): string + uploadPartCopy(ctx: context.Context, params: UploadPartCopyInput, ...optFns: ((_arg0: Options) => void)[]): (UploadPartCopyOutput) + } + interface Client { /** - * QueryParams returns the query parameters as `url.Values`. - */ - queryParams(): url.Values + * This operation is not supported by directory buckets. + * + * Passes transformed objects to a GetObject operation when using Object Lambda + * access points. For information about Object Lambda access points, see [Transforming objects with Object Lambda access points]in the + * Amazon S3 User Guide. + * + * This operation supports metadata that can be returned by [GetObject], in addition to + * RequestRoute , RequestToken , StatusCode , ErrorCode , and ErrorMessage . The + * GetObject response metadata is supported so that the WriteGetObjectResponse + * caller, typically an Lambda function, can provide the same metadata when it + * internally invokes GetObject . When WriteGetObjectResponse is called by a + * customer-owned Lambda function, the metadata returned to the end user GetObject + * call might differ from what Amazon S3 would normally return. + * + * You can include any number of metadata headers. When including a metadata + * header, it should be prefaced with x-amz-meta . For example, + * x-amz-meta-my-custom-header: MyCustomValue . The primary use case for this is to + * forward GetObject metadata. + * + * Amazon Web Services provides some prebuilt Lambda functions that you can use + * with S3 Object Lambda to detect and redact personally identifiable information + * (PII) and decompress S3 objects. These Lambda functions are available in the + * Amazon Web Services Serverless Application Repository, and can be selected + * through the Amazon Web Services Management Console when you create your Object + * Lambda access point. + * + * Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, a + * natural language processing (NLP) service using machine learning to find + * insights and relationships in text. It automatically detects personally + * identifiable information (PII) such as names, addresses, dates, credit card + * numbers, and social security numbers from documents in your Amazon S3 bucket. + * + * Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a + * natural language processing (NLP) service using machine learning to find + * insights and relationships in text. It automatically redacts personally + * identifiable information (PII) such as names, addresses, dates, credit card + * numbers, and social security numbers from documents in your Amazon S3 bucket. + * + * Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, is + * equipped to decompress objects stored in S3 in one of six compressed file + * formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. + * + * For information on how to view and use these functions, see [Using Amazon Web Services built Lambda functions] in the Amazon S3 + * User Guide. + * + * [Transforming objects with Object Lambda access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html + * [Using Amazon Web Services built Lambda functions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-examples.html + * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + */ + writeGetObjectResponse(ctx: context.Context, params: WriteGetObjectResponseInput, ...optFns: ((_arg0: Options) => void)[]): (WriteGetObjectResponseOutput) + } + // @ts-ignore + import internalcontext = context + // @ts-ignore + import awsxml = xml + // @ts-ignore + import internalendpoints = endpoints + // @ts-ignore + import smithyendpoints = endpoints + // @ts-ignore + import v4 = signer +} + +/** + * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html + * + * See README.md for more info. + */ +namespace jwt { + /** + * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. + * This is the default claims type if you don't supply one + */ + interface MapClaims extends _TygojaDict{} + interface MapClaims { /** - * QueryString returns the URL query string. + * VerifyAudience Compares the aud claim against cmp. + * If required is false, this method will return true if the value matches or is unset */ - queryString(): string + verifyAudience(cmp: string, req: boolean): boolean + } + interface MapClaims { /** - * FormValue returns the form field value for the provided name. + * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). + * If req is false, it will return true, if exp is unset. */ - formValue(name: string): string + verifyExpiresAt(cmp: number, req: boolean): boolean + } + interface MapClaims { /** - * FormValueDefault returns the form field value or default value for the provided name. + * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). + * If req is false, it will return true, if iat is unset. */ - formValueDefault(name: string, defaultValue: string): string + verifyIssuedAt(cmp: number, req: boolean): boolean + } + interface MapClaims { /** - * FormValues returns the form field values as `url.Values`. + * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). + * If req is false, it will return true, if nbf is unset. */ - formValues(): url.Values + verifyNotBefore(cmp: number, req: boolean): boolean + } + interface MapClaims { /** - * FormFile returns the multipart form file for the provided name. + * VerifyIssuer compares the iss claim against cmp. + * If required is false, this method will return true if the value matches or is unset */ - formFile(name: string): (multipart.FileHeader) + verifyIssuer(cmp: string, req: boolean): boolean + } + interface MapClaims { /** - * MultipartForm returns the multipart form. + * Valid validates time based claims "exp, iat, nbf". + * There is no accounting for clock skew. + * As well, if any of the above claims are not in the token, it will still + * be considered a valid claim. */ - multipartForm(): (multipart.Form) + valid(): void + } +} + +/** + * Package gcerrors provides support for getting error codes from + * errors returned by Go CDK APIs. + */ +namespace gcerrors { + /** + * An ErrorCode describes the error's category. Programs should act upon an error's + * code, not its message. + */ + interface ErrorCode extends gcerr.ErrorCode{} +} + +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { + /** + * Reader reads bytes from a blob. + * It implements io.ReadSeekCloser, and must be closed after + * reads are finished. + */ + interface Reader { + } + interface Reader { /** - * Cookie returns the named cookie provided in the request. + * Read implements io.Reader (https://golang.org/pkg/io/#Reader). */ - cookie(name: string): (http.Cookie) + read(p: string|Array): number + } + interface Reader { /** - * SetCookie adds a `Set-Cookie` header in HTTP response. + * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). */ - setCookie(cookie: http.Cookie): void + seek(offset: number, whence: number): number + } + interface Reader { /** - * Cookies returns the HTTP cookies sent with the request. + * Close implements io.Closer (https://golang.org/pkg/io/#Closer). */ - cookies(): Array<(http.Cookie | undefined)> + close(): void + } + interface Reader { /** - * Get retrieves data from the context. + * ContentType returns the MIME type of the blob. */ - get(key: string): { + contentType(): string } + interface Reader { /** - * Set saves data in the context. + * ModTime returns the time the blob was last modified. */ - set(key: string, val: { - }): void + modTime(): time.Time + } + interface Reader { /** - * Bind binds path params, query params and the request body into provided type `i`. The default binder - * binds body based on Content-Type header. + * Size returns the size of the blob content in bytes. */ - bind(i: { - }): void + size(): number + } + interface Reader { /** - * Validate validates provided `i`. It is usually called after `Context#Bind()`. - * Validator must be registered using `Echo#Validator`. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - validate(i: { - }): void + as(i: { + }): boolean + } + interface Reader { /** - * Render renders a template with data and sends a text/html response with status - * code. Renderer must be registered using `Echo.Renderer`. + * WriteTo reads from r and writes to w until there's no more data or + * an error occurs. + * The return value is the number of bytes written to w. + * + * It implements the io.WriterTo interface. */ - render(code: number, name: string, data: { - }): void + writeTo(w: io.Writer): number + } + /** + * Attributes contains attributes about a blob. + */ + interface Attributes { /** - * HTML sends an HTTP response with status code. + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control */ - html(code: number, html: string): void + cacheControl: string /** - * HTMLBlob sends an HTTP blob response with status code. + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition */ - htmlBlob(code: number, b: string|Array): void + contentDisposition: string /** - * String sends a string response with status code. + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding */ - string(code: number, s: string): void + contentEncoding: string /** - * JSON sends a JSON response with status code. + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language */ - json(code: number, i: { - }): void + contentLanguage: string /** - * JSONPretty sends a pretty-print JSON with status code. + * ContentType is the MIME type of the blob. It will not be empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type */ - jsonPretty(code: number, i: { - }, indent: string): void + contentType: string /** - * JSONBlob sends a JSON blob response with status code. + * Metadata holds key/value pairs associated with the blob. + * Keys are guaranteed to be in lowercase, even if the backend service + * has case-sensitive keys (although note that Metadata written via + * this package will always be lowercased). If there are duplicate + * case-insensitive keys (e.g., "foo" and "FOO"), only one value + * will be kept, and it is undefined which one. */ - jsonBlob(code: number, b: string|Array): void + metadata: _TygojaDict /** - * JSONP sends a JSONP response with status code. It uses `callback` to construct - * the JSONP payload. + * CreateTime is the time the blob was created, if available. If not available, + * CreateTime will be the zero time. */ - jsonp(code: number, callback: string, i: { - }): void + createTime: time.Time /** - * JSONPBlob sends a JSONP blob response with status code. It uses `callback` - * to construct the JSONP payload. + * ModTime is the time the blob was last modified. */ - jsonpBlob(code: number, callback: string, b: string|Array): void + modTime: time.Time /** - * XML sends an XML response with status code. + * Size is the size of the blob's content in bytes. */ - xml(code: number, i: { - }): void + size: number /** - * XMLPretty sends a pretty-print XML with status code. + * MD5 is an MD5 hash of the blob contents or nil if not available. */ - xmlPretty(code: number, i: { - }, indent: string): void + md5: string|Array /** - * XMLBlob sends an XML blob response with status code. + * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. */ - xmlBlob(code: number, b: string|Array): void + eTag: string + } + interface Attributes { /** - * Blob sends a blob response with status code and content type. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - blob(code: number, contentType: string, b: string|Array): void + as(i: { + }): boolean + } + /** + * ListObject represents a single blob returned from List. + */ + interface ListObject { /** - * Stream sends a streaming response with status code and content type. + * Key is the key for this blob. */ - stream(code: number, contentType: string, r: io.Reader): void + key: string /** - * File sends a response with the content of the file. + * ModTime is the time the blob was last modified. */ - file(file: string): void + modTime: time.Time /** - * FileFS sends a response with the content of the file from given filesystem. + * Size is the size of the blob's content in bytes. */ - fileFS(file: string, filesystem: fs.FS): void + size: number /** - * Attachment sends a response as attachment, prompting client to save the - * file. + * MD5 is an MD5 hash of the blob contents or nil if not available. */ - attachment(file: string, name: string): void + md5: string|Array /** - * Inline sends a response as inline, opening the file in the browser. + * IsDir indicates that this result represents a "directory" in the + * hierarchical namespace, ending in ListOptions.Delimiter. Key can be + * passed as ListOptions.Prefix to list items in the "directory". + * Fields other than Key and IsDir will not be set if IsDir is true. */ - inline(file: string, name: string): void + isDir: boolean + } + interface ListObject { /** - * NoContent sends a response with no body and a status code. - */ - noContent(code: number): void - /** - * Redirect redirects the request to a provided URL with status code. - */ - redirect(code: number, url: string): void - /** - * Error invokes the registered global HTTP error handler. Generally used by middleware. - * A side-effect of calling global error handler is that now Response has been committed (sent to the client) and - * middlewares up in chain can not change Response status code or Response body anymore. - * - * Avoid using this method in handlers as no middleware will be able to effectively handle errors after that. - * Instead of calling this method in handler return your error and let it be handled by middlewares or global error handler. - */ - error(err: Error): void - /** - * Echo returns the `Echo` instance. - * - * WARNING: Remember that Echo public fields and methods are coroutine safe ONLY when you are NOT mutating them - * anywhere in your code after Echo server has started. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - echo(): (Echo) + as(i: { + }): boolean } - // @ts-ignore - import stdContext = context /** - * Echo is the top-level framework instance. - * - * Goroutine safety: Do not mutate Echo instance fields after server has started. Accessing these - * fields from handlers/middlewares and changing field values at the same time leads to data-races. - * Same rule applies to adding new routes after server has been started - Adding a route is not Goroutine safe action. + * Bucket provides an easy and portable way to interact with blobs + * within a "bucket", including read, write, and list operations. + * To create a Bucket, use constructors found in driver subpackages. */ - interface Echo { - /** - * NewContextFunc allows using custom context implementations, instead of default *echo.context - */ - newContextFunc: (e: Echo, pathParamAllocSize: number) => ServableContext - debug: boolean - httpErrorHandler: HTTPErrorHandler - binder: Binder - jsonSerializer: JSONSerializer - validator: Validator - renderer: Renderer - logger: Logger - ipExtractor: IPExtractor + interface Bucket { + } + interface Bucket { /** - * Filesystem is file system used by Static and File handlers to access files. - * Defaults to os.DirFS(".") - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - filesystem: fs.FS + as(i: { + }): boolean + } + interface Bucket { /** - * OnAddRoute is called when Echo adds new route to specific host router. Handler is called for every router - * and before route is added to the host router. + * ErrorAs converts err to driver-specific types. + * ErrorAs panics if i is nil or not a pointer. + * ErrorAs returns false if err == nil. + * See https://gocloud.dev/concepts/as/ for background information. */ - onAddRoute: (host: string, route: Routable) => void + errorAs(err: Error, i: { + }): boolean } - /** - * HandlerFunc defines a function to serve HTTP requests. - */ - interface HandlerFunc {(c: Context): void } - /** - * MiddlewareFunc defines a function to process middleware. - */ - interface MiddlewareFunc {(next: HandlerFunc): HandlerFunc } - interface Echo { + interface Bucket { /** - * NewContext returns a new Context instance. + * ReadAll is a shortcut for creating a Reader via NewReader with nil + * ReaderOptions, and reading the entire blob. * - * Note: both request and response can be left to nil as Echo.ServeHTTP will call c.Reset(req,resp) anyway - * these arguments are useful when creating context for tests and cases like that. + * Using Download may be more efficient. */ - newContext(r: http.Request, w: http.ResponseWriter): Context + readAll(ctx: context.Context, key: string): string|Array } - interface Echo { + interface Bucket { /** - * Router returns the default router. + * Download writes the content of a blob into an io.Writer w. */ - router(): Router + download(ctx: context.Context, key: string, w: io.Writer, opts: ReaderOptions): void } - interface Echo { + interface Bucket { /** - * Routers returns the new map of host => router. + * List returns a ListIterator that can be used to iterate over blobs in a + * bucket, in lexicographical order of UTF-8 encoded keys. The underlying + * implementation fetches results in pages. + * + * A nil ListOptions is treated the same as the zero value. + * + * List is not guaranteed to include all recently-written blobs; + * some services are only eventually consistent. */ - routers(): _TygojaDict + list(opts: ListOptions): (ListIterator) } - interface Echo { + interface Bucket { /** - * RouterFor returns Router for given host. When host is left empty the default router is returned. + * ListPage returns a page of ListObject results for blobs in a bucket, in lexicographical + * order of UTF-8 encoded keys. + * + * To fetch the first page, pass FirstPageToken as the pageToken. For subsequent pages, pass + * the pageToken returned from a previous call to ListPage. + * It is not possible to "skip ahead" pages. + * + * Each call will return pageSize results, unless there are not enough blobs to fill the + * page, in which case it will return fewer results (possibly 0). + * + * If there are no more blobs available, ListPage will return an empty pageToken. Note that + * this may happen regardless of the number of returned results -- the last page might have + * 0 results (i.e., if the last item was deleted), pageSize results, or anything in between. + * + * Calling ListPage with an empty pageToken will immediately return io.EOF. When looping + * over pages, callers can either check for an empty pageToken, or they can make one more + * call and check for io.EOF. + * + * The underlying implementation fetches results in pages, but one call to ListPage may + * require multiple page fetches (and therefore, multiple calls to the BeforeList callback). + * + * A nil ListOptions is treated the same as the zero value. + * + * ListPage is not guaranteed to include all recently-written blobs; + * some services are only eventually consistent. */ - routerFor(host: string): [Router, boolean] + listPage(ctx: context.Context, pageToken: string|Array, pageSize: number, opts: ListOptions): [Array<(ListObject | undefined)>, string|Array] } - interface Echo { + interface Bucket { /** - * ResetRouterCreator resets callback for creating new router instances. - * Note: current (default) router is immediately replaced with router created with creator func and vhost routers are cleared. + * IsAccessible returns true if the bucket is accessible, false otherwise. + * It is a shortcut for calling ListPage and checking if it returns an error + * with code gcerrors.NotFound. */ - resetRouterCreator(creator: (e: Echo) => Router): void + isAccessible(ctx: context.Context): boolean } - interface Echo { + interface Bucket { /** - * Pre adds middleware to the chain which is run before router tries to find matching route. - * Meaning middleware is executed even for 404 (not found) cases. + * Exists returns true if a blob exists at key, false if it does not exist, or + * an error. + * It is a shortcut for calling Attributes and checking if it returns an error + * with code gcerrors.NotFound. */ - pre(...middleware: MiddlewareFunc[]): void + exists(ctx: context.Context, key: string): boolean } - interface Echo { + interface Bucket { /** - * Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed. + * Attributes returns attributes for the blob stored at key. + * + * If the blob does not exist, Attributes returns an error for which + * gcerrors.Code will return gcerrors.NotFound. */ - use(...middleware: MiddlewareFunc[]): void + attributes(ctx: context.Context, key: string): (Attributes) } - interface Echo { + interface Bucket { /** - * CONNECT registers a new CONNECT route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * NewReader is a shortcut for NewRangeReader with offset=0 and length=-1. */ - connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + newReader(ctx: context.Context, key: string, opts: ReaderOptions): (Reader) } - interface Echo { + interface Bucket { /** - * DELETE registers a new DELETE route for a path with matching handler in the router - * with optional route-level middleware. Panics on error. + * NewRangeReader returns a Reader to read content from the blob stored at key. + * It reads at most length bytes starting at offset (>= 0). + * If length is negative, it will read till the end of the blob. + * + * For the purposes of Seek, the returned Reader will start at offset and + * end at the minimum of the actual end of the blob or (if length > 0) offset + length. + * + * Note that ctx is used for all reads performed during the lifetime of the reader. + * + * If the blob does not exist, NewRangeReader returns an error for which + * gcerrors.Code will return gcerrors.NotFound. Exists is a lighter-weight way + * to check for existence. + * + * A nil ReaderOptions is treated the same as the zero value. + * + * The caller must call Close on the returned Reader when done reading. */ - delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + newRangeReader(ctx: context.Context, key: string, offset: number, length: number, opts: ReaderOptions): (Reader) } - interface Echo { + interface Bucket { /** - * GET registers a new GET route for a path with matching handler in the router - * with optional route-level middleware. Panics on error. + * WriteAll is a shortcut for creating a Writer via NewWriter and writing p. + * + * If opts.ContentMD5 is not set, WriteAll will compute the MD5 of p and use it + * as the ContentMD5 option for the Writer it creates. + * + * Using Upload may be more efficient. */ - get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + writeAll(ctx: context.Context, key: string, p: string|Array, opts: WriterOptions): void } - interface Echo { + interface Bucket { /** - * HEAD registers a new HEAD route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Upload reads from an io.Reader r and writes into a blob. + * + * opts.ContentType is required. */ - head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + upload(ctx: context.Context, key: string, r: io.Reader, opts: WriterOptions): void } - interface Echo { + interface Bucket { /** - * OPTIONS registers a new OPTIONS route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * NewWriter returns a Writer that writes to the blob stored at key. + * A nil WriterOptions is treated the same as the zero value. + * + * If a blob with this key already exists, it will be replaced. + * The blob being written is not guaranteed to be readable until Close + * has been called; until then, any previous blob will still be readable. + * Even after Close is called, newly written blobs are not guaranteed to be + * returned from List; some services are only eventually consistent. + * + * The returned Writer will store ctx for later use in Write and/or Close. + * To abort a write, cancel ctx; otherwise, it must remain open until + * Close is called. + * + * The caller must call Close on the returned Writer, even if the write is + * aborted. */ - options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + newWriter(ctx: context.Context, key: string, opts: WriterOptions): (Writer) } - interface Echo { + interface Bucket { /** - * PATCH registers a new PATCH route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Copy the blob stored at srcKey to dstKey. + * A nil CopyOptions is treated the same as the zero value. + * + * If the source blob does not exist, Copy returns an error for which + * gcerrors.Code will return gcerrors.NotFound. + * + * If the destination blob already exists, it is overwritten. */ - patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + copy(ctx: context.Context, dstKey: string, srcKey: string, opts: CopyOptions): void } - interface Echo { + interface Bucket { /** - * POST registers a new POST route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Delete deletes the blob stored at key. + * + * If the blob does not exist, Delete returns an error for which + * gcerrors.Code will return gcerrors.NotFound. */ - post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + delete(ctx: context.Context, key: string): void } - interface Echo { + interface Bucket { /** - * PUT registers a new PUT route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * SignedURL returns a URL that can be used to GET (default), PUT or DELETE + * the blob for the duration specified in opts.Expiry. + * + * A nil SignedURLOptions is treated the same as the zero value. + * + * It is valid to call SignedURL for a key that does not exist. + * + * If the driver does not support this functionality, SignedURL + * will return an error for which gcerrors.Code will return gcerrors.Unimplemented. */ - put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + signedURL(ctx: context.Context, key: string, opts: SignedURLOptions): string } - interface Echo { + interface Bucket { /** - * TRACE registers a new TRACE route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Close releases any resources used for the bucket. */ - trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + close(): void } - interface Echo { + interface Bucket { /** - * RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) - * for current request URL. - * Path supports static and named/any parameters just like other http method is defined. Generally path is ended with - * wildcard/match-any character (`/*`, `/download/*` etc). + * SetIOFSCallback sets a callback that is used during Open and calls on the objects + * returned from Open. * - * Example: `e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` + * fn should return a context.Context and *ReaderOptions that can be used in + * calls to List and NewReader on b. It may be called more than once. */ - routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + setIOFSCallback(fn: () => [context.Context, (ReaderOptions)]): void } - interface Echo { + interface Bucket { /** - * Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler - * in the router with optional route-level middleware. + * Open implements fs.FS.Open (https://pkg.go.dev/io/fs#FS). * - * Note: this method only adds specific set of supported HTTP methods as handler and is not true - * "catch-any-arbitrary-method" way of matching requests. + * SetIOFSCallback must be called prior to calling this function. */ - any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + open(path: string): fs.File } - interface Echo { + interface Bucket { /** - * Match registers a new route for multiple HTTP methods and path with matching - * handler in the router with optional route-level middleware. Panics on error. + * Sub implements fs.SubFS.Sub. + * + * SetIOFSCallback must be called prior to calling this function. */ - match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + sub(dir: string): fs.FS } - interface Echo { +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonArray defines a slice that is safe for json and db read/write. + */ + interface JsonArray extends Array{} + interface JsonArray { /** - * Static registers a new route with path prefix to serve static files from the provided root directory. + * MarshalJSON implements the [json.Marshaler] interface. */ - static(pathPrefix: string, fsRoot: string): RouteInfo + marshalJSON(): string|Array } - interface Echo { + interface JsonArray { /** - * StaticFS registers a new route with path prefix to serve static files from the provided file system. - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. + * Value implements the [driver.Valuer] interface. */ - staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo + value(): any } - interface Echo { + interface JsonArray { /** - * FileFS registers a new route with path to serve file from the provided file system. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonArray[T] instance. */ - fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo + scan(value: any): void } - interface Echo { + /** + * JsonMap defines a map that is safe for json and db read/write. + */ + interface JsonMap extends _TygojaDict{} + interface JsonMap { /** - * File registers a new route with path to serve a static file with optional route-level middleware. Panics on error. + * MarshalJSON implements the [json.Marshaler] interface. */ - file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo + marshalJSON(): string|Array } - interface Echo { + interface JsonMap { /** - * AddRoute registers a new Route with default host Router + * Get retrieves a single value from the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). */ - addRoute(route: Routable): RouteInfo + get(key: string): any } - interface Echo { + interface JsonMap { /** - * Add registers a new route for an HTTP method and path with matching handler - * in the router with optional route-level middleware. + * Set sets a single value in the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). */ - add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo + set(key: string, value: any): void } - interface Echo { + interface JsonMap { /** - * Host creates a new router group for the provided host and optional host-level middleware. + * Value implements the [driver.Valuer] interface. */ - host(name: string, ...m: MiddlewareFunc[]): (Group) + value(): any } - interface Echo { + interface JsonMap { /** - * Group creates a new router group with prefix and optional group-level middleware. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current `JsonMap` instance. */ - group(prefix: string, ...m: MiddlewareFunc[]): (Group) + scan(value: any): void } - interface Echo { +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation + /** + * Schema defines a dynamic db schema as a slice of `SchemaField`s. + */ + interface Schema { + } + interface Schema { /** - * AcquireContext returns an empty `Context` instance from the pool. - * You must return the context by calling `ReleaseContext()`. + * Fields returns the registered schema fields. */ - acquireContext(): Context + fields(): Array<(SchemaField | undefined)> } - interface Echo { + interface Schema { /** - * ReleaseContext returns the `Context` instance back to the pool. - * You must call it after `AcquireContext()`. + * InitFieldsOptions calls `InitOptions()` for all schema fields. */ - releaseContext(c: Context): void + initFieldsOptions(): void } - interface Echo { + interface Schema { /** - * ServeHTTP implements `http.Handler` interface, which serves HTTP requests. + * Clone creates a deep clone of the current schema. */ - serveHTTP(w: http.ResponseWriter, r: http.Request): void + clone(): (Schema) } - interface Echo { + interface Schema { /** - * Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by - * sending os.Interrupt signal with `ctrl+c`. - * - * Note: this method is created for use in examples/demos and is deliberately simple without providing configuration - * options. - * - * In need of customization use: - * - * ``` - * sc := echo.StartConfig{Address: ":8080"} - * if err := sc.Start(e); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * ``` - * - * // or standard library `http.Server` - * - * ``` - * s := http.Server{Addr: ":8080", Handler: e} - * if err := s.ListenAndServe(); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * ``` + * AsMap returns a map with all registered schema field. + * The returned map is indexed with each field name. */ - start(address: string): void + asMap(): _TygojaDict } -} - -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface Command { + interface Schema { /** - * GenBashCompletion generates bash completion file and writes to the passed writer. + * GetFieldById returns a single field by its id. */ - genBashCompletion(w: io.Writer): void + getFieldById(id: string): (SchemaField) } - interface Command { + interface Schema { /** - * GenBashCompletionFile generates bash completion file. + * GetFieldByName returns a single field by its name. */ - genBashCompletionFile(filename: string): void + getFieldByName(name: string): (SchemaField) } - interface Command { + interface Schema { /** - * GenBashCompletionFileV2 generates Bash completion version 2. + * RemoveField removes a single schema field by its id. + * + * This method does nothing if field with `id` doesn't exist. */ - genBashCompletionFileV2(filename: string, includeDesc: boolean): void + removeField(id: string): void } - interface Command { + interface Schema { /** - * GenBashCompletionV2 generates Bash completion file version 2 - * and writes it to the passed writer. + * AddField registers the provided newField to the current schema. + * + * If field with `newField.Id` already exist, the existing field is + * replaced with the new one. + * + * Otherwise the new field is appended to the other schema fields. */ - genBashCompletionV2(w: io.Writer, includeDesc: boolean): void + addField(newField: SchemaField): void } - // @ts-ignore - import flag = pflag - /** - * Command is just that, a command for your application. - * E.g. 'go run ...' - 'run' is the command. Cobra requires - * you to define the usage and description as part of your command - * definition to ensure usability. - */ - interface Command { + interface Schema { /** - * Use is the one-line usage message. - * Recommended syntax is as follows: - * ``` - * [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. - * ... indicates that you can specify multiple values for the previous argument. - * | indicates mutually exclusive information. You can use the argument to the left of the separator or the - * argument to the right of the separator. You cannot use both arguments in a single use of the command. - * { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are - * optional, they are enclosed in brackets ([ ]). - * ``` - * Example: add [-F file | -D dir]... [-f format] profile + * Validate makes Schema validatable by implementing [validation.Validatable] interface. + * + * Internally calls each individual field's validator and additionally + * checks for invalid renamed fields and field name duplications. */ - use: string + validate(): void + } + interface Schema { /** - * Aliases is an array of aliases that can be used instead of the first word in Use. + * MarshalJSON implements the [json.Marshaler] interface. */ - aliases: Array + marshalJSON(): string|Array + } + interface Schema { /** - * SuggestFor is an array of command names for which this command will be suggested - - * similar to aliases but only suggests. + * UnmarshalJSON implements the [json.Unmarshaler] interface. + * + * On success, all schema field options are auto initialized. */ - suggestFor: Array + unmarshalJSON(data: string|Array): void + } + interface Schema { /** - * Short is the short description shown in the 'help' output. + * Value implements the [driver.Valuer] interface. */ - short: string + value(): any + } + interface Schema { /** - * The group id under which this subcommand is grouped in the 'help' output of its parent. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current Schema instance. */ - groupID: string + scan(value: any): void + } +} + +/** + * Package models implements all PocketBase DB models and DTOs. + */ +namespace models { + type _subTPaAx = BaseModel + interface Admin extends _subTPaAx { + avatar: number + email: string + tokenKey: string + passwordHash: string + lastResetSentAt: types.DateTime + } + interface Admin { /** - * Long is the long message shown in the 'help ' output. + * TableName returns the Admin model SQL table name. */ - long: string + tableName(): string + } + interface Admin { /** - * Example is examples of how to use the command. + * ValidatePassword validates a plain password against the model's password. */ - example: string + validatePassword(password: string): boolean + } + interface Admin { /** - * ValidArgs is list of all valid non-flag arguments that are accepted in shell completions + * SetPassword sets cryptographically secure string to `model.Password`. + * + * Additionally this method also resets the LastResetSentAt and the TokenKey fields. */ - validArgs: Array + setPassword(password: string): void + } + interface Admin { /** - * ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. - * It is a dynamic version of using ValidArgs. - * Only one of ValidArgs and ValidArgsFunction can be used for a command. + * RefreshTokenKey generates and sets new random token key. */ - validArgsFunction: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective] + refreshTokenKey(): void + } + // @ts-ignore + import validation = ozzo_validation + type _subxVwLG = BaseModel + interface Collection extends _subxVwLG { + name: string + type: string + system: boolean + schema: schema.Schema + indexes: types.JsonArray /** - * Expected arguments + * rules */ - args: PositionalArgs + listRule?: string + viewRule?: string + createRule?: string + updateRule?: string + deleteRule?: string + options: types.JsonMap + } + interface Collection { /** - * ArgAliases is List of aliases for ValidArgs. - * These are not suggested to the user in the shell completion, - * but accepted if entered manually. + * TableName returns the Collection model SQL table name. */ - argAliases: Array + tableName(): string + } + interface Collection { /** - * BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. - * For portability with other shells, it is recommended to instead use ValidArgsFunction + * BaseFilesPath returns the storage dir path used by the collection. */ - bashCompletionFunction: string + baseFilesPath(): string + } + interface Collection { /** - * Deprecated defines, if this command is deprecated and should print this string when used. + * IsBase checks if the current collection has "base" type. */ - deprecated: string + isBase(): boolean + } + interface Collection { /** - * Annotations are key/value pairs that can be used by applications to identify or - * group commands or set special options. + * IsAuth checks if the current collection has "auth" type. */ - annotations: _TygojaDict + isAuth(): boolean + } + interface Collection { /** - * Version defines the version for this command. If this value is non-empty and the command does not - * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, - * will print content of the "Version" variable. A shorthand "v" flag will also be added if the - * command does not define one. + * IsView checks if the current collection has "view" type. */ - version: string + isView(): boolean + } + interface Collection { /** - * The *Run functions are executed in the following order: - * ``` - * * PersistentPreRun() - * * PreRun() - * * Run() - * * PostRun() - * * PersistentPostRun() - * ``` - * All functions get the same args, the arguments after the command name. - * The *PreRun and *PostRun functions will only be executed if the Run function of the current - * command has been declared. - * - * PersistentPreRun: children of this command will inherit and execute. - */ - persistentPreRun: (cmd: Command, args: Array) => void - /** - * PersistentPreRunE: PersistentPreRun but returns an error. - */ - persistentPreRunE: (cmd: Command, args: Array) => void - /** - * PreRun: children of this command will not inherit. - */ - preRun: (cmd: Command, args: Array) => void - /** - * PreRunE: PreRun but returns an error. - */ - preRunE: (cmd: Command, args: Array) => void - /** - * Run: Typically the actual work function. Most commands will only implement this. - */ - run: (cmd: Command, args: Array) => void - /** - * RunE: Run but returns an error. - */ - runE: (cmd: Command, args: Array) => void - /** - * PostRun: run after the Run command. - */ - postRun: (cmd: Command, args: Array) => void - /** - * PostRunE: PostRun but returns an error. - */ - postRunE: (cmd: Command, args: Array) => void - /** - * PersistentPostRun: children of this command will inherit and execute after PostRun. + * MarshalJSON implements the [json.Marshaler] interface. */ - persistentPostRun: (cmd: Command, args: Array) => void + marshalJSON(): string|Array + } + interface Collection { /** - * PersistentPostRunE: PersistentPostRun but returns an error. + * BaseOptions decodes the current collection options and returns them + * as new [CollectionBaseOptions] instance. */ - persistentPostRunE: (cmd: Command, args: Array) => void + baseOptions(): CollectionBaseOptions + } + interface Collection { /** - * FParseErrWhitelist flag parse errors to be ignored + * AuthOptions decodes the current collection options and returns them + * as new [CollectionAuthOptions] instance. */ - fParseErrWhitelist: FParseErrWhitelist + authOptions(): CollectionAuthOptions + } + interface Collection { /** - * CompletionOptions is a set of options to control the handling of shell completion + * ViewOptions decodes the current collection options and returns them + * as new [CollectionViewOptions] instance. */ - completionOptions: CompletionOptions + viewOptions(): CollectionViewOptions + } + interface Collection { /** - * TraverseChildren parses flags on all parents before executing child command. + * NormalizeOptions updates the current collection options with a + * new normalized state based on the collection type. */ - traverseChildren: boolean + normalizeOptions(): void + } + interface Collection { /** - * Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + * DecodeOptions decodes the current collection options into the + * provided "result" (must be a pointer). */ - hidden: boolean + decodeOptions(result: any): void + } + interface Collection { /** - * SilenceErrors is an option to quiet errors down stream. + * SetOptions normalizes and unmarshals the specified options into m.Options. */ - silenceErrors: boolean + setOptions(typedOptions: any): void + } + type _subnirpX = BaseModel + interface ExternalAuth extends _subnirpX { + collectionId: string + recordId: string + provider: string + providerId: string + } + interface ExternalAuth { + tableName(): string + } + type _subbYdTV = BaseModel + interface Record extends _subbYdTV { + } + interface Record { /** - * SilenceUsage is an option to silence usage when an error occurs. + * TableName returns the table name associated to the current Record model. */ - silenceUsage: boolean + tableName(): string + } + interface Record { /** - * DisableFlagParsing disables the flag parsing. - * If this is true all flags will be passed to the command as arguments. + * Collection returns the Collection model associated to the current Record model. */ - disableFlagParsing: boolean + collection(): (Collection) + } + interface Record { /** - * DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - * will be printed by generating docs for this command. + * OriginalCopy returns a copy of the current record model populated + * with its ORIGINAL data state (aka. the initially loaded) and + * everything else reset to the defaults. */ - disableAutoGenTag: boolean + originalCopy(): (Record) + } + interface Record { /** - * DisableFlagsInUseLine will disable the addition of [flags] to the usage - * line of a command when printing help or generating docs + * CleanCopy returns a copy of the current record model populated only + * with its LATEST data state and everything else reset to the defaults. */ - disableFlagsInUseLine: boolean + cleanCopy(): (Record) + } + interface Record { /** - * DisableSuggestions disables the suggestions based on Levenshtein distance - * that go along with 'unknown command' messages. + * Expand returns a shallow copy of the current Record model expand data. */ - disableSuggestions: boolean + expand(): _TygojaDict + } + interface Record { /** - * SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - * Must be > 0. + * SetExpand shallow copies the provided data to the current Record model's expand. */ - suggestionsMinimumDistance: number + setExpand(expand: _TygojaDict): void } - interface Command { + interface Record { /** - * Context returns underlying command context. If command was executed - * with ExecuteContext or the context was set with SetContext, the - * previously set context will be returned. Otherwise, nil is returned. + * MergeExpand merges recursively the provided expand data into + * the current model's expand (if any). * - * Notice that a call to Execute and ExecuteC will replace a nil context of - * a command with a context.Background, so a background context will be - * returned by Context after one of these functions has been called. + * Note that if an expanded prop with the same key is a slice (old or new expand) + * then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). + * Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew). */ - context(): context.Context + mergeExpand(expand: _TygojaDict): void } - interface Command { + interface Record { /** - * SetContext sets context for the command. This context will be overwritten by - * Command.ExecuteContext or Command.ExecuteContextC. + * SchemaData returns a shallow copy ONLY of the defined record schema fields data. */ - setContext(ctx: context.Context): void + schemaData(): _TygojaDict } - interface Command { + interface Record { /** - * SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden - * particularly useful when testing. + * UnknownData returns a shallow copy ONLY of the unknown record fields data, + * aka. fields that are neither one of the base and special system ones, + * nor defined by the collection schema. */ - setArgs(a: Array): void + unknownData(): _TygojaDict } - interface Command { + interface Record { /** - * SetOutput sets the destination for usage and error messages. - * If output is nil, os.Stderr is used. - * Deprecated: Use SetOut and/or SetErr instead + * IgnoreEmailVisibility toggles the flag to ignore the auth record email visibility check. */ - setOutput(output: io.Writer): void + ignoreEmailVisibility(state: boolean): void } - interface Command { + interface Record { /** - * SetOut sets the destination for usage messages. - * If newOut is nil, os.Stdout is used. + * WithUnknownData toggles the export/serialization of unknown data fields + * (false by default). */ - setOut(newOut: io.Writer): void + withUnknownData(state: boolean): void } - interface Command { + interface Record { /** - * SetErr sets the destination for error messages. - * If newErr is nil, os.Stderr is used. + * Set sets the provided key-value data pair for the current Record model. + * + * If the record collection has field with name matching the provided "key", + * the value will be further normalized according to the field rules. */ - setErr(newErr: io.Writer): void + set(key: string, value: any): void } - interface Command { + interface Record { /** - * SetIn sets the source for input data - * If newIn is nil, os.Stdin is used. + * Get returns a normalized single record model data value for "key". */ - setIn(newIn: io.Reader): void + get(key: string): any } - interface Command { + interface Record { /** - * SetUsageFunc sets usage function. Usage can be defined by application. + * GetBool returns the data value for "key" as a bool. */ - setUsageFunc(f: (_arg0: Command) => void): void + getBool(key: string): boolean } - interface Command { + interface Record { /** - * SetUsageTemplate sets usage template. Can be defined by Application. + * GetString returns the data value for "key" as a string. */ - setUsageTemplate(s: string): void + getString(key: string): string } - interface Command { + interface Record { /** - * SetFlagErrorFunc sets a function to generate an error when flag parsing - * fails. + * GetInt returns the data value for "key" as an int. */ - setFlagErrorFunc(f: (_arg0: Command, _arg1: Error) => void): void + getInt(key: string): number } - interface Command { + interface Record { /** - * SetHelpFunc sets help function. Can be defined by Application. + * GetFloat returns the data value for "key" as a float64. */ - setHelpFunc(f: (_arg0: Command, _arg1: Array) => void): void + getFloat(key: string): number } - interface Command { + interface Record { /** - * SetHelpCommand sets help command. + * GetTime returns the data value for "key" as a [time.Time] instance. */ - setHelpCommand(cmd: Command): void + getTime(key: string): time.Time } - interface Command { + interface Record { /** - * SetHelpCommandGroupID sets the group id of the help command. + * GetDateTime returns the data value for "key" as a DateTime instance. */ - setHelpCommandGroupID(groupID: string): void + getDateTime(key: string): types.DateTime } - interface Command { + interface Record { /** - * SetCompletionCommandGroupID sets the group id of the completion command. + * GetStringSlice returns the data value for "key" as a slice of unique strings. */ - setCompletionCommandGroupID(groupID: string): void + getStringSlice(key: string): Array } - interface Command { + interface Record { /** - * SetHelpTemplate sets help template to be used. Application can use it to set custom template. + * ExpandedOne retrieves a single relation Record from the already + * loaded expand data of the current model. + * + * If the requested expand relation is multiple, this method returns + * only first available Record from the expanded relation. + * + * Returns nil if there is no such expand relation loaded. */ - setHelpTemplate(s: string): void + expandedOne(relField: string): (Record) } - interface Command { + interface Record { /** - * SetVersionTemplate sets version template to be used. Application can use it to set custom template. + * ExpandedAll retrieves a slice of relation Records from the already + * loaded expand data of the current model. + * + * If the requested expand relation is single, this method normalizes + * the return result and will wrap the single model as a slice. + * + * Returns nil slice if there is no such expand relation loaded. */ - setVersionTemplate(s: string): void + expandedAll(relField: string): Array<(Record | undefined)> } - interface Command { + interface Record { /** - * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. + * Retrieves the "key" json field value and unmarshals it into "result". + * + * Example + * + * ``` + * result := struct { + * FirstName string `json:"first_name"` + * }{} + * err := m.UnmarshalJSONField("my_field_name", &result) + * ``` */ - setErrPrefix(s: string): void + unmarshalJSONField(key: string, result: any): void } - interface Command { + interface Record { /** - * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. - * The user should not have a cyclic dependency on commands. + * BaseFilesPath returns the storage dir path used by the record. */ - setGlobalNormalizationFunc(n: (f: any, name: string) => any): void + baseFilesPath(): string } - interface Command { + interface Record { /** - * OutOrStdout returns output to stdout. + * FindFileFieldByFile returns the first file type field for which + * any of the record's data contains the provided filename. */ - outOrStdout(): io.Writer + findFileFieldByFile(filename: string): (schema.SchemaField) } - interface Command { + interface Record { /** - * OutOrStderr returns output to stderr + * Load bulk loads the provided data into the current Record model. */ - outOrStderr(): io.Writer + load(data: _TygojaDict): void } - interface Command { + interface Record { /** - * ErrOrStderr returns output to stderr + * ColumnValueMap implements [ColumnValueMapper] interface. */ - errOrStderr(): io.Writer + columnValueMap(): _TygojaDict } - interface Command { + interface Record { /** - * InOrStdin returns input to stdin + * PublicExport exports only the record fields that are safe to be public. + * + * For auth records, to force the export of the email field you need to set + * `m.IgnoreEmailVisibility(true)`. */ - inOrStdin(): io.Reader + publicExport(): _TygojaDict } - interface Command { + interface Record { /** - * UsageFunc returns either the function set by SetUsageFunc for this command - * or a parent, or it returns a default usage function. + * MarshalJSON implements the [json.Marshaler] interface. + * + * Only the data exported by `PublicExport()` will be serialized. */ - usageFunc(): (_arg0: Command) => void + marshalJSON(): string|Array } - interface Command { + interface Record { /** - * Usage puts out the usage for the command. - * Used when a user provides invalid input. - * Can be defined by user by overriding UsageFunc. + * UnmarshalJSON implements the [json.Unmarshaler] interface. */ - usage(): void + unmarshalJSON(data: string|Array): void } - interface Command { + interface Record { /** - * HelpFunc returns either the function set by SetHelpFunc for this command - * or a parent, or it returns a function with default help behavior. + * ReplaceModifers returns a new map with applied modifier + * values based on the current record and the specified data. + * + * The resolved modifier keys will be removed. + * + * Multiple modifiers will be applied one after another, + * while reusing the previous base key value result (eg. 1; -5; +2 => -2). + * + * Example usage: + * + * ``` + * newData := record.ReplaceModifers(data) + * // record: {"field": 10} + * // data: {"field+": 5} + * // newData: {"field": 15} + * ``` */ - helpFunc(): (_arg0: Command, _arg1: Array) => void + replaceModifers(data: _TygojaDict): _TygojaDict } - interface Command { + interface Record { /** - * Help puts out the help for the command. - * Used when a user calls help [command]. - * Can be defined by user by overriding HelpFunc. + * Username returns the "username" auth record data value. */ - help(): void + username(): string } - interface Command { + interface Record { /** - * UsageString returns usage string. + * SetUsername sets the "username" auth record data value. + * + * This method doesn't check whether the provided value is a valid username. + * + * Returns an error if the record is not from an auth collection. */ - usageString(): string + setUsername(username: string): void } - interface Command { + interface Record { /** - * FlagErrorFunc returns either the function set by SetFlagErrorFunc for this - * command or a parent, or it returns a function which returns the original - * error. + * Email returns the "email" auth record data value. */ - flagErrorFunc(): (_arg0: Command, _arg1: Error) => void + email(): string } - interface Command { + interface Record { /** - * UsagePadding return padding for the usage. + * SetEmail sets the "email" auth record data value. + * + * This method doesn't check whether the provided value is a valid email. + * + * Returns an error if the record is not from an auth collection. */ - usagePadding(): number + setEmail(email: string): void } - interface Command { + interface Record { /** - * CommandPathPadding return padding for the command path. + * Verified returns the "emailVisibility" auth record data value. */ - commandPathPadding(): number + emailVisibility(): boolean } - interface Command { + interface Record { /** - * NamePadding returns padding for the name. + * SetEmailVisibility sets the "emailVisibility" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - namePadding(): number + setEmailVisibility(visible: boolean): void } - interface Command { + interface Record { /** - * UsageTemplate returns usage template for the command. + * Verified returns the "verified" auth record data value. */ - usageTemplate(): string + verified(): boolean } - interface Command { + interface Record { /** - * HelpTemplate return help template for the command. + * SetVerified sets the "verified" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - helpTemplate(): string + setVerified(verified: boolean): void } - interface Command { + interface Record { /** - * VersionTemplate return version template for the command. + * TokenKey returns the "tokenKey" auth record data value. */ - versionTemplate(): string + tokenKey(): string } - interface Command { + interface Record { /** - * ErrPrefix return error message prefix for the command + * SetTokenKey sets the "tokenKey" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - errPrefix(): string + setTokenKey(key: string): void } - interface Command { + interface Record { /** - * Find the target command given the args and command tree - * Meant to be run on the highest node. Only searches down. + * RefreshTokenKey generates and sets new random auth record "tokenKey". + * + * Returns an error if the record is not from an auth collection. */ - find(args: Array): [(Command), Array] + refreshTokenKey(): void } - interface Command { + interface Record { /** - * Traverse the command tree to find the command, and parse args for - * each parent. + * LastResetSentAt returns the "lastResentSentAt" auth record data value. */ - traverse(args: Array): [(Command), Array] + lastResetSentAt(): types.DateTime } - interface Command { + interface Record { /** - * SuggestionsFor provides suggestions for the typedName. + * SetLastResetSentAt sets the "lastResentSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - suggestionsFor(typedName: string): Array + setLastResetSentAt(dateTime: types.DateTime): void } - interface Command { + interface Record { /** - * VisitParents visits all parents of the command and invokes fn on each parent. + * LastVerificationSentAt returns the "lastVerificationSentAt" auth record data value. */ - visitParents(fn: (_arg0: Command) => void): void + lastVerificationSentAt(): types.DateTime } - interface Command { + interface Record { /** - * Root finds root command. + * SetLastVerificationSentAt sets an "lastVerificationSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - root(): (Command) + setLastVerificationSentAt(dateTime: types.DateTime): void } - interface Command { + interface Record { /** - * ArgsLenAtDash will return the length of c.Flags().Args at the moment - * when a -- was found during args parsing. + * LastLoginAlertSentAt returns the "lastLoginAlertSentAt" auth record data value. */ - argsLenAtDash(): number + lastLoginAlertSentAt(): types.DateTime } - interface Command { + interface Record { /** - * ExecuteContext is the same as Execute(), but sets the ctx on the command. - * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs - * functions. + * SetLastLoginAlertSentAt sets an "lastLoginAlertSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - executeContext(ctx: context.Context): void + setLastLoginAlertSentAt(dateTime: types.DateTime): void } - interface Command { + interface Record { /** - * Execute uses the args (os.Args[1:] by default) - * and run through the command tree finding appropriate matches - * for commands and then corresponding flags. + * PasswordHash returns the "passwordHash" auth record data value. */ - execute(): void + passwordHash(): string } - interface Command { + interface Record { /** - * ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. - * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs - * functions. + * ValidatePassword validates a plain password against the auth record password. + * + * Returns false if the password is incorrect or record is not from an auth collection. */ - executeContextC(ctx: context.Context): (Command) + validatePassword(password: string): boolean } - interface Command { + interface Record { /** - * ExecuteC executes the command. - */ - executeC(): (Command) - } - interface Command { - validateArgs(args: Array): void + * SetPassword sets cryptographically secure string to the auth record "password" field. + * This method also resets the "lastResetSentAt" and the "tokenKey" fields. + * + * Returns an error if the record is not from an auth collection or + * an empty password is provided. + */ + setPassword(password: string): void } - interface Command { + /** + * RequestInfo defines a HTTP request data struct, usually used + * as part of the `@request.*` filter resolver. + */ + interface RequestInfo { + context: string + query: _TygojaDict + data: _TygojaDict + headers: _TygojaDict + authRecord?: Record + admin?: Admin + method: string + } + interface RequestInfo { /** - * ValidateRequiredFlags validates all required flags are present and returns an error otherwise + * HasModifierDataKeys loosely checks if the current struct has any modifier Data keys. */ - validateRequiredFlags(): void + hasModifierDataKeys(): boolean } - interface Command { +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + /** + * Context represents the context of the current HTTP request. It holds request and + * response objects, path, path parameters, data and registered handler. + */ + interface Context { + [key:string]: any; /** - * InitDefaultHelpFlag adds default help flag to c. - * It is called automatically by executing the c or by calling help and usage. - * If c already has help flag, it will do nothing. + * Request returns `*http.Request`. */ - initDefaultHelpFlag(): void - } - interface Command { + request(): (http.Request) /** - * InitDefaultVersionFlag adds default version flag to c. - * It is called automatically by executing the c. - * If c already has a version flag, it will do nothing. - * If c.Version is empty, it will do nothing. + * SetRequest sets `*http.Request`. */ - initDefaultVersionFlag(): void - } - interface Command { + setRequest(r: http.Request): void /** - * InitDefaultHelpCmd adds default help command to c. - * It is called automatically by executing the c or by calling help and usage. - * If c already has help command or c has no subcommands, it will do nothing. + * SetResponse sets `*Response`. */ - initDefaultHelpCmd(): void - } - interface Command { + setResponse(r: Response): void /** - * ResetCommands delete parent, subcommand and help command from c. + * Response returns `*Response`. */ - resetCommands(): void - } - interface Command { + response(): (Response) /** - * Commands returns a sorted slice of child commands. + * IsTLS returns true if HTTP connection is TLS otherwise false. */ - commands(): Array<(Command | undefined)> - } - interface Command { + isTLS(): boolean /** - * AddCommand adds one or more commands to this parent command. + * IsWebSocket returns true if HTTP connection is WebSocket otherwise false. */ - addCommand(...cmds: (Command | undefined)[]): void - } - interface Command { + isWebSocket(): boolean /** - * Groups returns a slice of child command groups. + * Scheme returns the HTTP protocol scheme, `http` or `https`. */ - groups(): Array<(Group | undefined)> - } - interface Command { + scheme(): string /** - * AllChildCommandsHaveGroup returns if all subcommands are assigned to a group + * RealIP returns the client's network address based on `X-Forwarded-For` + * or `X-Real-IP` request header. + * The behavior can be configured using `Echo#IPExtractor`. */ - allChildCommandsHaveGroup(): boolean - } - interface Command { + realIP(): string /** - * ContainsGroup return if groupID exists in the list of command groups. + * RouteInfo returns current request route information. Method, Path, Name and params if they exist for matched route. + * In case of 404 (route not found) and 405 (method not allowed) RouteInfo returns generic struct for these cases. */ - containsGroup(groupID: string): boolean - } - interface Command { + routeInfo(): RouteInfo /** - * AddGroup adds one or more command groups to this parent command. + * Path returns the registered path for the handler. */ - addGroup(...groups: (Group | undefined)[]): void - } - interface Command { + path(): string /** - * RemoveCommand removes one or more commands from a parent command. + * PathParam returns path parameter by name. */ - removeCommand(...cmds: (Command | undefined)[]): void - } - interface Command { + pathParam(name: string): string /** - * Print is a convenience method to Print to the defined output, fallback to Stderr if not set. + * PathParamDefault returns the path parameter or default value for the provided name. + * + * Notes for DefaultRouter implementation: + * Path parameter could be empty for cases like that: + * * route `/release-:version/bin` and request URL is `/release-/bin` + * * route `/api/:version/image.jpg` and request URL is `/api//image.jpg` + * but not when path parameter is last part of route path + * * route `/download/file.:ext` will not match request `/download/file.` */ - print(...i: { - }[]): void - } - interface Command { + pathParamDefault(name: string, defaultValue: string): string /** - * Println is a convenience method to Println to the defined output, fallback to Stderr if not set. + * PathParams returns path parameter values. */ - println(...i: { - }[]): void - } - interface Command { + pathParams(): PathParams /** - * Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. + * SetPathParams sets path parameters for current request. */ - printf(format: string, ...i: { - }[]): void - } - interface Command { + setPathParams(params: PathParams): void /** - * PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. + * QueryParam returns the query param for the provided name. */ - printErr(...i: { - }[]): void - } - interface Command { + queryParam(name: string): string /** - * PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. + * QueryParamDefault returns the query param or default value for the provided name. */ - printErrln(...i: { - }[]): void - } - interface Command { + queryParamDefault(name: string, defaultValue: string): string /** - * PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. + * QueryParams returns the query parameters as `url.Values`. */ - printErrf(format: string, ...i: { - }[]): void - } - interface Command { + queryParams(): url.Values /** - * CommandPath returns the full path to this command. + * QueryString returns the URL query string. */ - commandPath(): string - } - interface Command { + queryString(): string /** - * UseLine puts out the full usage for a given command (including parents). + * FormValue returns the form field value for the provided name. */ - useLine(): string - } - interface Command { + formValue(name: string): string /** - * DebugFlags used to determine which flags have been assigned to which commands - * and which persist. - * nolint:goconst + * FormValueDefault returns the form field value or default value for the provided name. */ - debugFlags(): void - } - interface Command { + formValueDefault(name: string, defaultValue: string): string /** - * Name returns the command's name: the first word in the use line. + * FormValues returns the form field values as `url.Values`. */ - name(): string - } - interface Command { + formValues(): url.Values /** - * HasAlias determines if a given string is an alias of the command. + * FormFile returns the multipart form file for the provided name. */ - hasAlias(s: string): boolean - } - interface Command { + formFile(name: string): (multipart.FileHeader) /** - * CalledAs returns the command name or alias that was used to invoke - * this command or an empty string if the command has not been called. + * MultipartForm returns the multipart form. */ - calledAs(): string - } - interface Command { + multipartForm(): (multipart.Form) /** - * NameAndAliases returns a list of the command name and all aliases + * Cookie returns the named cookie provided in the request. */ - nameAndAliases(): string - } - interface Command { + cookie(name: string): (http.Cookie) /** - * HasExample determines if the command has example. + * SetCookie adds a `Set-Cookie` header in HTTP response. */ - hasExample(): boolean - } - interface Command { + setCookie(cookie: http.Cookie): void /** - * Runnable determines if the command is itself runnable. + * Cookies returns the HTTP cookies sent with the request. */ - runnable(): boolean - } - interface Command { + cookies(): Array<(http.Cookie | undefined)> /** - * HasSubCommands determines if the command has children commands. + * Get retrieves data from the context. */ - hasSubCommands(): boolean + get(key: string): { } - interface Command { /** - * IsAvailableCommand determines if a command is available as a non-help command - * (this includes all non deprecated/hidden commands). + * Set saves data in the context. */ - isAvailableCommand(): boolean - } - interface Command { + set(key: string, val: { + }): void /** - * IsAdditionalHelpTopicCommand determines if a command is an additional - * help topic command; additional help topic command is determined by the - * fact that it is NOT runnable/hidden/deprecated, and has no sub commands that - * are runnable/hidden/deprecated. - * Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. + * Bind binds path params, query params and the request body into provided type `i`. The default binder + * binds body based on Content-Type header. */ - isAdditionalHelpTopicCommand(): boolean - } - interface Command { + bind(i: { + }): void /** - * HasHelpSubCommands determines if a command has any available 'help' sub commands - * that need to be shown in the usage/help default template under 'additional help - * topics'. + * Validate validates provided `i`. It is usually called after `Context#Bind()`. + * Validator must be registered using `Echo#Validator`. */ - hasHelpSubCommands(): boolean - } - interface Command { + validate(i: { + }): void /** - * HasAvailableSubCommands determines if a command has available sub commands that - * need to be shown in the usage/help default template under 'available commands'. + * Render renders a template with data and sends a text/html response with status + * code. Renderer must be registered using `Echo.Renderer`. */ - hasAvailableSubCommands(): boolean - } - interface Command { + render(code: number, name: string, data: { + }): void /** - * HasParent determines if the command is a child command. + * HTML sends an HTTP response with status code. */ - hasParent(): boolean - } - interface Command { + html(code: number, html: string): void /** - * GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. + * HTMLBlob sends an HTTP blob response with status code. */ - globalNormalizationFunc(): (f: any, name: string) => any - } - interface Command { + htmlBlob(code: number, b: string|Array): void /** - * Flags returns the complete FlagSet that applies - * to this command (local and persistent declared here and by all parents). + * String sends a string response with status code. */ - flags(): (any) - } - interface Command { + string(code: number, s: string): void /** - * LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. + * JSON sends a JSON response with status code. */ - localNonPersistentFlags(): (any) - } - interface Command { + json(code: number, i: { + }): void /** - * LocalFlags returns the local FlagSet specifically set in the current command. + * JSONPretty sends a pretty-print JSON with status code. */ - localFlags(): (any) - } - interface Command { + jsonPretty(code: number, i: { + }, indent: string): void /** - * InheritedFlags returns all flags which were inherited from parent commands. + * JSONBlob sends a JSON blob response with status code. */ - inheritedFlags(): (any) - } - interface Command { + jsonBlob(code: number, b: string|Array): void /** - * NonInheritedFlags returns all flags which were not inherited from parent commands. + * JSONP sends a JSONP response with status code. It uses `callback` to construct + * the JSONP payload. */ - nonInheritedFlags(): (any) - } - interface Command { + jsonp(code: number, callback: string, i: { + }): void /** - * PersistentFlags returns the persistent FlagSet specifically set in the current command. + * JSONPBlob sends a JSONP blob response with status code. It uses `callback` + * to construct the JSONP payload. */ - persistentFlags(): (any) - } - interface Command { + jsonpBlob(code: number, callback: string, b: string|Array): void /** - * ResetFlags deletes all flags from command. + * XML sends an XML response with status code. */ - resetFlags(): void - } - interface Command { + xml(code: number, i: { + }): void /** - * HasFlags checks if the command contains any flags (local plus persistent from the entire structure). + * XMLPretty sends a pretty-print XML with status code. */ - hasFlags(): boolean - } - interface Command { + xmlPretty(code: number, i: { + }, indent: string): void /** - * HasPersistentFlags checks if the command contains persistent flags. + * XMLBlob sends an XML blob response with status code. */ - hasPersistentFlags(): boolean - } - interface Command { + xmlBlob(code: number, b: string|Array): void /** - * HasLocalFlags checks if the command has flags specifically declared locally. + * Blob sends a blob response with status code and content type. */ - hasLocalFlags(): boolean - } - interface Command { + blob(code: number, contentType: string, b: string|Array): void /** - * HasInheritedFlags checks if the command has flags inherited from its parent command. + * Stream sends a streaming response with status code and content type. */ - hasInheritedFlags(): boolean - } - interface Command { + stream(code: number, contentType: string, r: io.Reader): void /** - * HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire - * structure) which are not hidden or deprecated. + * File sends a response with the content of the file. */ - hasAvailableFlags(): boolean - } - interface Command { + file(file: string): void /** - * HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. + * FileFS sends a response with the content of the file from given filesystem. */ - hasAvailablePersistentFlags(): boolean - } - interface Command { + fileFS(file: string, filesystem: fs.FS): void /** - * HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden - * or deprecated. + * Attachment sends a response as attachment, prompting client to save the + * file. */ - hasAvailableLocalFlags(): boolean - } - interface Command { + attachment(file: string, name: string): void /** - * HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are - * not hidden or deprecated. + * Inline sends a response as inline, opening the file in the browser. */ - hasAvailableInheritedFlags(): boolean - } - interface Command { + inline(file: string, name: string): void /** - * Flag climbs up the command tree looking for matching flag. + * NoContent sends a response with no body and a status code. */ - flag(name: string): (any) - } - interface Command { + noContent(code: number): void /** - * ParseFlags parses persistent flag tree and local flags. + * Redirect redirects the request to a provided URL with status code. */ - parseFlags(args: Array): void - } - interface Command { + redirect(code: number, url: string): void /** - * Parent returns a commands parent command. + * Error invokes the registered global HTTP error handler. Generally used by middleware. + * A side-effect of calling global error handler is that now Response has been committed (sent to the client) and + * middlewares up in chain can not change Response status code or Response body anymore. + * + * Avoid using this method in handlers as no middleware will be able to effectively handle errors after that. + * Instead of calling this method in handler return your error and let it be handled by middlewares or global error handler. */ - parent(): (Command) - } - interface Command { + error(err: Error): void /** - * RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. + * Echo returns the `Echo` instance. + * + * WARNING: Remember that Echo public fields and methods are coroutine safe ONLY when you are NOT mutating them + * anywhere in your code after Echo server has started. */ - registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void + echo(): (Echo) } - interface Command { + // @ts-ignore + import stdContext = context + /** + * Echo is the top-level framework instance. + * + * Goroutine safety: Do not mutate Echo instance fields after server has started. Accessing these + * fields from handlers/middlewares and changing field values at the same time leads to data-races. + * Same rule applies to adding new routes after server has been started - Adding a route is not Goroutine safe action. + */ + interface Echo { /** - * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. + * NewContextFunc allows using custom context implementations, instead of default *echo.context */ - getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] - } - interface Command { + newContextFunc: (e: Echo, pathParamAllocSize: number) => ServableContext + debug: boolean + httpErrorHandler: HTTPErrorHandler + binder: Binder + jsonSerializer: JSONSerializer + validator: Validator + renderer: Renderer + logger: Logger + ipExtractor: IPExtractor /** - * InitDefaultCompletionCmd adds a default 'completion' command to c. - * This function will do nothing if any of the following is true: - * 1- the feature has been explicitly disabled by the program, - * 2- c has no subcommands (to avoid creating one), - * 3- c already has a 'completion' command provided by the program. + * Filesystem is file system used by Static and File handlers to access files. + * Defaults to os.DirFS(".") + * + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - initDefaultCompletionCmd(): void - } - interface Command { + filesystem: fs.FS /** - * GenFishCompletion generates fish completion file and writes to the passed writer. + * OnAddRoute is called when Echo adds new route to specific host router. Handler is called for every router + * and before route is added to the host router. */ - genFishCompletion(w: io.Writer, includeDesc: boolean): void + onAddRoute: (host: string, route: Routable) => void } - interface Command { + /** + * HandlerFunc defines a function to serve HTTP requests. + */ + interface HandlerFunc {(c: Context): void } + /** + * MiddlewareFunc defines a function to process middleware. + */ + interface MiddlewareFunc {(next: HandlerFunc): HandlerFunc } + interface Echo { /** - * GenFishCompletionFile generates fish completion file. + * NewContext returns a new Context instance. + * + * Note: both request and response can be left to nil as Echo.ServeHTTP will call c.Reset(req,resp) anyway + * these arguments are useful when creating context for tests and cases like that. */ - genFishCompletionFile(filename: string, includeDesc: boolean): void + newContext(r: http.Request, w: http.ResponseWriter): Context } - interface Command { + interface Echo { /** - * MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors - * if the command is invoked with a subset (but not all) of the given flags. + * Router returns the default router. */ - markFlagsRequiredTogether(...flagNames: string[]): void + router(): Router } - interface Command { + interface Echo { /** - * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors - * if the command is invoked without at least one flag from the given set of flags. + * Routers returns the new map of host => router. */ - markFlagsOneRequired(...flagNames: string[]): void + routers(): _TygojaDict } - interface Command { + interface Echo { /** - * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors - * if the command is invoked with more than one flag from the given set of flags. + * RouterFor returns Router for given host. When host is left empty the default router is returned. */ - markFlagsMutuallyExclusive(...flagNames: string[]): void + routerFor(host: string): [Router, boolean] } - interface Command { + interface Echo { /** - * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the - * first error encountered. + * ResetRouterCreator resets callback for creating new router instances. + * Note: current (default) router is immediately replaced with router created with creator func and vhost routers are cleared. */ - validateFlagGroups(): void + resetRouterCreator(creator: (e: Echo) => Router): void } - interface Command { + interface Echo { /** - * GenPowerShellCompletionFile generates powershell completion file without descriptions. + * Pre adds middleware to the chain which is run before router tries to find matching route. + * Meaning middleware is executed even for 404 (not found) cases. */ - genPowerShellCompletionFile(filename: string): void + pre(...middleware: MiddlewareFunc[]): void } - interface Command { + interface Echo { /** - * GenPowerShellCompletion generates powershell completion file without descriptions - * and writes it to the passed writer. + * Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed. */ - genPowerShellCompletion(w: io.Writer): void + use(...middleware: MiddlewareFunc[]): void } - interface Command { + interface Echo { /** - * GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. + * CONNECT registers a new CONNECT route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - genPowerShellCompletionFileWithDesc(filename: string): void + connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * GenPowerShellCompletionWithDesc generates powershell completion file with descriptions - * and writes it to the passed writer. + * DELETE registers a new DELETE route for a path with matching handler in the router + * with optional route-level middleware. Panics on error. */ - genPowerShellCompletionWithDesc(w: io.Writer): void + delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkFlagRequired instructs the various shell completion implementations to - * prioritize the named flag when performing completion, - * and causes your command to report an error if invoked without the flag. + * GET registers a new GET route for a path with matching handler in the router + * with optional route-level middleware. Panics on error. */ - markFlagRequired(name: string): void + get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkPersistentFlagRequired instructs the various shell completion implementations to - * prioritize the named persistent flag when performing completion, - * and causes your command to report an error if invoked without the flag. + * HEAD registers a new HEAD route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - markPersistentFlagRequired(name: string): void + head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkFlagFilename instructs the various shell completion implementations to - * limit completions for the named flag to the specified file extensions. + * OPTIONS registers a new OPTIONS route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - markFlagFilename(name: string, ...extensions: string[]): void + options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. - * The bash completion script will call the bash function f for the flag. - * - * This will only work for bash completion. - * It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows - * to register a Go function which will work across all shells. + * PATCH registers a new PATCH route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - markFlagCustom(name: string, f: string): void + patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkPersistentFlagFilename instructs the various shell completion - * implementations to limit completions for the named persistent flag to the - * specified file extensions. + * POST registers a new POST route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - markPersistentFlagFilename(name: string, ...extensions: string[]): void + post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkFlagDirname instructs the various shell completion implementations to - * limit completions for the named flag to directory names. + * PUT registers a new PUT route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - markFlagDirname(name: string): void + put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * MarkPersistentFlagDirname instructs the various shell completion - * implementations to limit completions for the named persistent flag to - * directory names. + * TRACE registers a new TRACE route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - markPersistentFlagDirname(name: string): void + trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * GenZshCompletionFile generates zsh completion file including descriptions. + * RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) + * for current request URL. + * Path supports static and named/any parameters just like other http method is defined. Generally path is ended with + * wildcard/match-any character (`/*`, `/download/*` etc). + * + * Example: `e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` */ - genZshCompletionFile(filename: string): void + routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Echo { /** - * GenZshCompletion generates zsh completion file including descriptions - * and writes it to the passed writer. + * Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler + * in the router with optional route-level middleware. + * + * Note: this method only adds specific set of supported HTTP methods as handler and is not true + * "catch-any-arbitrary-method" way of matching requests. */ - genZshCompletion(w: io.Writer): void + any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Command { + interface Echo { /** - * GenZshCompletionFileNoDesc generates zsh completion file without descriptions. + * Match registers a new route for multiple HTTP methods and path with matching + * handler in the router with optional route-level middleware. Panics on error. */ - genZshCompletionFileNoDesc(filename: string): void + match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Command { + interface Echo { /** - * GenZshCompletionNoDesc generates zsh completion file without descriptions - * and writes it to the passed writer. + * Static registers a new route with path prefix to serve static files from the provided root directory. */ - genZshCompletionNoDesc(w: io.Writer): void + static(pathPrefix: string, fsRoot: string): RouteInfo } - interface Command { + interface Echo { /** - * MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was - * not consistent with Bash completion. It has therefore been disabled. - * Instead, when no other completion is specified, file completion is done by - * default for every argument. One can disable file completion on a per-argument - * basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. - * To achieve file extension filtering, one can use ValidArgsFunction and - * ShellCompDirectiveFilterFileExt. + * StaticFS registers a new route with path prefix to serve static files from the provided file system. * - * Deprecated + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - markZshCompPositionalArgumentFile(argPosition: number, ...patterns: string[]): void + staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo } - interface Command { + interface Echo { /** - * MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore - * been disabled. - * To achieve the same behavior across all shells, one can use - * ValidArgs (for the first argument only) or ValidArgsFunction for - * any argument (can include the first one also). - * - * Deprecated + * FileFS registers a new route with path to serve file from the provided file system. */ - markZshCompPositionalArgumentWords(argPosition: number, ...words: string[]): void - } -} - -namespace auth { - /** - * AuthUser defines a standardized oauth2 user data structure. - */ - interface AuthUser { - id: string - name: string - username: string - email: string - avatarUrl: string - accessToken: string - refreshToken: string - expiry: types.DateTime - rawUser: _TygojaDict + fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo } - /** - * Provider defines a common interface for an OAuth2 client. - */ - interface Provider { - [key:string]: any; + interface Echo { /** - * Context returns the context associated with the provider (if any). + * File registers a new route with path to serve a static file with optional route-level middleware. Panics on error. */ - context(): context.Context + file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo + } + interface Echo { /** - * SetContext assigns the specified context to the current provider. + * AddRoute registers a new Route with default host Router */ - setContext(ctx: context.Context): void + addRoute(route: Routable): RouteInfo + } + interface Echo { /** - * PKCE indicates whether the provider can use the PKCE flow. + * Add registers a new route for an HTTP method and path with matching handler + * in the router with optional route-level middleware. */ - pkce(): boolean + add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo + } + interface Echo { /** - * SetPKCE toggles the state whether the provider can use the PKCE flow or not. + * Host creates a new router group for the provided host and optional host-level middleware. */ - setPKCE(enable: boolean): void + host(name: string, ...m: MiddlewareFunc[]): (Group) + } + interface Echo { /** - * DisplayName usually returns provider name as it is officially written - * and it could be used directly in the UI. + * Group creates a new router group with prefix and optional group-level middleware. */ - displayName(): string + group(prefix: string, ...m: MiddlewareFunc[]): (Group) + } + interface Echo { /** - * SetDisplayName sets the provider's display name. + * AcquireContext returns an empty `Context` instance from the pool. + * You must return the context by calling `ReleaseContext()`. */ - setDisplayName(displayName: string): void + acquireContext(): Context + } + interface Echo { /** - * Scopes returns the provider access permissions that will be requested. + * ReleaseContext returns the `Context` instance back to the pool. + * You must call it after `AcquireContext()`. */ - scopes(): Array + releaseContext(c: Context): void + } + interface Echo { /** - * SetScopes sets the provider access permissions that will be requested later. + * ServeHTTP implements `http.Handler` interface, which serves HTTP requests. */ - setScopes(scopes: Array): void - /** + serveHTTP(w: http.ResponseWriter, r: http.Request): void + } + interface Echo { + /** + * Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by + * sending os.Interrupt signal with `ctrl+c`. + * + * Note: this method is created for use in examples/demos and is deliberately simple without providing configuration + * options. + * + * In need of customization use: + * + * ``` + * sc := echo.StartConfig{Address: ":8080"} + * if err := sc.Start(e); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * ``` + * + * // or standard library `http.Server` + * + * ``` + * s := http.Server{Addr: ":8080", Handler: e} + * if err := s.ListenAndServe(); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * ``` + */ + start(address: string): void + } +} + +namespace auth { + /** + * AuthUser defines a standardized oauth2 user data structure. + */ + interface AuthUser { + id: string + name: string + username: string + email: string + avatarUrl: string + accessToken: string + refreshToken: string + expiry: types.DateTime + rawUser: _TygojaDict + } + /** + * Provider defines a common interface for an OAuth2 client. + */ + interface Provider { + [key:string]: any; + /** + * Context returns the context associated with the provider (if any). + */ + context(): context.Context + /** + * SetContext assigns the specified context to the current provider. + */ + setContext(ctx: context.Context): void + /** + * PKCE indicates whether the provider can use the PKCE flow. + */ + pkce(): boolean + /** + * SetPKCE toggles the state whether the provider can use the PKCE flow or not. + */ + setPKCE(enable: boolean): void + /** + * DisplayName usually returns provider name as it is officially written + * and it could be used directly in the UI. + */ + displayName(): string + /** + * SetDisplayName sets the provider's display name. + */ + setDisplayName(displayName: string): void + /** + * Scopes returns the provider access permissions that will be requested. + */ + scopes(): Array + /** + * SetScopes sets the provider access permissions that will be requested later. + */ + setScopes(scopes: Array): void + /** * ClientId returns the provider client's app ID. */ clientId(): string @@ -14577,4277 +20475,20875 @@ namespace migrate { } /** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. */ -namespace io { - /** - * ReadCloser is the interface that groups the basic Read and Close methods. - */ - interface ReadCloser { - [key:string]: any; +namespace cobra { + interface Command { + /** + * GenBashCompletion generates bash completion file and writes to the passed writer. + */ + genBashCompletion(w: io.Writer): void } - /** - * WriteCloser is the interface that groups the basic Write and Close methods. - */ - interface WriteCloser { - [key:string]: any; + interface Command { + /** + * GenBashCompletionFile generates bash completion file. + */ + genBashCompletionFile(filename: string): void } -} - -/** - * Package syscall contains an interface to the low-level operating system - * primitives. The details vary depending on the underlying system, and - * by default, godoc will display the syscall documentation for the current - * system. If you want godoc to display syscall documentation for another - * system, set $GOOS and $GOARCH to the desired system. For example, if - * you want to view documentation for freebsd/arm on linux/amd64, set $GOOS - * to freebsd and $GOARCH to arm. - * The primary use of syscall is inside other packages that provide a more - * portable interface to the system, such as "os", "time" and "net". Use - * those packages rather than this one if you can. - * For details of the functions and data types in this package consult - * the manuals for the appropriate operating system. - * These calls return err == nil to indicate success; otherwise - * err is an operating system error describing the failure. - * On most systems, that error has type syscall.Errno. - * - * NOTE: Most of the functions, types, and constants defined in - * this package are also available in the [golang.org/x/sys] package. - * That package has more system call support than this one, - * and most new code should prefer that package where possible. - * See https://golang.org/s/go1.4-syscall for more information. - */ -namespace syscall { - /** - * SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in Linux. - * See user_namespaces(7). - */ - interface SysProcIDMap { - containerID: number // Container ID. - hostID: number // Host ID. - size: number // Size. + interface Command { + /** + * GenBashCompletionFileV2 generates Bash completion version 2. + */ + genBashCompletionFileV2(filename: string, includeDesc: boolean): void } - // @ts-ignore - import errorspkg = errors - /** - * Credential holds user and group identities to be assumed - * by a child process started by StartProcess. - */ - interface Credential { - uid: number // User ID. - gid: number // Group ID. - groups: Array // Supplementary group IDs. - noSetGroups: boolean // If true, don't set supplementary groups + interface Command { + /** + * GenBashCompletionV2 generates Bash completion file version 2 + * and writes it to the passed writer. + */ + genBashCompletionV2(w: io.Writer, includeDesc: boolean): void } + // @ts-ignore + import flag = pflag /** - * A Signal is a number describing a process signal. - * It implements the os.Signal interface. + * Command is just that, a command for your application. + * E.g. 'go run ...' - 'run' is the command. Cobra requires + * you to define the usage and description as part of your command + * definition to ensure usability. */ - interface Signal extends Number{} - interface Signal { - signal(): void - } - interface Signal { - string(): string - } -} - -/** - * Package time provides functionality for measuring and displaying time. - * - * The calendrical calculations always assume a Gregorian calendar, with - * no leap seconds. - * - * # Monotonic Clocks - * - * Operating systems provide both a “wall clock,” which is subject to - * changes for clock synchronization, and a “monotonic clock,” which is - * not. The general rule is that the wall clock is for telling time and - * the monotonic clock is for measuring time. Rather than split the API, - * in this package the Time returned by time.Now contains both a wall - * clock reading and a monotonic clock reading; later time-telling - * operations use the wall clock reading, but later time-measuring - * operations, specifically comparisons and subtractions, use the - * monotonic clock reading. - * - * For example, this code always computes a positive elapsed time of - * approximately 20 milliseconds, even if the wall clock is changed during - * the operation being timed: - * - * ``` - * start := time.Now() - * ... operation that takes 20 milliseconds ... - * t := time.Now() - * elapsed := t.Sub(start) - * ``` - * - * Other idioms, such as time.Since(start), time.Until(deadline), and - * time.Now().Before(deadline), are similarly robust against wall clock - * resets. - * - * The rest of this section gives the precise details of how operations - * use monotonic clocks, but understanding those details is not required - * to use this package. - * - * The Time returned by time.Now contains a monotonic clock reading. - * If Time t has a monotonic clock reading, t.Add adds the same duration to - * both the wall clock and monotonic clock readings to compute the result. - * Because t.AddDate(y, m, d), t.Round(d), and t.Truncate(d) are wall time - * computations, they always strip any monotonic clock reading from their results. - * Because t.In, t.Local, and t.UTC are used for their effect on the interpretation - * of the wall time, they also strip any monotonic clock reading from their results. - * The canonical way to strip a monotonic clock reading is to use t = t.Round(0). - * - * If Times t and u both contain monotonic clock readings, the operations - * t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out - * using the monotonic clock readings alone, ignoring the wall clock - * readings. If either t or u contains no monotonic clock reading, these - * operations fall back to using the wall clock readings. - * - * On some systems the monotonic clock will stop if the computer goes to sleep. - * On such a system, t.Sub(u) may not accurately reflect the actual - * time that passed between t and u. - * - * Because the monotonic clock reading has no meaning outside - * the current process, the serialized forms generated by t.GobEncode, - * t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic - * clock reading, and t.Format provides no format for it. Similarly, the - * constructors time.Date, time.Parse, time.ParseInLocation, and time.Unix, - * as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. - * t.UnmarshalJSON, and t.UnmarshalText always create times with - * no monotonic clock reading. - * - * The monotonic clock reading exists only in Time values. It is not - * a part of Duration values or the Unix times returned by t.Unix and - * friends. - * - * Note that the Go == operator compares not just the time instant but - * also the Location and the monotonic clock reading. See the - * documentation for the Time type for a discussion of equality - * testing for Time values. - * - * For debugging, the result of t.String does include the monotonic - * clock reading if present. If t != u because of different monotonic clock readings, - * that difference will be visible when printing t.String() and u.String(). - * - * # Timer Resolution - * - * Timer resolution varies depending on the Go runtime, the operating system - * and the underlying hardware. - * On Unix, the resolution is approximately 1ms. - * On Windows, the default resolution is approximately 16ms, but - * a higher resolution may be requested using [golang.org/x/sys/windows.TimeBeginPeriod]. - */ -namespace time { - /** - * A Month specifies a month of the year (January = 1, ...). - */ - interface Month extends Number{} - interface Month { + interface Command { /** - * String returns the English name of the month ("January", "February", ...). + * Use is the one-line usage message. + * Recommended syntax is as follows: + * ``` + * [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. + * ... indicates that you can specify multiple values for the previous argument. + * | indicates mutually exclusive information. You can use the argument to the left of the separator or the + * argument to the right of the separator. You cannot use both arguments in a single use of the command. + * { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are + * optional, they are enclosed in brackets ([ ]). + * ``` + * Example: add [-F file | -D dir]... [-f format] profile */ - string(): string - } - /** - * A Weekday specifies a day of the week (Sunday = 0, ...). - */ - interface Weekday extends Number{} - interface Weekday { + use: string /** - * String returns the English name of the day ("Sunday", "Monday", ...). + * Aliases is an array of aliases that can be used instead of the first word in Use. */ - string(): string - } - /** - * A Location maps time instants to the zone in use at that time. - * Typically, the Location represents the collection of time offsets - * in use in a geographical area. For many Locations the time offset varies - * depending on whether daylight savings time is in use at the time instant. - * - * Location is used to provide a time zone in a printed Time value and for - * calculations involving intervals that may cross daylight savings time - * boundaries. - */ - interface Location { - } - interface Location { + aliases: Array /** - * String returns a descriptive name for the time zone information, - * corresponding to the name argument to LoadLocation or FixedZone. + * SuggestFor is an array of command names for which this command will be suggested - + * similar to aliases but only suggests. */ - string(): string - } -} - -/** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. - * - * See the [testing/fstest] package for support with testing - * implementations of file systems. - */ -namespace fs { -} - -/** - * Package context defines the Context type, which carries deadlines, - * cancellation signals, and other request-scoped values across API boundaries - * and between processes. - * - * Incoming requests to a server should create a [Context], and outgoing - * calls to servers should accept a Context. The chain of function - * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using [WithCancel], [WithDeadline], - * [WithTimeout], or [WithValue]. When a Context is canceled, all - * Contexts derived from it are also canceled. - * - * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a - * Context (the parent) and return a derived Context (the child) and a - * [CancelFunc]. Calling the CancelFunc cancels the child and its - * children, removes the parent's reference to the child, and stops - * any associated timers. Failing to call the CancelFunc leaks the - * child and its children until the parent is canceled or the timer - * fires. The go vet tool checks that CancelFuncs are used on all - * control-flow paths. - * - * The [WithCancelCause] function returns a [CancelCauseFunc], which - * takes an error and records it as the cancellation cause. Calling - * [Cause] on the canceled context or any of its children retrieves - * the cause. If no cause is specified, Cause(ctx) returns the same - * value as ctx.Err(). - * - * Programs that use Contexts should follow these rules to keep interfaces - * consistent across packages and enable static analysis tools to check context - * propagation: - * - * Do not store Contexts inside a struct type; instead, pass a Context - * explicitly to each function that needs it. The Context should be the first - * parameter, typically named ctx: - * - * ``` - * func DoSomething(ctx context.Context, arg Arg) error { - * // ... use ctx ... - * } - * ``` - * - * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] - * if you are unsure about which Context to use. - * - * Use context Values only for request-scoped data that transits processes and - * APIs, not for passing optional parameters to functions. - * - * The same Context may be passed to functions running in different goroutines; - * Contexts are safe for simultaneous use by multiple goroutines. - * - * See https://blog.golang.org/context for example code for a server that uses - * Contexts. - */ -namespace context { -} - -/** - * Package url parses URLs and implements query escaping. - */ -namespace url { - /** - * A URL represents a parsed URL (technically, a URI reference). - * - * The general form represented is: - * - * ``` - * [scheme:][//[userinfo@]host][/]path[?query][#fragment] - * ``` - * - * URLs that do not start with a slash after the scheme are interpreted as: - * - * ``` - * scheme:opaque[?query][#fragment] - * ``` - * - * The Host field contains the host and port subcomponents of the URL. - * When the port is present, it is separated from the host with a colon. - * When the host is an IPv6 address, it must be enclosed in square brackets: - * "[fe80::1]:80". The [net.JoinHostPort] function combines a host and port - * into a string suitable for the Host field, adding square brackets to - * the host when necessary. - * - * Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. - * A consequence is that it is impossible to tell which slashes in the Path were - * slashes in the raw URL and which were %2f. This distinction is rarely important, - * but when it is, the code should use the [URL.EscapedPath] method, which preserves - * the original encoding of Path. - * - * The RawPath field is an optional field which is only set when the default - * encoding of Path is different from the escaped path. See the EscapedPath method - * for more details. - * - * URL's String method uses the EscapedPath method to obtain the path. - */ - interface URL { - scheme: string - opaque: string // encoded opaque data - user?: Userinfo // username and password information - host: string // host or host:port (see Hostname and Port methods) - path: string // path (relative paths may omit leading slash) - rawPath: string // encoded path hint (see EscapedPath method) - omitHost: boolean // do not emit empty host (authority) - forceQuery: boolean // append a query ('?') even if RawQuery is empty - rawQuery: string // encoded query values, without '?' - fragment: string // fragment for references, without '#' - rawFragment: string // encoded fragment hint (see EscapedFragment method) - } - interface URL { + suggestFor: Array /** - * EscapedPath returns the escaped form of u.Path. - * In general there are multiple possible escaped forms of any path. - * EscapedPath returns u.RawPath when it is a valid escaping of u.Path. - * Otherwise EscapedPath ignores u.RawPath and computes an escaped - * form on its own. - * The [URL.String] and [URL.RequestURI] methods use EscapedPath to construct - * their results. - * In general, code should call EscapedPath instead of - * reading u.RawPath directly. + * Short is the short description shown in the 'help' output. */ - escapedPath(): string - } - interface URL { + short: string /** - * EscapedFragment returns the escaped form of u.Fragment. - * In general there are multiple possible escaped forms of any fragment. - * EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. - * Otherwise EscapedFragment ignores u.RawFragment and computes an escaped - * form on its own. - * The [URL.String] method uses EscapedFragment to construct its result. - * In general, code should call EscapedFragment instead of - * reading u.RawFragment directly. + * The group id under which this subcommand is grouped in the 'help' output of its parent. */ - escapedFragment(): string - } - interface URL { + groupID: string /** - * String reassembles the [URL] into a valid URL string. - * The general form of the result is one of: - * - * ``` - * scheme:opaque?query#fragment - * scheme://userinfo@host/path?query#fragment - * ``` - * - * If u.Opaque is non-empty, String uses the first form; - * otherwise it uses the second form. - * Any non-ASCII characters in host are escaped. - * To obtain the path, String uses u.EscapedPath(). - * - * In the second form, the following rules apply: - * ``` - * - if u.Scheme is empty, scheme: is omitted. - * - if u.User is nil, userinfo@ is omitted. - * - if u.Host is empty, host/ is omitted. - * - if u.Scheme and u.Host are empty and u.User is nil, - * the entire scheme://userinfo@host/ is omitted. - * - if u.Host is non-empty and u.Path begins with a /, - * the form host/path does not add its own /. - * - if u.RawQuery is empty, ?query is omitted. - * - if u.Fragment is empty, #fragment is omitted. - * ``` + * Long is the long message shown in the 'help ' output. */ - string(): string - } - interface URL { + long: string /** - * Redacted is like [URL.String] but replaces any password with "xxxxx". - * Only the password in u.User is redacted. + * Example is examples of how to use the command. */ - redacted(): string - } - /** - * Values maps a string key to a list of values. - * It is typically used for query parameters and form values. - * Unlike in the http.Header map, the keys in a Values map - * are case-sensitive. - */ - interface Values extends _TygojaDict{} - interface Values { + example: string /** - * Get gets the first value associated with the given key. - * If there are no values associated with the key, Get returns - * the empty string. To access multiple values, use the map - * directly. + * ValidArgs is list of all valid non-flag arguments that are accepted in shell completions */ - get(key: string): string - } - interface Values { + validArgs: Array /** - * Set sets the key to value. It replaces any existing - * values. + * ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. + * It is a dynamic version of using ValidArgs. + * Only one of ValidArgs and ValidArgsFunction can be used for a command. */ - set(key: string, value: string): void - } - interface Values { + validArgsFunction: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective] /** - * Add adds the value to key. It appends to any existing - * values associated with key. + * Expected arguments */ - add(key: string, value: string): void - } - interface Values { + args: PositionalArgs /** - * Del deletes the values associated with key. + * ArgAliases is List of aliases for ValidArgs. + * These are not suggested to the user in the shell completion, + * but accepted if entered manually. */ - del(key: string): void + argAliases: Array + /** + * BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. + * For portability with other shells, it is recommended to instead use ValidArgsFunction + */ + bashCompletionFunction: string + /** + * Deprecated defines, if this command is deprecated and should print this string when used. + */ + deprecated: string + /** + * Annotations are key/value pairs that can be used by applications to identify or + * group commands or set special options. + */ + annotations: _TygojaDict + /** + * Version defines the version for this command. If this value is non-empty and the command does not + * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + * will print content of the "Version" variable. A shorthand "v" flag will also be added if the + * command does not define one. + */ + version: string + /** + * The *Run functions are executed in the following order: + * ``` + * * PersistentPreRun() + * * PreRun() + * * Run() + * * PostRun() + * * PersistentPostRun() + * ``` + * All functions get the same args, the arguments after the command name. + * The *PreRun and *PostRun functions will only be executed if the Run function of the current + * command has been declared. + * + * PersistentPreRun: children of this command will inherit and execute. + */ + persistentPreRun: (cmd: Command, args: Array) => void + /** + * PersistentPreRunE: PersistentPreRun but returns an error. + */ + persistentPreRunE: (cmd: Command, args: Array) => void + /** + * PreRun: children of this command will not inherit. + */ + preRun: (cmd: Command, args: Array) => void + /** + * PreRunE: PreRun but returns an error. + */ + preRunE: (cmd: Command, args: Array) => void + /** + * Run: Typically the actual work function. Most commands will only implement this. + */ + run: (cmd: Command, args: Array) => void + /** + * RunE: Run but returns an error. + */ + runE: (cmd: Command, args: Array) => void + /** + * PostRun: run after the Run command. + */ + postRun: (cmd: Command, args: Array) => void + /** + * PostRunE: PostRun but returns an error. + */ + postRunE: (cmd: Command, args: Array) => void + /** + * PersistentPostRun: children of this command will inherit and execute after PostRun. + */ + persistentPostRun: (cmd: Command, args: Array) => void + /** + * PersistentPostRunE: PersistentPostRun but returns an error. + */ + persistentPostRunE: (cmd: Command, args: Array) => void + /** + * FParseErrWhitelist flag parse errors to be ignored + */ + fParseErrWhitelist: FParseErrWhitelist + /** + * CompletionOptions is a set of options to control the handling of shell completion + */ + completionOptions: CompletionOptions + /** + * TraverseChildren parses flags on all parents before executing child command. + */ + traverseChildren: boolean + /** + * Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + */ + hidden: boolean + /** + * SilenceErrors is an option to quiet errors down stream. + */ + silenceErrors: boolean + /** + * SilenceUsage is an option to silence usage when an error occurs. + */ + silenceUsage: boolean + /** + * DisableFlagParsing disables the flag parsing. + * If this is true all flags will be passed to the command as arguments. + */ + disableFlagParsing: boolean + /** + * DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + * will be printed by generating docs for this command. + */ + disableAutoGenTag: boolean + /** + * DisableFlagsInUseLine will disable the addition of [flags] to the usage + * line of a command when printing help or generating docs + */ + disableFlagsInUseLine: boolean + /** + * DisableSuggestions disables the suggestions based on Levenshtein distance + * that go along with 'unknown command' messages. + */ + disableSuggestions: boolean + /** + * SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + * Must be > 0. + */ + suggestionsMinimumDistance: number } - interface Values { + interface Command { /** - * Has checks whether a given key is set. + * Context returns underlying command context. If command was executed + * with ExecuteContext or the context was set with SetContext, the + * previously set context will be returned. Otherwise, nil is returned. + * + * Notice that a call to Execute and ExecuteC will replace a nil context of + * a command with a context.Background, so a background context will be + * returned by Context after one of these functions has been called. */ - has(key: string): boolean + context(): context.Context } - interface Values { + interface Command { /** - * Encode encodes the values into “URL encoded” form - * ("bar=baz&foo=quux") sorted by key. + * SetContext sets context for the command. This context will be overwritten by + * Command.ExecuteContext or Command.ExecuteContextC. */ - encode(): string + setContext(ctx: context.Context): void } - interface URL { + interface Command { /** - * IsAbs reports whether the [URL] is absolute. - * Absolute means that it has a non-empty scheme. + * SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden + * particularly useful when testing. */ - isAbs(): boolean + setArgs(a: Array): void } - interface URL { + interface Command { /** - * Parse parses a [URL] in the context of the receiver. The provided URL - * may be relative or absolute. Parse returns nil, err on parse - * failure, otherwise its return value is the same as [URL.ResolveReference]. + * SetOutput sets the destination for usage and error messages. + * If output is nil, os.Stderr is used. + * Deprecated: Use SetOut and/or SetErr instead */ - parse(ref: string): (URL) + setOutput(output: io.Writer): void } - interface URL { + interface Command { /** - * ResolveReference resolves a URI reference to an absolute URI from - * an absolute base URI u, per RFC 3986 Section 5.2. The URI reference - * may be relative or absolute. ResolveReference always returns a new - * [URL] instance, even if the returned URL is identical to either the - * base or reference. If ref is an absolute URL, then ResolveReference - * ignores base and returns a copy of ref. + * SetOut sets the destination for usage messages. + * If newOut is nil, os.Stdout is used. */ - resolveReference(ref: URL): (URL) + setOut(newOut: io.Writer): void } - interface URL { + interface Command { /** - * Query parses RawQuery and returns the corresponding values. - * It silently discards malformed value pairs. - * To check errors use [ParseQuery]. + * SetErr sets the destination for error messages. + * If newErr is nil, os.Stderr is used. */ - query(): Values + setErr(newErr: io.Writer): void } - interface URL { + interface Command { /** - * RequestURI returns the encoded path?query or opaque?query - * string that would be used in an HTTP request for u. + * SetIn sets the source for input data + * If newIn is nil, os.Stdin is used. */ - requestURI(): string + setIn(newIn: io.Reader): void } - interface URL { + interface Command { /** - * Hostname returns u.Host, stripping any valid port number if present. - * - * If the result is enclosed in square brackets, as literal IPv6 addresses are, - * the square brackets are removed from the result. + * SetUsageFunc sets usage function. Usage can be defined by application. */ - hostname(): string + setUsageFunc(f: (_arg0: Command) => void): void } - interface URL { + interface Command { /** - * Port returns the port part of u.Host, without the leading colon. - * - * If u.Host doesn't contain a valid numeric port, Port returns an empty string. + * SetUsageTemplate sets usage template. Can be defined by Application. */ - port(): string + setUsageTemplate(s: string): void } - interface URL { - marshalBinary(): string|Array + interface Command { + /** + * SetFlagErrorFunc sets a function to generate an error when flag parsing + * fails. + */ + setFlagErrorFunc(f: (_arg0: Command, _arg1: Error) => void): void } - interface URL { - unmarshalBinary(text: string|Array): void + interface Command { + /** + * SetHelpFunc sets help function. Can be defined by Application. + */ + setHelpFunc(f: (_arg0: Command, _arg1: Array) => void): void } - interface URL { + interface Command { /** - * JoinPath returns a new [URL] with the provided path elements joined to - * any existing path and the resulting path cleaned of any ./ or ../ elements. - * Any sequences of multiple / characters will be reduced to a single /. + * SetHelpCommand sets help command. */ - joinPath(...elem: string[]): (URL) + setHelpCommand(cmd: Command): void } -} - -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * By default the pure Go resolver is used, because a blocked DNS request consumes - * only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement, and when the name being looked up ends in .local - * or is an mDNS name. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. - * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. - */ -namespace net { - /** - * Conn is a generic stream-oriented network connection. - * - * Multiple goroutines may invoke methods on a Conn simultaneously. - */ - interface Conn { - [key:string]: any; + interface Command { /** - * Read reads data from the connection. - * Read can be made to time out and return an error after a fixed - * time limit; see SetDeadline and SetReadDeadline. + * SetHelpCommandGroupID sets the group id of the help command. */ - read(b: string|Array): number + setHelpCommandGroupID(groupID: string): void + } + interface Command { /** - * Write writes data to the connection. - * Write can be made to time out and return an error after a fixed - * time limit; see SetDeadline and SetWriteDeadline. + * SetCompletionCommandGroupID sets the group id of the completion command. */ - write(b: string|Array): number + setCompletionCommandGroupID(groupID: string): void + } + interface Command { /** - * Close closes the connection. - * Any blocked Read or Write operations will be unblocked and return errors. + * SetHelpTemplate sets help template to be used. Application can use it to set custom template. */ - close(): void + setHelpTemplate(s: string): void + } + interface Command { /** - * LocalAddr returns the local network address, if known. + * SetVersionTemplate sets version template to be used. Application can use it to set custom template. */ - localAddr(): Addr + setVersionTemplate(s: string): void + } + interface Command { /** - * RemoteAddr returns the remote network address, if known. + * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. */ - remoteAddr(): Addr + setErrPrefix(s: string): void + } + interface Command { /** - * SetDeadline sets the read and write deadlines associated - * with the connection. It is equivalent to calling both - * SetReadDeadline and SetWriteDeadline. - * - * A deadline is an absolute time after which I/O operations - * fail instead of blocking. The deadline applies to all future - * and pending I/O, not just the immediately following call to - * Read or Write. After a deadline has been exceeded, the - * connection can be refreshed by setting a deadline in the future. - * - * If the deadline is exceeded a call to Read or Write or to other - * I/O methods will return an error that wraps os.ErrDeadlineExceeded. - * This can be tested using errors.Is(err, os.ErrDeadlineExceeded). - * The error's Timeout method will return true, but note that there - * are other possible errors for which the Timeout method will - * return true even if the deadline has not been exceeded. - * - * An idle timeout can be implemented by repeatedly extending - * the deadline after successful Read or Write calls. - * - * A zero value for t means I/O operations will not time out. + * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. + * The user should not have a cyclic dependency on commands. */ - setDeadline(t: time.Time): void + setGlobalNormalizationFunc(n: (f: any, name: string) => any): void + } + interface Command { /** - * SetReadDeadline sets the deadline for future Read calls - * and any currently-blocked Read call. - * A zero value for t means Read will not time out. + * OutOrStdout returns output to stdout. */ - setReadDeadline(t: time.Time): void + outOrStdout(): io.Writer + } + interface Command { /** - * SetWriteDeadline sets the deadline for future Write calls - * and any currently-blocked Write call. - * Even if write times out, it may return n > 0, indicating that - * some of the data was successfully written. - * A zero value for t means Write will not time out. + * OutOrStderr returns output to stderr */ - setWriteDeadline(t: time.Time): void + outOrStderr(): io.Writer } - /** - * A Listener is a generic network listener for stream-oriented protocols. - * - * Multiple goroutines may invoke methods on a Listener simultaneously. - */ - interface Listener { - [key:string]: any; + interface Command { /** - * Accept waits for and returns the next connection to the listener. + * ErrOrStderr returns output to stderr */ - accept(): Conn + errOrStderr(): io.Writer + } + interface Command { /** - * Close closes the listener. - * Any blocked Accept operations will be unblocked and return errors. + * InOrStdin returns input to stdin */ - close(): void + inOrStdin(): io.Reader + } + interface Command { /** - * Addr returns the listener's network address. + * UsageFunc returns either the function set by SetUsageFunc for this command + * or a parent, or it returns a default usage function. */ - addr(): Addr + usageFunc(): (_arg0: Command) => void } -} - -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * IsolationLevel is the transaction isolation level used in [TxOptions]. - */ - interface IsolationLevel extends Number{} - interface IsolationLevel { + interface Command { /** - * String returns the name of the transaction isolation level. + * Usage puts out the usage for the command. + * Used when a user provides invalid input. + * Can be defined by user by overriding UsageFunc. */ - string(): string + usage(): void } - /** - * DBStats contains database statistics. - */ - interface DBStats { - maxOpenConnections: number // Maximum number of open connections to the database. + interface Command { /** - * Pool Status + * HelpFunc returns either the function set by SetHelpFunc for this command + * or a parent, or it returns a function with default help behavior. */ - openConnections: number // The number of established connections both in use and idle. - inUse: number // The number of connections currently in use. - idle: number // The number of idle connections. + helpFunc(): (_arg0: Command, _arg1: Array) => void + } + interface Command { /** - * Counters + * Help puts out the help for the command. + * Used when a user calls help [command]. + * Can be defined by user by overriding HelpFunc. */ - waitCount: number // The total number of connections waited for. - waitDuration: time.Duration // The total time blocked waiting for a new connection. - maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. - maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. - maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. + help(): void } - /** - * Conn represents a single database connection rather than a pool of database - * connections. Prefer running queries from [DB] unless there is a specific - * need for a continuous single database connection. - * - * A Conn must call [Conn.Close] to return the connection to the database pool - * and may do so concurrently with a running query. - * - * After a call to [Conn.Close], all operations on the - * connection fail with [ErrConnDone]. - */ - interface Conn { - } - interface Conn { + interface Command { /** - * PingContext verifies the connection to the database is still alive. + * UsageString returns usage string. */ - pingContext(ctx: context.Context): void + usageString(): string } - interface Conn { + interface Command { /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. + * FlagErrorFunc returns either the function set by SetFlagErrorFunc for this + * command or a parent, or it returns a function which returns the original + * error. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result + flagErrorFunc(): (_arg0: Command, _arg1: Error) => void } - interface Conn { + interface Command { /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. + * UsagePadding return padding for the usage. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + usagePadding(): number } - interface Conn { + interface Command { /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * the [*Row.Scan] method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * CommandPathPadding return padding for the command path. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + commandPathPadding(): number } - interface Conn { + interface Command { /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. + * NamePadding returns padding for the name. */ - prepareContext(ctx: context.Context, query: string): (Stmt) + namePadding(): number } - interface Conn { + interface Command { /** - * Raw executes f exposing the underlying driver connection for the - * duration of f. The driverConn must not be used outside of f. - * - * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable - * until [Conn.Close] is called. + * UsageTemplate returns usage template for the command. */ - raw(f: (driverConn: any) => void): void + usageTemplate(): string } - interface Conn { + interface Command { /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. + * HelpTemplate return help template for the command. */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) + helpTemplate(): string } - interface Conn { + interface Command { /** - * Close returns the connection to the connection pool. - * All operations after a Close will return with [ErrConnDone]. - * Close is safe to call concurrently with other operations and will - * block until all other operations finish. It may be useful to first - * cancel any used context and then call close directly after. + * VersionTemplate return version template for the command. */ - close(): void - } - /** - * ColumnType contains the name and type of a column. - */ - interface ColumnType { + versionTemplate(): string } - interface ColumnType { + interface Command { /** - * Name returns the name or alias of the column. + * ErrPrefix return error message prefix for the command */ - name(): string + errPrefix(): string } - interface ColumnType { + interface Command { /** - * Length returns the column type length for variable length column types such - * as text and binary field types. If the type length is unbounded the value will - * be [math.MaxInt64] (any database limits will still apply). - * If the column type is not variable length, such as an int, or if not supported - * by the driver ok is false. + * Find the target command given the args and command tree + * Meant to be run on the highest node. Only searches down. */ - length(): [number, boolean] + find(args: Array): [(Command), Array] } - interface ColumnType { + interface Command { /** - * DecimalSize returns the scale and precision of a decimal type. - * If not applicable or if not supported ok is false. + * Traverse the command tree to find the command, and parse args for + * each parent. */ - decimalSize(): [number, boolean] + traverse(args: Array): [(Command), Array] } - interface ColumnType { + interface Command { /** - * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. - * If a driver does not support this property ScanType will return - * the type of an empty interface. + * SuggestionsFor provides suggestions for the typedName. */ - scanType(): any + suggestionsFor(typedName: string): Array } - interface ColumnType { + interface Command { /** - * Nullable reports whether the column may be null. - * If a driver does not support this property ok will be false. + * VisitParents visits all parents of the command and invokes fn on each parent. */ - nullable(): boolean + visitParents(fn: (_arg0: Command) => void): void } - interface ColumnType { + interface Command { /** - * DatabaseTypeName returns the database system name of the column type. If an empty - * string is returned, then the driver type name is not supported. - * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers - * are not included. - * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - * "INT", and "BIGINT". + * Root finds root command. */ - databaseTypeName(): string + root(): (Command) } - /** - * Row is the result of calling [DB.QueryRow] to select a single row. - */ - interface Row { + interface Command { + /** + * ArgsLenAtDash will return the length of c.Flags().Args at the moment + * when a -- was found during args parsing. + */ + argsLenAtDash(): number } - interface Row { + interface Command { /** - * Scan copies the columns from the matched row into the values - * pointed at by dest. See the documentation on [Rows.Scan] for details. - * If more than one row matches the query, - * Scan uses the first row and discards the rest. If no row matches - * the query, Scan returns [ErrNoRows]. + * ExecuteContext is the same as Execute(), but sets the ctx on the command. + * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs + * functions. */ - scan(...dest: any[]): void + executeContext(ctx: context.Context): void } - interface Row { + interface Command { /** - * Err provides a way for wrapping packages to check for - * query errors without calling [Row.Scan]. - * Err returns the error, if any, that was encountered while running the query. - * If this error is not nil, this error will also be returned from [Row.Scan]. + * Execute uses the args (os.Args[1:] by default) + * and run through the command tree finding appropriate matches + * for commands and then corresponding flags. */ - err(): void + execute(): void } -} - -/** - * Package textproto implements generic support for text-based request/response - * protocols in the style of HTTP, NNTP, and SMTP. - * - * The package provides: - * - * [Error], which represents a numeric error response from - * a server. - * - * [Pipeline], to manage pipelined requests and responses - * in a client. - * - * [Reader], to read numeric response code lines, - * key: value headers, lines wrapped with leading spaces - * on continuation lines, and whole text blocks ending - * with a dot on a line by itself. - * - * [Writer], to write dot-encoded text blocks. - * - * [Conn], a convenient packaging of [Reader], [Writer], and [Pipeline] for use - * with a single network connection. - */ -namespace textproto { - /** - * A MIMEHeader represents a MIME-style header mapping - * keys to sets of values. - */ - interface MIMEHeader extends _TygojaDict{} - interface MIMEHeader { + interface Command { /** - * Add adds the key, value pair to the header. - * It appends to any existing values associated with key. + * ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. + * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs + * functions. */ - add(key: string, value: string): void + executeContextC(ctx: context.Context): (Command) } - interface MIMEHeader { + interface Command { /** - * Set sets the header entries associated with key to - * the single element value. It replaces any existing - * values associated with key. + * ExecuteC executes the command. */ - set(key: string, value: string): void + executeC(): (Command) } - interface MIMEHeader { + interface Command { + validateArgs(args: Array): void + } + interface Command { /** - * Get gets the first value associated with the given key. - * It is case insensitive; [CanonicalMIMEHeaderKey] is used - * to canonicalize the provided key. - * If there are no values associated with the key, Get returns "". - * To use non-canonical keys, access the map directly. + * ValidateRequiredFlags validates all required flags are present and returns an error otherwise */ - get(key: string): string + validateRequiredFlags(): void } - interface MIMEHeader { + interface Command { /** - * Values returns all values associated with the given key. - * It is case insensitive; [CanonicalMIMEHeaderKey] is - * used to canonicalize the provided key. To use non-canonical - * keys, access the map directly. - * The returned slice is not a copy. + * InitDefaultHelpFlag adds default help flag to c. + * It is called automatically by executing the c or by calling help and usage. + * If c already has help flag, it will do nothing. */ - values(key: string): Array + initDefaultHelpFlag(): void } - interface MIMEHeader { + interface Command { /** - * Del deletes the values associated with key. + * InitDefaultVersionFlag adds default version flag to c. + * It is called automatically by executing the c. + * If c already has a version flag, it will do nothing. + * If c.Version is empty, it will do nothing. */ - del(key: string): void + initDefaultVersionFlag(): void } -} - -/** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits - * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. - * - * Reader.NextPart and Reader.NextRawPart limit the number of headers in a - * part to 10000 and Reader.ReadForm limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. - * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. - */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. - */ -namespace multipart { - interface Reader { + interface Command { /** - * ReadForm parses an entire multipart message whose parts have - * a Content-Disposition of "form-data". - * It stores up to maxMemory bytes + 10MB (reserved for non-file parts) - * in memory. File parts which can't be stored in memory will be stored on - * disk in temporary files. - * It returns ErrMessageTooLarge if all non-file parts can't be stored in - * memory. + * InitDefaultHelpCmd adds default help command to c. + * It is called automatically by executing the c or by calling help and usage. + * If c already has help command or c has no subcommands, it will do nothing. */ - readForm(maxMemory: number): (Form) - } - /** - * Form is a parsed multipart form. - * Its File parts are stored either in memory or on disk, - * and are accessible via the *FileHeader's Open method. - * Its Value parts are stored as strings. - * Both are keyed by field name. - */ - interface Form { - value: _TygojaDict - file: _TygojaDict + initDefaultHelpCmd(): void } - interface Form { + interface Command { /** - * RemoveAll removes any temporary files associated with a Form. + * ResetCommands delete parent, subcommand and help command from c. */ - removeAll(): void + resetCommands(): void } - /** - * File is an interface to access the file part of a multipart message. - * Its contents may be either stored in memory or on disk. - * If stored on disk, the File's underlying concrete type will be an *os.File. - */ - interface File { - [key:string]: any; + interface Command { + /** + * Commands returns a sorted slice of child commands. + */ + commands(): Array<(Command | undefined)> } - /** - * Reader is an iterator over parts in a MIME multipart body. - * Reader's underlying parser consumes its input as needed. Seeking - * isn't supported. - */ - interface Reader { + interface Command { + /** + * AddCommand adds one or more commands to this parent command. + */ + addCommand(...cmds: (Command | undefined)[]): void } - interface Reader { + interface Command { /** - * NextPart returns the next part in the multipart or an error. - * When there are no more parts, the error io.EOF is returned. - * - * As a special case, if the "Content-Transfer-Encoding" header - * has a value of "quoted-printable", that header is instead - * hidden and the body is transparently decoded during Read calls. + * Groups returns a slice of child command groups. */ - nextPart(): (Part) + groups(): Array<(Group | undefined)> } - interface Reader { + interface Command { /** - * NextRawPart returns the next part in the multipart or an error. - * When there are no more parts, the error io.EOF is returned. - * - * Unlike NextPart, it does not have special handling for - * "Content-Transfer-Encoding: quoted-printable". + * AllChildCommandsHaveGroup returns if all subcommands are assigned to a group */ - nextRawPart(): (Part) + allChildCommandsHaveGroup(): boolean } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - /** - * A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an - * HTTP response or the Cookie header of an HTTP request. - * - * See https://tools.ietf.org/html/rfc6265 for details. - */ - interface Cookie { - name: string - value: string - path: string // optional - domain: string // optional - expires: time.Time // optional - rawExpires: string // for reading cookies only + interface Command { /** - * MaxAge=0 means no 'Max-Age' attribute specified. - * MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0' - * MaxAge>0 means Max-Age attribute present and given in seconds + * ContainsGroup return if groupID exists in the list of command groups. */ - maxAge: number - secure: boolean - httpOnly: boolean - sameSite: SameSite - raw: string - unparsed: Array // Raw text of unparsed attribute-value pairs + containsGroup(groupID: string): boolean } - interface Cookie { + interface Command { /** - * String returns the serialization of the cookie for use in a [Cookie] - * header (if only Name and Value are set) or a Set-Cookie response - * header (if other fields are set). - * If c is nil or c.Name is invalid, the empty string is returned. + * AddGroup adds one or more command groups to this parent command. */ - string(): string + addGroup(...groups: (Group | undefined)[]): void } - interface Cookie { + interface Command { /** - * Valid reports whether the cookie is valid. + * RemoveCommand removes one or more commands from a parent command. */ - valid(): void + removeCommand(...cmds: (Command | undefined)[]): void } - // @ts-ignore - import mathrand = rand - /** - * A Header represents the key-value pairs in an HTTP header. - * - * The keys should be in canonical form, as returned by - * [CanonicalHeaderKey]. - */ - interface Header extends _TygojaDict{} - interface Header { + interface Command { /** - * Add adds the key, value pair to the header. - * It appends to any existing values associated with key. - * The key is case insensitive; it is canonicalized by - * [CanonicalHeaderKey]. + * Print is a convenience method to Print to the defined output, fallback to Stderr if not set. */ - add(key: string, value: string): void + print(...i: { + }[]): void } - interface Header { + interface Command { /** - * Set sets the header entries associated with key to the - * single element value. It replaces any existing values - * associated with key. The key is case insensitive; it is - * canonicalized by [textproto.CanonicalMIMEHeaderKey]. - * To use non-canonical keys, assign to the map directly. + * Println is a convenience method to Println to the defined output, fallback to Stderr if not set. */ - set(key: string, value: string): void + println(...i: { + }[]): void } - interface Header { + interface Command { /** - * Get gets the first value associated with the given key. If - * there are no values associated with the key, Get returns "". - * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is - * used to canonicalize the provided key. Get assumes that all - * keys are stored in canonical form. To use non-canonical keys, - * access the map directly. + * Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. */ - get(key: string): string + printf(format: string, ...i: { + }[]): void } - interface Header { + interface Command { /** - * Values returns all values associated with the given key. - * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is - * used to canonicalize the provided key. To use non-canonical - * keys, access the map directly. - * The returned slice is not a copy. + * PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. */ - values(key: string): Array + printErr(...i: { + }[]): void } - interface Header { + interface Command { /** - * Del deletes the values associated with key. - * The key is case insensitive; it is canonicalized by - * [CanonicalHeaderKey]. + * PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. */ - del(key: string): void + printErrln(...i: { + }[]): void } - interface Header { + interface Command { /** - * Write writes a header in wire format. + * PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. */ - write(w: io.Writer): void + printErrf(format: string, ...i: { + }[]): void } - interface Header { + interface Command { /** - * Clone returns a copy of h or nil if h is nil. + * CommandPath returns the full path to this command. */ - clone(): Header + commandPath(): string } - interface Header { + interface Command { /** - * WriteSubset writes a header in wire format. - * If exclude is not nil, keys where exclude[key] == true are not written. - * Keys are not canonicalized before checking the exclude map. + * UseLine puts out the full usage for a given command (including parents). */ - writeSubset(w: io.Writer, exclude: _TygojaDict): void + useLine(): string } - // @ts-ignore - import urlpkg = url - /** - * Response represents the response from an HTTP request. - * - * The [Client] and [Transport] return Responses from servers once - * the response headers have been received. The response body - * is streamed on demand as the Body field is read. - */ - interface Response { - status: string // e.g. "200 OK" - statusCode: number // e.g. 200 - proto: string // e.g. "HTTP/1.0" - protoMajor: number // e.g. 1 - protoMinor: number // e.g. 0 + interface Command { /** - * Header maps header keys to values. If the response had multiple - * headers with the same key, they may be concatenated, with comma - * delimiters. (RFC 7230, section 3.2.2 requires that multiple headers - * be semantically equivalent to a comma-delimited sequence.) When - * Header values are duplicated by other fields in this struct (e.g., - * ContentLength, TransferEncoding, Trailer), the field values are - * authoritative. - * - * Keys in the map are canonicalized (see CanonicalHeaderKey). + * DebugFlags used to determine which flags have been assigned to which commands + * and which persist. */ - header: Header + debugFlags(): void + } + interface Command { /** - * Body represents the response body. - * - * The response body is streamed on demand as the Body field - * is read. If the network connection fails or the server - * terminates the response, Body.Read calls return an error. - * - * The http Client and Transport guarantee that Body is always - * non-nil, even on responses without a body or responses with - * a zero-length body. It is the caller's responsibility to - * close Body. The default HTTP client's Transport may not - * reuse HTTP/1.x "keep-alive" TCP connections if the Body is - * not read to completion and closed. - * - * The Body is automatically dechunked if the server replied - * with a "chunked" Transfer-Encoding. - * - * As of Go 1.12, the Body will also implement io.Writer - * on a successful "101 Switching Protocols" response, - * as used by WebSockets and HTTP/2's "h2c" mode. + * Name returns the command's name: the first word in the use line. */ - body: io.ReadCloser + name(): string + } + interface Command { /** - * ContentLength records the length of the associated content. The - * value -1 indicates that the length is unknown. Unless Request.Method - * is "HEAD", values >= 0 indicate that the given number of bytes may - * be read from Body. + * HasAlias determines if a given string is an alias of the command. */ - contentLength: number + hasAlias(s: string): boolean + } + interface Command { /** - * Contains transfer encodings from outer-most to inner-most. Value is - * nil, means that "identity" encoding is used. + * CalledAs returns the command name or alias that was used to invoke + * this command or an empty string if the command has not been called. */ - transferEncoding: Array + calledAs(): string + } + interface Command { /** - * Close records whether the header directed that the connection be - * closed after reading Body. The value is advice for clients: neither - * ReadResponse nor Response.Write ever closes a connection. + * NameAndAliases returns a list of the command name and all aliases */ - close: boolean + nameAndAliases(): string + } + interface Command { /** - * Uncompressed reports whether the response was sent compressed but - * was decompressed by the http package. When true, reading from - * Body yields the uncompressed content instead of the compressed - * content actually set from the server, ContentLength is set to -1, - * and the "Content-Length" and "Content-Encoding" fields are deleted - * from the responseHeader. To get the original response from - * the server, set Transport.DisableCompression to true. + * HasExample determines if the command has example. */ - uncompressed: boolean + hasExample(): boolean + } + interface Command { /** - * Trailer maps trailer keys to values in the same - * format as Header. - * - * The Trailer initially contains only nil values, one for - * each key specified in the server's "Trailer" header - * value. Those values are not added to Header. - * - * Trailer must not be accessed concurrently with Read calls - * on the Body. - * - * After Body.Read has returned io.EOF, Trailer will contain - * any trailer values sent by the server. + * Runnable determines if the command is itself runnable. */ - trailer: Header + runnable(): boolean + } + interface Command { /** - * Request is the request that was sent to obtain this Response. - * Request's Body is nil (having already been consumed). - * This is only populated for Client requests. + * HasSubCommands determines if the command has children commands. */ - request?: Request + hasSubCommands(): boolean + } + interface Command { /** - * TLS contains information about the TLS connection on which the - * response was received. It is nil for unencrypted responses. - * The pointer is shared between responses and should not be - * modified. + * IsAvailableCommand determines if a command is available as a non-help command + * (this includes all non deprecated/hidden commands). */ - tls?: any + isAvailableCommand(): boolean } - interface Response { + interface Command { /** - * Cookies parses and returns the cookies set in the Set-Cookie headers. + * IsAdditionalHelpTopicCommand determines if a command is an additional + * help topic command; additional help topic command is determined by the + * fact that it is NOT runnable/hidden/deprecated, and has no sub commands that + * are runnable/hidden/deprecated. + * Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. */ - cookies(): Array<(Cookie | undefined)> + isAdditionalHelpTopicCommand(): boolean } - interface Response { + interface Command { /** - * Location returns the URL of the response's "Location" header, - * if present. Relative redirects are resolved relative to - * [Response.Request]. [ErrNoLocation] is returned if no - * Location header is present. + * HasHelpSubCommands determines if a command has any available 'help' sub commands + * that need to be shown in the usage/help default template under 'additional help + * topics'. */ - location(): (url.URL) + hasHelpSubCommands(): boolean } - interface Response { + interface Command { /** - * ProtoAtLeast reports whether the HTTP protocol used - * in the response is at least major.minor. + * HasAvailableSubCommands determines if a command has available sub commands that + * need to be shown in the usage/help default template under 'available commands'. */ - protoAtLeast(major: number, minor: number): boolean + hasAvailableSubCommands(): boolean } - interface Response { + interface Command { /** - * Write writes r to w in the HTTP/1.x server response format, - * including the status line, headers, body, and optional trailer. - * - * This method consults the following fields of the response r: - * - * ``` - * StatusCode - * ProtoMajor - * ProtoMinor - * Request.Method - * TransferEncoding - * Trailer - * Body - * ContentLength - * Header, values for non-canonical keys will have unpredictable behavior - * ``` - * - * The Response Body is closed after it is sent. + * HasParent determines if the command is a child command. */ - write(w: io.Writer): void - } - /** - * A Handler responds to an HTTP request. - * - * [Handler.ServeHTTP] should write reply headers and data to the [ResponseWriter] - * and then return. Returning signals that the request is finished; it - * is not valid to use the [ResponseWriter] or read from the - * [Request.Body] after or concurrently with the completion of the - * ServeHTTP call. - * - * Depending on the HTTP client software, HTTP protocol version, and - * any intermediaries between the client and the Go server, it may not - * be possible to read from the [Request.Body] after writing to the - * [ResponseWriter]. Cautious handlers should read the [Request.Body] - * first, and then reply. - * - * Except for reading the body, handlers should not modify the - * provided Request. - * - * If ServeHTTP panics, the server (the caller of ServeHTTP) assumes - * that the effect of the panic was isolated to the active request. - * It recovers the panic, logs a stack trace to the server error log, - * and either closes the network connection or sends an HTTP/2 - * RST_STREAM, depending on the HTTP protocol. To abort a handler so - * the client sees an interrupted response but the server doesn't log - * an error, panic with the value [ErrAbortHandler]. - */ - interface Handler { - [key:string]: any; - serveHTTP(_arg0: ResponseWriter, _arg1: Request): void - } - /** - * A ConnState represents the state of a client connection to a server. - * It's used by the optional [Server.ConnState] hook. - */ - interface ConnState extends Number{} - interface ConnState { - string(): string - } -} - -namespace store { - /** - * Store defines a concurrent safe in memory key-value data store. - */ - interface Store { + hasParent(): boolean } - interface Store { + interface Command { /** - * Reset clears the store and replaces the store data with a - * shallow copy of the provided newData. + * GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. */ - reset(newData: _TygojaDict): void + globalNormalizationFunc(): (f: any, name: string) => any } - interface Store { + interface Command { /** - * Length returns the current number of elements in the store. + * Flags returns the complete FlagSet that applies + * to this command (local and persistent declared here and by all parents). */ - length(): number + flags(): (any) } - interface Store { + interface Command { /** - * RemoveAll removes all the existing store entries. + * LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - removeAll(): void + localNonPersistentFlags(): (any) } - interface Store { + interface Command { /** - * Remove removes a single entry from the store. - * - * Remove does nothing if key doesn't exist in the store. + * LocalFlags returns the local FlagSet specifically set in the current command. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - remove(key: string): void + localFlags(): (any) } - interface Store { + interface Command { /** - * Has checks if element with the specified key exist or not. + * InheritedFlags returns all flags which were inherited from parent commands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - has(key: string): boolean + inheritedFlags(): (any) } - interface Store { + interface Command { /** - * Get returns a single element value from the store. - * - * If key is not set, the zero T value is returned. + * NonInheritedFlags returns all flags which were not inherited from parent commands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - get(key: string): T + nonInheritedFlags(): (any) } - interface Store { + interface Command { /** - * GetAll returns a shallow copy of the current store data. + * PersistentFlags returns the persistent FlagSet specifically set in the current command. */ - getAll(): _TygojaDict + persistentFlags(): (any) } - interface Store { + interface Command { /** - * Set sets (or overwrite if already exist) a new value for key. + * ResetFlags deletes all flags from command. */ - set(key: string, value: T): void + resetFlags(): void } - interface Store { + interface Command { /** - * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. - * - * This method is similar to Set() but **it will skip adding new elements** - * to the store if the store length has reached the specified limit. - * false is returned if maxAllowedElements limit is reached. + * HasFlags checks if the command contains any flags (local plus persistent from the entire structure). */ - setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * DateTime represents a [time.Time] instance in UTC that is wrapped - * and serialized using the app default date layout. - */ - interface DateTime { + hasFlags(): boolean } - interface DateTime { + interface Command { /** - * Time returns the internal [time.Time] instance. + * HasPersistentFlags checks if the command contains persistent flags. */ - time(): time.Time + hasPersistentFlags(): boolean } - interface DateTime { + interface Command { /** - * IsZero checks whether the current DateTime instance has zero time value. + * HasLocalFlags checks if the command has flags specifically declared locally. */ - isZero(): boolean + hasLocalFlags(): boolean } - interface DateTime { + interface Command { /** - * String serializes the current DateTime instance into a formatted - * UTC date string. - * - * The zero value is serialized to an empty string. + * HasInheritedFlags checks if the command has flags inherited from its parent command. */ - string(): string + hasInheritedFlags(): boolean } - interface DateTime { + interface Command { /** - * MarshalJSON implements the [json.Marshaler] interface. + * HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire + * structure) which are not hidden or deprecated. */ - marshalJSON(): string|Array + hasAvailableFlags(): boolean } - interface DateTime { + interface Command { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. */ - unmarshalJSON(b: string|Array): void + hasAvailablePersistentFlags(): boolean } - interface DateTime { + interface Command { /** - * Value implements the [driver.Valuer] interface. + * HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden + * or deprecated. */ - value(): any + hasAvailableLocalFlags(): boolean } - interface DateTime { + interface Command { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current DateTime instance. + * HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are + * not hidden or deprecated. */ - scan(value: any): void + hasAvailableInheritedFlags(): boolean } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * SchemaField defines a single schema field structure. - */ - interface SchemaField { - system: boolean - id: string - name: string - type: string - required: boolean - /** - * Presentable indicates whether the field is suitable for - * visualization purposes (eg. in the Admin UI relation views). - */ - presentable: boolean + interface Command { /** - * Deprecated: This field is no-op and will be removed in future versions. - * Please use the collection.Indexes field to define a unique constraint. + * Flag climbs up the command tree looking for matching flag. */ - unique: boolean - options: any + flag(name: string): (any) } - interface SchemaField { + interface Command { /** - * ColDefinition returns the field db column type definition as string. + * ParseFlags parses persistent flag tree and local flags. */ - colDefinition(): string + parseFlags(args: Array): void } - interface SchemaField { + interface Command { /** - * String serializes and returns the current field as string. + * Parent returns a commands parent command. */ - string(): string + parent(): (Command) } - interface SchemaField { + interface Command { /** - * MarshalJSON implements the [json.Marshaler] interface. + * RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. */ - marshalJSON(): string|Array + registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void } - interface SchemaField { + interface Command { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - * - * The schema field options are auto initialized on success. + * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. */ - unmarshalJSON(data: string|Array): void + getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] } - interface SchemaField { + interface Command { /** - * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. + * InitDefaultCompletionCmd adds a default 'completion' command to c. + * This function will do nothing if any of the following is true: + * 1- the feature has been explicitly disabled by the program, + * 2- c has no subcommands (to avoid creating one), + * 3- c already has a 'completion' command provided by the program. */ - validate(): void + initDefaultCompletionCmd(): void } - interface SchemaField { + interface Command { /** - * InitOptions initializes the current field options based on its type. - * - * Returns error on unknown field type. + * GenFishCompletion generates fish completion file and writes to the passed writer. */ - initOptions(): void + genFishCompletion(w: io.Writer, includeDesc: boolean): void } - interface SchemaField { + interface Command { /** - * PrepareValue returns normalized and properly formatted field value. + * GenFishCompletionFile generates fish completion file. */ - prepareValue(value: any): any + genFishCompletionFile(filename: string, includeDesc: boolean): void } - interface SchemaField { + interface Command { /** - * PrepareValueWithModifier returns normalized and properly formatted field value - * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). + * MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors + * if the command is invoked with a subset (but not all) of the given flags. */ - prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any + markFlagsRequiredTogether(...flagNames: string[]): void } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - /** - * Model defines an interface with common methods that all db models should have. - */ - interface Model { - [key:string]: any; - tableName(): string - isNew(): boolean - markAsNew(): void - markAsNotNew(): void - hasId(): boolean - getId(): string - setId(id: string): void - getCreated(): types.DateTime - getUpdated(): types.DateTime - refreshId(): void - refreshCreated(): void - refreshUpdated(): void + interface Command { + /** + * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors + * if the command is invoked without at least one flag from the given set of flags. + */ + markFlagsOneRequired(...flagNames: string[]): void } - /** - * BaseModel defines common fields and methods used by all other models. - */ - interface BaseModel { - id: string - created: types.DateTime - updated: types.DateTime + interface Command { + /** + * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors + * if the command is invoked with more than one flag from the given set of flags. + */ + markFlagsMutuallyExclusive(...flagNames: string[]): void } - interface BaseModel { + interface Command { /** - * HasId returns whether the model has a nonzero id. + * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the + * first error encountered. */ - hasId(): boolean + validateFlagGroups(): void } - interface BaseModel { + interface Command { /** - * GetId returns the model id. + * GenPowerShellCompletionFile generates powershell completion file without descriptions. */ - getId(): string + genPowerShellCompletionFile(filename: string): void } - interface BaseModel { + interface Command { /** - * SetId sets the model id to the provided string value. + * GenPowerShellCompletion generates powershell completion file without descriptions + * and writes it to the passed writer. */ - setId(id: string): void + genPowerShellCompletion(w: io.Writer): void } - interface BaseModel { + interface Command { /** - * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). + * GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. */ - markAsNew(): void + genPowerShellCompletionFileWithDesc(filename: string): void } - interface BaseModel { + interface Command { /** - * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) + * GenPowerShellCompletionWithDesc generates powershell completion file with descriptions + * and writes it to the passed writer. */ - markAsNotNew(): void + genPowerShellCompletionWithDesc(w: io.Writer): void } - interface BaseModel { + interface Command { /** - * IsNew indicates what type of db query (insert or update) - * should be used with the model instance. + * MarkFlagRequired instructs the various shell completion implementations to + * prioritize the named flag when performing completion, + * and causes your command to report an error if invoked without the flag. */ - isNew(): boolean + markFlagRequired(name: string): void } - interface BaseModel { + interface Command { /** - * GetCreated returns the model Created datetime. + * MarkPersistentFlagRequired instructs the various shell completion implementations to + * prioritize the named persistent flag when performing completion, + * and causes your command to report an error if invoked without the flag. */ - getCreated(): types.DateTime + markPersistentFlagRequired(name: string): void } - interface BaseModel { + interface Command { /** - * GetUpdated returns the model Updated datetime. + * MarkFlagFilename instructs the various shell completion implementations to + * limit completions for the named flag to the specified file extensions. */ - getUpdated(): types.DateTime + markFlagFilename(name: string, ...extensions: string[]): void } - interface BaseModel { + interface Command { /** - * RefreshId generates and sets a new model id. + * MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. + * The bash completion script will call the bash function f for the flag. * - * The generated id is a cryptographically random 15 characters length string. + * This will only work for bash completion. + * It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows + * to register a Go function which will work across all shells. */ - refreshId(): void + markFlagCustom(name: string, f: string): void } - interface BaseModel { + interface Command { /** - * RefreshCreated updates the model Created field with the current datetime. + * MarkPersistentFlagFilename instructs the various shell completion + * implementations to limit completions for the named persistent flag to the + * specified file extensions. */ - refreshCreated(): void + markPersistentFlagFilename(name: string, ...extensions: string[]): void } - interface BaseModel { + interface Command { /** - * RefreshUpdated updates the model Updated field with the current datetime. + * MarkFlagDirname instructs the various shell completion implementations to + * limit completions for the named flag to directory names. */ - refreshUpdated(): void + markFlagDirname(name: string): void } - interface BaseModel { + interface Command { /** - * PostScan implements the [dbx.PostScanner] interface. - * - * It is executed right after the model was populated with the db row values. + * MarkPersistentFlagDirname instructs the various shell completion + * implementations to limit completions for the named persistent flag to + * directory names. */ - postScan(): void - } - // @ts-ignore - import validation = ozzo_validation - /** - * CollectionBaseOptions defines the "base" Collection.Options fields. - */ - interface CollectionBaseOptions { + markPersistentFlagDirname(name: string): void } - interface CollectionBaseOptions { + interface Command { /** - * Validate implements [validation.Validatable] interface. + * GenZshCompletionFile generates zsh completion file including descriptions. */ - validate(): void - } - /** - * CollectionAuthOptions defines the "auth" Collection.Options fields. - */ - interface CollectionAuthOptions { - manageRule?: string - allowOAuth2Auth: boolean - allowUsernameAuth: boolean - allowEmailAuth: boolean - requireEmail: boolean - exceptEmailDomains: Array - onlyVerified: boolean - onlyEmailDomains: Array - minPasswordLength: number + genZshCompletionFile(filename: string): void } - interface CollectionAuthOptions { + interface Command { /** - * Validate implements [validation.Validatable] interface. + * GenZshCompletion generates zsh completion file including descriptions + * and writes it to the passed writer. */ - validate(): void - } - /** - * CollectionViewOptions defines the "view" Collection.Options fields. - */ - interface CollectionViewOptions { - query: string + genZshCompletion(w: io.Writer): void } - interface CollectionViewOptions { + interface Command { /** - * Validate implements [validation.Validatable] interface. + * GenZshCompletionFileNoDesc generates zsh completion file without descriptions. */ - validate(): void - } - type _subWyIIM = BaseModel - interface Log extends _subWyIIM { - data: types.JsonMap - message: string - level: number - } - interface Log { - tableName(): string + genZshCompletionFileNoDesc(filename: string): void } - type _subXUePJ = BaseModel - interface Param extends _subXUePJ { - key: string - value: types.JsonRaw + interface Command { + /** + * GenZshCompletionNoDesc generates zsh completion file without descriptions + * and writes it to the passed writer. + */ + genZshCompletionNoDesc(w: io.Writer): void } - interface Param { - tableName(): string + interface Command { + /** + * MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was + * not consistent with Bash completion. It has therefore been disabled. + * Instead, when no other completion is specified, file completion is done by + * default for every argument. One can disable file completion on a per-argument + * basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. + * To achieve file extension filtering, one can use ValidArgsFunction and + * ShellCompDirectiveFilterFileExt. + * + * Deprecated + */ + markZshCompPositionalArgumentFile(argPosition: number, ...patterns: string[]): void } - interface TableInfoRow { + interface Command { /** - * the `db:"pk"` tag has special semantic so we cannot rename - * the original field without specifying a custom mapper + * MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore + * been disabled. + * To achieve the same behavior across all shells, one can use + * ValidArgs (for the first argument only) or ValidArgsFunction for + * any argument (can include the first one also). + * + * Deprecated */ - pk: number - index: number - name: string - type: string - notNull: boolean - defaultValue: types.JsonRaw + markZshCompPositionalArgumentWords(argPosition: number, ...words: string[]): void } } /** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: + * Package syscall contains an interface to the low-level operating system + * primitives. The details vary depending on the underlying system, and + * by default, godoc will display the syscall documentation for the current + * system. If you want godoc to display syscall documentation for another + * system, set $GOOS and $GOARCH to the desired system. For example, if + * you want to view documentation for freebsd/arm on linux/amd64, set $GOOS + * to freebsd and $GOARCH to arm. + * The primary use of syscall is inside other packages that provide a more + * portable interface to the system, such as "os", "time" and "net". Use + * those packages rather than this one if you can. + * For details of the functions and data types in this package consult + * the manuals for the appropriate operating system. + * These calls return err == nil to indicate success; otherwise + * err is an operating system error describing the failure. + * On most systems, that error has type [Errno]. * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) - * - * // Routes - * e.GET("/", hello) - * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` - * - * Learn more at https://echo.labstack.com + * NOTE: Most of the functions, types, and constants defined in + * this package are also available in the [golang.org/x/sys] package. + * That package has more system call support than this one, + * and most new code should prefer that package where possible. + * See https://golang.org/s/go1.4-syscall for more information. */ -namespace echo { - /** - * Binder is the interface that wraps the Bind method. - */ - interface Binder { - [key:string]: any; - bind(c: Context, i: { - }): void - } +namespace syscall { /** - * ServableContext is interface that Echo context implementation must implement to be usable in middleware/handlers and - * be able to be routed by Router. + * SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in Linux. + * See user_namespaces(7). + * + * Note that User Namespaces are not available on a number of popular Linux + * versions (due to security issues), or are available but subject to AppArmor + * restrictions like in Ubuntu 24.04. */ - interface ServableContext { - [key:string]: any; - /** - * Reset resets the context after request completes. It must be called along - * with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. - * See `Echo#ServeHTTP()` - */ - reset(r: http.Request, w: http.ResponseWriter): void + interface SysProcIDMap { + containerID: number // Container ID. + hostID: number // Host ID. + size: number // Size. } // @ts-ignore - import stdContext = context + import errorspkg = errors /** - * JSONSerializer is the interface that encodes and decodes JSON to and from interfaces. + * Credential holds user and group identities to be assumed + * by a child process started by [StartProcess]. */ - interface JSONSerializer { - [key:string]: any; - serialize(c: Context, i: { - }, indent: string): void - deserialize(c: Context, i: { - }): void + interface Credential { + uid: number // User ID. + gid: number // Group ID. + groups: Array // Supplementary group IDs. + noSetGroups: boolean // If true, don't set supplementary groups } + // @ts-ignore + import runtimesyscall = syscall /** - * HTTPErrorHandler is a centralized HTTP error handler. - */ - interface HTTPErrorHandler {(c: Context, err: Error): void } - /** - * Validator is the interface that wraps the Validate function. + * A Signal is a number describing a process signal. + * It implements the [os.Signal] interface. */ - interface Validator { - [key:string]: any; - validate(i: { - }): void + interface Signal extends Number{} + interface Signal { + signal(): void } - /** - * Renderer is the interface that wraps the Render function. - */ - interface Renderer { - [key:string]: any; - render(_arg0: io.Writer, _arg1: string, _arg2: { - }, _arg3: Context): void + interface Signal { + string(): string } +} + +/** + * Package time provides functionality for measuring and displaying time. + * + * The calendrical calculations always assume a Gregorian calendar, with + * no leap seconds. + * + * # Monotonic Clocks + * + * Operating systems provide both a “wall clock,” which is subject to + * changes for clock synchronization, and a “monotonic clock,” which is + * not. The general rule is that the wall clock is for telling time and + * the monotonic clock is for measuring time. Rather than split the API, + * in this package the Time returned by [time.Now] contains both a wall + * clock reading and a monotonic clock reading; later time-telling + * operations use the wall clock reading, but later time-measuring + * operations, specifically comparisons and subtractions, use the + * monotonic clock reading. + * + * For example, this code always computes a positive elapsed time of + * approximately 20 milliseconds, even if the wall clock is changed during + * the operation being timed: + * + * ``` + * start := time.Now() + * ... operation that takes 20 milliseconds ... + * t := time.Now() + * elapsed := t.Sub(start) + * ``` + * + * Other idioms, such as [time.Since](start), [time.Until](deadline), and + * time.Now().Before(deadline), are similarly robust against wall clock + * resets. + * + * The rest of this section gives the precise details of how operations + * use monotonic clocks, but understanding those details is not required + * to use this package. + * + * The Time returned by time.Now contains a monotonic clock reading. + * If Time t has a monotonic clock reading, t.Add adds the same duration to + * both the wall clock and monotonic clock readings to compute the result. + * Because t.AddDate(y, m, d), t.Round(d), and t.Truncate(d) are wall time + * computations, they always strip any monotonic clock reading from their results. + * Because t.In, t.Local, and t.UTC are used for their effect on the interpretation + * of the wall time, they also strip any monotonic clock reading from their results. + * The canonical way to strip a monotonic clock reading is to use t = t.Round(0). + * + * If Times t and u both contain monotonic clock readings, the operations + * t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out + * using the monotonic clock readings alone, ignoring the wall clock + * readings. If either t or u contains no monotonic clock reading, these + * operations fall back to using the wall clock readings. + * + * On some systems the monotonic clock will stop if the computer goes to sleep. + * On such a system, t.Sub(u) may not accurately reflect the actual + * time that passed between t and u. The same applies to other functions and + * methods that subtract times, such as [Since], [Until], [Before], [After], + * [Add], [Sub], [Equal] and [Compare]. In some cases, you may need to strip + * the monotonic clock to get accurate results. + * + * Because the monotonic clock reading has no meaning outside + * the current process, the serialized forms generated by t.GobEncode, + * t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic + * clock reading, and t.Format provides no format for it. Similarly, the + * constructors [time.Date], [time.Parse], [time.ParseInLocation], and [time.Unix], + * as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. + * t.UnmarshalJSON, and t.UnmarshalText always create times with + * no monotonic clock reading. + * + * The monotonic clock reading exists only in [Time] values. It is not + * a part of [Duration] values or the Unix times returned by t.Unix and + * friends. + * + * Note that the Go == operator compares not just the time instant but + * also the [Location] and the monotonic clock reading. See the + * documentation for the Time type for a discussion of equality + * testing for Time values. + * + * For debugging, the result of t.String does include the monotonic + * clock reading if present. If t != u because of different monotonic clock readings, + * that difference will be visible when printing t.String() and u.String(). + * + * # Timer Resolution + * + * [Timer] resolution varies depending on the Go runtime, the operating system + * and the underlying hardware. + * On Unix, the resolution is ~1ms. + * On Windows version 1803 and newer, the resolution is ~0.5ms. + * On older Windows versions, the default resolution is ~16ms, but + * a higher resolution may be requested using [golang.org/x/sys/windows.TimeBeginPeriod]. + */ +namespace time { /** - * Group is a set of sub-routes for a specified route. It can be used for inner - * routes that share a common middleware or functionality that should be separate - * from the parent echo instance while still inheriting from it. + * A Month specifies a month of the year (January = 1, ...). */ - interface Group { - } - interface Group { - /** - * Use implements `Echo#Use()` for sub-routes within the Group. - * Group middlewares are not executed on request when there is no matching route found. - */ - use(...middleware: MiddlewareFunc[]): void - } - interface Group { - /** - * CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. Panics on error. - */ - connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * DELETE implements `Echo#DELETE()` for sub-routes within the Group. Panics on error. - */ - delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * GET implements `Echo#GET()` for sub-routes within the Group. Panics on error. - */ - get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { + interface Month extends Number{} + interface Month { /** - * HEAD implements `Echo#HEAD()` for sub-routes within the Group. Panics on error. + * String returns the English name of the month ("January", "February", ...). */ - head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + string(): string } - interface Group { + /** + * A Weekday specifies a day of the week (Sunday = 0, ...). + */ + interface Weekday extends Number{} + interface Weekday { /** - * OPTIONS implements `Echo#OPTIONS()` for sub-routes within the Group. Panics on error. + * String returns the English name of the day ("Sunday", "Monday", ...). */ - options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + string(): string } - interface Group { - /** - * PATCH implements `Echo#PATCH()` for sub-routes within the Group. Panics on error. - */ - patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + /** + * A Location maps time instants to the zone in use at that time. + * Typically, the Location represents the collection of time offsets + * in use in a geographical area. For many Locations the time offset varies + * depending on whether daylight savings time is in use at the time instant. + * + * Location is used to provide a time zone in a printed Time value and for + * calculations involving intervals that may cross daylight savings time + * boundaries. + */ + interface Location { } - interface Group { + interface Location { /** - * POST implements `Echo#POST()` for sub-routes within the Group. Panics on error. + * String returns a descriptive name for the time zone information, + * corresponding to the name argument to [LoadLocation] or [FixedZone]. */ - post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + string(): string } - interface Group { - /** - * PUT implements `Echo#PUT()` for sub-routes within the Group. Panics on error. - */ - put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo +} + +/** + * Package context defines the Context type, which carries deadlines, + * cancellation signals, and other request-scoped values across API boundaries + * and between processes. + * + * Incoming requests to a server should create a [Context], and outgoing + * calls to servers should accept a Context. The chain of function + * calls between them must propagate the Context, optionally replacing + * it with a derived Context created using [WithCancel], [WithDeadline], + * [WithTimeout], or [WithValue]. When a Context is canceled, all + * Contexts derived from it are also canceled. + * + * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a + * Context (the parent) and return a derived Context (the child) and a + * [CancelFunc]. Calling the CancelFunc cancels the child and its + * children, removes the parent's reference to the child, and stops + * any associated timers. Failing to call the CancelFunc leaks the + * child and its children until the parent is canceled or the timer + * fires. The go vet tool checks that CancelFuncs are used on all + * control-flow paths. + * + * The [WithCancelCause] function returns a [CancelCauseFunc], which + * takes an error and records it as the cancellation cause. Calling + * [Cause] on the canceled context or any of its children retrieves + * the cause. If no cause is specified, Cause(ctx) returns the same + * value as ctx.Err(). + * + * Programs that use Contexts should follow these rules to keep interfaces + * consistent across packages and enable static analysis tools to check context + * propagation: + * + * Do not store Contexts inside a struct type; instead, pass a Context + * explicitly to each function that needs it. The Context should be the first + * parameter, typically named ctx: + * + * ``` + * func DoSomething(ctx context.Context, arg Arg) error { + * // ... use ctx ... + * } + * ``` + * + * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] + * if you are unsure about which Context to use. + * + * Use context Values only for request-scoped data that transits processes and + * APIs, not for passing optional parameters to functions. + * + * The same Context may be passed to functions running in different goroutines; + * Contexts are safe for simultaneous use by multiple goroutines. + * + * See https://blog.golang.org/context for example code for a server that uses + * Contexts. + */ +namespace context { +} + +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * ReadCloser is the interface that groups the basic Read and Close methods. + */ + interface ReadCloser { + [key:string]: any; } - interface Group { - /** - * TRACE implements `Echo#TRACE()` for sub-routes within the Group. Panics on error. - */ - trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + /** + * WriteCloser is the interface that groups the basic Write and Close methods. + */ + interface WriteCloser { + [key:string]: any; } - interface Group { - /** - * Any implements `Echo#Any()` for sub-routes within the Group. Panics on error. - */ - any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes +} + +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + * + * See the [testing/fstest] package for support with testing + * implementations of file systems. + */ +namespace fs { +} + +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { + /** + * The Userinfo type is an immutable encapsulation of username and + * password details for a [URL]. An existing Userinfo value is guaranteed + * to have a username set (potentially empty, as allowed by RFC 2396), + * and optionally a password. + */ + interface Userinfo { } - interface Group { + interface Userinfo { /** - * Match implements `Echo#Match()` for sub-routes within the Group. Panics on error. + * Username returns the username. */ - match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + username(): string } - interface Group { + interface Userinfo { /** - * Group creates a new sub-group with prefix and optional sub-group-level middleware. - * Important! Group middlewares are only executed in case there was exact route match and not - * for 404 (not found) or 405 (method not allowed) cases. If this kind of behaviour is needed then add - * a catch-all route `/*` for the group which handler returns always 404 + * Password returns the password in case it is set, and whether it is set. */ - group(prefix: string, ...middleware: MiddlewareFunc[]): (Group) + password(): [string, boolean] } - interface Group { + interface Userinfo { /** - * Static implements `Echo#Static()` for sub-routes within the Group. + * String returns the encoded userinfo information in the standard form + * of "username[:password]". */ - static(pathPrefix: string, fsRoot: string): RouteInfo + string(): string } - interface Group { - /** - * StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. - */ - staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * DateTime represents a [time.Time] instance in UTC that is wrapped + * and serialized using the app default date layout. + */ + interface DateTime { } - interface Group { + interface DateTime { /** - * FileFS implements `Echo#FileFS()` for sub-routes within the Group. + * Time returns the internal [time.Time] instance. */ - fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo + time(): time.Time } - interface Group { + interface DateTime { /** - * File implements `Echo#File()` for sub-routes within the Group. Panics on error. + * IsZero checks whether the current DateTime instance has zero time value. */ - file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo + isZero(): boolean } - interface Group { + interface DateTime { /** - * RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group. + * String serializes the current DateTime instance into a formatted + * UTC date string. * - * Example: `g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` + * The zero value is serialized to an empty string. */ - routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + string(): string } - interface Group { + interface DateTime { /** - * Add implements `Echo#Add()` for sub-routes within the Group. Panics on error. + * MarshalJSON implements the [json.Marshaler] interface. */ - add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo + marshalJSON(): string|Array } - interface Group { + interface DateTime { /** - * AddRoute registers a new Routable with Router + * UnmarshalJSON implements the [json.Unmarshaler] interface. */ - addRoute(route: Routable): RouteInfo + unmarshalJSON(b: string|Array): void } - /** - * IPExtractor is a function to extract IP addr from http.Request. - * Set appropriate one to Echo#IPExtractor. - * See https://echo.labstack.com/guide/ip-address for more details. - */ - interface IPExtractor {(_arg0: http.Request): string } - /** - * Logger defines the logging interface that Echo uses internally in few places. - * For logging in handlers use your own logger instance (dependency injected or package/public variable) from logging framework of your choice. - */ - interface Logger { - [key:string]: any; + interface DateTime { /** - * Write provides writer interface for http.Server `ErrorLog` and for logging startup messages. - * `http.Server.ErrorLog` logs errors from accepting connections, unexpected behavior from handlers, - * and underlying FileSystem errors. - * `logger` middleware will use this method to write its JSON payload. + * Value implements the [driver.Valuer] interface. */ - write(p: string|Array): number + value(): any + } + interface DateTime { /** - * Error logs the error + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current DateTime instance. */ - error(err: Error): void + scan(value: any): void } +} + +namespace store { /** - * Response wraps an http.ResponseWriter and implements its interface to be used - * by an HTTP handler to construct an HTTP response. - * See: https://golang.org/pkg/net/http/#ResponseWriter + * Store defines a concurrent safe in memory key-value data store. */ - interface Response { - writer: http.ResponseWriter - status: number - size: number - committed: boolean + interface Store { } - interface Response { + interface Store { /** - * Header returns the header map for the writer that will be sent by - * WriteHeader. Changing the header after a call to WriteHeader (or Write) has - * no effect unless the modified headers were declared as trailers by setting - * the "Trailer" header before the call to WriteHeader (see example) - * To suppress implicit response headers, set their value to nil. - * Example: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers + * Reset clears the store and replaces the store data with a + * shallow copy of the provided newData. */ - header(): http.Header + reset(newData: _TygojaDict): void } - interface Response { + interface Store { /** - * Before registers a function which is called just before the response is written. + * Length returns the current number of elements in the store. */ - before(fn: () => void): void + length(): number } - interface Response { + interface Store { /** - * After registers a function which is called just after the response is written. - * If the `Content-Length` is unknown, none of the after function is executed. + * RemoveAll removes all the existing store entries. */ - after(fn: () => void): void + removeAll(): void } - interface Response { + interface Store { /** - * WriteHeader sends an HTTP response header with status code. If WriteHeader is - * not called explicitly, the first call to Write will trigger an implicit - * WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly - * used to send error codes. + * Remove removes a single entry from the store. + * + * Remove does nothing if key doesn't exist in the store. */ - writeHeader(code: number): void + remove(key: string): void } - interface Response { + interface Store { /** - * Write writes the data to the connection as part of an HTTP reply. + * Has checks if element with the specified key exist or not. */ - write(b: string|Array): number + has(key: string): boolean } - interface Response { + interface Store { /** - * Flush implements the http.Flusher interface to allow an HTTP handler to flush - * buffered data to the client. - * See [http.Flusher](https://golang.org/pkg/net/http/#Flusher) + * Get returns a single element value from the store. + * + * If key is not set, the zero T value is returned. */ - flush(): void + get(key: string): T } - interface Response { + interface Store { /** - * Hijack implements the http.Hijacker interface to allow an HTTP handler to - * take over the connection. - * See [http.Hijacker](https://golang.org/pkg/net/http/#Hijacker) + * GetAll returns a shallow copy of the current store data. */ - hijack(): [net.Conn, (bufio.ReadWriter)] + getAll(): _TygojaDict } - interface Response { + interface Store { /** - * Unwrap returns the original http.ResponseWriter. - * ResponseController can be used to access the original http.ResponseWriter. - * See [https://go.dev/blog/go1.20] + * Set sets (or overwrite if already exist) a new value for key. */ - unwrap(): http.ResponseWriter + set(key: string, value: T): void } - interface Routes { + interface Store { /** - * Reverse reverses route to URL string by replacing path parameters with given params values. + * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. + * + * This method is similar to Set() but **it will skip adding new elements** + * to the store if the store length has reached the specified limit. + * false is returned if maxAllowedElements limit is reached. */ - reverse(name: string, ...params: { - }[]): string + setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean } - interface Routes { +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { + /** + * Conn is a generic stream-oriented network connection. + * + * Multiple goroutines may invoke methods on a Conn simultaneously. + */ + interface Conn { + [key:string]: any; /** - * FindByMethodPath searched for matching route info by method and path + * Read reads data from the connection. + * Read can be made to time out and return an error after a fixed + * time limit; see SetDeadline and SetReadDeadline. */ - findByMethodPath(method: string, path: string): RouteInfo - } - interface Routes { + read(b: string|Array): number /** - * FilterByMethod searched for matching route info by method + * Write writes data to the connection. + * Write can be made to time out and return an error after a fixed + * time limit; see SetDeadline and SetWriteDeadline. */ - filterByMethod(method: string): Routes - } - interface Routes { + write(b: string|Array): number /** - * FilterByPath searched for matching route info by path + * Close closes the connection. + * Any blocked Read or Write operations will be unblocked and return errors. */ - filterByPath(path: string): Routes - } - interface Routes { + close(): void /** - * FilterByName searched for matching route info by name + * LocalAddr returns the local network address, if known. */ - filterByName(name: string): Routes - } - /** - * Router is interface for routing request contexts to registered routes. - * - * Contract between Echo/Context instance and the router: - * ``` - * - all routes must be added through methods on echo.Echo instance. - * Reason: Echo instance uses RouteInfo.Params() length to allocate slice for paths parameters (see `Echo.contextPathParamAllocSize`). - * - Router must populate Context during Router.Route call with: - * - RoutableContext.SetPath - * - RoutableContext.SetRawPathParams (IMPORTANT! with same slice pointer that c.RawPathParams() returns) - * - RoutableContext.SetRouteInfo - * And optionally can set additional information to Context with RoutableContext.Set - * ``` - */ - interface Router { - [key:string]: any; + localAddr(): Addr /** - * Add registers Routable with the Router and returns registered RouteInfo + * RemoteAddr returns the remote network address, if known. */ - add(routable: Routable): RouteInfo + remoteAddr(): Addr /** - * Remove removes route from the Router + * SetDeadline sets the read and write deadlines associated + * with the connection. It is equivalent to calling both + * SetReadDeadline and SetWriteDeadline. + * + * A deadline is an absolute time after which I/O operations + * fail instead of blocking. The deadline applies to all future + * and pending I/O, not just the immediately following call to + * Read or Write. After a deadline has been exceeded, the + * connection can be refreshed by setting a deadline in the future. + * + * If the deadline is exceeded a call to Read or Write or to other + * I/O methods will return an error that wraps os.ErrDeadlineExceeded. + * This can be tested using errors.Is(err, os.ErrDeadlineExceeded). + * The error's Timeout method will return true, but note that there + * are other possible errors for which the Timeout method will + * return true even if the deadline has not been exceeded. + * + * An idle timeout can be implemented by repeatedly extending + * the deadline after successful Read or Write calls. + * + * A zero value for t means I/O operations will not time out. */ - remove(method: string, path: string): void + setDeadline(t: time.Time): void /** - * Routes returns information about all registered routes + * SetReadDeadline sets the deadline for future Read calls + * and any currently-blocked Read call. + * A zero value for t means Read will not time out. */ - routes(): Routes + setReadDeadline(t: time.Time): void /** - * Route searches Router for matching route and applies it to the given context. In case when no matching method - * was not found (405) or no matching route exists for path (404), router will return its implementation of 405/404 - * handler function. + * SetWriteDeadline sets the deadline for future Write calls + * and any currently-blocked Write call. + * Even if write times out, it may return n > 0, indicating that + * some of the data was successfully written. + * A zero value for t means Write will not time out. */ - route(c: RoutableContext): HandlerFunc + setWriteDeadline(t: time.Time): void } /** - * Routable is interface for registering Route with Router. During route registration process the Router will - * convert Routable to RouteInfo with ToRouteInfo method. By creating custom implementation of Routable additional - * information about registered route can be stored in Routes (i.e. privileges used with route etc.) + * A Listener is a generic network listener for stream-oriented protocols. + * + * Multiple goroutines may invoke methods on a Listener simultaneously. */ - interface Routable { + interface Listener { [key:string]: any; /** - * ToRouteInfo converts Routable to RouteInfo - * - * This method is meant to be used by Router after it parses url for path parameters, to store information about - * route just added. + * Accept waits for and returns the next connection to the listener. */ - toRouteInfo(params: Array): RouteInfo + accept(): Conn /** - * ToRoute converts Routable to Route which Router uses to register the method handler for path. - * - * This method is meant to be used by Router to get fields (including handler and middleware functions) needed to - * add Route to Router. + * Close closes the listener. + * Any blocked Accept operations will be unblocked and return errors. */ - toRoute(): Route + close(): void /** - * ForGroup recreates routable with added group prefix and group middlewares it is grouped to. - * - * Is necessary for Echo.Group to be able to add/register Routable with Router and having group prefix and group - * middlewares included in actually registered Route. - */ - forGroup(pathPrefix: string, middlewares: Array): Routable - } - /** - * Routes is collection of RouteInfo instances with various helper methods. - */ - interface Routes extends Array{} - /** - * RouteInfo describes registered route base fields. - * Method+Path pair uniquely identifies the Route. Name can have duplicates. - */ - interface RouteInfo { - [key:string]: any; - method(): string - path(): string - name(): string - params(): Array - /** - * Reverse reverses route to URL string by replacing path parameters with given params values. - */ - reverse(...params: { - }[]): string - } - /** - * PathParams is collections of PathParam instances with various helper methods - */ - interface PathParams extends Array{} - interface PathParams { - /** - * Get returns path parameter value for given name or default value. + * Addr returns the listener's network address. */ - get(name: string, defaultValue: string): string + addr(): Addr } } -/** - * Package oauth2 provides support for making - * OAuth2 authorized and authenticated HTTP requests, - * as specified in RFC 6749. - * It can additionally grant authorization with Bearer JWT. - */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. - */ -namespace oauth2 { +namespace hook { /** - * An AuthCodeOption is passed to Config.AuthCodeURL. + * Hook defines a concurrent safe structure for handling event hooks + * (aka. callbacks propagation). */ - interface AuthCodeOption { - [key:string]: any; + interface Hook { } - /** - * Token represents the credentials used to authorize - * the requests to access protected resources on the OAuth 2.0 - * provider's backend. - * - * Most users of this package should not access fields of Token - * directly. They're exported mostly for use by related packages - * implementing derivative OAuth2 flows. - */ - interface Token { - /** - * AccessToken is the token that authorizes and authenticates - * the requests. - */ - accessToken: string + interface Hook { /** - * TokenType is the type of token. - * The Type method returns either this or "Bearer", the default. + * PreAdd registers a new handler to the hook by prepending it to the existing queue. + * + * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). */ - tokenType: string + preAdd(fn: Handler): string + } + interface Hook { /** - * RefreshToken is a token that's used by the application - * (as opposed to the user) to refresh the access token - * if it expires. + * Add registers a new handler to the hook by appending it to the existing queue. + * + * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). */ - refreshToken: string + add(fn: Handler): string + } + interface Hook { /** - * Expiry is the optional expiration time of the access token. - * - * If zero, TokenSource implementations will reuse the same - * token forever and RefreshToken or equivalent - * mechanisms for that TokenSource will not be used. + * Remove removes a single hook handler by its id. */ - expiry: time.Time + remove(id: string): void } - interface Token { + interface Hook { /** - * Type returns t.TokenType if non-empty, else "Bearer". + * RemoveAll removes all registered handlers. */ - type(): string + removeAll(): void } - interface Token { + interface Hook { /** - * SetAuthHeader sets the Authorization header to r using the access - * token in t. + * Trigger executes all registered hook handlers one by one + * with the specified `data` as an argument. * - * This method is unnecessary when using Transport or an HTTP Client - * returned by this package. + * Optionally, this method allows also to register additional one off + * handlers that will be temporary appended to the handlers queue. + * + * The execution stops when: + * - hook.StopPropagation is returned in one of the handlers + * - any non-nil error is returned in one of the handlers */ - setAuthHeader(r: http.Request): void + trigger(data: T, ...oneOffHandlers: Handler[]): void } - interface Token { + /** + * TaggedHook defines a proxy hook which register handlers that are triggered only + * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). + */ + type _subbFzXR = mainHook + interface TaggedHook extends _subbFzXR { + } + interface TaggedHook { /** - * WithExtra returns a new Token that's a clone of t, but using the - * provided raw extra map. This is only intended for use by packages - * implementing derivative OAuth2 flows. + * CanTriggerOn checks if the current TaggedHook can be triggered with + * the provided event data tags. */ - withExtra(extra: { - }): (Token) + canTriggerOn(tags: Array): boolean } - interface Token { + interface TaggedHook { /** - * Extra returns an extra field. - * Extra fields are key-value pairs returned by the server as a - * part of the token retrieval response. + * PreAdd registers a new handler to the hook by prepending it to the existing queue. + * + * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. */ - extra(key: string): { - } + preAdd(fn: Handler): string } - interface Token { + interface TaggedHook { /** - * Valid reports whether t is non-nil, has an AccessToken, and is not expired. + * Add registers a new handler to the hook by appending it to the existing queue. + * + * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. */ - valid(): boolean + add(fn: Handler): string } } -namespace mailer { +namespace logging { /** - * Mailer defines a base mail client interface. + * Logger is an interface for logging entries at certain classifications. */ - interface Mailer { + interface Logger { [key:string]: any; /** - * Send sends an email with the provided Message. + * Logf is expected to support the standard fmt package "verbs". */ - send(message: Message): void + logf(classification: Classification, format: string, ...v: { + }[]): void } } -namespace settings { - // @ts-ignore - import validation = ozzo_validation - interface TokenConfig { - secret: string - duration: number - } - interface TokenConfig { +/** + * Package textproto implements generic support for text-based request/response + * protocols in the style of HTTP, NNTP, and SMTP. + * + * The package provides: + * + * [Error], which represents a numeric error response from + * a server. + * + * [Pipeline], to manage pipelined requests and responses + * in a client. + * + * [Reader], to read numeric response code lines, + * key: value headers, lines wrapped with leading spaces + * on continuation lines, and whole text blocks ending + * with a dot on a line by itself. + * + * [Writer], to write dot-encoded text blocks. + * + * [Conn], a convenient packaging of [Reader], [Writer], and [Pipeline] for use + * with a single network connection. + */ +namespace textproto { + /** + * A MIMEHeader represents a MIME-style header mapping + * keys to sets of values. + */ + interface MIMEHeader extends _TygojaDict{} + interface MIMEHeader { /** - * Validate makes TokenConfig validatable by implementing [validation.Validatable] interface. + * Add adds the key, value pair to the header. + * It appends to any existing values associated with key. */ - validate(): void + add(key: string, value: string): void } - interface SmtpConfig { - enabled: boolean - host: string - port: number - username: string - password: string + interface MIMEHeader { /** - * SMTP AUTH - PLAIN (default) or LOGIN + * Set sets the header entries associated with key to + * the single element value. It replaces any existing + * values associated with key. */ - authMethod: string + set(key: string, value: string): void + } + interface MIMEHeader { /** - * Whether to enforce TLS encryption for the mail server connection. - * - * When set to false StartTLS command is send, leaving the server - * to decide whether to upgrade the connection or not. + * Get gets the first value associated with the given key. + * It is case insensitive; [CanonicalMIMEHeaderKey] is used + * to canonicalize the provided key. + * If there are no values associated with the key, Get returns "". + * To use non-canonical keys, access the map directly. */ - tls: boolean + get(key: string): string + } + interface MIMEHeader { /** - * LocalName is optional domain name or IP address used for the - * EHLO/HELO exchange (if not explicitly set, defaults to "localhost"). - * - * This is required only by some SMTP servers, such as Gmail SMTP-relay. + * Values returns all values associated with the given key. + * It is case insensitive; [CanonicalMIMEHeaderKey] is + * used to canonicalize the provided key. To use non-canonical + * keys, access the map directly. + * The returned slice is not a copy. */ - localName: string + values(key: string): Array } - interface SmtpConfig { + interface MIMEHeader { /** - * Validate makes SmtpConfig validatable by implementing [validation.Validatable] interface. + * Del deletes the values associated with key. */ - validate(): void - } - interface S3Config { - enabled: boolean - bucket: string - region: string - endpoint: string - accessKey: string - secret: string - forcePathStyle: boolean - } - interface S3Config { - /** - * Validate makes S3Config validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface BackupsConfig { - /** - * Cron is a cron expression to schedule auto backups, eg. "* * * * *". - * - * Leave it empty to disable the auto backups functionality. - */ - cron: string - /** - * CronMaxKeep is the max number of cron generated backups to - * keep before removing older entries. - * - * This field works only when the cron config has valid cron expression. - */ - cronMaxKeep: number - /** - * S3 is an optional S3 storage config specifying where to store the app backups. - */ - s3: S3Config - } - interface BackupsConfig { - /** - * Validate makes BackupsConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface MetaConfig { - appName: string - appUrl: string - hideControls: boolean - senderName: string - senderAddress: string - verificationTemplate: EmailTemplate - resetPasswordTemplate: EmailTemplate - confirmEmailChangeTemplate: EmailTemplate - } - interface MetaConfig { - /** - * Validate makes MetaConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface LogsConfig { - maxDays: number - minLevel: number - logIp: boolean - } - interface LogsConfig { - /** - * Validate makes LogsConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface AuthProviderConfig { - enabled: boolean - clientId: string - clientSecret: string - authUrl: string - tokenUrl: string - userApiUrl: string - displayName: string - pkce?: boolean - } - interface AuthProviderConfig { - /** - * Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface AuthProviderConfig { - /** - * SetupProvider loads the current AuthProviderConfig into the specified provider. - */ - setupProvider(provider: auth.Provider): void - } - /** - * Deprecated: Will be removed in v0.9+ - */ - interface EmailAuthConfig { - enabled: boolean - exceptDomains: Array - onlyDomains: Array - minPasswordLength: number - } - interface EmailAuthConfig { - /** - * Deprecated: Will be removed in v0.9+ - */ - validate(): void + del(key: string): void } } /** - * Package daos handles common PocketBase DB model manipulations. + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. * - * Think of daos as DB repository and service layer in one. + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. */ -namespace daos { - interface LogsStatsItem { - total: number - date: types.DateTime - } - /** - * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. - */ - interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } - // @ts-ignore - import validation = ozzo_validation -} - -namespace hook { - /** - * Hook defines a concurrent safe structure for handling event hooks - * (aka. callbacks propagation). - */ - interface Hook { - } - interface Hook { - /** - * PreAdd registers a new handler to the hook by prepending it to the existing queue. - * - * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). - */ - preAdd(fn: Handler): string - } - interface Hook { +namespace multipart { + interface Reader { /** - * Add registers a new handler to the hook by appending it to the existing queue. - * - * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). + * ReadForm parses an entire multipart message whose parts have + * a Content-Disposition of "form-data". + * It stores up to maxMemory bytes + 10MB (reserved for non-file parts) + * in memory. File parts which can't be stored in memory will be stored on + * disk in temporary files. + * It returns [ErrMessageTooLarge] if all non-file parts can't be stored in + * memory. */ - add(fn: Handler): string + readForm(maxMemory: number): (Form) } - interface Hook { - /** - * Remove removes a single hook handler by its id. - */ - remove(id: string): void + /** + * Form is a parsed multipart form. + * Its File parts are stored either in memory or on disk, + * and are accessible via the [*FileHeader]'s Open method. + * Its Value parts are stored as strings. + * Both are keyed by field name. + */ + interface Form { + value: _TygojaDict + file: _TygojaDict } - interface Hook { + interface Form { /** - * RemoveAll removes all registered handlers. + * RemoveAll removes any temporary files associated with a [Form]. */ removeAll(): void } - interface Hook { - /** - * Trigger executes all registered hook handlers one by one - * with the specified `data` as an argument. - * - * Optionally, this method allows also to register additional one off - * handlers that will be temporary appended to the handlers queue. - * - * The execution stops when: - * - hook.StopPropagation is returned in one of the handlers - * - any non-nil error is returned in one of the handlers - */ - trigger(data: T, ...oneOffHandlers: Handler[]): void - } /** - * TaggedHook defines a proxy hook which register handlers that are triggered only - * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). + * File is an interface to access the file part of a multipart message. + * Its contents may be either stored in memory or on disk. + * If stored on disk, the File's underlying concrete type will be an *os.File. */ - type _subhfFNE = mainHook - interface TaggedHook extends _subhfFNE { + interface File { + [key:string]: any; } - interface TaggedHook { - /** - * CanTriggerOn checks if the current TaggedHook can be triggered with - * the provided event data tags. - */ - canTriggerOn(tags: Array): boolean + /** + * Reader is an iterator over parts in a MIME multipart body. + * Reader's underlying parser consumes its input as needed. Seeking + * isn't supported. + */ + interface Reader { } - interface TaggedHook { + interface Reader { /** - * PreAdd registers a new handler to the hook by prepending it to the existing queue. + * NextPart returns the next part in the multipart or an error. + * When there are no more parts, the error [io.EOF] is returned. * - * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. + * As a special case, if the "Content-Transfer-Encoding" header + * has a value of "quoted-printable", that header is instead + * hidden and the body is transparently decoded during Read calls. */ - preAdd(fn: Handler): string + nextPart(): (Part) } - interface TaggedHook { + interface Reader { /** - * Add registers a new handler to the hook by appending it to the existing queue. + * NextRawPart returns the next part in the multipart or an error. + * When there are no more parts, the error [io.EOF] is returned. * - * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. + * Unlike [Reader.NextPart], it does not have special handling for + * "Content-Transfer-Encoding: quoted-printable". */ - add(fn: Handler): string + nextRawPart(): (Part) } } /** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. + * Package http provides HTTP client and server implementations. * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: * * ``` - * slog.Info("hello", "count", 3) + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) * ``` * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` - * slog.SetDefault(logger) - * ``` - * - * will cause the top-level functions like [Info] to use it. - * [SetDefault] also updates the default logger used by the [log] package, - * so that existing applications that use [log.Printf] and related functions - * will send log records to the logger's handler without needing to be rewritten. - * - * Some attributes are common to many log calls. - * For example, you may wish to include the URL or trace identifier of a server request - * with all log events arising from the request. - * Rather than repeat the attribute with every log call, you can use [Logger.With] - * to construct a new Logger containing the attributes: - * - * ``` - * logger2 := logger.With("url", r.URL) - * ``` - * - * The arguments to With are the same key-value pairs used in [Logger.Info]. - * The result is a new Logger with the same handler as the original, but additional - * attributes that will appear in the output of every call. - * - * # Levels - * - * A [Level] is an integer representing the importance or severity of a log event. - * The higher the level, the more severe the event. - * This package defines constants for the most common levels, - * but any int can be used as a level. - * - * In an application, you may wish to log messages only at a certain level or greater. - * One common configuration is to log messages at Info or higher levels, - * suppressing debug logging until it is needed. - * The built-in handlers can be configured with the minimum level to output by - * setting [HandlerOptions.Level]. - * The program's `main` function typically does this. - * The default value is LevelInfo. - * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: - * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: - * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` - * - * Now the program can change its logging level with a single statement: + * The caller must close the response body when finished with it: * * ``` - * programLevel.Set(slog.LevelDebug) + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... * ``` * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. - * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: - * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` + * # Clients and Transports * - * TextHandler would display this group as + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: * * ``` - * request.method=GET request.url=http://example.com - * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } * - * JSONHandler would display it as + * resp, err := client.Get("http://example.com") + * // ... * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: * * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") * ``` * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. + * # Servers * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: * * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values + * http.Handle("/foo", fooHandler) * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) * - * ``` - * slog.Info("hello", slog.Int("count", 3)) + * log.Fatal(http.ListenAndServe(":8080", nil)) * ``` * - * behaves the same as + * More control over the server's behavior is available by creating a + * custom Server: * * ``` - * slog.Info("hello", "count", 3) + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) * ``` * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` + * # HTTP/2 * - * is the most efficient way to achieve the same output as + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: * * ``` - * slog.InfoContext(ctx, "hello", "count", 3) + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps * ``` * - * # Customizing a type's logging behavior + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call - * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` - * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: - * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` - * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: - * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: - * - * ``` - * type expensive struct { arg int } - * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } - * ``` - * - * Then use a value of that type in log calls: - * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that each record is written in one piece. User-defined - * handlers are responsible for their own locking. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. */ -namespace slog { - // @ts-ignore - import loginternal = internal +namespace http { /** - * A Logger records structured information about each call to its - * Log, Debug, Info, Warn, and Error methods. - * For each call, it creates a [Record] and passes it to a [Handler]. + * A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an + * HTTP response or the Cookie header of an HTTP request. * - * To create a new Logger, call [New] or a Logger method - * that begins "With". + * See https://tools.ietf.org/html/rfc6265 for details. */ - interface Logger { - } - interface Logger { + interface Cookie { + name: string + value: string + quoted: boolean // indicates whether the Value was originally quoted + path: string // optional + domain: string // optional + expires: time.Time // optional + rawExpires: string // for reading cookies only /** - * Handler returns l's Handler. + * MaxAge=0 means no 'Max-Age' attribute specified. + * MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0' + * MaxAge>0 means Max-Age attribute present and given in seconds */ - handler(): Handler + maxAge: number + secure: boolean + httpOnly: boolean + sameSite: SameSite + partitioned: boolean + raw: string + unparsed: Array // Raw text of unparsed attribute-value pairs } - interface Logger { + interface Cookie { /** - * With returns a Logger that includes the given attributes - * in each output operation. Arguments are converted to - * attributes as if by [Logger.Log]. + * String returns the serialization of the cookie for use in a [Cookie] + * header (if only Name and Value are set) or a Set-Cookie response + * header (if other fields are set). + * If c is nil or c.Name is invalid, the empty string is returned. */ - with(...args: any[]): (Logger) + string(): string } - interface Logger { + interface Cookie { /** - * WithGroup returns a Logger that starts a group, if name is non-empty. - * The keys of all attributes added to the Logger will be qualified by the given - * name. (How that qualification happens depends on the [Handler.WithGroup] - * method of the Logger's Handler.) - * - * If name is empty, WithGroup returns the receiver. + * Valid reports whether the cookie is valid. */ - withGroup(name: string): (Logger) + valid(): void } - interface Logger { + // @ts-ignore + import mathrand = rand + /** + * A Header represents the key-value pairs in an HTTP header. + * + * The keys should be in canonical form, as returned by + * [CanonicalHeaderKey]. + */ + interface Header extends _TygojaDict{} + interface Header { /** - * Enabled reports whether l emits log records at the given context and level. + * Add adds the key, value pair to the header. + * It appends to any existing values associated with key. + * The key is case insensitive; it is canonicalized by + * [CanonicalHeaderKey]. */ - enabled(ctx: context.Context, level: Level): boolean + add(key: string, value: string): void } - interface Logger { + interface Header { /** - * Log emits a log record with the current time and the given level and message. - * The Record's Attrs consist of the Logger's attributes followed by - * the Attrs specified by args. - * - * The attribute arguments are processed as follows: - * ``` - * - If an argument is an Attr, it is used as is. - * - If an argument is a string and this is not the last argument, - * the following argument is treated as the value and the two are combined - * into an Attr. - * - Otherwise, the argument is treated as a value with key "!BADKEY". - * ``` + * Set sets the header entries associated with key to the + * single element value. It replaces any existing values + * associated with key. The key is case insensitive; it is + * canonicalized by [textproto.CanonicalMIMEHeaderKey]. + * To use non-canonical keys, assign to the map directly. */ - log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void + set(key: string, value: string): void } - interface Logger { + interface Header { /** - * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. + * Get gets the first value associated with the given key. If + * there are no values associated with the key, Get returns "". + * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is + * used to canonicalize the provided key. Get assumes that all + * keys are stored in canonical form. To use non-canonical keys, + * access the map directly. */ - logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void + get(key: string): string } - interface Logger { + interface Header { /** - * Debug logs at [LevelDebug]. + * Values returns all values associated with the given key. + * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is + * used to canonicalize the provided key. To use non-canonical + * keys, access the map directly. + * The returned slice is not a copy. */ - debug(msg: string, ...args: any[]): void + values(key: string): Array } - interface Logger { + interface Header { /** - * DebugContext logs at [LevelDebug] with the given context. + * Del deletes the values associated with key. + * The key is case insensitive; it is canonicalized by + * [CanonicalHeaderKey]. */ - debugContext(ctx: context.Context, msg: string, ...args: any[]): void + del(key: string): void } - interface Logger { + interface Header { /** - * Info logs at [LevelInfo]. + * Write writes a header in wire format. */ - info(msg: string, ...args: any[]): void + write(w: io.Writer): void } - interface Logger { + interface Header { /** - * InfoContext logs at [LevelInfo] with the given context. + * Clone returns a copy of h or nil if h is nil. */ - infoContext(ctx: context.Context, msg: string, ...args: any[]): void + clone(): Header } - interface Logger { + interface Header { /** - * Warn logs at [LevelWarn]. + * WriteSubset writes a header in wire format. + * If exclude is not nil, keys where exclude[key] == true are not written. + * Keys are not canonicalized before checking the exclude map. */ - warn(msg: string, ...args: any[]): void + writeSubset(w: io.Writer, exclude: _TygojaDict): void } - interface Logger { + // @ts-ignore + import urlpkg = url + /** + * Response represents the response from an HTTP request. + * + * The [Client] and [Transport] return Responses from servers once + * the response headers have been received. The response body + * is streamed on demand as the Body field is read. + */ + interface Response { + status: string // e.g. "200 OK" + statusCode: number // e.g. 200 + proto: string // e.g. "HTTP/1.0" + protoMajor: number // e.g. 1 + protoMinor: number // e.g. 0 /** - * WarnContext logs at [LevelWarn] with the given context. + * Header maps header keys to values. If the response had multiple + * headers with the same key, they may be concatenated, with comma + * delimiters. (RFC 7230, section 3.2.2 requires that multiple headers + * be semantically equivalent to a comma-delimited sequence.) When + * Header values are duplicated by other fields in this struct (e.g., + * ContentLength, TransferEncoding, Trailer), the field values are + * authoritative. + * + * Keys in the map are canonicalized (see CanonicalHeaderKey). */ - warnContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { + header: Header /** - * Error logs at [LevelError]. + * Body represents the response body. + * + * The response body is streamed on demand as the Body field + * is read. If the network connection fails or the server + * terminates the response, Body.Read calls return an error. + * + * The http Client and Transport guarantee that Body is always + * non-nil, even on responses without a body or responses with + * a zero-length body. It is the caller's responsibility to + * close Body. The default HTTP client's Transport may not + * reuse HTTP/1.x "keep-alive" TCP connections if the Body is + * not read to completion and closed. + * + * The Body is automatically dechunked if the server replied + * with a "chunked" Transfer-Encoding. + * + * As of Go 1.12, the Body will also implement io.Writer + * on a successful "101 Switching Protocols" response, + * as used by WebSockets and HTTP/2's "h2c" mode. */ - error(msg: string, ...args: any[]): void - } - interface Logger { + body: io.ReadCloser /** - * ErrorContext logs at [LevelError] with the given context. + * ContentLength records the length of the associated content. The + * value -1 indicates that the length is unknown. Unless Request.Method + * is "HEAD", values >= 0 indicate that the given number of bytes may + * be read from Body. */ - errorContext(ctx: context.Context, msg: string, ...args: any[]): void - } -} - -namespace subscriptions { - /** - * Broker defines a struct for managing subscriptions clients. - */ - interface Broker { + contentLength: number + /** + * Contains transfer encodings from outer-most to inner-most. Value is + * nil, means that "identity" encoding is used. + */ + transferEncoding: Array + /** + * Close records whether the header directed that the connection be + * closed after reading Body. The value is advice for clients: neither + * ReadResponse nor Response.Write ever closes a connection. + */ + close: boolean + /** + * Uncompressed reports whether the response was sent compressed but + * was decompressed by the http package. When true, reading from + * Body yields the uncompressed content instead of the compressed + * content actually set from the server, ContentLength is set to -1, + * and the "Content-Length" and "Content-Encoding" fields are deleted + * from the responseHeader. To get the original response from + * the server, set Transport.DisableCompression to true. + */ + uncompressed: boolean + /** + * Trailer maps trailer keys to values in the same + * format as Header. + * + * The Trailer initially contains only nil values, one for + * each key specified in the server's "Trailer" header + * value. Those values are not added to Header. + * + * Trailer must not be accessed concurrently with Read calls + * on the Body. + * + * After Body.Read has returned io.EOF, Trailer will contain + * any trailer values sent by the server. + */ + trailer: Header + /** + * Request is the request that was sent to obtain this Response. + * Request's Body is nil (having already been consumed). + * This is only populated for Client requests. + */ + request?: Request + /** + * TLS contains information about the TLS connection on which the + * response was received. It is nil for unencrypted responses. + * The pointer is shared between responses and should not be + * modified. + */ + tls?: any } - interface Broker { + interface Response { /** - * Clients returns a shallow copy of all registered clients indexed - * with their connection id. + * Cookies parses and returns the cookies set in the Set-Cookie headers. */ - clients(): _TygojaDict + cookies(): Array<(Cookie | undefined)> } - interface Broker { + interface Response { /** - * ClientById finds a registered client by its id. - * - * Returns non-nil error when client with clientId is not registered. + * Location returns the URL of the response's "Location" header, + * if present. Relative redirects are resolved relative to + * [Response.Request]. [ErrNoLocation] is returned if no + * Location header is present. */ - clientById(clientId: string): Client + location(): (url.URL) } - interface Broker { + interface Response { /** - * Register adds a new client to the broker instance. + * ProtoAtLeast reports whether the HTTP protocol used + * in the response is at least major.minor. */ - register(client: Client): void + protoAtLeast(major: number, minor: number): boolean } - interface Broker { + interface Response { /** - * Unregister removes a single client by its id. + * Write writes r to w in the HTTP/1.x server response format, + * including the status line, headers, body, and optional trailer. * - * If client with clientId doesn't exist, this method does nothing. + * This method consults the following fields of the response r: + * + * ``` + * StatusCode + * ProtoMajor + * ProtoMinor + * Request.Method + * TransferEncoding + * Trailer + * Body + * ContentLength + * Header, values for non-canonical keys will have unpredictable behavior + * ``` + * + * The Response Body is closed after it is sent. */ - unregister(clientId: string): void + write(w: io.Writer): void + } + /** + * A Handler responds to an HTTP request. + * + * [Handler.ServeHTTP] should write reply headers and data to the [ResponseWriter] + * and then return. Returning signals that the request is finished; it + * is not valid to use the [ResponseWriter] or read from the + * [Request.Body] after or concurrently with the completion of the + * ServeHTTP call. + * + * Depending on the HTTP client software, HTTP protocol version, and + * any intermediaries between the client and the Go server, it may not + * be possible to read from the [Request.Body] after writing to the + * [ResponseWriter]. Cautious handlers should read the [Request.Body] + * first, and then reply. + * + * Except for reading the body, handlers should not modify the + * provided Request. + * + * If ServeHTTP panics, the server (the caller of ServeHTTP) assumes + * that the effect of the panic was isolated to the active request. + * It recovers the panic, logs a stack trace to the server error log, + * and either closes the network connection or sends an HTTP/2 + * RST_STREAM, depending on the HTTP protocol. To abort a handler so + * the client sees an interrupted response but the server doesn't log + * an error, panic with the value [ErrAbortHandler]. + */ + interface Handler { + [key:string]: any; + serveHTTP(_arg0: ResponseWriter, _arg1: Request): void + } + /** + * A ConnState represents the state of a client connection to a server. + * It's used by the optional [Server.ConnState] hook. + */ + interface ConnState extends Number{} + interface ConnState { + string(): string } } /** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. + * Package gcerr provides an error type for Go CDK APIs. */ -namespace core { - interface BootstrapEvent { - app: App - } - interface TerminateEvent { - app: App - isRestart: boolean - } - interface ServeEvent { - app: App - router?: echo.Echo - server?: http.Server - certManager?: any - } - interface ApiErrorEvent { - httpContext: echo.Context - error: Error - } - type _subIqXTj = BaseModelEvent - interface ModelEvent extends _subIqXTj { - dao?: daos.Dao - } - type _subYBsYP = BaseCollectionEvent - interface MailerRecordEvent extends _subYBsYP { - mailClient: mailer.Mailer - message?: mailer.Message - record?: models.Record - meta: _TygojaDict - } - interface MailerAdminEvent { - mailClient: mailer.Mailer - message?: mailer.Message - admin?: models.Admin - meta: _TygojaDict - } - interface RealtimeConnectEvent { - httpContext: echo.Context - client: subscriptions.Client - idleTimeout: time.Duration - } - interface RealtimeDisconnectEvent { - httpContext: echo.Context - client: subscriptions.Client - } - interface RealtimeMessageEvent { - httpContext: echo.Context - client: subscriptions.Client - message?: subscriptions.Message - } - interface RealtimeSubscribeEvent { - httpContext: echo.Context - client: subscriptions.Client - subscriptions: Array - } - interface SettingsListEvent { - httpContext: echo.Context - redactedSettings?: settings.Settings - } - interface SettingsUpdateEvent { - httpContext: echo.Context - oldSettings?: settings.Settings - newSettings?: settings.Settings - } - type _subLkmRK = BaseCollectionEvent - interface RecordsListEvent extends _subLkmRK { - httpContext: echo.Context - records: Array<(models.Record | undefined)> - result?: search.Result - } - type _subrYldn = BaseCollectionEvent - interface RecordViewEvent extends _subrYldn { - httpContext: echo.Context - record?: models.Record - } - type _subShsfQ = BaseCollectionEvent - interface RecordCreateEvent extends _subShsfQ { - httpContext: echo.Context - record?: models.Record - uploadedFiles: _TygojaDict - } - type _subBQgiv = BaseCollectionEvent - interface RecordUpdateEvent extends _subBQgiv { - httpContext: echo.Context - record?: models.Record - uploadedFiles: _TygojaDict - } - type _subwKNJA = BaseCollectionEvent - interface RecordDeleteEvent extends _subwKNJA { - httpContext: echo.Context - record?: models.Record - } - type _subNVvZz = BaseCollectionEvent - interface RecordAuthEvent extends _subNVvZz { - httpContext: echo.Context - record?: models.Record - token: string - meta: any - } - type _subxBJeP = BaseCollectionEvent - interface RecordAuthWithPasswordEvent extends _subxBJeP { - httpContext: echo.Context - record?: models.Record - identity: string - password: string - } - type _subUSiim = BaseCollectionEvent - interface RecordAuthWithOAuth2Event extends _subUSiim { - httpContext: echo.Context - providerName: string - providerClient: auth.Provider - record?: models.Record - oAuth2User?: auth.AuthUser - isNewRecord: boolean - } - type _subdXIjq = BaseCollectionEvent - interface RecordAuthRefreshEvent extends _subdXIjq { - httpContext: echo.Context - record?: models.Record - } - type _subvFage = BaseCollectionEvent - interface RecordRequestPasswordResetEvent extends _subvFage { - httpContext: echo.Context - record?: models.Record - } - type _subojVuh = BaseCollectionEvent - interface RecordConfirmPasswordResetEvent extends _subojVuh { - httpContext: echo.Context - record?: models.Record - } - type _subhRgnz = BaseCollectionEvent - interface RecordRequestVerificationEvent extends _subhRgnz { - httpContext: echo.Context - record?: models.Record - } - type _subOEyNW = BaseCollectionEvent - interface RecordConfirmVerificationEvent extends _subOEyNW { - httpContext: echo.Context - record?: models.Record - } - type _subJiOHg = BaseCollectionEvent - interface RecordRequestEmailChangeEvent extends _subJiOHg { - httpContext: echo.Context - record?: models.Record - } - type _suboVOGS = BaseCollectionEvent - interface RecordConfirmEmailChangeEvent extends _suboVOGS { - httpContext: echo.Context - record?: models.Record - } - type _subQMnYt = BaseCollectionEvent - interface RecordListExternalAuthsEvent extends _subQMnYt { - httpContext: echo.Context - record?: models.Record - externalAuths: Array<(models.ExternalAuth | undefined)> - } - type _subAmSHR = BaseCollectionEvent - interface RecordUnlinkExternalAuthEvent extends _subAmSHR { - httpContext: echo.Context - record?: models.Record - externalAuth?: models.ExternalAuth - } - interface AdminsListEvent { - httpContext: echo.Context - admins: Array<(models.Admin | undefined)> - result?: search.Result - } - interface AdminViewEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminCreateEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminUpdateEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminDeleteEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminAuthEvent { - httpContext: echo.Context - admin?: models.Admin - token: string - } - interface AdminAuthWithPasswordEvent { - httpContext: echo.Context - admin?: models.Admin - identity: string - password: string - } - interface AdminAuthRefreshEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminRequestPasswordResetEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminConfirmPasswordResetEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface CollectionsListEvent { - httpContext: echo.Context - collections: Array<(models.Collection | undefined)> - result?: search.Result - } - type _subsmzBX = BaseCollectionEvent - interface CollectionViewEvent extends _subsmzBX { - httpContext: echo.Context - } - type _subErkii = BaseCollectionEvent - interface CollectionCreateEvent extends _subErkii { - httpContext: echo.Context - } - type _subwhxGp = BaseCollectionEvent - interface CollectionUpdateEvent extends _subwhxGp { - httpContext: echo.Context - } - type _subLGwgi = BaseCollectionEvent - interface CollectionDeleteEvent extends _subLGwgi { - httpContext: echo.Context - } - interface CollectionsImportEvent { - httpContext: echo.Context - collections: Array<(models.Collection | undefined)> - } - type _subJwbPo = BaseModelEvent - interface FileTokenEvent extends _subJwbPo { - httpContext: echo.Context - token: string - } - type _subcppDF = BaseCollectionEvent - interface FileDownloadEvent extends _subcppDF { - httpContext: echo.Context - record?: models.Record - fileField?: schema.SchemaField - servedPath: string - servedName: string +namespace gcerr { + interface ErrorCode { + string(): string } + /** + * An ErrorCode describes the error's category. + */ + interface ErrorCode extends Number{} } /** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} +namespace blob { /** - * Group Structure to manage groups for commands + * Writer writes bytes to a blob. + * + * It implements io.WriteCloser (https://golang.org/pkg/io/#Closer), and must be + * closed after all writes are done. */ - interface Group { - id: string - title: string + interface Writer { } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} - /** - * CompletionOptions are the options to control shell completion - */ - interface CompletionOptions { + interface Writer { /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + * Write implements the io.Writer interface (https://golang.org/pkg/io/#Writer). + * + * Writes may happen asynchronously, so the returned error can be nil + * even if the actual write eventually fails. The write is only guaranteed to + * have succeeded if Close returns no error. */ - disableDefaultCmd: boolean + write(p: string|Array): number + } + interface Writer { /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions + * Close closes the blob writer. The write operation is not guaranteed to have succeeded until + * Close returns with no error. + * Close may return an error if the context provided to create the Writer is + * canceled or reaches its deadline. */ - disableNoDescFlag: boolean + close(): void + } + interface Writer { /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them + * ReadFrom reads from r and writes to w until EOF or error. + * The return value is the number of bytes read from r. + * + * It implements the io.ReaderFrom interface. */ - disableDescriptions: boolean + readFrom(r: io.Reader): number + } + /** + * ListOptions sets options for listing blobs via Bucket.List. + */ + interface ListOptions { /** - * HiddenDefaultCmd makes the default 'completion' command hidden + * Prefix indicates that only blobs with a key starting with this prefix + * should be returned. */ - hiddenDefaultCmd: boolean - } -} - -namespace migrate { - interface Migration { - file: string - up: (db: dbx.Builder) => void - down: (db: dbx.Builder) => void + prefix: string + /** + * Delimiter sets the delimiter used to define a hierarchical namespace, + * like a filesystem with "directories". It is highly recommended that you + * use "" or "/" as the Delimiter. Other values should work through this API, + * but service UIs generally assume "/". + * + * An empty delimiter means that the bucket is treated as a single flat + * namespace. + * + * A non-empty delimiter means that any result with the delimiter in its key + * after Prefix is stripped will be returned with ListObject.IsDir = true, + * ListObject.Key truncated after the delimiter, and zero values for other + * ListObject fields. These results represent "directories". Multiple results + * in a "directory" are returned as a single result. + */ + delimiter: string + /** + * BeforeList is a callback that will be called before each call to the + * the underlying service's list functionality. + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. + */ + beforeList: (asFunc: (_arg0: { + }) => boolean) => void } -} - -/** - * Package url parses URLs and implements query escaping. - */ -namespace url { /** - * The Userinfo type is an immutable encapsulation of username and - * password details for a [URL]. An existing Userinfo value is guaranteed - * to have a username set (potentially empty, as allowed by RFC 2396), - * and optionally a password. + * ListIterator iterates over List results. */ - interface Userinfo { + interface ListIterator { } - interface Userinfo { + interface ListIterator { /** - * Username returns the username. + * Next returns a *ListObject for the next blob. It returns (nil, io.EOF) if + * there are no more. */ - username(): string + next(ctx: context.Context): (ListObject) } - interface Userinfo { + /** + * SignedURLOptions sets options for SignedURL. + */ + interface SignedURLOptions { /** - * Password returns the password in case it is set, and whether it is set. + * Expiry sets how long the returned URL is valid for. + * Defaults to DefaultSignedURLExpiry. */ - password(): [string, boolean] - } - interface Userinfo { + expiry: time.Duration /** - * String returns the encoded userinfo information in the standard form - * of "username[:password]". + * Method is the HTTP method that can be used on the URL; one of "GET", "PUT", + * or "DELETE". Defaults to "GET". */ - string(): string + method: string + /** + * ContentType specifies the Content-Type HTTP header the user agent is + * permitted to use in the PUT request. It must match exactly. See + * EnforceAbsentContentType for behavior when ContentType is the empty string. + * If a bucket does not implement this verification, then it returns an + * Unimplemented error. + * + * Must be empty for non-PUT requests. + */ + contentType: string + /** + * If EnforceAbsentContentType is true and ContentType is the empty string, + * then PUTing to the signed URL will fail if the Content-Type header is + * present. Not all buckets support this: ones that do not will return an + * Unimplemented error. + * + * If EnforceAbsentContentType is false and ContentType is the empty string, + * then PUTing without a Content-Type header will succeed, but it is + * implementation-specific whether providing a Content-Type header will fail. + * + * Must be false for non-PUT requests. + */ + enforceAbsentContentType: boolean + /** + * BeforeSign is a callback that will be called before each call to the + * the underlying service's sign functionality. + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. + */ + beforeSign: (asFunc: (_arg0: { + }) => boolean) => void } -} - -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * By default the pure Go resolver is used, because a blocked DNS request consumes - * only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement, and when the name being looked up ends in .local - * or is an mDNS name. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. - * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. - */ -namespace net { /** - * Addr represents a network end point address. - * - * The two methods [Addr.Network] and [Addr.String] conventionally return strings - * that can be passed as the arguments to [Dial], but the exact form - * and meaning of the strings is up to the implementation. + * ReaderOptions sets options for NewReader and NewRangeReader. */ - interface Addr { - [key:string]: any; - network(): string // name of the network (for example, "tcp", "udp") - string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") + interface ReaderOptions { + /** + * BeforeRead is a callback that will be called before + * any data is read (unless NewReader returns an error before then, in which + * case it may not be called at all). + * + * Calling Seek may reset the underlying reader, and result in BeforeRead + * getting called again with a different underlying provider-specific reader.. + * + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. + */ + beforeRead: (asFunc: (_arg0: { + }) => boolean) => void } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { /** - * JsonRaw defines a json value type that is safe for db read/write. + * WriterOptions sets options for NewWriter. */ - interface JsonRaw extends Array{} - interface JsonRaw { + interface WriterOptions { /** - * String returns the current JsonRaw instance as a json encoded string. + * BufferSize changes the default size in bytes of the chunks that + * Writer will upload in a single request; larger blobs will be split into + * multiple requests. + * + * This option may be ignored by some drivers. + * + * If 0, the driver will choose a reasonable default. + * + * If the Writer is used to do many small writes concurrently, using a + * smaller BufferSize may reduce memory usage. */ - string(): string - } - interface JsonRaw { + bufferSize: number /** - * MarshalJSON implements the [json.Marshaler] interface. + * MaxConcurrency changes the default concurrency for parts of an upload. + * + * This option may be ignored by some drivers. + * + * If 0, the driver will choose a reasonable default. */ - marshalJSON(): string|Array - } - interface JsonRaw { + maxConcurrency: number /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control */ - unmarshalJSON(b: string|Array): void - } - interface JsonRaw { + cacheControl: string /** - * Value implements the [driver.Valuer] interface. + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition */ - value(): any - } - interface JsonRaw { + contentDisposition: string /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonRaw instance. + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding */ - scan(value: any): void + contentEncoding: string + /** + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language + */ + contentLanguage: string + /** + * ContentType specifies the MIME type of the blob being written. If not set, + * it will be inferred from the content using the algorithm described at + * http://mimesniff.spec.whatwg.org/. + * Set DisableContentTypeDetection to true to disable the above and force + * the ContentType to stay empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type + */ + contentType: string + /** + * When true, if ContentType is the empty string, it will stay the empty + * string rather than being inferred from the content. + * Note that while the blob will be written with an empty string ContentType, + * most providers will fill one in during reads, so don't expect an empty + * ContentType if you read the blob back. + */ + disableContentTypeDetection: boolean + /** + * ContentMD5 is used as a message integrity check. + * If len(ContentMD5) > 0, the MD5 hash of the bytes written must match + * ContentMD5, or Close will return an error without completing the write. + * https://tools.ietf.org/html/rfc1864 + */ + contentMD5: string|Array + /** + * Metadata holds key/value strings to be associated with the blob, or nil. + * Keys may not be empty, and are lowercased before being written. + * Duplicate case-insensitive keys (e.g., "foo" and "FOO") will result in + * an error. + */ + metadata: _TygojaDict + /** + * BeforeWrite is a callback that will be called exactly once, before + * any data is written (unless NewWriter returns an error, in which case + * it will not be called at all). Note that this is not necessarily during + * or after the first Write call, as drivers may buffer bytes before + * sending an upload request. + * + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. + */ + beforeWrite: (asFunc: (_arg0: { + }) => boolean) => void } -} - -/** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. - */ -namespace bufio { /** - * ReadWriter stores pointers to a [Reader] and a [Writer]. - * It implements [io.ReadWriter]. + * CopyOptions sets options for Copy. */ - type _subjuTbM = Reader&Writer - interface ReadWriter extends _subjuTbM { + interface CopyOptions { + /** + * BeforeCopy is a callback that will be called before the copy is + * initiated. + * + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. + */ + beforeCopy: (asFunc: (_arg0: { + }) => boolean) => void } } /** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. * - * Reader.NextPart and Reader.NextRawPart limit the number of headers in a - * part to 10000 and Reader.ReadForm limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. + * Drivers that do not support context cancellation will not return until + * after the query is completed. * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. - */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. */ -namespace multipart { +namespace sql { /** - * A Part represents a single part in a multipart body. + * IsolationLevel is the transaction isolation level used in [TxOptions]. */ - interface Part { + interface IsolationLevel extends Number{} + interface IsolationLevel { /** - * The headers of the body, if any, with the keys canonicalized - * in the same fashion that the Go http.Request headers are. - * For example, "foo-bar" changes case to "Foo-Bar" + * String returns the name of the transaction isolation level. */ - header: textproto.MIMEHeader + string(): string } - interface Part { + /** + * DBStats contains database statistics. + */ + interface DBStats { + maxOpenConnections: number // Maximum number of open connections to the database. /** - * FormName returns the name parameter if p has a Content-Disposition - * of type "form-data". Otherwise it returns the empty string. + * Pool Status */ - formName(): string + openConnections: number // The number of established connections both in use and idle. + inUse: number // The number of connections currently in use. + idle: number // The number of idle connections. + /** + * Counters + */ + waitCount: number // The total number of connections waited for. + waitDuration: time.Duration // The total time blocked waiting for a new connection. + maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. + maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. + maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. } - interface Part { + /** + * Conn represents a single database connection rather than a pool of database + * connections. Prefer running queries from [DB] unless there is a specific + * need for a continuous single database connection. + * + * A Conn must call [Conn.Close] to return the connection to the database pool + * and may do so concurrently with a running query. + * + * After a call to [Conn.Close], all operations on the + * connection fail with [ErrConnDone]. + */ + interface Conn { + } + interface Conn { /** - * FileName returns the filename parameter of the Part's Content-Disposition - * header. If not empty, the filename is passed through filepath.Base (which is - * platform dependent) before being returned. + * PingContext verifies the connection to the database is still alive. */ - fileName(): string + pingContext(ctx: context.Context): void } - interface Part { + interface Conn { /** - * Read reads the body of a part, after its headers and before the - * next part (if any) begins. + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. */ - read(d: string|Array): number + execContext(ctx: context.Context, query: string, ...args: any[]): Result } - interface Part { + interface Conn { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface Conn { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * the [*Row.Scan] method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface Conn { + /** + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + */ + prepareContext(ctx: context.Context, query: string): (Stmt) + } + interface Conn { + /** + * Raw executes f exposing the underlying driver connection for the + * duration of f. The driverConn must not be used outside of f. + * + * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable + * until [Conn.Close] is called. + */ + raw(f: (driverConn: any) => void): void + } + interface Conn { + /** + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. + * + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. + */ + beginTx(ctx: context.Context, opts: TxOptions): (Tx) + } + interface Conn { + /** + * Close returns the connection to the connection pool. + * All operations after a Close will return with [ErrConnDone]. + * Close is safe to call concurrently with other operations and will + * block until all other operations finish. It may be useful to first + * cancel any used context and then call close directly after. + */ close(): void } + /** + * ColumnType contains the name and type of a column. + */ + interface ColumnType { + } + interface ColumnType { + /** + * Name returns the name or alias of the column. + */ + name(): string + } + interface ColumnType { + /** + * Length returns the column type length for variable length column types such + * as text and binary field types. If the type length is unbounded the value will + * be [math.MaxInt64] (any database limits will still apply). + * If the column type is not variable length, such as an int, or if not supported + * by the driver ok is false. + */ + length(): [number, boolean] + } + interface ColumnType { + /** + * DecimalSize returns the scale and precision of a decimal type. + * If not applicable or if not supported ok is false. + */ + decimalSize(): [number, number, boolean] + } + interface ColumnType { + /** + * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. + * If a driver does not support this property ScanType will return + * the type of an empty interface. + */ + scanType(): any + } + interface ColumnType { + /** + * Nullable reports whether the column may be null. + * If a driver does not support this property ok will be false. + */ + nullable(): [boolean, boolean] + } + interface ColumnType { + /** + * DatabaseTypeName returns the database system name of the column type. If an empty + * string is returned, then the driver type name is not supported. + * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers + * are not included. + * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + */ + databaseTypeName(): string + } + /** + * Row is the result of calling [DB.QueryRow] to select a single row. + */ + interface Row { + } + interface Row { + /** + * Scan copies the columns from the matched row into the values + * pointed at by dest. See the documentation on [Rows.Scan] for details. + * If more than one row matches the query, + * Scan uses the first row and discards the rest. If no row matches + * the query, Scan returns [ErrNoRows]. + */ + scan(...dest: any[]): void + } + interface Row { + /** + * Err provides a way for wrapping packages to check for + * query errors without calling [Row.Scan]. + * Err returns the error, if any, that was encountered while running the query. + * If this error is not nil, this error will also be returned from [Row.Scan]. + */ + err(): void + } +} + +namespace migrate { + interface Migration { + file: string + up: (db: dbx.Builder) => void + down: (db: dbx.Builder) => void + } } /** - * Package http provides HTTP client and server implementations. + * Package middleware provides transport agnostic middleware for decorating SDK + * handlers. * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * The Smithy middleware stack provides ordered behavior to be invoked on an + * underlying handler. The stack is separated into steps that are invoked in a + * static order. A step is a collection of middleware that are injected into a + * ordered list defined by the user. The user may add, insert, swap, and remove a + * step's middleware. When the stack is invoked the step middleware become static, + * and their order cannot be modified. * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` + * A stack and its step middleware are **not** safe to modify concurrently. * - * The caller must close the response body when finished with it: + * A stack will use the ordered list of middleware to decorate a underlying + * handler. A handler could be something like an HTTP Client that round trips an + * API operation over HTTP. * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` + * Smithy Middleware Stack * - * # Clients and Transports + * A Stack is a collection of middleware that wrap a handler. The stack can be + * broken down into discreet steps. Each step may contain zero or more middleware + * specific to that stack's step. * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: + * A Stack Step is a predefined set of middleware that are invoked in a static + * order by the Stack. These steps represent fixed points in the middleware stack + * for organizing specific behavior, such as serialize and build. A Stack Step is + * composed of zero or more middleware that are specific to that step. A step may + * define its own set of input/output parameters the generic input/output + * parameters are cast from. A step calls its middleware recursively, before + * calling the next step in the stack returning the result or error of the step + * middleware decorating the underlying handler. * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } + * * Initialize: Prepares the input, and sets any default parameters as needed, + * (e.g. idempotency token, and presigned URLs). * - * resp, err := client.Get("http://example.com") - * // ... + * * Serialize: Serializes the prepared input into a data structure that can be + * consumed by the target transport's message, (e.g. REST-JSON serialization). * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` + * * Build: Adds additional metadata to the serialized transport message, (e.g. + * HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: + * * Finalize: Performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated to + * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request + * signing). * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` + * * Deserialize: Reacts to the handler's response returned by the recipient of + * the request message. Deserializes the response into a structured type or + * error above stacks can react to. * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. + * Adding Middleware to a Stack Step * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: + * Middleware can be added to a step front or back, or relative, by name, to an + * existing middleware in that stack. If a middleware does not have a name, a + * unique name will be generated at the middleware and be added to the step. * * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 + * // Create middleware stack + * stack := middleware.NewStack() * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: + * // Add middleware to stack steps + * stack.Initialize.Add(paramValidationMiddleware, middleware.After) + * stack.Serialize.Add(marshalOperationFoo, middleware.After) + * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) * + * // Invoke middleware on handler. + * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. */ -namespace http { +namespace middleware { /** - * SameSite allows a server to define a cookie attribute making it impossible for - * the browser to send this cookie along with cross-site requests. The main - * goal is to mitigate the risk of cross-origin information leakage, and provide - * some protection against cross-site request forgery attacks. + * Stack provides protocol and transport agnostic set of middleware split into + * distinct steps. Steps have specific transitions between them, that are + * managed by the individual step. * - * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. + * Steps are composed as middleware around the underlying handler in the + * following order: + * + * ``` + * Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler + * ``` + * + * Any middleware within the chain may choose to stop and return an error or + * response. Since the middleware decorate the handler like a call stack, each + * middleware will receive the result of the next middleware in the chain. + * Middleware that does not need to react to an input, or result must forward + * along the input down the chain, or return the result back up the chain. + * + * ``` + * Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler + * ``` */ - interface SameSite extends Number{} - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url -} - -namespace store { + interface Stack { + /** + * Initialize prepares the input, and sets any default parameters as + * needed, (e.g. idempotency token, and presigned URLs). + * + * Takes Input Parameters, and returns result or error. + * + * Receives result or error from Serialize step. + */ + initialize?: InitializeStep + /** + * Serialize serializes the prepared input into a data structure that can be consumed + * by the target transport's message, (e.g. REST-JSON serialization) + * + * Converts Input Parameters into a Request, and returns the result or error. + * + * Receives result or error from Build step. + */ + serialize?: SerializeStep + /** + * Build adds additional metadata to the serialized transport message + * (e.g. HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. + * + * Takes Request, and returns result or error. + * + * Receives result or error from Finalize step. + */ + build?: BuildStep + /** + * Finalize performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated + * to meet the expectations of the recipient (e.g. Retry and AWS SigV4 + * request signing) + * + * Takes Request, and returns result or error. + * + * Receives result or error from Deserialize step. + */ + finalize?: FinalizeStep + /** + * Deserialize reacts to the handler's response returned by the recipient of the request + * message. Deserializes the response into a structured type or error above + * stacks can react to. + * + * Should only forward Request to underlying handler. + * + * Takes Request, and returns result or error. + * + * Receives raw response, or error from underlying handler. + */ + deserialize?: DeserializeStep + } + interface Stack { + /** + * ID returns the unique ID for the stack as a middleware. + */ + id(): string + } + interface Stack { + /** + * HandleMiddleware invokes the middleware stack decorating the next handler. + * Each step of stack will be invoked in order before calling the next step. + * With the next handler call last. + * + * The input value must be the input parameters of the operation being + * performed. + * + * Will return the result of the operation, or error. + */ + handleMiddleware(ctx: context.Context, input: { + }, next: Handler): [{ + }, Metadata] + } + interface Stack { + /** + * List returns a list of all middleware in the stack by step. + */ + list(): Array + } + interface Stack { + string(): string + } } -namespace mailer { +/** + * Package bearer provides middleware and utilities for authenticating API + * operation calls with a Bearer Token. + */ +namespace bearer { + // @ts-ignore + import smithyhttp = http /** - * Message defines a generic email message struct. + * TokenProvider provides interface for retrieving bearer tokens. */ - interface Message { - from: mail.Address - to: Array - bcc: Array - cc: Array - subject: string - html: string - text: string - headers: _TygojaDict - attachments: _TygojaDict + interface TokenProvider { + [key:string]: any; + retrieveBearerToken(_arg0: context.Context): Token } + // @ts-ignore + import smithycontext = context } /** - * Package echo implements high performance, minimalist Go web framework. + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. * - * Example: + * # Value and Pointer Conversion Utilities + * + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. + * + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. + * + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. * * ``` - * package main + * var strPtr *string * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } + * // With the SDK's conversion functions + * strPtr = aws.String("my string") * - * func main() { - * // Echo instance - * e := echo.New() + * // Convert *string to string value + * str = aws.ToString(strPtr) + * ``` * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. * - * // Routes - * e.GET("/", hello) + * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) + * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) * ``` * - * Learn more at https://echo.labstack.com + * # SDK Default HTTP Client + * + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. + * + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. */ -namespace echo { +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + /** + * AccountIDEndpointMode controls how a resolved AWS account ID is handled for endpoint routing. + */ + interface AccountIDEndpointMode extends String{} // @ts-ignore - import stdContext = context + import smithybearer = bearer /** - * Route contains information to adding/registering new route with the router. - * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. + * HTTPClient provides the interface to provide custom HTTPClients. Generally + * *http.Client is sufficient for most use cases. The HTTPClient should not + * follow 301 or 302 redirects. */ - interface Route { - method: string - path: string - handler: HandlerFunc - middlewares: Array - name: string + interface HTTPClient { + [key:string]: any; + do(_arg0: http.Request): (http.Response) } - interface Route { + // @ts-ignore + import sdkrand = rand + /** + * A CredentialsProvider is the interface for any component which will provide + * credentials Credentials. A CredentialsProvider is required to manage its own + * Expired state, and what to be expired means. + * + * A credentials provider implementation can be wrapped with a CredentialCache + * to cache the credential value retrieved. Without the cache the SDK will + * attempt to retrieve the credentials for every request. + */ + interface CredentialsProvider { + [key:string]: any; /** - * ToRouteInfo converts Route to RouteInfo + * Retrieve returns nil if it successfully retrieved the value. + * Error is returned if the value were not obtainable, or empty. */ - toRouteInfo(params: Array): RouteInfo + retrieve(ctx: context.Context): Credentials } - interface Route { + /** + * DefaultsMode is the SDK defaults mode setting. + */ + interface DefaultsMode extends String{} + interface DefaultsMode { /** - * ToRoute returns Route which Router uses to register the method handler for path. + * SetFromString sets the DefaultsMode value to one of the pre-defined constants that matches + * the provided string when compared using EqualFold. If the value does not match a known + * constant it will be set to as-is and the function will return false. As a special case, if the + * provided value is a zero-length string, the mode will be set to LegacyDefaultsMode. */ - toRoute(): Route + setFromString(v: string): boolean } - interface Route { - /** - * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. - */ - forGroup(pathPrefix: string, middlewares: Array): Routable + /** + * EndpointResolver is an endpoint resolver that can be used to provide or + * override an endpoint for the given service and region. API clients will + * attempt to use the EndpointResolver first to resolve an endpoint if + * available. If the EndpointResolver returns an EndpointNotFoundError error, + * API clients will fallback to attempting to resolve the endpoint using its + * internal default endpoint resolver. + * + * Deprecated: The global endpoint resolution interface is deprecated. The API + * for endpoint resolution is now unique to each service and is set via the + * EndpointResolverV2 field on service client options. Setting a value for + * EndpointResolver on aws.Config or service client options will prevent you + * from using any endpoint-related service features released after the + * introduction of EndpointResolverV2. You may also encounter broken or + * unexpected behavior when using the old global interface with services that + * use many endpoint-related customizations such as S3. + */ + interface EndpointResolver { + [key:string]: any; + resolveEndpoint(service: string, region: string): Endpoint } /** - * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this - * interface are meant for request routing purposes and should not be used in middlewares. + * EndpointResolverWithOptions is an endpoint resolver that can be used to provide or + * override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will + * attempt to use the EndpointResolverWithOptions first to resolve an endpoint if + * available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error, + * API clients will fallback to attempting to resolve the endpoint using its + * internal default endpoint resolver. + * + * Deprecated: The global endpoint resolution interface is deprecated. See + * deprecation docs on [EndpointResolver]. */ - interface RoutableContext { + interface EndpointResolverWithOptions { [key:string]: any; + resolveEndpoint(service: string, region: string, ...options: { + }[]): Endpoint + } + /** + * ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where + * each bit is a flag that describes the logging behavior for one or more client components. + * The entire 64-bit group is reserved for later expansion by the SDK. + * + * Example: Setting ClientLogMode to enable logging of retries and requests + * + * ``` + * clientLogMode := aws.LogRetries | aws.LogRequest + * ``` + * + * Example: Adding an additional log mode to an existing ClientLogMode value + * + * ``` + * clientLogMode |= aws.LogResponse + * ``` + */ + interface ClientLogMode extends Number{} + interface ClientLogMode { /** - * Request returns `*http.Request`. + * IsSigning returns whether the Signing logging mode bit is set */ - request(): (http.Request) + isSigning(): boolean + } + interface ClientLogMode { /** - * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. + * IsRetries returns whether the Retries logging mode bit is set */ - rawPathParams(): (PathParams) + isRetries(): boolean + } + interface ClientLogMode { /** - * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). - * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. + * IsRequest returns whether the Request logging mode bit is set */ - setRawPathParams(params: PathParams): void + isRequest(): boolean + } + interface ClientLogMode { /** - * SetPath sets the registered path for the handler. + * IsRequestWithBody returns whether the RequestWithBody logging mode bit is set */ - setPath(p: string): void + isRequestWithBody(): boolean + } + interface ClientLogMode { /** - * SetRouteInfo sets the route info of this request to the context. + * IsResponse returns whether the Response logging mode bit is set */ - setRouteInfo(ri: RouteInfo): void + isResponse(): boolean + } + interface ClientLogMode { /** - * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context - * for later use in middlewares/handler. + * IsResponseWithBody returns whether the ResponseWithBody logging mode bit is set */ - set(key: string, val: { - }): void + isResponseWithBody(): boolean } - /** - * PathParam is tuple pf path parameter name and its value in request path - */ - interface PathParam { - name: string - value: string + interface ClientLogMode { + /** + * IsDeprecatedUsage returns whether the DeprecatedUsage logging mode bit is set + */ + isDeprecatedUsage(): boolean } -} - -namespace search { - /** - * Result defines the returned search result structure. - */ - interface Result { - page: number - perPage: number - totalItems: number - totalPages: number - items: any + interface ClientLogMode { + /** + * IsRequestEventMessage returns whether the RequestEventMessage logging mode bit is set + */ + isRequestEventMessage(): boolean } -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - interface EmailTemplate { - body: string - subject: string - actionUrl: string - hidden: boolean + interface ClientLogMode { + /** + * IsResponseEventMessage returns whether the ResponseEventMessage logging mode bit is set + */ + isResponseEventMessage(): boolean } - interface EmailTemplate { + interface ClientLogMode { /** - * Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. + * ClearSigning clears the Signing logging mode bit */ - validate(): void + clearSigning(): void } - interface EmailTemplate { + interface ClientLogMode { /** - * Resolve replaces the placeholder parameters in the current email - * template and returns its components as ready-to-use strings. + * ClearRetries clears the Retries logging mode bit */ - resolve(appName: string, appUrl: string, token: string): string + clearRetries(): void + } + interface ClientLogMode { + /** + * ClearRequest clears the Request logging mode bit + */ + clearRequest(): void + } + interface ClientLogMode { + /** + * ClearRequestWithBody clears the RequestWithBody logging mode bit + */ + clearRequestWithBody(): void + } + interface ClientLogMode { + /** + * ClearResponse clears the Response logging mode bit + */ + clearResponse(): void + } + interface ClientLogMode { + /** + * ClearResponseWithBody clears the ResponseWithBody logging mode bit + */ + clearResponseWithBody(): void + } + interface ClientLogMode { + /** + * ClearDeprecatedUsage clears the DeprecatedUsage logging mode bit + */ + clearDeprecatedUsage(): void + } + interface ClientLogMode { + /** + * ClearRequestEventMessage clears the RequestEventMessage logging mode bit + */ + clearRequestEventMessage(): void + } + interface ClientLogMode { + /** + * ClearResponseEventMessage clears the ResponseEventMessage logging mode bit + */ + clearResponseEventMessage(): void } -} - -namespace subscriptions { /** - * Message defines a client's channel data. + * RetryMode provides the mode the API client will use to create a retryer + * based on. */ - interface Message { - name: string - data: string|Array + interface RetryMode extends String{} + interface RetryMode { + string(): string } /** - * Client is an interface for a generic subscription client. + * Retryer is an interface to determine if a given error from a + * attempt should be retried, and if so what backoff delay to apply. The + * default implementation used by most services is the retry package's Standard + * type. Which contains basic retry logic using exponential backoff. */ - interface Client { + interface Retryer { [key:string]: any; /** - * Id Returns the unique id of the client. + * IsErrorRetryable returns if the failed attempt is retryable. This check + * should determine if the error can be retried, or if the error is + * terminal. */ - id(): string + isErrorRetryable(_arg0: Error): boolean /** - * Channel returns the client's communication channel. + * MaxAttempts returns the maximum number of attempts that can be made for + * an attempt before failing. A value of 0 implies that the attempt should + * be retried until it succeeds if the errors are retryable. */ - channel(): undefined + maxAttempts(): number /** - * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. - * If no prefix is specified, returns all subscriptions. + * RetryDelay returns the delay that should be used before retrying the + * attempt. Will return error if the delay could not be determined. */ - subscriptions(...prefixes: string[]): _TygojaDict + retryDelay(attempt: number, opErr: Error): time.Duration /** - * Subscribe subscribes the client to the provided subscriptions list. + * GetRetryToken attempts to deduct the retry cost from the retry token pool. + * Returning the token release function, or error. + */ + getRetryToken(ctx: context.Context, opErr: Error): (_arg0: Error) => void + /** + * GetInitialToken returns the initial attempt token that can increment the + * retry token pool if the attempt is successful. + */ + getInitialToken(): (_arg0: Error) => void + } + /** + * RuntimeEnvironment is a collection of values that are determined at runtime + * based on the environment that the SDK is executing in. Some of these values + * may or may not be present based on the executing environment and certain SDK + * configuration properties that drive whether these values are populated.. + */ + interface RuntimeEnvironment { + environmentIdentifier: ExecutionEnvironmentID + region: string + ec2InstanceMetadataRegion: string + } +} + +/** + * Package s3 provides the API client, operations, and parameter types for Amazon + * Simple Storage Service. + */ +namespace s3 { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import awshttp = http + // @ts-ignore + import internalauth = auth + // @ts-ignore + import internalauthsmithy = smithy + // @ts-ignore + import internalConfig = configsources + // @ts-ignore + import internalmiddleware = middleware + // @ts-ignore + import acceptencodingcust = accept_encoding + // @ts-ignore + import internalChecksum = checksum + // @ts-ignore + import presignedurlcust = presigned_url + // @ts-ignore + import s3sharedconfig = config + // @ts-ignore + import s3cust = customizations + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithyauth = auth + // @ts-ignore + import smithydocument = document + // @ts-ignore + import smithyhttp = http + type _subdoBVF = noSmithyDocumentSerde + interface AbortMultipartUploadInput extends _subdoBVF { + /** + * The bucket name to which the upload was taking place. * - * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. * - * Example: + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. * - * ``` - * Subscribe( - * "subscriptionA", - * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, - * ) - * ``` + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. */ - subscribe(...subs: string[]): void + bucket?: string /** - * Unsubscribe unsubscribes the client from the provided subscriptions list. + * Key of the object for which the multipart upload was initiated. + * + * This member is required. */ - unsubscribe(...subs: string[]): void + key?: string /** - * HasSubscription checks if the client is subscribed to `sub`. + * Upload ID that identifies the multipart upload. + * + * This member is required. */ - hasSubscription(sub: string): boolean + uploadId?: string /** - * Set stores any value to the client's context. + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). */ - set(key: string, value: any): void + expectedBucketOwner?: string /** - * Unset removes a single value from the client's context. + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html */ - unset(key: string): void + requestPayer: types.RequestPayer + } + type _subAhzcd = noSmithyDocumentSerde + interface AbortMultipartUploadOutput extends _subAhzcd { /** - * Get retrieves the key value from the client's context. + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. */ - get(key: string): any + requestCharged: types.RequestCharged /** - * Discard marks the client as "discarded", meaning that it - * shouldn't be used anymore for sending new messages. + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subRygdJ = noSmithyDocumentSerde + interface CompleteMultipartUploadInput extends _subRygdJ { + /** + * Name of the bucket to which the multipart upload was initiated. * - * It is safe to call Discard() multiple times. + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. */ - discard(): void + bucket?: string /** - * IsDiscarded indicates whether the client has been "discarded" - * and should no longer be used. + * Object key for which the multipart upload was initiated. + * + * This member is required. */ - isDiscarded(): boolean + key?: string /** - * Send sends the specified message to the client's channel (if not discarded). + * ID for the initiated multipart upload. + * + * This member is required. */ - send(m: Message): void + uploadId?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see + * [Checking object integrity]in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32C?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA1?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Uploads the object only if the object key name does not already exist in the + * bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. + * + * If a conflicting operation occurs during the upload S3 returns a 409 + * ConditionalRequestConflict response. On a 409 failure you should re-initiate the + * multipart upload with CreateMultipartUpload and re-upload each part. + * + * Expects the '*' (asterisk) character. + * + * For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + * User Guide. + * + * [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifNoneMatch?: string + /** + * The container for the multipart upload request information. + */ + multipartUpload?: types.CompletedMultipartUpload + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The server-side encryption (SSE) algorithm used to encrypt the object. This + * parameter is required only when the object was created using a checksum + * algorithm or if your bucket policy requires the use of SSE-C. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#ssec-require-condition-key + */ + sseCustomerAlgorithm?: string + /** + * The server-side encryption (SSE) customer managed key. This parameter is needed + * only when the object was created using a checksum algorithm. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKey?: string + /** + * The MD5 server-side encryption (SSE) customer managed key. This parameter is + * needed only when the object was created using a checksum algorithm. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKeyMD5?: string } -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` + type _subopwgM = noSmithyDocumentSerde + interface CompleteMultipartUploadOutput extends _subopwgM { + /** + * The name of the bucket that contains the newly created object. Does not return + * the access point ARN or access point alias if used. + * + * Access points are not supported by directory buckets. + */ + bucket?: string + /** + * Indicates whether the multipart upload uses an S3 Bucket Key for server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * Entity tag that identifies the newly created object's data. Objects with + * different object data will have different entity tags. The entity tag is an + * opaque string. The entity tag may or may not be an MD5 digest of the object + * data. If the entity tag is not an MD5 digest of the object data, it will contain + * one or more nonhexadecimal characters and/or will consist of less than 32 or + * more than 32 hexadecimal digits. For more information about how the entity tag + * is calculated, see [Checking object integrity]in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + eTag?: string + /** + * If the object expiration is configured, this will contain the expiration date ( + * expiry-date ) and rule ID ( rule-id ). The value of rule-id is URL-encoded. + * + * This functionality is not supported for directory buckets. + */ + expiration?: string + /** + * The object key of the newly created object. + */ + key?: string + /** + * The URI that identifies the newly created object. + */ + location?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when storing this object in Amazon S3 + * (for example, AES256 , aws:kms ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Version ID of the newly created object, in case the bucket has versioning + * turned on. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subzVCbd = noSmithyDocumentSerde + interface CopyObjectInput extends _subzVCbd { + /** + * The name of the destination bucket. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Specifies the source object for the copy operation. The source object can be up + * to 5 GB. If the source object is an object that was uploaded by using a + * multipart upload, the object copy will be a single part object after the source + * object is copied to the destination bucket. + * + * You specify the value of the copy source in one of two formats, depending on + * whether you want to access the source object through an [access point]: + * + * ``` + * - For objects not accessed through an access point, specify the name of the + * source bucket and the key of the source object, separated by a slash (/). For + * example, to copy the object reports/january.pdf from the general purpose + * bucket awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value + * must be URL-encoded. To copy the object reports/january.pdf from the directory + * bucket awsexamplebucket--use1-az5--x-s3 , use + * awsexamplebucket--use1-az5--x-s3/reports/january.pdf . The value must be + * URL-encoded. + * + * - For objects accessed through access points, specify the Amazon Resource + * Name (ARN) of the object as accessed through the access point, in the format + * arn:aws:s3:::accesspoint//object/ . For example, to copy the object + * reports/january.pdf through access point my-access-point owned by account + * 123456789012 in Region us-west-2 , use the URL encoding of + * arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf + * . The value must be URL encoded. + * + * - Amazon S3 supports copy operations using Access points only when the source + * and destination buckets are in the same Amazon Web Services Region. + * + * - Access points are not supported by directory buckets. + * ``` + * + * Alternatively, for objects accessed through Amazon S3 on Outposts, specify the + * ``` + * ARN of the object as accessed in the format + * arn:aws:s3-outposts:::outpost//object/ . For example, to copy the object + * reports/january.pdf through outpost my-outpost owned by account 123456789012 + * in Region us-west-2 , use the URL encoding of + * arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf + * . The value must be URL-encoded. + * ``` + * + * If your source bucket versioning is enabled, the x-amz-copy-source header by + * default identifies the current version of an object to copy. If the current + * version is a delete marker, Amazon S3 behaves as if the object was deleted. To + * copy a different version, use the versionId query parameter. Specifically, + * append ?versionId= to the value (for example, + * awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 + * ). If you don't specify a version ID, Amazon S3 copies the latest version of the + * source object. + * + * If you enable versioning on the destination bucket, Amazon S3 generates a + * unique version ID for the copied object. This version ID is different from the + * version ID of the source object. Amazon S3 returns the version ID of the copied + * object in the x-amz-version-id response header in the response. + * + * If you do not enable versioning or suspend it on the destination bucket, the + * version ID that Amazon S3 generates in the x-amz-version-id response header is + * always null. + * + * Directory buckets - S3 Versioning isn't enabled and supported for directory + * buckets. + * + * [access point]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html + * + * This member is required. + */ + copySource?: string + /** + * The key of the destination object. + * + * This member is required. + */ + key?: string + /** + * The canned access control list (ACL) to apply to the object. + * + * When you copy an object, the ACL metadata is not preserved and is set to private + * by default. Only the owner has full access control. To override the default ACL + * setting, specify a new ACL when you generate a copy request. For more + * information, see [Using ACLs]. + * + * If the destination bucket that you're copying objects to uses the bucket owner + * enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect + * permissions. Buckets that use this setting only accept PUT requests that don't + * specify an ACL or PUT requests that specify bucket owner full control ACLs, + * such as the bucket-owner-full-control canned ACL or an equivalent form of this + * ACL expressed in the XML format. For more information, see [Controlling ownership of objects and disabling ACLs]in the Amazon S3 + * User Guide. + * + * ``` + * - If your destination bucket uses the bucket owner enforced setting for + * Object Ownership, all objects written to the bucket by any account will be owned + * by the bucket owner. + * + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html + * [Controlling ownership of objects and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + */ + acl: types.ObjectCannedACL + /** + * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption + * with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). + * If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. + * + * Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object + * encryption with SSE-KMS. Specifying this header with a COPY action doesn’t + * affect bucket-level settings for S3 Bucket Key. + * + * For more information, see [Amazon S3 Bucket Keys] in the Amazon S3 User Guide. + * + * Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS + * encrypted objects from general purpose buckets to directory buckets, from + * directory buckets to general purpose buckets, or between directory buckets, + * through [CopyObject]. In this case, Amazon S3 makes a call to KMS every time a copy request + * is made for a KMS-encrypted object. + * + * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + */ + bucketKeyEnabled?: boolean + /** + * Specifies the caching behavior along the request/reply chain. + */ + cacheControl?: string + /** + * Indicates the algorithm that you want Amazon S3 to use to create the checksum + * for the object. For more information, see [Checking object integrity]in the Amazon S3 User Guide. + * + * When you copy an object, if the source object has a checksum, that checksum + * value will be copied to the new object by default. If the CopyObject request + * does not include this x-amz-checksum-algorithm header, the checksum algorithm + * will be copied from the source object to the destination object (if it's present + * on the source object). You can optionally specify a different checksum algorithm + * to use with the x-amz-checksum-algorithm header. Unrecognized or unsupported + * values will respond with the HTTP status code 400 Bad Request . + * + * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + * default checksum algorithm that's used for performance. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * Specifies presentational information for the object. Indicates whether an + * object should be displayed in a web browser or downloaded as a file. It allows + * specifying the desired filename for the downloaded file. + */ + contentDisposition?: string + /** + * Specifies what content encodings have been applied to the object and thus what + * decoding mechanisms must be applied to obtain the media-type referenced by the + * Content-Type header field. + * + * For directory buckets, only the aws-chunked value is supported in this header + * field. + */ + contentEncoding?: string + /** + * The language the content is in. + */ + contentLanguage?: string + /** + * A standard MIME type that describes the format of the object data. + */ + contentType?: string + /** + * Copies the object if its entity tag (ETag) matches the specified tag. + * + * If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since + * headers are present in the request and evaluate as follows, Amazon S3 returns + * 200 OK and copies the data: + * + * ``` + * - x-amz-copy-source-if-match condition evaluates to true + * + * - x-amz-copy-source-if-unmodified-since condition evaluates to false + * ``` + */ + copySourceIfMatch?: string + /** + * Copies the object if it has been modified since the specified time. + * + * If both the x-amz-copy-source-if-none-match and + * x-amz-copy-source-if-modified-since headers are present in the request and + * evaluate as follows, Amazon S3 returns the 412 Precondition Failed response + * code: + * + * ``` + * - x-amz-copy-source-if-none-match condition evaluates to false + * + * - x-amz-copy-source-if-modified-since condition evaluates to true + * ``` + */ + copySourceIfModifiedSince?: time.Time + /** + * Copies the object if its entity tag (ETag) is different than the specified ETag. + * + * If both the x-amz-copy-source-if-none-match and + * x-amz-copy-source-if-modified-since headers are present in the request and + * evaluate as follows, Amazon S3 returns the 412 Precondition Failed response + * code: + * + * ``` + * - x-amz-copy-source-if-none-match condition evaluates to false + * + * - x-amz-copy-source-if-modified-since condition evaluates to true + * ``` + */ + copySourceIfNoneMatch?: string + /** + * Copies the object if it hasn't been modified since the specified time. + * + * If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since + * headers are present in the request and evaluate as follows, Amazon S3 returns + * 200 OK and copies the data: + * + * ``` + * - x-amz-copy-source-if-match condition evaluates to true + * + * - x-amz-copy-source-if-unmodified-since condition evaluates to false + * ``` + */ + copySourceIfUnmodifiedSince?: time.Time + /** + * Specifies the algorithm to use when decrypting the source object (for example, + * AES256 ). + * + * If the source object for the copy is stored in Amazon S3 using SSE-C, you must + * provide the necessary encryption information in your request so that Amazon S3 + * can decrypt the object for copying. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceSSECustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use to decrypt + * the source object. The encryption key provided in this header must be the same + * one that was used when the source object was created. + * + * If the source object for the copy is stored in Amazon S3 using SSE-C, you must + * provide the necessary encryption information in your request so that Amazon S3 + * can decrypt the object for copying. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceSSECustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * If the source object for the copy is stored in Amazon S3 using SSE-C, you must + * provide the necessary encryption information in your request so that Amazon S3 + * can decrypt the object for copying. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceSSECustomerKeyMD5?: string + /** + * The account ID of the expected destination bucket owner. If the account ID that + * you provide does not match the actual owner of the destination bucket, the + * request fails with the HTTP status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The account ID of the expected source bucket owner. If the account ID that you + * provide does not match the actual owner of the source bucket, the request fails + * with the HTTP status code 403 Forbidden (access denied). + */ + expectedSourceBucketOwner?: string + /** + * The date and time at which the object is no longer cacheable. + */ + expires?: time.Time + /** + * Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantFullControl?: string + /** + * Allows grantee to read the object data and its metadata. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantRead?: string + /** + * Allows grantee to read the object ACL. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantReadACP?: string + /** + * Allows grantee to write the ACL for the applicable object. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantWriteACP?: string + /** + * A map of metadata to store with the object in S3. + */ + metadata: _TygojaDict + /** + * Specifies whether the metadata is copied from the source object or replaced + * with metadata that's provided in the request. When copying an object, you can + * preserve all metadata (the default) or specify new metadata. If this header + * isn’t specified, COPY is the default behavior. + * + * General purpose bucket - For general purpose buckets, when you grant + * permissions, you can use the s3:x-amz-metadata-directive condition key to + * enforce certain metadata behavior when objects are uploaded. For more + * information, see [Amazon S3 condition key examples]in the Amazon S3 User Guide. + * + * x-amz-website-redirect-location is unique to each object and is not copied when + * using the x-amz-metadata-directive header. To copy the value, you must specify + * x-amz-website-redirect-location in the request header. + * + * [Amazon S3 condition key examples]: https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html + */ + metadataDirective: types.MetadataDirective + /** + * Specifies whether you want to apply a legal hold to the object copy. + * + * This functionality is not supported for directory buckets. + */ + objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus + /** + * The Object Lock mode that you want to apply to the object copy. + * + * This functionality is not supported for directory buckets. + */ + objectLockMode: types.ObjectLockMode + /** + * The date and time when you want the Object Lock of the object copy to expire. + * + * This functionality is not supported for directory buckets. + */ + objectLockRetainUntilDate?: time.Time + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256 ). + * + * When you perform a CopyObject operation, if you want to use a different type of + * encryption setting for the target object, you can specify appropriate + * encryption-related headers to encrypt the target object with an Amazon S3 + * managed key, a KMS key, or a customer-provided key. If the encryption setting in + * your request is different from the default encryption configuration of the + * destination bucket, the encryption setting in your request takes precedence. + * + * This functionality is not supported when the destination bucket is a directory + * bucket. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded. Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. + * + * This functionality is not supported when the destination bucket is a directory + * bucket. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported when the destination bucket is a directory + * bucket. + */ + sseCustomerKeyMD5?: string + /** + * Specifies the Amazon Web Services KMS Encryption Context as an additional + * encryption context to use for the destination object encryption. The value of + * this header is a base64-encoded UTF-8 string holding JSON with the encryption + * context key-value pairs. + * + * General purpose buckets - This value must be explicitly added to specify + * encryption context for CopyObject requests if you want an additional encryption + * context for your destination object. The additional encryption context of the + * source object won't be copied to the destination object. For more information, + * see [Encryption context]in the Amazon S3 User Guide. + * + * Directory buckets - You can optionally provide an explicit encryption context + * value. The value must match the default encryption context - the bucket Amazon + * Resource Name (ARN). An additional encryption context value is not supported. + * + * [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context + */ + ssekmsEncryptionContext?: string + /** + * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object + * encryption. All GET and PUT requests for an object protected by KMS will fail if + * they're not made via SSL or using SigV4. For information about configuring any + * of the officially supported Amazon Web Services SDKs and Amazon Web Services + * CLI, see [Specifying the Signature Version in Request Authentication]in the Amazon S3 User Guide. + * + * Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , + * you must specify the x-amz-server-side-encryption-aws-kms-key-id header with + * the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key + * to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID + * or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS + * configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the + * bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Specifying the Signature Version in Request Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when storing this object in Amazon + * S3. Unrecognized or unsupported values won’t write a destination object and will + * receive a 400 Bad Request response. + * + * Amazon S3 automatically encrypts all new objects that are copied to an S3 + * bucket. When copying an object, if you don't specify encryption information in + * your copy request, the encryption setting of the target object is set to the + * default encryption configuration of the destination bucket. By default, all + * buckets have a base level of encryption configuration that uses server-side + * encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a + * different default encryption configuration, Amazon S3 uses the corresponding + * encryption key to encrypt the target object copy. + * + * With server-side encryption, Amazon S3 encrypts your data as it writes your + * data to disks in its data centers and decrypts the data when you access it. For + * more information about server-side encryption, see [Using Server-Side Encryption]in the Amazon S3 User Guide. + * + * General purpose buckets + * + * ``` + * - For general purpose buckets, there are the following supported options for + * server-side encryption: server-side encryption with Key Management Service (KMS) + * keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS + * keys (DSSE-KMS), and server-side encryption with customer-provided encryption + * keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided + * key to encrypt the target object copy. + * + * - When you perform a CopyObject operation, if you want to use a different type + * of encryption setting for the target object, you can specify appropriate + * encryption-related headers to encrypt the target object with an Amazon S3 + * managed key, a KMS key, or a customer-provided key. If the encryption setting in + * your request is different from the default encryption configuration of the + * destination bucket, the encryption setting in your request takes precedence. + * ``` + * + * Directory buckets + * + * ``` + * - For directory buckets, there are only two supported options for server-side + * encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( + * AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). We + * recommend that the bucket's default encryption uses the desired encryption + * configuration and you don't override the bucket default encryption in your + * CreateSession requests or PUT object requests. Then, new objects are + * automatically encrypted with the desired encryption settings. For more + * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about the + * encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + * + * - To encrypt new object copies to a directory bucket with SSE-KMS, we + * recommend you specify SSE-KMS as the directory bucket's default encryption + * configuration with a KMS key (specifically, a [customer managed key]). [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * Your SSE-KMS configuration can only support 1 [customer managed key]per directory bucket for the + * lifetime of the bucket. After you specify a customer managed key for SSE-KMS, + * you can't override the customer managed key for the bucket's SSE-KMS + * configuration. Then, when you perform a CopyObject operation and want to + * specify server-side encryption settings for new object copies with SSE-KMS in + * the encryption-related request headers, you must ensure the encryption key is + * the same customer managed key that you specified for the directory bucket's + * default encryption configuration. + * ``` + * + * [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + serverSideEncryption: types.ServerSideEncryption + /** + * If the x-amz-storage-class header is not used, the copied object will be stored + * in the STANDARD Storage Class by default. The STANDARD storage class provides + * high durability and high availability. Depending on performance needs, you can + * specify a different Storage Class. + * + * ``` + * - Directory buckets - For directory buckets, only the S3 Express One Zone + * storage class is supported to store newly created objects. Unsupported storage + * class values won't write a destination object and will respond with the HTTP + * status code 400 Bad Request . + * + * - Amazon S3 on Outposts - S3 on Outposts only uses the OUTPOSTS Storage Class. + * ``` + * + * You can use the CopyObject action to change the storage class of an object that + * is already stored in Amazon S3 by using the x-amz-storage-class header. For + * more information, see [Storage Classes]in the Amazon S3 User Guide. + * + * Before using an object as a source object for the copy operation, you must + * restore a copy of it if it meets any of the following conditions: + * + * ``` + * - The storage class of the source object is GLACIER or DEEP_ARCHIVE . + * + * - The storage class of the source object is INTELLIGENT_TIERING and it's [S3 Intelligent-Tiering access tier]is + * Archive Access or Deep Archive Access . + * ``` + * + * For more information, see [RestoreObject] and [Copying Objects] in the Amazon S3 User Guide. + * + * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + * [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html + * [Copying Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html + * [S3 Intelligent-Tiering access tier]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering-overview.html#intel-tiering-tier-definition + */ + storageClass: types.StorageClass + /** + * The tag-set for the object copy in the destination bucket. This value must be + * used in conjunction with the x-amz-tagging-directive if you choose REPLACE for + * the x-amz-tagging-directive . If you choose COPY for the x-amz-tagging-directive + * , you don't need to set the x-amz-tagging header, because the tag-set will be + * copied from the source object directly. The tag-set must be encoded as URL Query + * parameters. + * + * The default value is the empty value. + * + * Directory buckets - For directory buckets in a CopyObject operation, only the + * empty tag-set is supported. Any requests that attempt to write non-empty tags + * into directory buckets will receive a 501 Not Implemented status code. When the + * destination bucket is a directory bucket, you will receive a 501 Not Implemented + * response in any of the following situations: + * + * ``` + * - When you attempt to COPY the tag-set from an S3 source object that has + * non-empty tags. + * + * - When you attempt to REPLACE the tag-set of a source object and set a + * non-empty value to x-amz-tagging . + * + * - When you don't set the x-amz-tagging-directive header and the source object + * has non-empty tags. This is because the default value of + * x-amz-tagging-directive is COPY . + * ``` + * + * Because only the empty tag-set is supported for directory buckets in a + * CopyObject operation, the following situations are allowed: + * + * ``` + * - When you attempt to COPY the tag-set from a directory bucket source object + * that has no tags to a general purpose bucket. It copies an empty tag-set to the + * destination object. + * + * - When you attempt to REPLACE the tag-set of a directory bucket source object + * and set the x-amz-tagging value of the directory bucket destination object to + * empty. + * + * - When you attempt to REPLACE the tag-set of a general purpose bucket source + * object that has non-empty tags and set the x-amz-tagging value of the + * directory bucket destination object to empty. + * + * - When you attempt to REPLACE the tag-set of a directory bucket source object + * and don't set the x-amz-tagging value of the directory bucket destination + * object. This is because the default value of x-amz-tagging is the empty value. + * ``` + */ + tagging?: string + /** + * Specifies whether the object tag-set is copied from the source object or + * replaced with the tag-set that's provided in the request. + * + * The default value is COPY . + * + * Directory buckets - For directory buckets in a CopyObject operation, only the + * empty tag-set is supported. Any requests that attempt to write non-empty tags + * into directory buckets will receive a 501 Not Implemented status code. When the + * destination bucket is a directory bucket, you will receive a 501 Not Implemented + * response in any of the following situations: + * + * ``` + * - When you attempt to COPY the tag-set from an S3 source object that has + * non-empty tags. + * + * - When you attempt to REPLACE the tag-set of a source object and set a + * non-empty value to x-amz-tagging . + * + * - When you don't set the x-amz-tagging-directive header and the source object + * has non-empty tags. This is because the default value of + * x-amz-tagging-directive is COPY . + * ``` + * + * Because only the empty tag-set is supported for directory buckets in a + * CopyObject operation, the following situations are allowed: + * + * ``` + * - When you attempt to COPY the tag-set from a directory bucket source object + * that has no tags to a general purpose bucket. It copies an empty tag-set to the + * destination object. + * + * - When you attempt to REPLACE the tag-set of a directory bucket source object + * and set the x-amz-tagging value of the directory bucket destination object to + * empty. + * + * - When you attempt to REPLACE the tag-set of a general purpose bucket source + * object that has non-empty tags and set the x-amz-tagging value of the + * directory bucket destination object to empty. + * + * - When you attempt to REPLACE the tag-set of a directory bucket source object + * and don't set the x-amz-tagging value of the directory bucket destination + * object. This is because the default value of x-amz-tagging is the empty value. + * ``` + */ + taggingDirective: types.TaggingDirective + /** + * If the destination bucket is configured as a website, redirects requests for + * this object copy to another object in the same bucket or to an external URL. + * Amazon S3 stores the value of this header in the object metadata. This value is + * unique to each object and is not copied when using the x-amz-metadata-directive + * header. Instead, you may opt to provide this header in combination with the + * x-amz-metadata-directive header. + * + * This functionality is not supported for directory buckets. + */ + websiteRedirectLocation?: string + } + type _subMUDlx = noSmithyDocumentSerde + interface CopyObjectOutput extends _subMUDlx { + /** + * Indicates whether the copied object uses an S3 Bucket Key for server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * Container for all response elements. + */ + copyObjectResult?: types.CopyObjectResult + /** + * Version ID of the source object that was copied. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceVersionId?: string + /** + * If the object expiration is configured, the response includes this header. + * + * This functionality is not supported for directory buckets. + */ + expiration?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the Amazon Web Services KMS Encryption Context to use for + * object encryption. The value of this header is a base64-encoded UTF-8 string + * holding JSON with the encryption context key-value pairs. + */ + ssekmsEncryptionContext?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3 (for example, AES256 , aws:kms , aws:kms:dsse ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Version ID of the newly created copy. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subFvUAF = noSmithyDocumentSerde + interface CreateBucketInput extends _subFvUAF { + /** + * The name of the bucket to create. + * + * General purpose buckets - For information about bucket naming restrictions, see [Bucket naming rules] + * in the Amazon S3 User Guide. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [Bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html + * + * This member is required. + */ + bucket?: string + /** + * The canned ACL to apply to the bucket. + * + * This functionality is not supported for directory buckets. + */ + acl: types.BucketCannedACL + /** + * The configuration information for the bucket. + */ + createBucketConfiguration?: types.CreateBucketConfiguration + /** + * Allows grantee the read, write, read ACP, and write ACP permissions on the + * bucket. + * + * This functionality is not supported for directory buckets. + */ + grantFullControl?: string + /** + * Allows grantee to list the objects in the bucket. + * + * This functionality is not supported for directory buckets. + */ + grantRead?: string + /** + * Allows grantee to read the bucket ACL. + * + * This functionality is not supported for directory buckets. + */ + grantReadACP?: string + /** + * Allows grantee to create new objects in the bucket. + * + * For the bucket and object owners of existing objects, also allows deletions and + * overwrites of those objects. + * + * This functionality is not supported for directory buckets. + */ + grantWrite?: string + /** + * Allows grantee to write the ACL for the applicable bucket. + * + * This functionality is not supported for directory buckets. + */ + grantWriteACP?: string + /** + * Specifies whether you want S3 Object Lock to be enabled for the new bucket. + * + * This functionality is not supported for directory buckets. + */ + objectLockEnabledForBucket?: boolean + /** + * The container element for object ownership for a bucket's ownership controls. + * + * BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the + * bucket owner if the objects are uploaded with the bucket-owner-full-control + * canned ACL. + * + * ObjectWriter - The uploading account will own the object if the object is + * uploaded with the bucket-owner-full-control canned ACL. + * + * BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer + * affect permissions. The bucket owner automatically owns and has full control + * over every object in the bucket. The bucket only accepts PUT requests that don't + * specify an ACL or specify bucket owner full control ACLs (such as the predefined + * bucket-owner-full-control canned ACL or a custom ACL in XML format that grants + * the same permissions). + * + * By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are + * disabled. We recommend keeping ACLs disabled, except in uncommon use cases where + * you must control access for each object individually. For more information about + * S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. Directory buckets + * use the bucket owner enforced setting for S3 Object Ownership. + * + * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + */ + objectOwnership: types.ObjectOwnership + } + type _subVPZab = noSmithyDocumentSerde + interface CreateBucketOutput extends _subVPZab { + /** + * A forward slash followed by the name of the bucket. + */ + location?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subcEoRi = noSmithyDocumentSerde + interface CreateMultipartUploadInput extends _subcEoRi { + /** + * The name of the bucket where the multipart upload is initiated and where the + * object is uploaded. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Object key for which the multipart upload is to be initiated. + * + * This member is required. + */ + key?: string + /** + * The canned ACL to apply to the object. Amazon S3 supports a set of predefined + * ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees and + * permissions. For more information, see [Canned ACL]in the Amazon S3 User Guide. + * + * By default, all objects are private. Only the owner has full access control. + * When uploading an object, you can grant access permissions to individual Amazon + * Web Services accounts or to predefined groups defined by Amazon S3. These + * permissions are then added to the access control list (ACL) on the new object. + * For more information, see [Using ACLs]. One way to grant the permissions using the request + * headers is to specify a canned ACL with the x-amz-acl request header. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + * [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html + */ + acl: types.ObjectCannedACL + /** + * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption + * with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). + * + * General purpose buckets - Setting this header to true causes Amazon S3 to use + * an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this + * header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. + * + * Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + * supported, when you copy SSE-KMS encrypted objects from general purpose buckets + * to directory buckets, from directory buckets to general purpose buckets, or + * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + * call to KMS every time a copy request is made for a KMS-encrypted object. + * + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + */ + bucketKeyEnabled?: boolean + /** + * Specifies caching behavior along the request/reply chain. + */ + cacheControl?: string + /** + * Indicates the algorithm that you want Amazon S3 to use to create the checksum + * for the object. For more information, see [Checking object integrity]in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * Specifies presentational information for the object. + */ + contentDisposition?: string + /** + * Specifies what content encodings have been applied to the object and thus what + * decoding mechanisms must be applied to obtain the media-type referenced by the + * Content-Type header field. + * + * For directory buckets, only the aws-chunked value is supported in this header + * field. + */ + contentEncoding?: string + /** + * The language that the content is in. + */ + contentLanguage?: string + /** + * A standard MIME type describing the format of the object data. + */ + contentType?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The date and time at which the object is no longer cacheable. + */ + expires?: time.Time + /** + * Specify access permissions explicitly to give the grantee READ, READ_ACP, and + * WRITE_ACP permissions on the object. + * + * By default, all objects are private. Only the owner has full access control. + * When uploading an object, you can use this header to explicitly grant access + * permissions to specific Amazon Web Services accounts or groups. This header maps + * to specific permissions that Amazon S3 supports in an ACL. For more information, + * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + * + * You specify each grantee as a type=value pair, where the type is one of the + * following: + * + * ``` + * - id – if the value specified is the canonical user ID of an Amazon Web + * Services account + * + * - uri – if you are granting permissions to a predefined group + * + * - emailAddress – if the value specified is the email address of an Amazon Web + * Services account + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * ``` + * Amazon Web Services General Reference. + * ``` + * + * For example, the following x-amz-grant-read header grants the Amazon Web + * Services accounts identified by account IDs permissions to read object data and + * its metadata: + * + * ``` + * x-amz-grant-read: id="11112222333", id="444455556666" + * + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + */ + grantFullControl?: string + /** + * Specify access permissions explicitly to allow grantee to read the object data + * and its metadata. + * + * By default, all objects are private. Only the owner has full access control. + * When uploading an object, you can use this header to explicitly grant access + * permissions to specific Amazon Web Services accounts or groups. This header maps + * to specific permissions that Amazon S3 supports in an ACL. For more information, + * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + * + * You specify each grantee as a type=value pair, where the type is one of the + * following: + * + * ``` + * - id – if the value specified is the canonical user ID of an Amazon Web + * Services account + * + * - uri – if you are granting permissions to a predefined group + * + * - emailAddress – if the value specified is the email address of an Amazon Web + * Services account + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * ``` + * Amazon Web Services General Reference. + * ``` + * + * For example, the following x-amz-grant-read header grants the Amazon Web + * Services accounts identified by account IDs permissions to read object data and + * its metadata: + * + * ``` + * x-amz-grant-read: id="11112222333", id="444455556666" + * + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + */ + grantRead?: string + /** + * Specify access permissions explicitly to allows grantee to read the object ACL. + * + * By default, all objects are private. Only the owner has full access control. + * When uploading an object, you can use this header to explicitly grant access + * permissions to specific Amazon Web Services accounts or groups. This header maps + * to specific permissions that Amazon S3 supports in an ACL. For more information, + * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + * + * You specify each grantee as a type=value pair, where the type is one of the + * following: + * + * ``` + * - id – if the value specified is the canonical user ID of an Amazon Web + * Services account + * + * - uri – if you are granting permissions to a predefined group + * + * - emailAddress – if the value specified is the email address of an Amazon Web + * Services account + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * ``` + * Amazon Web Services General Reference. + * ``` + * + * For example, the following x-amz-grant-read header grants the Amazon Web + * Services accounts identified by account IDs permissions to read object data and + * its metadata: + * + * ``` + * x-amz-grant-read: id="11112222333", id="444455556666" + * + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + */ + grantReadACP?: string + /** + * Specify access permissions explicitly to allows grantee to allow grantee to + * write the ACL for the applicable object. + * + * By default, all objects are private. Only the owner has full access control. + * When uploading an object, you can use this header to explicitly grant access + * permissions to specific Amazon Web Services accounts or groups. This header maps + * to specific permissions that Amazon S3 supports in an ACL. For more information, + * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + * + * You specify each grantee as a type=value pair, where the type is one of the + * following: + * + * ``` + * - id – if the value specified is the canonical user ID of an Amazon Web + * Services account + * + * - uri – if you are granting permissions to a predefined group + * + * - emailAddress – if the value specified is the email address of an Amazon Web + * Services account + * ``` + * + * Using email addresses to specify a grantee is only supported in the following + * ``` + * Amazon Web Services Regions: + * + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + * ``` + * Amazon Web Services General Reference. + * ``` + * + * For example, the following x-amz-grant-read header grants the Amazon Web + * Services accounts identified by account IDs permissions to read object data and + * its metadata: + * + * ``` + * x-amz-grant-read: id="11112222333", id="444455556666" + * + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + */ + grantWriteACP?: string + /** + * A map of metadata to store with the object in S3. + */ + metadata: _TygojaDict + /** + * Specifies whether you want to apply a legal hold to the uploaded object. + * + * This functionality is not supported for directory buckets. + */ + objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus + /** + * Specifies the Object Lock mode that you want to apply to the uploaded object. + * + * This functionality is not supported for directory buckets. + */ + objectLockMode: types.ObjectLockMode + /** + * Specifies the date and time when you want the Object Lock to expire. + * + * This functionality is not supported for directory buckets. + */ + objectLockRetainUntilDate?: time.Time + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256). + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the customer-provided encryption key + * according to RFC 1321. Amazon S3 uses this header for a message integrity check + * to ensure that the encryption key was transmitted without error. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * Specifies the Amazon Web Services KMS Encryption Context to use for object + * encryption. The value of this header is a Base64-encoded string of a UTF-8 + * encoded JSON, which contains the encryption context as key-value pairs. + * + * Directory buckets - You can optionally provide an explicit encryption context + * value. The value must match the default encryption context - the bucket Amazon + * Resource Name (ARN). An additional encryption context value is not supported. + */ + ssekmsEncryptionContext?: string + /** + * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object + * encryption. If the KMS key doesn't exist in the same account that's issuing the + * command, you must use the full Key ARN not the Key ID. + * + * General purpose buckets - If you specify x-amz-server-side-encryption with + * aws:kms or aws:kms:dsse , this header specifies the ID (Key ID, Key ARN, or Key + * Alias) of the KMS key to use. If you specify + * x-amz-server-side-encryption:aws:kms or + * x-amz-server-side-encryption:aws:kms:dsse , but do not provide + * x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web + * Services managed key ( aws/s3 ) to protect the data. + * + * Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , + * you must specify the x-amz-server-side-encryption-aws-kms-key-id header with + * the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key + * to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID + * or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS + * configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the + * bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3 (for example, AES256 , aws:kms ). + * + * ``` + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: server-side encryption with Amazon S3 + * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses + * the desired encryption configuration and you don't override the bucket default + * encryption in your CreateSession requests or PUT object requests. Then, new + * objects are automatically encrypted with the desired encryption settings. For + * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about + * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + * ``` + * + * In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the + * ``` + * encryption request headers must match the encryption settings that are specified + * in the CreateSession request. You can't override the values of the encryption + * settings ( x-amz-server-side-encryption , + * x-amz-server-side-encryption-aws-kms-key-id , + * x-amz-server-side-encryption-context , and + * x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the + * CreateSession request. You don't need to explicitly specify these encryption + * settings values in Zonal endpoint API calls, and Amazon S3 will use the + * encryption settings values from the CreateSession request to protect new + * objects in the directory bucket. + * ``` + * + * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the + * ``` + * session token refreshes automatically to avoid service interruptions when a + * session expires. The CLI or the Amazon Web Services SDKs use the bucket's + * default encryption configuration for the CreateSession request. It's not + * supported to override the encryption settings values in the CreateSession + * request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption + * request headers must match the default encryption configuration of the directory + * bucket. + * ``` + * + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + */ + serverSideEncryption: types.ServerSideEncryption + /** + * By default, Amazon S3 uses the STANDARD Storage Class to store newly created + * objects. The STANDARD storage class provides high durability and high + * availability. Depending on performance needs, you can specify a different + * Storage Class. For more information, see [Storage Classes]in the Amazon S3 User Guide. + * + * ``` + * - For directory buckets, only the S3 Express One Zone storage class is + * supported to store newly created objects. + * + * - Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. + * ``` + * + * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + */ + storageClass: types.StorageClass + /** + * The tag-set for the object. The tag-set must be encoded as URL Query parameters. + * + * This functionality is not supported for directory buckets. + */ + tagging?: string + /** + * If the bucket is configured as a website, redirects requests for this object to + * another object in the same bucket or to an external URL. Amazon S3 stores the + * value of this header in the object metadata. + * + * This functionality is not supported for directory buckets. + */ + websiteRedirectLocation?: string + } + type _subHZuFd = noSmithyDocumentSerde + interface CreateMultipartUploadOutput extends _subHZuFd { + /** + * If the bucket has a lifecycle rule configured with an action to abort + * incomplete multipart uploads and the prefix in the lifecycle rule matches the + * object name in the request, the response includes this header. The header + * indicates when the initiated multipart upload becomes eligible for an abort + * operation. For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. + * + * The response also includes the x-amz-abort-rule-id header that provides the ID + * of the lifecycle configuration rule that defines the abort action. + * + * This functionality is not supported for directory buckets. + * + * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config + */ + abortDate?: time.Time + /** + * This header is returned along with the x-amz-abort-date header. It identifies + * the applicable lifecycle configuration rule that defines the action to abort + * incomplete multipart uploads. + * + * This functionality is not supported for directory buckets. + */ + abortRuleId?: string + /** + * The name of the bucket to which the multipart upload was initiated. Does not + * return the access point ARN or access point alias if used. + * + * Access points are not supported by directory buckets. + */ + bucket?: string + /** + * Indicates whether the multipart upload uses an S3 Bucket Key for server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * The algorithm that was used to create a checksum of the object. + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * Object key for which the multipart upload was initiated. + */ + key?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the Amazon Web Services KMS Encryption Context to use for + * object encryption. The value of this header is a Base64-encoded string of a + * UTF-8 encoded JSON, which contains the encryption context as key-value pairs. + */ + ssekmsEncryptionContext?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3 (for example, AES256 , aws:kms ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * ID for the initiated multipart upload. + */ + uploadId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subNnMiF = noSmithyDocumentSerde + interface CreateSessionInput extends _subNnMiF { + /** + * The name of the bucket that you create a session for. + * + * This member is required. + */ + bucket?: string + /** + * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption + * with server-side encryption using KMS keys (SSE-KMS). + * + * S3 Bucket Keys are always enabled for GET and PUT operations in a directory + * bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy + * SSE-KMS encrypted objects from general purpose buckets to directory buckets, + * from directory buckets to general purpose buckets, or between directory buckets, + * through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a call to KMS every time a + * copy request is made for a KMS-encrypted object. + * + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + */ + bucketKeyEnabled?: boolean + /** + * Specifies the Amazon Web Services KMS Encryption Context as an additional + * encryption context to use for object encryption. The value of this header is a + * Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption + * context as key-value pairs. This value is stored as object metadata and + * automatically gets passed on to Amazon Web Services KMS for future GetObject + * operations on this object. + * + * General purpose buckets - This value must be explicitly added during CopyObject + * operations if you want an additional encryption context for your object. For + * more information, see [Encryption context]in the Amazon S3 User Guide. + * + * Directory buckets - You can optionally provide an explicit encryption context + * value. The value must match the default encryption context - the bucket Amazon + * Resource Name (ARN). An additional encryption context value is not supported. + * + * [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context + */ + ssekmsEncryptionContext?: string + /** + * If you specify x-amz-server-side-encryption with aws:kms , you must specify the + * x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key + * ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you + * get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key + * alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist + * in the same account that't issuing the command, you must use the full Key ARN + * not the Key ID. + * + * Your SSE-KMS configuration can only support 1 [customer managed key] per directory bucket for the + * lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm to use when you store objects in the + * directory bucket. + * + * For directory buckets, there are only two supported options for server-side + * encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( AES256 + * ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). By default, + * Amazon S3 encrypts data with SSE-S3. For more information, see [Protecting data with server-side encryption]in the Amazon S3 + * User Guide. + * + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Specifies the mode of the session that will be created, either ReadWrite or + * ReadOnly . By default, a ReadWrite session is created. A ReadWrite session is + * capable of executing all the Zonal endpoint API operations on a directory + * bucket. A ReadOnly session is constrained to execute the following Zonal + * endpoint API operations: GetObject , HeadObject , ListObjectsV2 , + * GetObjectAttributes , ListParts , and ListMultipartUploads . + */ + sessionMode: types.SessionMode + } + type _subKUQZg = noSmithyDocumentSerde + interface CreateSessionOutput extends _subKUQZg { + /** + * The established temporary security credentials for the created session. + * + * This member is required. + */ + credentials?: types.SessionCredentials + /** + * Indicates whether to use an S3 Bucket Key for server-side encryption with KMS + * keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * If present, indicates the Amazon Web Services KMS Encryption Context to use for + * object encryption. The value of this header is a Base64-encoded string of a + * UTF-8 encoded JSON, which contains the encryption context as key-value pairs. + * This value is stored as object metadata and automatically gets passed on to + * Amazon Web Services KMS for future GetObject operations on this object. + */ + ssekmsEncryptionContext?: string + /** + * If you specify x-amz-server-side-encryption with aws:kms , this header indicates + * the ID of the KMS symmetric encryption customer managed key that was used for + * object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store objects in the + * directory bucket. + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subWWBVW = noSmithyDocumentSerde + interface DeleteBucketInput extends _subWWBVW { + /** + * Specifies the bucket being deleted. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subKOrqE = noSmithyDocumentSerde + interface DeleteBucketOutput extends _subKOrqE { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subPauEn = noSmithyDocumentSerde + interface DeleteBucketAnalyticsConfigurationInput extends _subPauEn { + /** + * The name of the bucket from which an analytics configuration is deleted. + * + * This member is required. + */ + bucket?: string + /** + * The ID that identifies the analytics configuration. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subyOGOJ = noSmithyDocumentSerde + interface DeleteBucketAnalyticsConfigurationOutput extends _subyOGOJ { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subKrJPX = noSmithyDocumentSerde + interface DeleteBucketCorsInput extends _subKrJPX { + /** + * Specifies the bucket whose cors configuration is being deleted. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subUJnEh = noSmithyDocumentSerde + interface DeleteBucketCorsOutput extends _subUJnEh { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subSOoKo = noSmithyDocumentSerde + interface DeleteBucketEncryptionInput extends _subSOoKo { + /** + * The name of the bucket containing the server-side encryption configuration to + * delete. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subfyfpN = noSmithyDocumentSerde + interface DeleteBucketEncryptionOutput extends _subfyfpN { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _submCnCq = noSmithyDocumentSerde + interface DeleteBucketIntelligentTieringConfigurationInput extends _submCnCq { + /** + * The name of the Amazon S3 bucket whose configuration you want to modify or + * retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the S3 Intelligent-Tiering configuration. + * + * This member is required. + */ + id?: string + } + type _subKbBci = noSmithyDocumentSerde + interface DeleteBucketIntelligentTieringConfigurationOutput extends _subKbBci { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subJcILg = noSmithyDocumentSerde + interface DeleteBucketInventoryConfigurationInput extends _subJcILg { + /** + * The name of the bucket containing the inventory configuration to delete. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the inventory configuration. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subUovMy = noSmithyDocumentSerde + interface DeleteBucketInventoryConfigurationOutput extends _subUovMy { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subNuiWc = noSmithyDocumentSerde + interface DeleteBucketLifecycleInput extends _subNuiWc { + /** + * The bucket name of the lifecycle to delete. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subacBoP = noSmithyDocumentSerde + interface DeleteBucketLifecycleOutput extends _subacBoP { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subBqDnL = noSmithyDocumentSerde + interface DeleteBucketMetricsConfigurationInput extends _subBqDnL { + /** + * The name of the bucket containing the metrics configuration to delete. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the metrics configuration. The ID has a 64 character + * limit and can only contain letters, numbers, periods, dashes, and underscores. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subRTqPc = noSmithyDocumentSerde + interface DeleteBucketMetricsConfigurationOutput extends _subRTqPc { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subpReTa = noSmithyDocumentSerde + interface DeleteBucketOwnershipControlsInput extends _subpReTa { + /** + * The Amazon S3 bucket whose OwnershipControls you want to delete. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subomweP = noSmithyDocumentSerde + interface DeleteBucketOwnershipControlsOutput extends _subomweP { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subYpTYR = noSmithyDocumentSerde + interface DeleteBucketPolicyInput extends _subYpTYR { + /** + * The bucket name. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subSarex = noSmithyDocumentSerde + interface DeleteBucketPolicyOutput extends _subSarex { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subyoKUU = noSmithyDocumentSerde + interface DeleteBucketReplicationInput extends _subyoKUU { + /** + * The bucket name. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subcFLBG = noSmithyDocumentSerde + interface DeleteBucketReplicationOutput extends _subcFLBG { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subFkuCR = noSmithyDocumentSerde + interface DeleteBucketTaggingInput extends _subFkuCR { + /** + * The bucket that has the tag set to be removed. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subXaBzc = noSmithyDocumentSerde + interface DeleteBucketTaggingOutput extends _subXaBzc { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subfMerk = noSmithyDocumentSerde + interface DeleteBucketWebsiteInput extends _subfMerk { + /** + * The bucket name for which you want to remove the website configuration. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subGWwIc = noSmithyDocumentSerde + interface DeleteBucketWebsiteOutput extends _subGWwIc { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subkIyTL = noSmithyDocumentSerde + interface DeleteObjectInput extends _subkIyTL { + /** + * The bucket name of the bucket containing the object. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Key name of the object to delete. + * + * This member is required. + */ + key?: string + /** + * Indicates whether S3 Object Lock should bypass Governance-mode restrictions to + * process this operation. To use this header, you must have the + * s3:BypassGovernanceRetention permission. + * + * This functionality is not supported for directory buckets. + */ + bypassGovernanceRetention?: boolean + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The concatenation of the authentication device's serial number, a space, and + * the value that is displayed on your authentication device. Required to + * permanently delete a versioned object if versioning is configured with MFA + * delete enabled. + * + * This functionality is not supported for directory buckets. + */ + mfa?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Version ID used to reference a specific version of the object. + * + * For directory buckets in this API operation, only the null value of the version + * ID is supported. + */ + versionId?: string + } + type _subynbWF = noSmithyDocumentSerde + interface DeleteObjectOutput extends _subynbWF { + /** + * Indicates whether the specified object version that was permanently deleted was + * (true) or was not (false) a delete marker before deletion. In a simple DELETE, + * this header indicates whether (true) or not (false) the current version of the + * object is a delete marker. + * + * This functionality is not supported for directory buckets. + */ + deleteMarker?: boolean + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Returns the version ID of the delete marker created as a result of the DELETE + * operation. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subUIqMT = noSmithyDocumentSerde + interface DeleteObjectTaggingInput extends _subUIqMT { + /** + * The bucket name containing the objects from which to remove the tags. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The key that identifies the object in the bucket from which to remove all tags. + * + * This member is required. + */ + key?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The versionId of the object that the tag-set will be removed from. + */ + versionId?: string + } + type _subhfXHb = noSmithyDocumentSerde + interface DeleteObjectTaggingOutput extends _subhfXHb { + /** + * The versionId of the object the tag-set was removed from. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subUILFI = noSmithyDocumentSerde + interface DeleteObjectsInput extends _subUILFI { + /** + * The bucket name containing the objects to delete. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Container for the request. + * + * This member is required. + */ + delete?: types.Delete + /** + * Specifies whether you want to delete this object even if it has a + * Governance-type Object Lock in place. To use this header, you must have the + * s3:BypassGovernanceRetention permission. + * + * This functionality is not supported for directory buckets. + */ + bypassGovernanceRetention?: boolean + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 + * fails the request with the HTTP status code 400 Bad Request . + * + * For the x-amz-checksum-algorithm header, replace algorithm with the + * supported algorithm from the following list: + * + * ``` + * - CRC32 + * + * - CRC32C + * + * - SHA1 + * + * - SHA256 + * ``` + * + * For more information, see [Checking object integrity] in the Amazon S3 User Guide. + * + * If the individual checksum value you provide through x-amz-checksum-algorithm + * doesn't match the checksum algorithm you set through + * x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm + * parameter and uses the checksum algorithm that matches the provided value in + * x-amz-checksum-algorithm . + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The concatenation of the authentication device's serial number, a space, and + * the value that is displayed on your authentication device. Required to + * permanently delete a versioned object if versioning is configured with MFA + * delete enabled. + * + * When performing the DeleteObjects operation on an MFA delete enabled bucket, + * which attempts to delete the specified versioned objects, you must include an + * MFA token. If you don't provide an MFA token, the entire request will fail, even + * if there are non-versioned objects that you are trying to delete. If you provide + * an invalid token, whether there are versioned object keys in the request or not, + * the entire Multi-Object Delete request will fail. For information about MFA + * Delete, see [MFA Delete]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete + */ + mfa?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + } + type _subDrSEi = noSmithyDocumentSerde + interface DeleteObjectsOutput extends _subDrSEi { + /** + * Container element for a successful delete. It identifies the object that was + * successfully deleted. + */ + deleted: Array + /** + * Container for a failed delete action that describes the object that Amazon S3 + * attempted to delete and the error it encountered. + */ + errors: Array + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subdkKfs = noSmithyDocumentSerde + interface DeletePublicAccessBlockInput extends _subdkKfs { + /** + * The Amazon S3 bucket whose PublicAccessBlock configuration you want to delete. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subbnEep = noSmithyDocumentSerde + interface DeletePublicAccessBlockOutput extends _subbnEep { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subxadmv = noSmithyDocumentSerde + interface GetBucketAccelerateConfigurationInput extends _subxadmv { + /** + * The name of the bucket for which the accelerate configuration is retrieved. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + } + type _subMJXUk = noSmithyDocumentSerde + interface GetBucketAccelerateConfigurationOutput extends _subMJXUk { + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * The accelerate configuration of the bucket. + */ + status: types.BucketAccelerateStatus + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subymWaB = noSmithyDocumentSerde + interface GetBucketAclInput extends _subymWaB { + /** + * Specifies the S3 bucket whose ACL is being requested. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subZjWFl = noSmithyDocumentSerde + interface GetBucketAclOutput extends _subZjWFl { + /** + * A list of grants. + */ + grants: Array + /** + * Container for the bucket owner's display name and ID. + */ + owner?: types.Owner + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subSTUzj = noSmithyDocumentSerde + interface GetBucketAnalyticsConfigurationInput extends _subSTUzj { + /** + * The name of the bucket from which an analytics configuration is retrieved. + * + * This member is required. + */ + bucket?: string + /** + * The ID that identifies the analytics configuration. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subGjmkO = noSmithyDocumentSerde + interface GetBucketAnalyticsConfigurationOutput extends _subGjmkO { + /** + * The configuration and any analyses for the analytics filter. + */ + analyticsConfiguration?: types.AnalyticsConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subBAguP = noSmithyDocumentSerde + interface GetBucketCorsInput extends _subBAguP { + /** + * The bucket name for which to get the cors configuration. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subaoqvd = noSmithyDocumentSerde + interface GetBucketCorsOutput extends _subaoqvd { + /** + * A set of origins and methods (cross-origin access that you want to allow). You + * can add up to 100 rules to the configuration. + */ + corsRules: Array + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subGSqbe = noSmithyDocumentSerde + interface GetBucketEncryptionInput extends _subGSqbe { + /** + * The name of the bucket from which the server-side encryption configuration is + * retrieved. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subWdusS = noSmithyDocumentSerde + interface GetBucketEncryptionOutput extends _subWdusS { + /** + * Specifies the default server-side-encryption configuration. + */ + serverSideEncryptionConfiguration?: types.ServerSideEncryptionConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subZxizZ = noSmithyDocumentSerde + interface GetBucketIntelligentTieringConfigurationInput extends _subZxizZ { + /** + * The name of the Amazon S3 bucket whose configuration you want to modify or + * retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the S3 Intelligent-Tiering configuration. + * + * This member is required. + */ + id?: string + } + type _subeeKSR = noSmithyDocumentSerde + interface GetBucketIntelligentTieringConfigurationOutput extends _subeeKSR { + /** + * Container for S3 Intelligent-Tiering configuration. + */ + intelligentTieringConfiguration?: types.IntelligentTieringConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _submQByk = noSmithyDocumentSerde + interface GetBucketInventoryConfigurationInput extends _submQByk { + /** + * The name of the bucket containing the inventory configuration to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the inventory configuration. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _sublBZFv = noSmithyDocumentSerde + interface GetBucketInventoryConfigurationOutput extends _sublBZFv { + /** + * Specifies the inventory configuration. + */ + inventoryConfiguration?: types.InventoryConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _sublFvsi = noSmithyDocumentSerde + interface GetBucketLifecycleConfigurationInput extends _sublFvsi { + /** + * The name of the bucket for which to get the lifecycle information. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subkQQAq = noSmithyDocumentSerde + interface GetBucketLifecycleConfigurationOutput extends _subkQQAq { + /** + * Container for a lifecycle rule. + */ + rules: Array + /** + * Indicates which default minimum object size behavior is applied to the + * lifecycle configuration. + * + * ``` + * - all_storage_classes_128K - Objects smaller than 128 KB will not transition + * to any storage class by default. + * + * - varies_by_storage_class - Objects smaller than 128 KB will transition to + * Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, + * all other storage classes will prevent transitions smaller than 128 KB. + * ``` + * + * To customize the minimum object size for any transition you can add a filter + * that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body + * of your transition rule. Custom filters always take precedence over the default + * transition behavior. + */ + transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import smithyio = io + type _subtPYNo = noSmithyDocumentSerde + interface GetBucketLocationInput extends _subtPYNo { + /** + * The name of the bucket for which to get the location. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subYSLff = noSmithyDocumentSerde + interface GetBucketLocationOutput extends _subYSLff { + /** + * Specifies the Region where the bucket resides. For a list of all the Amazon S3 + * supported location constraints by Region, see [Regions and Endpoints]. Buckets in Region us-east-1 + * have a LocationConstraint of null . + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + */ + locationConstraint: types.BucketLocationConstraint + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subffqWS = noSmithyDocumentSerde + interface GetBucketLoggingInput extends _subffqWS { + /** + * The bucket name for which to get the logging information. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subLKFCe = noSmithyDocumentSerde + interface GetBucketLoggingOutput extends _subLKFCe { + /** + * Describes where logs are stored and the prefix that Amazon S3 assigns to all + * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API + * Reference. + * + * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html + */ + loggingEnabled?: types.LoggingEnabled + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subXnQXI = noSmithyDocumentSerde + interface GetBucketMetricsConfigurationInput extends _subXnQXI { + /** + * The name of the bucket containing the metrics configuration to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the metrics configuration. The ID has a 64 character + * limit and can only contain letters, numbers, periods, dashes, and underscores. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subPlbFZ = noSmithyDocumentSerde + interface GetBucketMetricsConfigurationOutput extends _subPlbFZ { + /** + * Specifies the metrics configuration. + */ + metricsConfiguration?: types.MetricsConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subtoemD = noSmithyDocumentSerde + interface GetBucketNotificationConfigurationInput extends _subtoemD { + /** + * The name of the bucket for which to get the notification configuration. + * + * When you use this API operation with an access point, provide the alias of the + * access point in place of the bucket name. + * + * When you use this API operation with an Object Lambda access point, provide the + * alias of the Object Lambda access point in place of the bucket name. If the + * Object Lambda access point alias in a request is not valid, the error code + * InvalidAccessPointAliasError is returned. For more information about + * InvalidAccessPointAliasError , see [List of Error Codes]. + * + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + /** + * A container for specifying the notification configuration of the bucket. If + * this element is empty, notifications are turned off for the bucket. + */ + type _subMPMnb = noSmithyDocumentSerde + interface GetBucketNotificationConfigurationOutput extends _subMPMnb { + /** + * Enables delivery of events to Amazon EventBridge. + */ + eventBridgeConfiguration?: types.EventBridgeConfiguration + /** + * Describes the Lambda functions to invoke and the events for which to invoke + * them. + */ + lambdaFunctionConfigurations: Array + /** + * The Amazon Simple Queue Service queues to publish messages to and the events + * for which to publish messages. + */ + queueConfigurations: Array + /** + * The topic to which notifications are sent and the events for which + * notifications are generated. + */ + topicConfigurations: Array + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subuEFGJ = noSmithyDocumentSerde + interface GetBucketOwnershipControlsInput extends _subuEFGJ { + /** + * The name of the Amazon S3 bucket whose OwnershipControls you want to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subgMVIl = noSmithyDocumentSerde + interface GetBucketOwnershipControlsOutput extends _subgMVIl { + /** + * The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or + * ObjectWriter) currently in effect for this Amazon S3 bucket. + */ + ownershipControls?: types.OwnershipControls + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subJDaPJ = noSmithyDocumentSerde + interface GetBucketPolicyInput extends _subJDaPJ { + /** + * The bucket name to get the bucket policy for. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * Access points - When you use this API operation with an access point, provide + * the alias of the access point in place of the bucket name. + * + * Object Lambda access points - When you use this API operation with an Object + * Lambda access point, provide the alias of the Object Lambda access point in + * place of the bucket name. If the Object Lambda access point alias in a request + * is not valid, the error code InvalidAccessPointAliasError is returned. For more + * information about InvalidAccessPointAliasError , see [List of Error Codes]. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subtdLaI = noSmithyDocumentSerde + interface GetBucketPolicyOutput extends _subtdLaI { + /** + * The bucket policy as a JSON document. + */ + policy?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subbnuMF = noSmithyDocumentSerde + interface GetBucketPolicyStatusInput extends _subbnuMF { + /** + * The name of the Amazon S3 bucket whose policy status you want to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subBRLkC = noSmithyDocumentSerde + interface GetBucketPolicyStatusOutput extends _subBRLkC { + /** + * The policy status for the specified bucket. + */ + policyStatus?: types.PolicyStatus + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subUECqT = noSmithyDocumentSerde + interface GetBucketReplicationInput extends _subUECqT { + /** + * The bucket name for which to get the replication information. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subirNjO = noSmithyDocumentSerde + interface GetBucketReplicationOutput extends _subirNjO { + /** + * A container for replication rules. You can add up to 1,000 rules. The maximum + * size of a replication configuration is 2 MB. + */ + replicationConfiguration?: types.ReplicationConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subItMYt = noSmithyDocumentSerde + interface GetBucketRequestPaymentInput extends _subItMYt { + /** + * The name of the bucket for which to get the payment request configuration + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subvFcwV = noSmithyDocumentSerde + interface GetBucketRequestPaymentOutput extends _subvFcwV { + /** + * Specifies who pays for the download and request fees. + */ + payer: types.Payer + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subpdzhk = noSmithyDocumentSerde + interface GetBucketTaggingInput extends _subpdzhk { + /** + * The name of the bucket for which to get the tagging information. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subcxgba = noSmithyDocumentSerde + interface GetBucketTaggingOutput extends _subcxgba { + /** + * Contains the tag set. + * + * This member is required. + */ + tagSet: Array + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subckrrF = noSmithyDocumentSerde + interface GetBucketVersioningInput extends _subckrrF { + /** + * The name of the bucket for which to get the versioning information. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subZmfqn = noSmithyDocumentSerde + interface GetBucketVersioningOutput extends _subZmfqn { + /** + * Specifies whether MFA delete is enabled in the bucket versioning configuration. + * This element is only returned if the bucket has been configured with MFA delete. + * If the bucket has never been so configured, this element is not returned. + */ + mfaDelete: types.MFADeleteStatus + /** + * The versioning state of the bucket. + */ + status: types.BucketVersioningStatus + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subpcLqO = noSmithyDocumentSerde + interface GetBucketWebsiteInput extends _subpcLqO { + /** + * The bucket name for which to get the website configuration. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subpWjbK = noSmithyDocumentSerde + interface GetBucketWebsiteOutput extends _subpWjbK { + /** + * The object key name of the website error document to use for 4XX class errors. + */ + errorDocument?: types.ErrorDocument + /** + * The name of the index document for the website (for example index.html ). + */ + indexDocument?: types.IndexDocument + /** + * Specifies the redirect behavior of all requests to a website endpoint of an + * Amazon S3 bucket. + */ + redirectAllRequestsTo?: types.RedirectAllRequestsTo + /** + * Rules that define when a redirect is applied and the redirect behavior. + */ + routingRules: Array + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subrfljy = noSmithyDocumentSerde + interface GetObjectInput extends _subrfljy { + /** + * The bucket name containing the object. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Object Lambda access points - When you use this action with an Object Lambda + * access point, you must direct requests to the Object Lambda access point + * hostname. The Object Lambda access point hostname takes the form + * AccessPointName-AccountId.s3-object-lambda.Region.amazonaws.com. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Key of the object to get. + * + * This member is required. + */ + key?: string + /** + * To retrieve the checksum, this mode must be enabled. + * + * General purpose buckets - In addition, if you enable checksum mode and the + * object is uploaded with a [checksum]and encrypted with an Key Management Service (KMS) + * key, you must have permission to use the kms:Decrypt action to retrieve the + * checksum. + * + * [checksum]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html + */ + checksumMode: types.ChecksumMode + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Return the object only if its entity tag (ETag) is the same as the one + * specified in this header; otherwise, return a 412 Precondition Failed error. + * + * If both of the If-Match and If-Unmodified-Since headers are present in the + * request as follows: If-Match condition evaluates to true , and; + * If-Unmodified-Since condition evaluates to false ; then, S3 returns 200 OK and + * the data requested. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifMatch?: string + /** + * Return the object only if it has been modified since the specified time; + * otherwise, return a 304 Not Modified error. + * + * If both of the If-None-Match and If-Modified-Since headers are present in the + * request as follows: If-None-Match condition evaluates to false , and; + * If-Modified-Since condition evaluates to true ; then, S3 returns 304 Not + * Modified status code. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifModifiedSince?: time.Time + /** + * Return the object only if its entity tag (ETag) is different from the one + * specified in this header; otherwise, return a 304 Not Modified error. + * + * If both of the If-None-Match and If-Modified-Since headers are present in the + * request as follows: If-None-Match condition evaluates to false , and; + * If-Modified-Since condition evaluates to true ; then, S3 returns 304 Not + * Modified HTTP status code. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifNoneMatch?: string + /** + * Return the object only if it has not been modified since the specified time; + * otherwise, return a 412 Precondition Failed error. + * + * If both of the If-Match and If-Unmodified-Since headers are present in the + * request as follows: If-Match condition evaluates to true , and; + * If-Unmodified-Since condition evaluates to false ; then, S3 returns 200 OK and + * the data requested. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifUnmodifiedSince?: time.Time + /** + * Part number of the object being read. This is a positive integer between 1 and + * 10,000. Effectively performs a 'ranged' GET request for the part specified. + * Useful for downloading just a part of an object. + */ + partNumber?: number + /** + * Downloads the specified byte range of an object. For more information about the + * HTTP Range header, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-range]. + * + * Amazon S3 doesn't support retrieving multiple ranges of data per GET request. + * + * [https://www.rfc-editor.org/rfc/rfc9110.html#name-range]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range + */ + range?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Sets the Cache-Control header of the response. + */ + responseCacheControl?: string + /** + * Sets the Content-Disposition header of the response. + */ + responseContentDisposition?: string + /** + * Sets the Content-Encoding header of the response. + */ + responseContentEncoding?: string + /** + * Sets the Content-Language header of the response. + */ + responseContentLanguage?: string + /** + * Sets the Content-Type header of the response. + */ + responseContentType?: string + /** + * Sets the Expires header of the response. + */ + responseExpires?: time.Time + /** + * Specifies the algorithm to use when decrypting the object (for example, AES256 ). + * + * If you encrypt an object by using server-side encryption with customer-provided + * encryption keys (SSE-C) when you store the object in Amazon S3, then when you + * GET the object, you must use the following headers: + * + * ``` + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key that you originally provided for + * Amazon S3 to encrypt the data before storing it. This value is used to decrypt + * the object when recovering it and must match the one used when storing the data. + * The key must be appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. + * + * If you encrypt an object by using server-side encryption with customer-provided + * encryption keys (SSE-C) when you store the object in Amazon S3, then when you + * GET the object, you must use the following headers: + * + * ``` + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the customer-provided encryption key + * according to RFC 1321. Amazon S3 uses this header for a message integrity check + * to ensure that the encryption key was transmitted without error. + * + * If you encrypt an object by using server-side encryption with customer-provided + * encryption keys (SSE-C) when you store the object in Amazon S3, then when you + * GET the object, you must use the following headers: + * + * ``` + * - x-amz-server-side-encryption-customer-algorithm + * + * - x-amz-server-side-encryption-customer-key + * + * - x-amz-server-side-encryption-customer-key-MD5 + * ``` + * + * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKeyMD5?: string + /** + * Version ID used to reference a specific version of the object. + * + * By default, the GetObject operation returns the current version of an object. + * To return a different version, use the versionId subresource. + * + * ``` + * - If you include a versionId in your request header, you must have the + * s3:GetObjectVersion permission to access a specific version of an object. The + * s3:GetObject permission is not required in this scenario. + * + * - If you request the current version of an object without a specific versionId + * in the request header, only the s3:GetObject permission is required. The + * s3:GetObjectVersion permission is not required in this scenario. + * + * - Directory buckets - S3 Versioning isn't enabled and supported for directory + * buckets. For this API operation, only the null value of the version ID is + * supported by directory buckets. You can only specify null to the versionId + * query parameter in the request. + * ``` + * + * For more information about versioning, see [PutBucketVersioning]. + * + * [PutBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html + */ + versionId?: string + } + type _subaoaMd = noSmithyDocumentSerde + interface GetObjectOutput extends _subaoaMd { + /** + * Indicates that a range of bytes was specified in the request. + */ + acceptRanges?: string + /** + * Object data. + */ + body: io.ReadCloser + /** + * Indicates whether the object uses an S3 Bucket Key for server-side encryption + * with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * Specifies caching behavior along the request/reply chain. + */ + cacheControl?: string + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * Specifies presentational information for the object. + */ + contentDisposition?: string + /** + * Indicates what content encodings have been applied to the object and thus what + * decoding mechanisms must be applied to obtain the media-type referenced by the + * Content-Type header field. + */ + contentEncoding?: string + /** + * The language the content is in. + */ + contentLanguage?: string + /** + * Size of the body in bytes. + */ + contentLength?: number + /** + * The portion of the object returned in the response. + */ + contentRange?: string + /** + * A standard MIME type describing the format of the object data. + */ + contentType?: string + /** + * Indicates whether the object retrieved was (true) or was not (false) a Delete + * Marker. If false, this response header does not appear in the response. + * + * ``` + * - If the current version of the object is a delete marker, Amazon S3 behaves + * as if the object was deleted and includes x-amz-delete-marker: true in the + * response. + * + * - If the specified version in the request is a delete marker, the response + * returns a 405 Method Not Allowed error and the Last-Modified: timestamp + * response header. + * ``` + */ + deleteMarker?: boolean + /** + * An entity tag (ETag) is an opaque identifier assigned by a web server to a + * specific version of a resource found at a URL. + */ + eTag?: string + /** + * If the object expiration is configured (see [PutBucketLifecycleConfiguration]PutBucketLifecycleConfiguration ), + * the response includes this header. It includes the expiry-date and rule-id + * key-value pairs providing object expiration information. The value of the + * rule-id is URL-encoded. + * + * This functionality is not supported for directory buckets. + * + * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html + */ + expiration?: string + /** + * The date and time at which the object is no longer cacheable. + * + * Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using + * the ExpiresString field which contains the unparsed value from the service + * response. + */ + expires?: time.Time + /** + * The unparsed value of the Expires field from the service response. Prefer use + * of this value over the normal Expires response field where possible. + */ + expiresString?: string + /** + * Date and time when the object was last modified. + * + * General purpose buckets - When you specify a versionId of the object in your + * request, if the specified version in the request is a delete marker, the + * response returns a 405 Method Not Allowed error and the Last-Modified: timestamp + * response header. + */ + lastModified?: time.Time + /** + * A map of metadata to store with the object in S3. + * + * Map keys will be normalized to lower-case. + */ + metadata: _TygojaDict + /** + * This is set to the number of metadata entries not returned in the headers that + * are prefixed with x-amz-meta- . This can happen if you create metadata using an + * API like SOAP that supports more flexible metadata than the REST API. For + * example, using SOAP, you can create metadata whose values are not legal HTTP + * headers. + * + * This functionality is not supported for directory buckets. + */ + missingMeta?: number + /** + * Indicates whether this object has an active legal hold. This field is only + * returned if you have permission to view an object's legal hold status. + * + * This functionality is not supported for directory buckets. + */ + objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus + /** + * The Object Lock mode that's currently in place for this object. + * + * This functionality is not supported for directory buckets. + */ + objectLockMode: types.ObjectLockMode + /** + * The date and time when this object's Object Lock will expire. + * + * This functionality is not supported for directory buckets. + */ + objectLockRetainUntilDate?: time.Time + /** + * The count of parts this object has. This value is only returned if you specify + * partNumber in your request and the object was uploaded as a multipart upload. + */ + partsCount?: number + /** + * Amazon S3 can return this if your request involves a bucket that is either a + * source or destination in a replication rule. + * + * This functionality is not supported for directory buckets. + */ + replicationStatus: types.ReplicationStatus + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Provides information about object restoration action and expiration time of the + * restored object copy. + * + * This functionality is not supported for directory buckets. Only the S3 Express + * One Zone storage class is supported by directory buckets to store objects. + */ + restore?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3. + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Provides storage class information of the object. Amazon S3 returns this header + * for all objects except for S3 Standard storage class objects. + * + * Directory buckets - Only the S3 Express One Zone storage class is supported by + * directory buckets to store objects. + */ + storageClass: types.StorageClass + /** + * The number of tags, if any, on the object, when you have the relevant + * permission to read object tags. + * + * You can use [GetObjectTagging] to retrieve the tag set associated with an object. + * + * This functionality is not supported for directory buckets. + * + * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html + */ + tagCount?: number + /** + * Version ID of the object. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + /** + * If the bucket is configured as a website, redirects requests for this object to + * another object in the same bucket or to an external URL. Amazon S3 stores the + * value of this header in the object metadata. + * + * This functionality is not supported for directory buckets. + */ + websiteRedirectLocation?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subcSmrI = noSmithyDocumentSerde + interface GetObjectAclInput extends _subcSmrI { + /** + * The bucket name that contains the object for which to get the ACL information. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The key of the object for which to get the ACL information. + * + * This member is required. + */ + key?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Version ID used to reference a specific version of the object. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + } + type _subAcamt = noSmithyDocumentSerde + interface GetObjectAclOutput extends _subAcamt { + /** + * A list of grants. + */ + grants: Array + /** + * Container for the bucket owner's display name and ID. + */ + owner?: types.Owner + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subxCSXH = noSmithyDocumentSerde + interface GetObjectAttributesInput extends _subxCSXH { + /** + * The name of the bucket that contains the object. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The object key. + * + * This member is required. + */ + key?: string + /** + * Specifies the fields at the root level that you want returned in the response. + * Fields that you do not specify are not returned. + * + * This member is required. + */ + objectAttributes: Array + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Sets the maximum number of parts to return. + */ + maxParts?: number + /** + * Specifies the part after which listing should begin. Only parts with higher + * part numbers will be listed. + */ + partNumberMarker?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256). + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * The version ID used to reference a specific version of the object. + * + * S3 Versioning isn't enabled and supported for directory buckets. For this API + * operation, only the null value of the version ID is supported by directory + * buckets. You can only specify null to the versionId query parameter in the + * request. + */ + versionId?: string + } + type _subtJwoC = noSmithyDocumentSerde + interface GetObjectAttributesOutput extends _subtJwoC { + /** + * The checksum or digest of the object. + */ + checksum?: types.Checksum + /** + * Specifies whether the object retrieved was ( true ) or was not ( false ) a + * delete marker. If false , this response header does not appear in the response. + * + * This functionality is not supported for directory buckets. + */ + deleteMarker?: boolean + /** + * An ETag is an opaque identifier assigned by a web server to a specific version + * of a resource found at a URL. + */ + eTag?: string + /** + * The creation date of the object. + */ + lastModified?: time.Time + /** + * A collection of parts associated with a multipart upload. + */ + objectParts?: types.GetObjectAttributesParts + /** + * The size of the object in bytes. + */ + objectSize?: number + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Provides the storage class information of the object. Amazon S3 returns this + * header for all objects except for S3 Standard storage class objects. + * + * For more information, see [Storage Classes]. + * + * Directory buckets - Only the S3 Express One Zone storage class is supported by + * directory buckets to store objects. + * + * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + */ + storageClass: types.StorageClass + /** + * The version ID of the object. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subyrFaW = noSmithyDocumentSerde + interface GetObjectLegalHoldInput extends _subyrFaW { + /** + * The bucket name containing the object whose legal hold status you want to + * retrieve. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The key name for the object whose legal hold status you want to retrieve. + * + * This member is required. + */ + key?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The version ID of the object whose legal hold status you want to retrieve. + */ + versionId?: string + } + type _subYTMHo = noSmithyDocumentSerde + interface GetObjectLegalHoldOutput extends _subYTMHo { + /** + * The current legal hold status for the specified object. + */ + legalHold?: types.ObjectLockLegalHold + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _suboPiwy = noSmithyDocumentSerde + interface GetObjectLockConfigurationInput extends _suboPiwy { + /** + * The bucket whose Object Lock configuration you want to retrieve. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subGRZzR = noSmithyDocumentSerde + interface GetObjectLockConfigurationOutput extends _subGRZzR { + /** + * The specified bucket's Object Lock configuration. + */ + objectLockConfiguration?: types.ObjectLockConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subBxtRy = noSmithyDocumentSerde + interface GetObjectRetentionInput extends _subBxtRy { + /** + * The bucket name containing the object whose retention settings you want to + * retrieve. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The key name for the object whose retention settings you want to retrieve. + * + * This member is required. + */ + key?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The version ID for the object whose retention settings you want to retrieve. + */ + versionId?: string + } + type _subdWwqE = noSmithyDocumentSerde + interface GetObjectRetentionOutput extends _subdWwqE { + /** + * The container element for an object's retention settings. + */ + retention?: types.ObjectLockRetention + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subMZCpC = noSmithyDocumentSerde + interface GetObjectTaggingInput extends _subMZCpC { + /** + * The bucket name containing the object for which to get the tagging information. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Object key for which to get the tagging information. + * + * This member is required. + */ + key?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The versionId of the object for which to get the tagging information. + */ + versionId?: string + } + type _subZcjmo = noSmithyDocumentSerde + interface GetObjectTaggingOutput extends _subZcjmo { + /** + * Contains the tag set. + * + * This member is required. + */ + tagSet: Array + /** + * The versionId of the object for which you got the tagging information. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subpvHHG = noSmithyDocumentSerde + interface GetObjectTorrentInput extends _subpvHHG { + /** + * The name of the bucket containing the object for which to get the torrent files. + * + * This member is required. + */ + bucket?: string + /** + * The object key for which to get the information. + * + * This member is required. + */ + key?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + } + type _subDeCIU = noSmithyDocumentSerde + interface GetObjectTorrentOutput extends _subDeCIU { + /** + * A Bencoded dictionary as defined by the BitTorrent specification + */ + body: io.ReadCloser + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subwDirT = noSmithyDocumentSerde + interface GetPublicAccessBlockInput extends _subwDirT { + /** + * The name of the Amazon S3 bucket whose PublicAccessBlock configuration you want + * to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subLleHs = noSmithyDocumentSerde + interface GetPublicAccessBlockOutput extends _subLleHs { + /** + * The PublicAccessBlock configuration currently in effect for this Amazon S3 + * bucket. + */ + publicAccessBlockConfiguration?: types.PublicAccessBlockConfiguration + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + // @ts-ignore + import smithytime = time + // @ts-ignore + import smithywaiter = waiter + type _subTJcNB = noSmithyDocumentSerde + interface HeadBucketInput extends _subTJcNB { + /** + * The bucket name. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Object Lambda access points - When you use this API operation with an Object + * Lambda access point, provide the alias of the Object Lambda access point in + * place of the bucket name. If the Object Lambda access point alias in a request + * is not valid, the error code InvalidAccessPointAliasError is returned. For more + * information about InvalidAccessPointAliasError , see [List of Error Codes]. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList + * + * This member is required. + */ + bucket?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _submwZVR = noSmithyDocumentSerde + interface HeadBucketOutput extends _submwZVR { + /** + * Indicates whether the bucket name used in the request is an access point alias. + * + * For directory buckets, the value of this field is false . + */ + accessPointAlias?: boolean + /** + * The name of the location where the bucket will be created. + * + * For directory buckets, the AZ ID of the Availability Zone where the bucket is + * created. An example AZ ID value is usw2-az1 . + * + * This functionality is only supported by directory buckets. + */ + bucketLocationName?: string + /** + * The type of location where the bucket is created. + * + * This functionality is only supported by directory buckets. + */ + bucketLocationType: types.LocationType + /** + * The Region that the bucket is located. + */ + bucketRegion?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subaRmfR = noSmithyDocumentSerde + interface HeadObjectInput extends _subaRmfR { + /** + * The name of the bucket that contains the object. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The object key. + * + * This member is required. + */ + key?: string + /** + * To retrieve the checksum, this parameter must be enabled. + * + * General purpose buckets - If you enable checksum mode and the object is + * uploaded with a [checksum]and encrypted with an Key Management Service (KMS) key, you + * must have permission to use the kms:Decrypt action to retrieve the checksum. + * + * Directory buckets - If you enable ChecksumMode and the object is encrypted with + * Amazon Web Services Key Management Service (Amazon Web Services KMS), you must + * also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM + * identity-based policies and KMS key policies for the KMS key to retrieve the + * checksum of the object. + * + * [checksum]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html + */ + checksumMode: types.ChecksumMode + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Return the object only if its entity tag (ETag) is the same as the one + * specified; otherwise, return a 412 (precondition failed) error. + * + * If both of the If-Match and If-Unmodified-Since headers are present in the + * request as follows: + * + * ``` + * - If-Match condition evaluates to true , and; + * + * - If-Unmodified-Since condition evaluates to false ; + * ``` + * + * Then Amazon S3 returns 200 OK and the data requested. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifMatch?: string + /** + * Return the object only if it has been modified since the specified time; + * otherwise, return a 304 (not modified) error. + * + * If both of the If-None-Match and If-Modified-Since headers are present in the + * request as follows: + * + * ``` + * - If-None-Match condition evaluates to false , and; + * + * - If-Modified-Since condition evaluates to true ; + * ``` + * + * Then Amazon S3 returns the 304 Not Modified response code. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifModifiedSince?: time.Time + /** + * Return the object only if its entity tag (ETag) is different from the one + * specified; otherwise, return a 304 (not modified) error. + * + * If both of the If-None-Match and If-Modified-Since headers are present in the + * request as follows: + * + * ``` + * - If-None-Match condition evaluates to false , and; + * + * - If-Modified-Since condition evaluates to true ; + * ``` + * + * Then Amazon S3 returns the 304 Not Modified response code. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifNoneMatch?: string + /** + * Return the object only if it has not been modified since the specified time; + * otherwise, return a 412 (precondition failed) error. + * + * If both of the If-Match and If-Unmodified-Since headers are present in the + * request as follows: + * + * ``` + * - If-Match condition evaluates to true , and; + * + * - If-Unmodified-Since condition evaluates to false ; + * ``` + * + * Then Amazon S3 returns 200 OK and the data requested. + * + * For more information about conditional requests, see [RFC 7232]. + * + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifUnmodifiedSince?: time.Time + /** + * Part number of the object being read. This is a positive integer between 1 and + * 10,000. Effectively performs a 'ranged' HEAD request for the part specified. + * Useful querying about the size of the part and the number of parts in this + * object. + */ + partNumber?: number + /** + * HeadObject returns only the metadata for an object. If the Range is + * satisfiable, only the ContentLength is affected in the response. If the Range + * is not satisfiable, S3 returns a 416 - Requested Range Not Satisfiable error. + */ + range?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Sets the Cache-Control header of the response. + */ + responseCacheControl?: string + /** + * Sets the Content-Disposition header of the response. + */ + responseContentDisposition?: string + /** + * Sets the Content-Encoding header of the response. + */ + responseContentEncoding?: string + /** + * Sets the Content-Language header of the response. + */ + responseContentLanguage?: string + /** + * Sets the Content-Type header of the response. + */ + responseContentType?: string + /** + * Sets the Expires header of the response. + */ + responseExpires?: time.Time + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256). + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * Version ID used to reference a specific version of the object. + * + * For directory buckets in this API operation, only the null value of the version + * ID is supported. + */ + versionId?: string + } + type _subFwlXE = noSmithyDocumentSerde + interface HeadObjectOutput extends _subFwlXE { + /** + * Indicates that a range of bytes was specified. + */ + acceptRanges?: string + /** + * The archive state of the head object. + * + * This functionality is not supported for directory buckets. + */ + archiveStatus: types.ArchiveStatus + /** + * Indicates whether the object uses an S3 Bucket Key for server-side encryption + * with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * Specifies caching behavior along the request/reply chain. + */ + cacheControl?: string + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * Specifies presentational information for the object. + */ + contentDisposition?: string + /** + * Indicates what content encodings have been applied to the object and thus what + * decoding mechanisms must be applied to obtain the media-type referenced by the + * Content-Type header field. + */ + contentEncoding?: string + /** + * The language the content is in. + */ + contentLanguage?: string + /** + * Size of the body in bytes. + */ + contentLength?: number + /** + * A standard MIME type describing the format of the object data. + */ + contentType?: string + /** + * Specifies whether the object retrieved was (true) or was not (false) a Delete + * Marker. If false, this response header does not appear in the response. + * + * This functionality is not supported for directory buckets. + */ + deleteMarker?: boolean + /** + * An entity tag (ETag) is an opaque identifier assigned by a web server to a + * specific version of a resource found at a URL. + */ + eTag?: string + /** + * If the object expiration is configured (see [PutBucketLifecycleConfiguration]PutBucketLifecycleConfiguration ), + * the response includes this header. It includes the expiry-date and rule-id + * key-value pairs providing object expiration information. The value of the + * rule-id is URL-encoded. + * + * This functionality is not supported for directory buckets. + * + * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html + */ + expiration?: string + /** + * The date and time at which the object is no longer cacheable. + * + * Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using + * the ExpiresString field which contains the unparsed value from the service + * response. + */ + expires?: time.Time + /** + * The unparsed value of the Expires field from the service response. Prefer use + * of this value over the normal Expires response field where possible. + */ + expiresString?: string + /** + * Date and time when the object was last modified. + */ + lastModified?: time.Time + /** + * A map of metadata to store with the object in S3. + * + * Map keys will be normalized to lower-case. + */ + metadata: _TygojaDict + /** + * This is set to the number of metadata entries not returned in x-amz-meta + * headers. This can happen if you create metadata using an API like SOAP that + * supports more flexible metadata than the REST API. For example, using SOAP, you + * can create metadata whose values are not legal HTTP headers. + * + * This functionality is not supported for directory buckets. + */ + missingMeta?: number + /** + * Specifies whether a legal hold is in effect for this object. This header is + * only returned if the requester has the s3:GetObjectLegalHold permission. This + * header is not returned if the specified version of this object has never had a + * legal hold applied. For more information about S3 Object Lock, see [Object Lock]. + * + * This functionality is not supported for directory buckets. + * + * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + */ + objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus + /** + * The Object Lock mode, if any, that's in effect for this object. This header is + * only returned if the requester has the s3:GetObjectRetention permission. For + * more information about S3 Object Lock, see [Object Lock]. + * + * This functionality is not supported for directory buckets. + * + * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + */ + objectLockMode: types.ObjectLockMode + /** + * The date and time when the Object Lock retention period expires. This header is + * only returned if the requester has the s3:GetObjectRetention permission. + * + * This functionality is not supported for directory buckets. + */ + objectLockRetainUntilDate?: time.Time + /** + * The count of parts this object has. This value is only returned if you specify + * partNumber in your request and the object was uploaded as a multipart upload. + */ + partsCount?: number + /** + * Amazon S3 can return this header if your request involves a bucket that is + * either a source or a destination in a replication rule. + * + * In replication, you have a source bucket on which you configure replication and + * destination bucket or buckets where Amazon S3 stores object replicas. When you + * request an object ( GetObject ) or object metadata ( HeadObject ) from these + * buckets, Amazon S3 will return the x-amz-replication-status header in the + * response as follows: + * + * ``` + * - If requesting an object from the source bucket, Amazon S3 will return the + * x-amz-replication-status header if the object in your request is eligible for + * replication. + * ``` + * + * For example, suppose that in your replication configuration, you specify object + * ``` + * prefix TaxDocs requesting Amazon S3 to replicate objects with key prefix + * TaxDocs . Any objects you upload with this key name prefix, for example + * TaxDocs/document1.pdf , are eligible for replication. For any object request + * with this key name prefix, Amazon S3 will return the x-amz-replication-status + * header with value PENDING, COMPLETED or FAILED indicating object replication + * status. + * + * - If requesting an object from a destination bucket, Amazon S3 will return + * the x-amz-replication-status header with value REPLICA if the object in your + * request is a replica that Amazon S3 created and there is no replica modification + * replication in progress. + * + * - When replicating objects to multiple destination buckets, the + * x-amz-replication-status header acts differently. The header of the source + * object will only return a value of COMPLETED when replication is successful to + * all destinations. The header will remain at value PENDING until replication has + * completed for all destinations. If one or more destinations fails replication + * the header will return FAILED. + * ``` + * + * For more information, see [Replication]. + * + * This functionality is not supported for directory buckets. + * + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + */ + replicationStatus: types.ReplicationStatus + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If the object is an archived object (an object whose storage class is GLACIER), + * the response includes this header if either the archive restoration is in + * progress (see [RestoreObject]or an archive copy is already restored. + * + * If an archive copy is already restored, the header value indicates when Amazon + * S3 is scheduled to delete the object copy. For example: + * + * ``` + * x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 + * GMT" + * ``` + * + * If the object restoration is in progress, the header returns the value + * ongoing-request="true" . + * + * For more information about archiving objects, see [Transitioning Objects: General Considerations]. + * + * This functionality is not supported for directory buckets. Only the S3 Express + * One Zone storage class is supported by directory buckets to store objects. + * + * [Transitioning Objects: General Considerations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations + * [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html + */ + restore?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3 (for example, AES256 , aws:kms , aws:kms:dsse ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Provides storage class information of the object. Amazon S3 returns this header + * for all objects except for S3 Standard storage class objects. + * + * For more information, see [Storage Classes]. + * + * Directory buckets - Only the S3 Express One Zone storage class is supported by + * directory buckets to store objects. + * + * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + */ + storageClass: types.StorageClass + /** + * Version ID of the object. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + /** + * If the bucket is configured as a website, redirects requests for this object to + * another object in the same bucket or to an external URL. Amazon S3 stores the + * value of this header in the object metadata. + * + * This functionality is not supported for directory buckets. + */ + websiteRedirectLocation?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subdNWQa = noSmithyDocumentSerde + interface ListBucketAnalyticsConfigurationsInput extends _subdNWQa { + /** + * The name of the bucket from which analytics configurations are retrieved. + * + * This member is required. + */ + bucket?: string + /** + * The ContinuationToken that represents a placeholder from where this request + * should begin. + */ + continuationToken?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subaBiJF = noSmithyDocumentSerde + interface ListBucketAnalyticsConfigurationsOutput extends _subaBiJF { + /** + * The list of analytics configurations for a bucket. + */ + analyticsConfigurationList: Array + /** + * The marker that is used as a starting point for this analytics configuration + * list response. This value is present if it was sent in the request. + */ + continuationToken?: string + /** + * Indicates whether the returned list of analytics configurations is complete. A + * value of true indicates that the list is not complete and the + * NextContinuationToken will be provided for a subsequent request. + */ + isTruncated?: boolean + /** + * NextContinuationToken is sent when isTruncated is true, which indicates that + * there are more analytics configurations to list. The next request must include + * this NextContinuationToken . The token is obfuscated and is not a usable value. + */ + nextContinuationToken?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subdKGaA = noSmithyDocumentSerde + interface ListBucketIntelligentTieringConfigurationsInput extends _subdKGaA { + /** + * The name of the Amazon S3 bucket whose configuration you want to modify or + * retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The ContinuationToken that represents a placeholder from where this request + * should begin. + */ + continuationToken?: string + } + type _subnzypp = noSmithyDocumentSerde + interface ListBucketIntelligentTieringConfigurationsOutput extends _subnzypp { + /** + * The ContinuationToken that represents a placeholder from where this request + * should begin. + */ + continuationToken?: string + /** + * The list of S3 Intelligent-Tiering configurations for a bucket. + */ + intelligentTieringConfigurationList: Array + /** + * Indicates whether the returned list of analytics configurations is complete. A + * value of true indicates that the list is not complete and the + * NextContinuationToken will be provided for a subsequent request. + */ + isTruncated?: boolean + /** + * The marker used to continue this inventory configuration listing. Use the + * NextContinuationToken from this response to continue the listing in a subsequent + * request. The continuation token is an opaque value that Amazon S3 understands. + */ + nextContinuationToken?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subBEkvG = noSmithyDocumentSerde + interface ListBucketInventoryConfigurationsInput extends _subBEkvG { + /** + * The name of the bucket containing the inventory configurations to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The marker used to continue an inventory configuration listing that has been + * truncated. Use the NextContinuationToken from a previously truncated list + * response to continue the listing. The continuation token is an opaque value that + * Amazon S3 understands. + */ + continuationToken?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subNlUiN = noSmithyDocumentSerde + interface ListBucketInventoryConfigurationsOutput extends _subNlUiN { + /** + * If sent in the request, the marker that is used as a starting point for this + * inventory configuration list response. + */ + continuationToken?: string + /** + * The list of inventory configurations for a bucket. + */ + inventoryConfigurationList: Array + /** + * Tells whether the returned list of inventory configurations is complete. A + * value of true indicates that the list is not complete and the + * NextContinuationToken is provided for a subsequent request. + */ + isTruncated?: boolean + /** + * The marker used to continue this inventory configuration listing. Use the + * NextContinuationToken from this response to continue the listing in a subsequent + * request. The continuation token is an opaque value that Amazon S3 understands. + */ + nextContinuationToken?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subuBMnM = noSmithyDocumentSerde + interface ListBucketMetricsConfigurationsInput extends _subuBMnM { + /** + * The name of the bucket containing the metrics configurations to retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The marker that is used to continue a metrics configuration listing that has + * been truncated. Use the NextContinuationToken from a previously truncated list + * response to continue the listing. The continuation token is an opaque value that + * Amazon S3 understands. + */ + continuationToken?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subWAvdQ = noSmithyDocumentSerde + interface ListBucketMetricsConfigurationsOutput extends _subWAvdQ { + /** + * The marker that is used as a starting point for this metrics configuration list + * response. This value is present if it was sent in the request. + */ + continuationToken?: string + /** + * Indicates whether the returned list of metrics configurations is complete. A + * value of true indicates that the list is not complete and the + * NextContinuationToken will be provided for a subsequent request. + */ + isTruncated?: boolean + /** + * The list of metrics configurations for a bucket. + */ + metricsConfigurationList: Array + /** + * The marker used to continue a metrics configuration listing that has been + * truncated. Use the NextContinuationToken from a previously truncated list + * response to continue the listing. The continuation token is an opaque value that + * Amazon S3 understands. + */ + nextContinuationToken?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subDHJJR = noSmithyDocumentSerde + interface ListBucketsInput extends _subDHJJR { + /** + * ContinuationToken indicates to Amazon S3 that the list is being continued on + * this bucket with a token. ContinuationToken is obfuscated and is not a real + * key. You can use this ContinuationToken for pagination of the list results. + * + * Length Constraints: Minimum length of 0. Maximum length of 1024. + * + * Required: No. + */ + continuationToken?: string + /** + * Maximum number of buckets to be returned in response. When the number is more + * than the count of buckets that are owned by an Amazon Web Services account, + * return all the buckets in response. + */ + maxBuckets?: number + } + type _subZmNtO = noSmithyDocumentSerde + interface ListBucketsOutput extends _subZmNtO { + /** + * The list of buckets owned by the requester. + */ + buckets: Array + /** + * ContinuationToken is included in the response when there are more buckets that + * can be listed with pagination. The next ListBuckets request to Amazon S3 can be + * continued with this ContinuationToken . ContinuationToken is obfuscated and is + * not a real bucket. + */ + continuationToken?: string + /** + * The owner of the buckets listed. + */ + owner?: types.Owner + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subymSpX = noSmithyDocumentSerde + interface ListDirectoryBucketsInput extends _subymSpX { + /** + * ContinuationToken indicates to Amazon S3 that the list is being continued on + * buckets in this account with a token. ContinuationToken is obfuscated and is + * not a real bucket name. You can use this ContinuationToken for the pagination + * of the list results. + */ + continuationToken?: string + /** + * Maximum number of buckets to be returned in response. When the number is more + * than the count of buckets that are owned by an Amazon Web Services account, + * return all the buckets in response. + */ + maxDirectoryBuckets?: number + } + type _subHVtMn = noSmithyDocumentSerde + interface ListDirectoryBucketsOutput extends _subHVtMn { + /** + * The list of buckets owned by the requester. + */ + buckets: Array + /** + * If ContinuationToken was sent with the request, it is included in the response. + * You can use the returned ContinuationToken for pagination of the list response. + */ + continuationToken?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subZXicn = noSmithyDocumentSerde + interface ListMultipartUploadsInput extends _subZXicn { + /** + * The name of the bucket to which the multipart upload was initiated. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Character you use to group keys. + * + * All keys that contain the same string between the prefix, if specified, and the + * first occurrence of the delimiter after the prefix are grouped under a single + * result element, CommonPrefixes . If you don't specify the prefix parameter, then + * the substring starts at the beginning of the key. The keys that are grouped + * under CommonPrefixes result element are not returned elsewhere in the response. + * + * Directory buckets - For directory buckets, / is the only supported delimiter. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + * encoded only in UTF-8. An object key can contain any Unicode character. However, + * the XML 1.0 parser can't parse certain characters, such as characters with an + * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + * can add this parameter to request that Amazon S3 encode the keys in the + * response. For more information about characters to avoid in object key names, + * see [Object key naming guidelines]. + * + * When using the URL encoding type, non-ASCII characters that are used in an + * object's key name will be percent-encoded according to UTF-8 code values. For + * example, the object test_file(3).png will appear as test_file%283%29.png . + * + * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html + */ + encodingType: types.EncodingType + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Specifies the multipart upload after which listing should begin. + * + * ``` + * - General purpose buckets - For general purpose buckets, key-marker is an + * object key. Together with upload-id-marker , this parameter specifies the + * multipart upload after which listing should begin. + * ``` + * + * If upload-id-marker is not specified, only the keys lexicographically greater + * ``` + * than the specified key-marker will be included in the list. + * ``` + * + * If upload-id-marker is specified, any multipart uploads for a key equal to the + * ``` + * key-marker might also be included, provided those multipart uploads have + * upload IDs lexicographically greater than the specified upload-id-marker . + * + * - Directory buckets - For directory buckets, key-marker is obfuscated and + * isn't a real object key. The upload-id-marker parameter isn't supported by + * directory buckets. To list the additional multipart uploads, you only need to + * set the value of key-marker to the NextKeyMarker value from the previous + * response. + * ``` + * + * In the ListMultipartUploads response, the multipart uploads aren't sorted + * ``` + * lexicographically based on the object keys. + * ``` + */ + keyMarker?: string + /** + * Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the + * response body. 1,000 is the maximum number of uploads that can be returned in a + * response. + */ + maxUploads?: number + /** + * Lists in-progress uploads only for those keys that begin with the specified + * prefix. You can use prefixes to separate a bucket into different grouping of + * keys. (You can think of using prefix to make groups in the same way that you'd + * use a folder in a file system.) + * + * Directory buckets - For directory buckets, only prefixes that end in a + * delimiter ( / ) are supported. + */ + prefix?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Together with key-marker, specifies the multipart upload after which listing + * should begin. If key-marker is not specified, the upload-id-marker parameter is + * ignored. Otherwise, any multipart uploads for a key equal to the key-marker + * might be included in the list only if they have an upload ID lexicographically + * greater than the specified upload-id-marker . + * + * This functionality is not supported for directory buckets. + */ + uploadIdMarker?: string + } + type _subopNEP = noSmithyDocumentSerde + interface ListMultipartUploadsOutput extends _subopNEP { + /** + * The name of the bucket to which the multipart upload was initiated. Does not + * return the access point ARN or access point alias if used. + */ + bucket?: string + /** + * If you specify a delimiter in the request, then the result returns each + * distinct key prefix containing the delimiter in a CommonPrefixes element. The + * distinct key prefixes are returned in the Prefix child element. + * + * Directory buckets - For directory buckets, only prefixes that end in a + * delimiter ( / ) are supported. + */ + commonPrefixes: Array + /** + * Contains the delimiter you specified in the request. If you don't specify a + * delimiter in your request, this element is absent from the response. + * + * Directory buckets - For directory buckets, / is the only supported delimiter. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode object keys in the response. + * + * If you specify the encoding-type request parameter, Amazon S3 includes this + * element in the response, and returns encoded key name values in the following + * response elements: + * + * Delimiter , KeyMarker , Prefix , NextKeyMarker , Key . + */ + encodingType: types.EncodingType + /** + * Indicates whether the returned list of multipart uploads is truncated. A value + * of true indicates that the list was truncated. The list can be truncated if the + * number of multipart uploads exceeds the limit allowed or specified by max + * uploads. + */ + isTruncated?: boolean + /** + * The key at or after which the listing began. + */ + keyMarker?: string + /** + * Maximum number of multipart uploads that could have been included in the + * response. + */ + maxUploads?: number + /** + * When a list is truncated, this element specifies the value that should be used + * for the key-marker request parameter in a subsequent request. + */ + nextKeyMarker?: string + /** + * When a list is truncated, this element specifies the value that should be used + * for the upload-id-marker request parameter in a subsequent request. + * + * This functionality is not supported for directory buckets. + */ + nextUploadIdMarker?: string + /** + * When a prefix is provided in the request, this field contains the specified + * prefix. The result contains only keys starting with the specified prefix. + * + * Directory buckets - For directory buckets, only prefixes that end in a + * delimiter ( / ) are supported. + */ + prefix?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Together with key-marker, specifies the multipart upload after which listing + * should begin. If key-marker is not specified, the upload-id-marker parameter is + * ignored. Otherwise, any multipart uploads for a key equal to the key-marker + * might be included in the list only if they have an upload ID lexicographically + * greater than the specified upload-id-marker . + * + * This functionality is not supported for directory buckets. + */ + uploadIdMarker?: string + /** + * Container for elements related to a particular multipart upload. A response can + * contain zero or more Upload elements. + */ + uploads: Array + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subYLZDQ = noSmithyDocumentSerde + interface ListObjectVersionsInput extends _subYLZDQ { + /** + * The bucket name that contains the objects. + * + * This member is required. + */ + bucket?: string + /** + * A delimiter is a character that you specify to group keys. All keys that + * contain the same string between the prefix and the first occurrence of the + * delimiter are grouped under a single result element in CommonPrefixes . These + * groups are counted as one result against the max-keys limitation. These keys + * are not returned elsewhere in the response. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + * encoded only in UTF-8. An object key can contain any Unicode character. However, + * the XML 1.0 parser can't parse certain characters, such as characters with an + * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + * can add this parameter to request that Amazon S3 encode the keys in the + * response. For more information about characters to avoid in object key names, + * see [Object key naming guidelines]. + * + * When using the URL encoding type, non-ASCII characters that are used in an + * object's key name will be percent-encoded according to UTF-8 code values. For + * example, the object test_file(3).png will appear as test_file%283%29.png . + * + * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html + */ + encodingType: types.EncodingType + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Specifies the key to start with when listing objects in a bucket. + */ + keyMarker?: string + /** + * Sets the maximum number of keys returned in the response. By default, the + * action returns up to 1,000 key names. The response might contain fewer keys but + * will never contain more. If additional keys satisfy the search criteria, but + * were not returned because max-keys was exceeded, the response contains true . To + * return the additional keys, see key-marker and version-id-marker . + */ + maxKeys?: number + /** + * Specifies the optional fields that you want returned in the response. Fields + * that you do not specify are not returned. + */ + optionalObjectAttributes: Array + /** + * Use this parameter to select only those keys that begin with the specified + * prefix. You can use prefixes to separate a bucket into different groupings of + * keys. (You can think of using prefix to make groups in the same way that you'd + * use a folder in a file system.) You can use prefix with delimiter to roll up + * numerous objects into a single result under CommonPrefixes . + */ + prefix?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the object version you want to start listing from. + */ + versionIdMarker?: string + } + type _subHQVKY = noSmithyDocumentSerde + interface ListObjectVersionsOutput extends _subHQVKY { + /** + * All of the keys rolled up into a common prefix count as a single return when + * calculating the number of returns. + */ + commonPrefixes: Array + /** + * Container for an object that is a delete marker. + */ + deleteMarkers: Array + /** + * The delimiter grouping the included keys. A delimiter is a character that you + * specify to group keys. All keys that contain the same string between the prefix + * and the first occurrence of the delimiter are grouped under a single result + * element in CommonPrefixes . These groups are counted as one result against the + * max-keys limitation. These keys are not returned elsewhere in the response. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode object key names in the XML response. + * + * If you specify the encoding-type request parameter, Amazon S3 includes this + * element in the response, and returns encoded key name values in the following + * response elements: + * + * KeyMarker, NextKeyMarker, Prefix, Key , and Delimiter . + */ + encodingType: types.EncodingType + /** + * A flag that indicates whether Amazon S3 returned all of the results that + * satisfied the search criteria. If your results were truncated, you can make a + * follow-up paginated request by using the NextKeyMarker and NextVersionIdMarker + * response parameters as a starting place in another request to return the rest of + * the results. + */ + isTruncated?: boolean + /** + * Marks the last key returned in a truncated response. + */ + keyMarker?: string + /** + * Specifies the maximum number of objects to return. + */ + maxKeys?: number + /** + * The bucket name. + */ + name?: string + /** + * When the number of responses exceeds the value of MaxKeys , NextKeyMarker + * specifies the first key not returned that satisfies the search criteria. Use + * this value for the key-marker request parameter in a subsequent request. + */ + nextKeyMarker?: string + /** + * When the number of responses exceeds the value of MaxKeys , NextVersionIdMarker + * specifies the first object version not returned that satisfies the search + * criteria. Use this value for the version-id-marker request parameter in a + * subsequent request. + */ + nextVersionIdMarker?: string + /** + * Selects objects that start with the value supplied by this parameter. + */ + prefix?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Marks the last version of the key returned in a truncated response. + */ + versionIdMarker?: string + /** + * Container for version information. + */ + versions: Array + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subpZPkc = noSmithyDocumentSerde + interface ListObjectsInput extends _subpZPkc { + /** + * The name of the bucket containing the objects. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * A delimiter is a character that you use to group keys. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + * encoded only in UTF-8. An object key can contain any Unicode character. However, + * the XML 1.0 parser can't parse certain characters, such as characters with an + * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + * can add this parameter to request that Amazon S3 encode the keys in the + * response. For more information about characters to avoid in object key names, + * see [Object key naming guidelines]. + * + * When using the URL encoding type, non-ASCII characters that are used in an + * object's key name will be percent-encoded according to UTF-8 code values. For + * example, the object test_file(3).png will appear as test_file%283%29.png . + * + * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html + */ + encodingType: types.EncodingType + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Marker is where you want Amazon S3 to start listing from. Amazon S3 starts + * listing after this specified key. Marker can be any key in the bucket. + */ + marker?: string + /** + * Sets the maximum number of keys returned in the response. By default, the + * action returns up to 1,000 key names. The response might contain fewer keys but + * will never contain more. + */ + maxKeys?: number + /** + * Specifies the optional fields that you want returned in the response. Fields + * that you do not specify are not returned. + */ + optionalObjectAttributes: Array + /** + * Limits the response to keys that begin with the specified prefix. + */ + prefix?: string + /** + * Confirms that the requester knows that she or he will be charged for the list + * objects request. Bucket owners need not specify this parameter in their + * requests. + */ + requestPayer: types.RequestPayer + } + type _subOSJeO = noSmithyDocumentSerde + interface ListObjectsOutput extends _subOSJeO { + /** + * All of the keys (up to 1,000) rolled up in a common prefix count as a single + * return when calculating the number of returns. + * + * A response can contain CommonPrefixes only if you specify a delimiter. + * + * CommonPrefixes contains all (if there are any) keys between Prefix and the next + * occurrence of the string specified by the delimiter. + * + * CommonPrefixes lists keys that act like subdirectories in the directory + * specified by Prefix . + * + * For example, if the prefix is notes/ and the delimiter is a slash ( / ), as in + * notes/summer/july , the common prefix is notes/summer/ . All of the keys that + * roll up into a common prefix count as a single return when calculating the + * number of returns. + */ + commonPrefixes: Array + /** + * Metadata about each object returned. + */ + contents: Array + /** + * Causes keys that contain the same string between the prefix and the first + * occurrence of the delimiter to be rolled up into a single result element in the + * CommonPrefixes collection. These rolled-up keys are not returned elsewhere in + * the response. Each rolled-up result counts as only one return against the + * MaxKeys value. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + * encoded only in UTF-8. An object key can contain any Unicode character. However, + * the XML 1.0 parser can't parse certain characters, such as characters with an + * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + * can add this parameter to request that Amazon S3 encode the keys in the + * response. For more information about characters to avoid in object key names, + * see [Object key naming guidelines]. + * + * When using the URL encoding type, non-ASCII characters that are used in an + * object's key name will be percent-encoded according to UTF-8 code values. For + * example, the object test_file(3).png will appear as test_file%283%29.png . + * + * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html + */ + encodingType: types.EncodingType + /** + * A flag that indicates whether Amazon S3 returned all of the results that + * satisfied the search criteria. + */ + isTruncated?: boolean + /** + * Indicates where in the bucket listing begins. Marker is included in the + * response if it was sent with the request. + */ + marker?: string + /** + * The maximum number of keys returned in the response body. + */ + maxKeys?: number + /** + * The bucket name. + */ + name?: string + /** + * When the response is truncated (the IsTruncated element value in the response + * is true ), you can use the key name in this field as the marker parameter in + * the subsequent request to get the next set of objects. Amazon S3 lists objects + * in alphabetical order. + * + * This element is returned only if you have the delimiter request parameter + * specified. If the response does not include the NextMarker element and it is + * truncated, you can use the value of the last Key element in the response as the + * marker parameter in the subsequent request to get the next set of object keys. + */ + nextMarker?: string + /** + * Keys that begin with the indicated prefix. + */ + prefix?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subYNZGG = noSmithyDocumentSerde + interface ListObjectsV2Input extends _subYNZGG { + /** + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * ContinuationToken indicates to Amazon S3 that the list is being continued on + * this bucket with a token. ContinuationToken is obfuscated and is not a real + * key. You can use this ContinuationToken for pagination of the list results. + */ + continuationToken?: string + /** + * A delimiter is a character that you use to group keys. + * + * ``` + * - Directory buckets - For directory buckets, / is the only supported delimiter. + * + * - Directory buckets - When you query ListObjectsV2 with a delimiter during + * in-progress multipart uploads, the CommonPrefixes response parameter contains + * the prefixes that are associated with the in-progress multipart uploads. For + * more information about multipart uploads, see [Multipart Upload Overview]in the Amazon S3 User Guide. + * ``` + * + * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + * encoded only in UTF-8. An object key can contain any Unicode character. However, + * the XML 1.0 parser can't parse certain characters, such as characters with an + * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + * can add this parameter to request that Amazon S3 encode the keys in the + * response. For more information about characters to avoid in object key names, + * see [Object key naming guidelines]. + * + * When using the URL encoding type, non-ASCII characters that are used in an + * object's key name will be percent-encoded according to UTF-8 code values. For + * example, the object test_file(3).png will appear as test_file%283%29.png . + * + * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html + */ + encodingType: types.EncodingType + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The owner field is not present in ListObjectsV2 by default. If you want to + * return the owner field with each key in the result, then set the FetchOwner + * field to true . + * + * Directory buckets - For directory buckets, the bucket owner is returned as the + * object owner for all objects. + */ + fetchOwner?: boolean + /** + * Sets the maximum number of keys returned in the response. By default, the + * action returns up to 1,000 key names. The response might contain fewer keys but + * will never contain more. + */ + maxKeys?: number + /** + * Specifies the optional fields that you want returned in the response. Fields + * that you do not specify are not returned. + * + * This functionality is not supported for directory buckets. + */ + optionalObjectAttributes: Array + /** + * Limits the response to keys that begin with the specified prefix. + * + * Directory buckets - For directory buckets, only prefixes that end in a + * delimiter ( / ) are supported. + */ + prefix?: string + /** + * Confirms that the requester knows that she or he will be charged for the list + * objects request in V2 style. Bucket owners need not specify this parameter in + * their requests. + * + * This functionality is not supported for directory buckets. + */ + requestPayer: types.RequestPayer + /** + * StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts + * listing after this specified key. StartAfter can be any key in the bucket. + * + * This functionality is not supported for directory buckets. + */ + startAfter?: string + } + type _subMMqpa = noSmithyDocumentSerde + interface ListObjectsV2Output extends _subMMqpa { + /** + * All of the keys (up to 1,000) that share the same prefix are grouped together. + * When counting the total numbers of returns by this API operation, this group of + * keys is considered as one item. + * + * A response can contain CommonPrefixes only if you specify a delimiter. + * + * CommonPrefixes contains all (if there are any) keys between Prefix and the next + * occurrence of the string specified by a delimiter. + * + * CommonPrefixes lists keys that act like subdirectories in the directory + * specified by Prefix . + * + * For example, if the prefix is notes/ and the delimiter is a slash ( / ) as in + * notes/summer/july , the common prefix is notes/summer/ . All of the keys that + * roll up into a common prefix count as a single return when calculating the + * number of returns. + * + * ``` + * - Directory buckets - For directory buckets, only prefixes that end in a + * delimiter ( / ) are supported. + * + * - Directory buckets - When you query ListObjectsV2 with a delimiter during + * in-progress multipart uploads, the CommonPrefixes response parameter contains + * the prefixes that are associated with the in-progress multipart uploads. For + * more information about multipart uploads, see [Multipart Upload Overview]in the Amazon S3 User Guide. + * ``` + * + * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html + */ + commonPrefixes: Array + /** + * Metadata about each object returned. + */ + contents: Array + /** + * If ContinuationToken was sent with the request, it is included in the + * response. You can use the returned ContinuationToken for pagination of the list + * response. You can use this ContinuationToken for pagination of the list + * results. + */ + continuationToken?: string + /** + * Causes keys that contain the same string between the prefix and the first + * occurrence of the delimiter to be rolled up into a single result element in the + * CommonPrefixes collection. These rolled-up keys are not returned elsewhere in + * the response. Each rolled-up result counts as only one return against the + * MaxKeys value. + * + * Directory buckets - For directory buckets, / is the only supported delimiter. + */ + delimiter?: string + /** + * Encoding type used by Amazon S3 to encode object key names in the XML response. + * + * If you specify the encoding-type request parameter, Amazon S3 includes this + * element in the response, and returns encoded key name values in the following + * response elements: + * + * Delimiter, Prefix, Key, and StartAfter . + */ + encodingType: types.EncodingType + /** + * Set to false if all of the results were returned. Set to true if more keys are + * available to return. If the number of results exceeds that specified by MaxKeys + * , all of the results might not be returned. + */ + isTruncated?: boolean + /** + * KeyCount is the number of keys returned with this request. KeyCount will always + * be less than or equal to the MaxKeys field. For example, if you ask for 50 + * keys, your result will include 50 keys or fewer. + */ + keyCount?: number + /** + * Sets the maximum number of keys returned in the response. By default, the + * action returns up to 1,000 key names. The response might contain fewer keys but + * will never contain more. + */ + maxKeys?: number + /** + * The bucket name. + */ + name?: string + /** + * NextContinuationToken is sent when isTruncated is true, which means there are + * more keys in the bucket that can be listed. The next list requests to Amazon S3 + * can be continued with this NextContinuationToken . NextContinuationToken is + * obfuscated and is not a real key + */ + nextContinuationToken?: string + /** + * Keys that begin with the indicated prefix. + * + * Directory buckets - For directory buckets, only prefixes that end in a + * delimiter ( / ) are supported. + */ + prefix?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If StartAfter was sent with the request, it is included in the response. + * + * This functionality is not supported for directory buckets. + */ + startAfter?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subLIeSp = noSmithyDocumentSerde + interface ListPartsInput extends _subLIeSp { + /** + * The name of the bucket to which the parts are being uploaded. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Object key for which the multipart upload was initiated. + * + * This member is required. + */ + key?: string + /** + * Upload ID identifying the multipart upload whose parts are being listed. + * + * This member is required. + */ + uploadId?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Sets the maximum number of parts to return. + */ + maxParts?: number + /** + * Specifies the part after which listing should begin. Only parts with higher + * part numbers will be listed. + */ + partNumberMarker?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The server-side encryption (SSE) algorithm used to encrypt the object. This + * parameter is needed only when the object was created using a checksum algorithm. + * For more information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerAlgorithm?: string + /** + * The server-side encryption (SSE) customer managed key. This parameter is needed + * only when the object was created using a checksum algorithm. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKey?: string + /** + * The MD5 server-side encryption (SSE) customer managed key. This parameter is + * needed only when the object was created using a checksum algorithm. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKeyMD5?: string + } + type _subVoJFh = noSmithyDocumentSerde + interface ListPartsOutput extends _subVoJFh { + /** + * If the bucket has a lifecycle rule configured with an action to abort + * incomplete multipart uploads and the prefix in the lifecycle rule matches the + * object name in the request, then the response includes this header indicating + * when the initiated multipart upload will become eligible for abort operation. + * For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]. + * + * The response will also include the x-amz-abort-rule-id header that will provide + * the ID of the lifecycle configuration rule that defines this action. + * + * This functionality is not supported for directory buckets. + * + * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config + */ + abortDate?: time.Time + /** + * This header is returned along with the x-amz-abort-date header. It identifies + * applicable lifecycle configuration rule that defines the action to abort + * incomplete multipart uploads. + * + * This functionality is not supported for directory buckets. + */ + abortRuleId?: string + /** + * The name of the bucket to which the multipart upload was initiated. Does not + * return the access point ARN or access point alias if used. + */ + bucket?: string + /** + * The algorithm that was used to create a checksum of the object. + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * Container element that identifies who initiated the multipart upload. If the + * initiator is an Amazon Web Services account, this element provides the same + * information as the Owner element. If the initiator is an IAM User, this element + * provides the user ARN and display name. + */ + initiator?: types.Initiator + /** + * Indicates whether the returned list of parts is truncated. A true value + * indicates that the list was truncated. A list can be truncated if the number of + * parts exceeds the limit returned in the MaxParts element. + */ + isTruncated?: boolean + /** + * Object key for which the multipart upload was initiated. + */ + key?: string + /** + * Maximum number of parts that were allowed in the response. + */ + maxParts?: number + /** + * When a list is truncated, this element specifies the last part in the list, as + * well as the value to use for the part-number-marker request parameter in a + * subsequent request. + */ + nextPartNumberMarker?: string + /** + * Container element that identifies the object owner, after the object is + * created. If multipart upload is initiated by an IAM user, this element provides + * the parent account ID and display name. + * + * Directory buckets - The bucket owner is returned as the object owner for all + * the parts. + */ + owner?: types.Owner + /** + * Specifies the part after which listing should begin. Only parts with higher + * part numbers will be listed. + */ + partNumberMarker?: string + /** + * Container for elements related to a particular part. A response can contain + * zero or more Part elements. + */ + parts: Array + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * The class of storage used to store the uploaded object. + * + * Directory buckets - Only the S3 Express One Zone storage class is supported by + * directory buckets to store objects. + */ + storageClass: types.StorageClass + /** + * Upload ID identifying the multipart upload whose parts are being listed. + */ + uploadId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subdvmub = noSmithyDocumentSerde + interface PutBucketAccelerateConfigurationInput extends _subdvmub { + /** + * Container for setting the transfer acceleration state. + * + * This member is required. + */ + accelerateConfiguration?: types.AccelerateConfiguration + /** + * The name of the bucket for which the accelerate configuration is set. + * + * This member is required. + */ + bucket?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subIvJxE = noSmithyDocumentSerde + interface PutBucketAccelerateConfigurationOutput extends _subIvJxE { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subYpAFl = noSmithyDocumentSerde + interface PutBucketAclInput extends _subYpAFl { + /** + * The bucket to which to apply the ACL. + * + * This member is required. + */ + bucket?: string + /** + * The canned ACL to apply to the bucket. + */ + acl: types.BucketCannedACL + /** + * Contains the elements that set the ACL permissions for an object per grantee. + */ + accessControlPolicy?: types.AccessControlPolicy + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. This header must be used as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, go to [RFC 1864.] + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864.]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Allows grantee the read, write, read ACP, and write ACP permissions on the + * bucket. + */ + grantFullControl?: string + /** + * Allows grantee to list the objects in the bucket. + */ + grantRead?: string + /** + * Allows grantee to read the bucket ACL. + */ + grantReadACP?: string + /** + * Allows grantee to create new objects in the bucket. + * + * For the bucket and object owners of existing objects, also allows deletions and + * overwrites of those objects. + */ + grantWrite?: string + /** + * Allows grantee to write the ACL for the applicable bucket. + */ + grantWriteACP?: string + } + type _sublhrtH = noSmithyDocumentSerde + interface PutBucketAclOutput extends _sublhrtH { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subZSIfw = noSmithyDocumentSerde + interface PutBucketAnalyticsConfigurationInput extends _subZSIfw { + /** + * The configuration and any analyses for the analytics filter. + * + * This member is required. + */ + analyticsConfiguration?: types.AnalyticsConfiguration + /** + * The name of the bucket to which an analytics configuration is stored. + * + * This member is required. + */ + bucket?: string + /** + * The ID that identifies the analytics configuration. + * + * This member is required. + */ + id?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subRNcDs = noSmithyDocumentSerde + interface PutBucketAnalyticsConfigurationOutput extends _subRNcDs { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subMrBSr = noSmithyDocumentSerde + interface PutBucketCorsInput extends _subMrBSr { + /** + * Specifies the bucket impacted by the cors configuration. + * + * This member is required. + */ + bucket?: string + /** + * Describes the cross-origin access configuration for objects in an Amazon S3 + * bucket. For more information, see [Enabling Cross-Origin Resource Sharing]in the Amazon S3 User Guide. + * + * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html + * + * This member is required. + */ + corsConfiguration?: types.CORSConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. This header must be used as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, go to [RFC 1864.] + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864.]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subGcPQY = noSmithyDocumentSerde + interface PutBucketCorsOutput extends _subGcPQY { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subWpkys = noSmithyDocumentSerde + interface PutBucketEncryptionInput extends _subWpkys { + /** + * Specifies default encryption for a bucket using server-side encryption with + * different key options. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * + * This member is required. + */ + bucket?: string + /** + * Specifies the default server-side-encryption configuration. + * + * This member is required. + */ + serverSideEncryptionConfiguration?: types.ServerSideEncryptionConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + * default checksum algorithm that's used for performance. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the server-side encryption + * configuration. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * This functionality is not supported for directory buckets. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subQzgEL = noSmithyDocumentSerde + interface PutBucketEncryptionOutput extends _subQzgEL { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subusqpL = noSmithyDocumentSerde + interface PutBucketIntelligentTieringConfigurationInput extends _subusqpL { + /** + * The name of the Amazon S3 bucket whose configuration you want to modify or + * retrieve. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the S3 Intelligent-Tiering configuration. + * + * This member is required. + */ + id?: string + /** + * Container for S3 Intelligent-Tiering configuration. + * + * This member is required. + */ + intelligentTieringConfiguration?: types.IntelligentTieringConfiguration + } + type _subCYkED = noSmithyDocumentSerde + interface PutBucketIntelligentTieringConfigurationOutput extends _subCYkED { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subEDQDU = noSmithyDocumentSerde + interface PutBucketInventoryConfigurationInput extends _subEDQDU { + /** + * The name of the bucket where the inventory configuration will be stored. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the inventory configuration. + * + * This member is required. + */ + id?: string + /** + * Specifies the inventory configuration. + * + * This member is required. + */ + inventoryConfiguration?: types.InventoryConfiguration + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subrBuEk = noSmithyDocumentSerde + interface PutBucketInventoryConfigurationOutput extends _subrBuEk { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subNvNOa = noSmithyDocumentSerde + interface PutBucketLifecycleConfigurationInput extends _subNvNOa { + /** + * The name of the bucket for which to set the configuration. + * + * This member is required. + */ + bucket?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Container for lifecycle rules. You can add as many as 1,000 rules. + */ + lifecycleConfiguration?: types.BucketLifecycleConfiguration + /** + * Indicates which default minimum object size behavior is applied to the + * lifecycle configuration. + * + * ``` + * - all_storage_classes_128K - Objects smaller than 128 KB will not transition + * to any storage class by default. + * + * - varies_by_storage_class - Objects smaller than 128 KB will transition to + * Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, + * all other storage classes will prevent transitions smaller than 128 KB. + * ``` + * + * To customize the minimum object size for any transition you can add a filter + * that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body + * of your transition rule. Custom filters always take precedence over the default + * transition behavior. + */ + transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize + } + type _subGWwQT = noSmithyDocumentSerde + interface PutBucketLifecycleConfigurationOutput extends _subGWwQT { + /** + * Indicates which default minimum object size behavior is applied to the + * lifecycle configuration. + * + * ``` + * - all_storage_classes_128K - Objects smaller than 128 KB will not transition + * to any storage class by default. + * + * - varies_by_storage_class - Objects smaller than 128 KB will transition to + * Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, + * all other storage classes will prevent transitions smaller than 128 KB. + * ``` + * + * To customize the minimum object size for any transition you can add a filter + * that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body + * of your transition rule. Custom filters always take precedence over the default + * transition behavior. + */ + transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subuRdDU = noSmithyDocumentSerde + interface PutBucketLoggingInput extends _subuRdDU { + /** + * The name of the bucket for which to set the logging parameters. + * + * This member is required. + */ + bucket?: string + /** + * Container for logging status information. + * + * This member is required. + */ + bucketLoggingStatus?: types.BucketLoggingStatus + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The MD5 hash of the PutBucketLogging request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subVqzPz = noSmithyDocumentSerde + interface PutBucketLoggingOutput extends _subVqzPz { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subAuGIi = noSmithyDocumentSerde + interface PutBucketMetricsConfigurationInput extends _subAuGIi { + /** + * The name of the bucket for which the metrics configuration is set. + * + * This member is required. + */ + bucket?: string + /** + * The ID used to identify the metrics configuration. The ID has a 64 character + * limit and can only contain letters, numbers, periods, dashes, and underscores. + * + * This member is required. + */ + id?: string + /** + * Specifies the metrics configuration. + * + * This member is required. + */ + metricsConfiguration?: types.MetricsConfiguration + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subZZnAv = noSmithyDocumentSerde + interface PutBucketMetricsConfigurationOutput extends _subZZnAv { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subVChPt = noSmithyDocumentSerde + interface PutBucketNotificationConfigurationInput extends _subVChPt { + /** + * The name of the bucket. + * + * This member is required. + */ + bucket?: string + /** + * A container for specifying the notification configuration of the bucket. If + * this element is empty, notifications are turned off for the bucket. + * + * This member is required. + */ + notificationConfiguration?: types.NotificationConfiguration + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or + * false value. + */ + skipDestinationValidation?: boolean + } + type _subzhWTS = noSmithyDocumentSerde + interface PutBucketNotificationConfigurationOutput extends _subzhWTS { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subUkynR = noSmithyDocumentSerde + interface PutBucketOwnershipControlsInput extends _subUkynR { + /** + * The name of the Amazon S3 bucket whose OwnershipControls you want to set. + * + * This member is required. + */ + bucket?: string + /** + * The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or + * ObjectWriter) that you want to apply to this Amazon S3 bucket. + * + * This member is required. + */ + ownershipControls?: types.OwnershipControls + /** + * The MD5 hash of the OwnershipControls request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subgncqn = noSmithyDocumentSerde + interface PutBucketOwnershipControlsOutput extends _subgncqn { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subfjRvj = noSmithyDocumentSerde + interface PutBucketPolicyInput extends _subfjRvj { + /** + * The name of the bucket. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use path-style requests in the format + * https://s3express-control.region_code.amazonaws.com/bucket-name . + * Virtual-hosted-style requests aren't supported. Directory bucket names must be + * unique in the chosen Availability Zone. Bucket names must also follow the format + * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 + * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User + * Guide + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * + * This member is required. + */ + bucket?: string + /** + * The bucket policy as a JSON document. + * + * For directory buckets, the only IAM action supported in the bucket policy is + * s3express:CreateSession . + * + * This member is required. + */ + policy?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 + * fails the request with the HTTP status code 400 Bad Request . + * + * For the x-amz-checksum-algorithm header, replace algorithm with the + * supported algorithm from the following list: + * + * ``` + * - CRC32 + * + * - CRC32C + * + * - SHA1 + * + * - SHA256 + * ``` + * + * For more information, see [Checking object integrity] in the Amazon S3 User Guide. + * + * If the individual checksum value you provide through x-amz-checksum-algorithm + * doesn't match the checksum algorithm you set through + * x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm + * parameter and uses the checksum algorithm that matches the provided value in + * x-amz-checksum-algorithm . + * + * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + * default checksum algorithm that's used for performance. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * Set this parameter to true to confirm that you want to remove your permissions + * to change this bucket policy in the future. + * + * This functionality is not supported for directory buckets. + */ + confirmRemoveSelfBucketAccess?: boolean + /** + * The MD5 hash of the request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * This functionality is not supported for directory buckets. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + * + * For directory buckets, this header is not supported in this API operation. If + * you specify this header, the request fails with the HTTP status code 501 Not + * Implemented . + */ + expectedBucketOwner?: string + } + type _subJNMQZ = noSmithyDocumentSerde + interface PutBucketPolicyOutput extends _subJNMQZ { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subhBUWh = noSmithyDocumentSerde + interface PutBucketReplicationInput extends _subhBUWh { + /** + * The name of the bucket + * + * This member is required. + */ + bucket?: string + /** + * A container for replication rules. You can add up to 1,000 rules. The maximum + * size of a replication configuration is 2 MB. + * + * This member is required. + */ + replicationConfiguration?: types.ReplicationConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. You must use this header as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, see [RFC 1864]. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * A token to allow Object Lock to be enabled for an existing bucket. + */ + token?: string + } + type _subhwzAr = noSmithyDocumentSerde + interface PutBucketReplicationOutput extends _subhwzAr { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subyrzSF = noSmithyDocumentSerde + interface PutBucketRequestPaymentInput extends _subyrzSF { + /** + * The bucket name. + * + * This member is required. + */ + bucket?: string + /** + * Container for Payer. + * + * This member is required. + */ + requestPaymentConfiguration?: types.RequestPaymentConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. You must use this header as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, see [RFC 1864]. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _sublqlWX = noSmithyDocumentSerde + interface PutBucketRequestPaymentOutput extends _sublqlWX { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subsIsNs = noSmithyDocumentSerde + interface PutBucketTaggingInput extends _subsIsNs { + /** + * The bucket name. + * + * This member is required. + */ + bucket?: string + /** + * Container for the TagSet and Tag elements. + * + * This member is required. + */ + tagging?: types.Tagging + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. You must use this header as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, see [RFC 1864]. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subJklpP = noSmithyDocumentSerde + interface PutBucketTaggingOutput extends _subJklpP { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subZTOJl = noSmithyDocumentSerde + interface PutBucketVersioningInput extends _subZTOJl { + /** + * The bucket name. + * + * This member is required. + */ + bucket?: string + /** + * Container for setting the versioning state. + * + * This member is required. + */ + versioningConfiguration?: types.VersioningConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * >The base64-encoded 128-bit MD5 digest of the data. You must use this header as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, see [RFC 1864]. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The concatenation of the authentication device's serial number, a space, and + * the value that is displayed on your authentication device. + */ + mfa?: string + } + type _subGTuLM = noSmithyDocumentSerde + interface PutBucketVersioningOutput extends _subGTuLM { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subnRJwE = noSmithyDocumentSerde + interface PutBucketWebsiteInput extends _subnRJwE { + /** + * The bucket name. + * + * This member is required. + */ + bucket?: string + /** + * Container for the request. + * + * This member is required. + */ + websiteConfiguration?: types.WebsiteConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. You must use this header as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, see [RFC 1864]. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _submkdXl = noSmithyDocumentSerde + interface PutBucketWebsiteOutput extends _submkdXl { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subeJRpI = noSmithyDocumentSerde + interface PutObjectInput extends _subeJRpI { + /** + * The bucket name to which the PUT action was initiated. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Object key for which the PUT action was initiated. + * + * This member is required. + */ + key?: string + /** + * The canned ACL to apply to the object. For more information, see [Canned ACL] in the Amazon + * S3 User Guide. + * + * When adding a new object, you can use headers to grant ACL-based permissions to + * individual Amazon Web Services accounts or to predefined groups defined by + * Amazon S3. These permissions are then added to the ACL on the object. By + * default, all objects are private. Only the owner has full access control. For + * more information, see [Access Control List (ACL) Overview]and [Managing ACLs Using the REST API] in the Amazon S3 User Guide. + * + * If the bucket that you're uploading objects to uses the bucket owner enforced + * setting for S3 Object Ownership, ACLs are disabled and no longer affect + * permissions. Buckets that use this setting only accept PUT requests that don't + * specify an ACL or PUT requests that specify bucket owner full control ACLs, such + * as the bucket-owner-full-control canned ACL or an equivalent form of this ACL + * expressed in the XML format. PUT requests that contain other ACLs (for example, + * custom grants to certain Amazon Web Services accounts) fail and return a 400 + * error with the error code AccessControlListNotSupported . For more information, + * see [Controlling ownership of objects and disabling ACLs]in the Amazon S3 User Guide. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + * + * [Managing ACLs Using the REST API]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html + * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + * [Controlling ownership of objects and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + */ + acl: types.ObjectCannedACL + /** + * Object data. + */ + body: io.Reader + /** + * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption + * with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). + * + * General purpose buckets - Setting this header to true causes Amazon S3 to use + * an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this + * header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. + * + * Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + * supported, when you copy SSE-KMS encrypted objects from general purpose buckets + * to directory buckets, from directory buckets to general purpose buckets, or + * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + * call to KMS every time a copy request is made for a KMS-encrypted object. + * + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + */ + bucketKeyEnabled?: boolean + /** + * Can be used to specify caching behavior along the request/reply chain. For more + * information, see [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9]. + * + * [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 + */ + cacheControl?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 + * fails the request with the HTTP status code 400 Bad Request . + * + * For the x-amz-checksum-algorithm header, replace algorithm with the + * supported algorithm from the following list: + * + * ``` + * - CRC32 + * + * - CRC32C + * + * - SHA1 + * + * - SHA256 + * ``` + * + * For more information, see [Checking object integrity] in the Amazon S3 User Guide. + * + * If the individual checksum value you provide through x-amz-checksum-algorithm + * doesn't match the checksum algorithm you set through + * x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm + * parameter and uses the checksum algorithm that matches the provided value in + * x-amz-checksum-algorithm . + * + * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + * default checksum algorithm that's used for performance. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see + * [Checking object integrity]in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32C?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA1?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * Specifies presentational information for the object. For more information, see [https://www.rfc-editor.org/rfc/rfc6266#section-4]. + * + * [https://www.rfc-editor.org/rfc/rfc6266#section-4]: https://www.rfc-editor.org/rfc/rfc6266#section-4 + */ + contentDisposition?: string + /** + * Specifies what content encodings have been applied to the object and thus what + * decoding mechanisms must be applied to obtain the media-type referenced by the + * Content-Type header field. For more information, see [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding]. + * + * [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding + */ + contentEncoding?: string + /** + * The language the content is in. + */ + contentLanguage?: string + /** + * Size of the body in bytes. This parameter is useful when the size of the body + * cannot be determined automatically. For more information, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length]. + * + * [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length + */ + contentLength?: number + /** + * The base64-encoded 128-bit MD5 digest of the message (without the headers) + * according to RFC 1864. This header can be used as a message integrity check to + * verify that the data is the same data that was originally sent. Although it is + * optional, we recommend using the Content-MD5 mechanism as an end-to-end + * integrity check. For more information about REST request authentication, see [REST Authentication]. + * + * The Content-MD5 header is required for any request to upload an object with a + * retention period configured using Amazon S3 Object Lock. For more information + * about Amazon S3 Object Lock, see [Amazon S3 Object Lock Overview]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + * [Amazon S3 Object Lock Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html + */ + contentMD5?: string + /** + * A standard MIME type describing the format of the contents. For more + * information, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type]. + * + * [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type + */ + contentType?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The date and time at which the object is no longer cacheable. For more + * information, see [https://www.rfc-editor.org/rfc/rfc7234#section-5.3]. + * + * [https://www.rfc-editor.org/rfc/rfc7234#section-5.3]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3 + */ + expires?: time.Time + /** + * Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantFullControl?: string + /** + * Allows grantee to read the object data and its metadata. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantRead?: string + /** + * Allows grantee to read the object ACL. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantReadACP?: string + /** + * Allows grantee to write the ACL for the applicable object. + * + * ``` + * - This functionality is not supported for directory buckets. + * + * - This functionality is not supported for Amazon S3 on Outposts. + * ``` + */ + grantWriteACP?: string + /** + * Uploads the object only if the object key name does not already exist in the + * bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. + * + * If a conflicting operation occurs during the upload S3 returns a 409 + * ConditionalRequestConflict response. On a 409 failure you should retry the + * upload. + * + * Expects the '*' (asterisk) character. + * + * For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + * User Guide. + * + * [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + * [RFC 7232]: https://tools.ietf.org/html/rfc7232 + */ + ifNoneMatch?: string + /** + * A map of metadata to store with the object in S3. + */ + metadata: _TygojaDict + /** + * Specifies whether a legal hold will be applied to this object. For more + * information about S3 Object Lock, see [Object Lock]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + */ + objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus + /** + * The Object Lock mode that you want to apply to this object. + * + * This functionality is not supported for directory buckets. + */ + objectLockMode: types.ObjectLockMode + /** + * The date and time when you want this object's Object Lock to expire. Must be + * formatted as a timestamp parameter. + * + * This functionality is not supported for directory buckets. + */ + objectLockRetainUntilDate?: time.Time + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256 ). + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * Specifies the Amazon Web Services KMS Encryption Context as an additional + * encryption context to use for object encryption. The value of this header is a + * Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption + * context as key-value pairs. This value is stored as object metadata and + * automatically gets passed on to Amazon Web Services KMS for future GetObject + * operations on this object. + * + * General purpose buckets - This value must be explicitly added during CopyObject + * operations if you want an additional encryption context for your object. For + * more information, see [Encryption context]in the Amazon S3 User Guide. + * + * Directory buckets - You can optionally provide an explicit encryption context + * value. The value must match the default encryption context - the bucket Amazon + * Resource Name (ARN). An additional encryption context value is not supported. + * + * [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context + */ + ssekmsEncryptionContext?: string + /** + * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object + * encryption. If the KMS key doesn't exist in the same account that's issuing the + * command, you must use the full Key ARN not the Key ID. + * + * General purpose buckets - If you specify x-amz-server-side-encryption with + * aws:kms or aws:kms:dsse , this header specifies the ID (Key ID, Key ARN, or Key + * Alias) of the KMS key to use. If you specify + * x-amz-server-side-encryption:aws:kms or + * x-amz-server-side-encryption:aws:kms:dsse , but do not provide + * x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web + * Services managed key ( aws/s3 ) to protect the data. + * + * Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , + * you must specify the x-amz-server-side-encryption-aws-kms-key-id header with + * the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key + * to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID + * or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS + * configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the + * bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm that was used when you store this object + * in Amazon S3 (for example, AES256 , aws:kms , aws:kms:dsse ). + * + * ``` + * - General purpose buckets - You have four mutually exclusive options to + * protect data using server-side encryption in Amazon S3, depending on how you + * choose to manage the encryption keys. Specifically, the encryption key options + * are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or + * DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with + * server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You + * can optionally tell Amazon S3 to encrypt data at rest by using server-side + * encryption with other key options. For more information, see [Using Server-Side Encryption]in the Amazon S3 + * User Guide. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: server-side encryption with Amazon S3 + * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses + * the desired encryption configuration and you don't override the bucket default + * encryption in your CreateSession requests or PUT object requests. Then, new + * objects are automatically encrypted with the desired encryption settings. For + * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about + * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + * ``` + * + * In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the + * ``` + * encryption request headers must match the encryption settings that are specified + * in the CreateSession request. You can't override the values of the encryption + * settings ( x-amz-server-side-encryption , + * x-amz-server-side-encryption-aws-kms-key-id , + * x-amz-server-side-encryption-context , and + * x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the + * CreateSession request. You don't need to explicitly specify these encryption + * settings values in Zonal endpoint API calls, and Amazon S3 will use the + * encryption settings values from the CreateSession request to protect new + * objects in the directory bucket. + * ``` + * + * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the + * ``` + * session token refreshes automatically to avoid service interruptions when a + * session expires. The CLI or the Amazon Web Services SDKs use the bucket's + * default encryption configuration for the CreateSession request. It's not + * supported to override the encryption settings values in the CreateSession + * request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption + * request headers must match the default encryption configuration of the directory + * bucket. + * ``` + * + * [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html + * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + */ + serverSideEncryption: types.ServerSideEncryption + /** + * By default, Amazon S3 uses the STANDARD Storage Class to store newly created + * objects. The STANDARD storage class provides high durability and high + * availability. Depending on performance needs, you can specify a different + * Storage Class. For more information, see [Storage Classes]in the Amazon S3 User Guide. + * + * ``` + * - For directory buckets, only the S3 Express One Zone storage class is + * supported to store newly created objects. + * + * - Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. + * ``` + * + * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + */ + storageClass: types.StorageClass + /** + * The tag-set for the object. The tag-set must be encoded as URL Query + * parameters. (For example, "Key1=Value1") + * + * This functionality is not supported for directory buckets. + */ + tagging?: string + /** + * If the bucket is configured as a website, redirects requests for this object to + * another object in the same bucket or to an external URL. Amazon S3 stores the + * value of this header in the object metadata. For information about object + * metadata, see [Object Key and Metadata]in the Amazon S3 User Guide. + * + * In the following example, the request header sets the redirect to an object + * (anotherPage.html) in the same bucket: + * + * ``` + * x-amz-website-redirect-location: /anotherPage.html + * ``` + * + * In the following example, the request header sets the object redirect to + * another website: + * + * ``` + * x-amz-website-redirect-location: http://www.example.com/ + * ``` + * + * For more information about website hosting in Amazon S3, see [Hosting Websites on Amazon S3] and [How to Configure Website Page Redirects] in the + * Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. + * + * [How to Configure Website Page Redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html + * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html + * [Object Key and Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html + */ + websiteRedirectLocation?: string + } + type _subPlEPr = noSmithyDocumentSerde + interface PutObjectOutput extends _subPlEPr { + /** + * Indicates whether the uploaded object uses an S3 Bucket Key for server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * Entity tag for the uploaded object. + * + * General purpose buckets - To ensure that data is not corrupted traversing the + * network, for objects where the ETag is the MD5 digest of the object, you can + * calculate the MD5 while putting an object to Amazon S3 and compare the returned + * ETag to the calculated MD5 value. + * + * Directory buckets - The ETag for the object in a directory bucket isn't the MD5 + * digest of the object. + */ + eTag?: string + /** + * If the expiration is configured for the object (see [PutBucketLifecycleConfiguration]) in the Amazon S3 User + * Guide, the response includes this header. It includes the expiry-date and + * rule-id key-value pairs that provide information about object expiration. The + * value of the rule-id is URL-encoded. + * + * This functionality is not supported for directory buckets. + * + * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html + */ + expiration?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the Amazon Web Services KMS Encryption Context to use for + * object encryption. The value of this header is a Base64-encoded string of a + * UTF-8 encoded JSON, which contains the encryption context as key-value pairs. + * This value is stored as object metadata and automatically gets passed on to + * Amazon Web Services KMS for future GetObject operations on this object. + */ + ssekmsEncryptionContext?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3. + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Version ID of the object. + * + * If you enable versioning for a bucket, Amazon S3 automatically generates a + * unique version ID for the object being stored. Amazon S3 returns this ID in the + * response. When you enable versioning for a bucket, if Amazon S3 receives + * multiple write requests for the same object simultaneously, it stores all of the + * objects. For more information about versioning, see [Adding Objects to Versioning-Enabled Buckets]in the Amazon S3 User + * Guide. For information about returning the versioning state of a bucket, see [GetBucketVersioning]. + * + * This functionality is not supported for directory buckets. + * + * [Adding Objects to Versioning-Enabled Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html + * [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subGFZDA = noSmithyDocumentSerde + interface PutObjectAclInput extends _subGFZDA { + /** + * The bucket name that contains the object to which you want to attach the ACL. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Key for which the PUT action was initiated. + * + * This member is required. + */ + key?: string + /** + * The canned ACL to apply to the object. For more information, see [Canned ACL]. + * + * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + */ + acl: types.ObjectCannedACL + /** + * Contains the elements that set the ACL permissions for an object per grantee. + */ + accessControlPolicy?: types.AccessControlPolicy + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The base64-encoded 128-bit MD5 digest of the data. This header must be used as + * a message integrity check to verify that the request body was not corrupted in + * transit. For more information, go to [RFC 1864.>] + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + * + * [RFC 1864.>]: http://www.ietf.org/rfc/rfc1864.txt + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Allows grantee the read, write, read ACP, and write ACP permissions on the + * bucket. + * + * This functionality is not supported for Amazon S3 on Outposts. + */ + grantFullControl?: string + /** + * Allows grantee to list the objects in the bucket. + * + * This functionality is not supported for Amazon S3 on Outposts. + */ + grantRead?: string + /** + * Allows grantee to read the bucket ACL. + * + * This functionality is not supported for Amazon S3 on Outposts. + */ + grantReadACP?: string + /** + * Allows grantee to create new objects in the bucket. + * + * For the bucket and object owners of existing objects, also allows deletions and + * overwrites of those objects. + */ + grantWrite?: string + /** + * Allows grantee to write the ACL for the applicable bucket. + * + * This functionality is not supported for Amazon S3 on Outposts. + */ + grantWriteACP?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Version ID used to reference a specific version of the object. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + } + type _subhYLJz = noSmithyDocumentSerde + interface PutObjectAclOutput extends _subhYLJz { + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subyfpPe = noSmithyDocumentSerde + interface PutObjectLegalHoldInput extends _subyfpPe { + /** + * The bucket name containing the object that you want to place a legal hold on. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The key name for the object that you want to place a legal hold on. + * + * This member is required. + */ + key?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The MD5 hash for the request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Container element for the legal hold configuration you want to apply to the + * specified object. + */ + legalHold?: types.ObjectLockLegalHold + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The version ID of the object that you want to place a legal hold on. + */ + versionId?: string + } + type _subPWMsH = noSmithyDocumentSerde + interface PutObjectLegalHoldOutput extends _subPWMsH { + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subpFViB = noSmithyDocumentSerde + interface PutObjectLockConfigurationInput extends _subpFViB { + /** + * The bucket whose Object Lock configuration you want to create or replace. + * + * This member is required. + */ + bucket?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The MD5 hash for the request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The Object Lock configuration that you want to apply to the specified bucket. + */ + objectLockConfiguration?: types.ObjectLockConfiguration + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * A token to allow Object Lock to be enabled for an existing bucket. + */ + token?: string + } + type _subCfBIC = noSmithyDocumentSerde + interface PutObjectLockConfigurationOutput extends _subCfBIC { + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subQDqpO = noSmithyDocumentSerde + interface PutObjectRetentionInput extends _subQDqpO { + /** + * The bucket name that contains the object you want to apply this Object + * Retention configuration to. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * The key name for the object that you want to apply this Object Retention + * configuration to. + * + * This member is required. + */ + key?: string + /** + * Indicates whether this action should bypass Governance-mode restrictions. + */ + bypassGovernanceRetention?: boolean + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The MD5 hash for the request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The container element for the Object Retention configuration. + */ + retention?: types.ObjectLockRetention + /** + * The version ID for the object that you want to apply this Object Retention + * configuration to. + */ + versionId?: string + } + type _subditGI = noSmithyDocumentSerde + interface PutObjectRetentionOutput extends _subditGI { + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _suboiOeh = noSmithyDocumentSerde + interface PutObjectTaggingInput extends _suboiOeh { + /** + * The bucket name containing the object. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Name of the object key. + * + * This member is required. + */ + key?: string + /** + * Container for the TagSet and Tag elements + * + * This member is required. + */ + tagging?: types.Tagging + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The MD5 hash for the request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * The versionId of the object that the tag-set will be added to. + */ + versionId?: string + } + type _subuVSga = noSmithyDocumentSerde + interface PutObjectTaggingOutput extends _subuVSga { + /** + * The versionId of the object the tag-set was added to. + */ + versionId?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subwMCvj = noSmithyDocumentSerde + interface PutPublicAccessBlockInput extends _subwMCvj { + /** + * The name of the Amazon S3 bucket whose PublicAccessBlock configuration you want + * to set. + * + * This member is required. + */ + bucket?: string + /** + * The PublicAccessBlock configuration that you want to apply to this Amazon S3 + * bucket. You can enable the configuration options in any combination. For more + * information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in + * the Amazon S3 User Guide. + * + * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + * + * This member is required. + */ + publicAccessBlockConfiguration?: types.PublicAccessBlockConfiguration + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The MD5 hash of the PutPublicAccessBlock request body. + * + * For requests made using the Amazon Web Services Command Line Interface (CLI) or + * Amazon Web Services SDKs, this field is calculated automatically. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + } + type _subKeqew = noSmithyDocumentSerde + interface PutPublicAccessBlockOutput extends _subKeqew { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subkObCn = noSmithyDocumentSerde + interface RestoreObjectInput extends _subkObCn { + /** + * The bucket name containing the object to restore. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Object key for which the action was initiated. + * + * This member is required. + */ + key?: string + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Container for restore job parameters. + */ + restoreRequest?: types.RestoreRequest + /** + * VersionId used to reference a specific version of the object. + */ + versionId?: string + } + type _subHBstk = noSmithyDocumentSerde + interface RestoreObjectOutput extends _subHBstk { + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Indicates the path in the provided S3 output location where Select results will + * be restored to. + */ + restoreOutputPath?: string + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + // @ts-ignore + import smithysync = sync + /** + * Learn Amazon S3 Select is no longer available to new customers. Existing + * customers of Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Request to filter the contents of an Amazon S3 object based on a simple + * Structured Query Language (SQL) statement. In the request, along with the SQL + * expression, you must specify a data serialization format (JSON or CSV) of the + * object. Amazon S3 uses this to parse object data into records. It returns only + * records that match the specified SQL expression. You must also specify the data + * serialization format for the response. For more information, see [S3Select API Documentation]. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [S3Select API Documentation]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html + */ + type _subjzKEZ = noSmithyDocumentSerde + interface SelectObjectContentInput extends _subjzKEZ { + /** + * The S3 bucket. + * + * This member is required. + */ + bucket?: string + /** + * The expression that is used to query the object. + * + * This member is required. + */ + expression?: string + /** + * The type of the provided expression (for example, SQL). + * + * This member is required. + */ + expressionType: types.ExpressionType + /** + * Describes the format of the data in the object that is being queried. + * + * This member is required. + */ + inputSerialization?: types.InputSerialization + /** + * The object key. + * + * This member is required. + */ + key?: string + /** + * Describes the format of the data that you want Amazon S3 to return in response. + * + * This member is required. + */ + outputSerialization?: types.OutputSerialization + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Specifies if periodic request progress information should be enabled. + */ + requestProgress?: types.RequestProgress + /** + * The server-side encryption (SSE) algorithm used to encrypt the object. This + * parameter is needed only when the object was created using a checksum algorithm. + * For more information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerAlgorithm?: string + /** + * The server-side encryption (SSE) customer managed key. This parameter is needed + * only when the object was created using a checksum algorithm. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKey?: string + /** + * The MD5 server-side encryption (SSE) customer managed key. This parameter is + * needed only when the object was created using a checksum algorithm. For more + * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + * + * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKeyMD5?: string + /** + * Specifies the byte range of the object to get the records from. A record is + * processed when its first byte is contained by the range. This parameter is + * optional, but when specified, it must not be empty. See RFC 2616, Section + * 14.35.1 about how to specify the start and end of the range. + * + * ScanRange may be used in the following ways: + * + * ``` + * - 50100 - process only the records starting between the bytes 50 and 100 + * (inclusive, counting from zero) + * + * - 50 - process only the records starting after the byte 50 + * + * - 50 - process only the records within the last 50 bytes of the file. + * ``` + */ + scanRange?: types.ScanRange + } + type _subGliMM = noSmithyDocumentSerde + interface SelectObjectContentOutput extends _subGliMM { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + interface SelectObjectContentOutput { + /** + * GetStream returns the type to interact with the event stream. + */ + getStream(): (SelectObjectContentEventStream) + } + type _subXWhvG = noSmithyDocumentSerde + interface UploadPartInput extends _subXWhvG { + /** + * The name of the bucket to which the multipart upload was initiated. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Object key for which the multipart upload was initiated. + * + * This member is required. + */ + key?: string + /** + * Part number of part being uploaded. This is a positive integer between 1 and + * 10,000. + * + * This member is required. + */ + partNumber?: number + /** + * Upload ID identifying the multipart upload whose part is being uploaded. + * + * This member is required. + */ + uploadId?: string + /** + * Object data. + */ + body: io.Reader + /** + * Indicates the algorithm used to create the checksum for the object when you use + * the SDK. This header will not provide any additional functionality if you don't + * use the SDK. When you send this header, there must be a corresponding + * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * If you provide an individual checksum, Amazon S3 ignores any provided + * ChecksumAlgorithm parameter. + * + * This checksum algorithm must be the same for all parts and it match the + * checksum value supplied in the CreateMultipartUpload request. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumAlgorithm: types.ChecksumAlgorithm + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see + * [Checking object integrity]in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32C?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA1?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * Size of the body in bytes. This parameter is useful when the size of the body + * cannot be determined automatically. + */ + contentLength?: number + /** + * The base64-encoded 128-bit MD5 digest of the part data. This parameter is + * auto-populated when using the command from the CLI. This parameter is required + * if object lock parameters are specified. + * + * This functionality is not supported for directory buckets. + */ + contentMD5?: string + /** + * The account ID of the expected bucket owner. If the account ID that you provide + * does not match the actual owner of the bucket, the request fails with the HTTP + * status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256). + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header . This must be the same + * encryption key specified in the initiate multipart upload request. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + } + type _subuZGom = noSmithyDocumentSerde + interface UploadPartOutput extends _subuZGom { + /** + * Indicates whether the multipart upload uses an S3 Bucket Key for server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * Entity tag for the uploaded object. + */ + eTag?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3 (for example, AES256 , aws:kms ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subIrsiu = noSmithyDocumentSerde + interface UploadPartCopyInput extends _subIrsiu { + /** + * The bucket name. + * + * Directory buckets - When you use this operation with a directory bucket, you + * must use virtual-hosted-style requests in the format + * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not + * supported. Directory bucket names must be unique in the chosen Availability + * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for + * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket + * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + * + * Access points - When you use this action with an access point, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When using the access point ARN, you must direct requests to the + * access point hostname. The access point hostname takes the form + * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + * action with an access point through the Amazon Web Services SDKs, you provide + * the access point ARN in place of the bucket name. For more information about + * access point ARNs, see [Using access points]in the Amazon S3 User Guide. + * + * Access points and Object Lambda access points are not supported by directory + * buckets. + * + * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form + * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you + * use this action with S3 on Outposts through the Amazon Web Services SDKs, you + * provide the Outposts access point ARN in place of the bucket name. For more + * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + * + * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + * + * This member is required. + */ + bucket?: string + /** + * Specifies the source object for the copy operation. You specify the value in + * one of two formats, depending on whether you want to access the source object + * through an [access point]: + * + * ``` + * - For objects not accessed through an access point, specify the name of the + * source bucket and key of the source object, separated by a slash (/). For + * example, to copy the object reports/january.pdf from the bucket + * awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value must + * be URL-encoded. + * + * - For objects accessed through access points, specify the Amazon Resource + * Name (ARN) of the object as accessed through the access point, in the format + * arn:aws:s3:::accesspoint//object/ . For example, to copy the object + * reports/january.pdf through access point my-access-point owned by account + * 123456789012 in Region us-west-2 , use the URL encoding of + * arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf + * . The value must be URL encoded. + * + * - Amazon S3 supports copy operations using Access points only when the source + * and destination buckets are in the same Amazon Web Services Region. + * + * - Access points are not supported by directory buckets. + * ``` + * + * Alternatively, for objects accessed through Amazon S3 on Outposts, specify the + * ``` + * ARN of the object as accessed in the format + * arn:aws:s3-outposts:::outpost//object/ . For example, to copy the object + * reports/january.pdf through outpost my-outpost owned by account 123456789012 + * in Region us-west-2 , use the URL encoding of + * arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf + * . The value must be URL-encoded. + * ``` + * + * If your bucket has versioning enabled, you could have multiple versions of the + * same object. By default, x-amz-copy-source identifies the current version of + * the source object to copy. To copy a specific version of the source object to + * copy, append ?versionId= to the x-amz-copy-source request header (for example, + * x-amz-copy-source: + * /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 + * ). + * + * If the current version is a delete marker and you don't specify a versionId in + * the x-amz-copy-source request header, Amazon S3 returns a 404 Not Found error, + * because the object does not exist. If you specify versionId in the + * x-amz-copy-source and the versionId is a delete marker, Amazon S3 returns an + * HTTP 400 Bad Request error, because you are not allowed to specify a delete + * marker as a version for the x-amz-copy-source . + * + * Directory buckets - S3 Versioning isn't enabled and supported for directory + * buckets. + * + * [access point]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html + * + * This member is required. + */ + copySource?: string + /** + * Object key for which the multipart upload was initiated. + * + * This member is required. + */ + key?: string + /** + * Part number of part being copied. This is a positive integer between 1 and + * 10,000. + * + * This member is required. + */ + partNumber?: number + /** + * Upload ID identifying the multipart upload whose part is being copied. + * + * This member is required. + */ + uploadId?: string + /** + * Copies the object if its entity tag (ETag) matches the specified tag. + * + * If both of the x-amz-copy-source-if-match and + * x-amz-copy-source-if-unmodified-since headers are present in the request as + * follows: + * + * x-amz-copy-source-if-match condition evaluates to true , and; + * + * x-amz-copy-source-if-unmodified-since condition evaluates to false ; + * + * Amazon S3 returns 200 OK and copies the data. + */ + copySourceIfMatch?: string + /** + * Copies the object if it has been modified since the specified time. + * + * If both of the x-amz-copy-source-if-none-match and + * x-amz-copy-source-if-modified-since headers are present in the request as + * follows: + * + * x-amz-copy-source-if-none-match condition evaluates to false , and; + * + * x-amz-copy-source-if-modified-since condition evaluates to true ; + * + * Amazon S3 returns 412 Precondition Failed response code. + */ + copySourceIfModifiedSince?: time.Time + /** + * Copies the object if its entity tag (ETag) is different than the specified ETag. + * + * If both of the x-amz-copy-source-if-none-match and + * x-amz-copy-source-if-modified-since headers are present in the request as + * follows: + * + * x-amz-copy-source-if-none-match condition evaluates to false , and; + * + * x-amz-copy-source-if-modified-since condition evaluates to true ; + * + * Amazon S3 returns 412 Precondition Failed response code. + */ + copySourceIfNoneMatch?: string + /** + * Copies the object if it hasn't been modified since the specified time. + * + * If both of the x-amz-copy-source-if-match and + * x-amz-copy-source-if-unmodified-since headers are present in the request as + * follows: + * + * x-amz-copy-source-if-match condition evaluates to true , and; + * + * x-amz-copy-source-if-unmodified-since condition evaluates to false ; + * + * Amazon S3 returns 200 OK and copies the data. + */ + copySourceIfUnmodifiedSince?: time.Time + /** + * The range of bytes to copy from the source object. The range value must use the + * form bytes=first-last, where the first and last are the zero-based byte offsets + * to copy. For example, bytes=0-9 indicates that you want to copy the first 10 + * bytes of the source. You can copy a range only if the source object is greater + * than 5 MB. + */ + copySourceRange?: string + /** + * Specifies the algorithm to use when decrypting the source object (for example, + * AES256 ). + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceSSECustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use to decrypt + * the source object. The encryption key provided in this header must be one that + * was used when the source object was created. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceSSECustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceSSECustomerKeyMD5?: string + /** + * The account ID of the expected destination bucket owner. If the account ID that + * you provide does not match the actual owner of the destination bucket, the + * request fails with the HTTP status code 403 Forbidden (access denied). + */ + expectedBucketOwner?: string + /** + * The account ID of the expected source bucket owner. If the account ID that you + * provide does not match the actual owner of the source bucket, the request fails + * with the HTTP status code 403 Forbidden (access denied). + */ + expectedSourceBucketOwner?: string + /** + * Confirms that the requester knows that they will be charged for the request. + * Bucket owners need not specify this parameter in their requests. If either the + * source or destination S3 bucket has Requester Pays enabled, the requester will + * pay for corresponding charges to copy the object. For information about + * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + * Guide. + * + * This functionality is not supported for directory buckets. + * + * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + */ + requestPayer: types.RequestPayer + /** + * Specifies the algorithm to use when encrypting the object (for example, AES256). + * + * This functionality is not supported when the destination bucket is a directory + * bucket. + */ + sseCustomerAlgorithm?: string + /** + * Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header. This must be the same + * encryption key specified in the initiate multipart upload request. + * + * This functionality is not supported when the destination bucket is a directory + * bucket. + */ + sseCustomerKey?: string + /** + * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error. + * + * This functionality is not supported when the destination bucket is a directory + * bucket. + */ + sseCustomerKeyMD5?: string + } + type _subCjJBx = noSmithyDocumentSerde + interface UploadPartCopyOutput extends _subCjJBx { + /** + * Indicates whether the multipart upload uses an S3 Bucket Key for server-side + * encryption with Key Management Service (KMS) keys (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * Container for all response elements. + */ + copyPartResult?: types.CopyPartResult + /** + * The version of the source object that was copied, if you have enabled + * versioning on the source bucket. + * + * This functionality is not supported when the source object is in a directory + * bucket. + */ + copySourceVersionId?: string + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to confirm the encryption + * algorithm that's used. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerAlgorithm?: string + /** + * If server-side encryption with a customer-provided encryption key was + * requested, the response will include this header to provide the round-trip + * message integrity verification of the customer-provided encryption key. + * + * This functionality is not supported for directory buckets. + */ + sseCustomerKeyMD5?: string + /** + * If present, indicates the ID of the KMS key that was used for object encryption. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when you store this object in Amazon + * S3 (for example, AES256 , aws:kms ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + type _subPezLW = noSmithyDocumentSerde + interface WriteGetObjectResponseInput extends _subPezLW { + /** + * Route prefix to the HTTP URL generated. + * + * This member is required. + */ + requestRoute?: string + /** + * A single use encrypted token that maps WriteGetObjectResponse to the end user + * GetObject request. + * + * This member is required. + */ + requestToken?: string + /** + * Indicates that a range of bytes was specified. + */ + acceptRanges?: string + /** + * The object data. + */ + body: io.Reader + /** + * Indicates whether the object stored in Amazon S3 uses an S3 bucket key for + * server-side encryption with Amazon Web Services KMS (SSE-KMS). + */ + bucketKeyEnabled?: boolean + /** + * Specifies caching behavior along the request/reply chain. + */ + cacheControl?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object returned by the Object + * Lambda function. This may not match the checksum for the object stored in Amazon + * S3. Amazon S3 will perform validation of the checksum values only when the + * original GetObject request required checksum validation. For more information + * about checksums, see [Checking object integrity]in the Amazon S3 User Guide. + * + * Only one checksum header can be specified at a time. If you supply multiple + * checksum headers, this request will fail. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This specifies the + * base64-encoded, 32-bit CRC-32C checksum of the object returned by the Object + * Lambda function. This may not match the checksum for the object stored in Amazon + * S3. Amazon S3 will perform validation of the checksum values only when the + * original GetObject request required checksum validation. For more information + * about checksums, see [Checking object integrity]in the Amazon S3 User Guide. + * + * Only one checksum header can be specified at a time. If you supply multiple + * checksum headers, this request will fail. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32C?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This specifies the + * base64-encoded, 160-bit SHA-1 digest of the object returned by the Object Lambda + * function. This may not match the checksum for the object stored in Amazon S3. + * Amazon S3 will perform validation of the checksum values only when the original + * GetObject request required checksum validation. For more information about + * checksums, see [Checking object integrity]in the Amazon S3 User Guide. + * + * Only one checksum header can be specified at a time. If you supply multiple + * checksum headers, this request will fail. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA1?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This specifies the + * base64-encoded, 256-bit SHA-256 digest of the object returned by the Object + * Lambda function. This may not match the checksum for the object stored in Amazon + * S3. Amazon S3 will perform validation of the checksum values only when the + * original GetObject request required checksum validation. For more information + * about checksums, see [Checking object integrity]in the Amazon S3 User Guide. + * + * Only one checksum header can be specified at a time. If you supply multiple + * checksum headers, this request will fail. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * Specifies presentational information for the object. + */ + contentDisposition?: string + /** + * Specifies what content encodings have been applied to the object and thus what + * decoding mechanisms must be applied to obtain the media-type referenced by the + * Content-Type header field. + */ + contentEncoding?: string + /** + * The language the content is in. + */ + contentLanguage?: string + /** + * The size of the content body in bytes. + */ + contentLength?: number + /** + * The portion of the object returned in the response. + */ + contentRange?: string + /** + * A standard MIME type describing the format of the object data. + */ + contentType?: string + /** + * Specifies whether an object stored in Amazon S3 is ( true ) or is not ( false ) + * a delete marker. + */ + deleteMarker?: boolean + /** + * An opaque identifier assigned by a web server to a specific version of a + * resource found at a URL. + */ + eTag?: string + /** + * A string that uniquely identifies an error condition. Returned in the tag of + * the error XML response for a corresponding GetObject call. Cannot be used with + * a successful StatusCode header or when the transformed object is provided in + * the body. All error codes from S3 are sentence-cased. The regular expression + * (regex) value is "^[A-Z][a-zA-Z]+$" . + */ + errorCode?: string + /** + * Contains a generic description of the error condition. Returned in the tag of + * the error XML response for a corresponding GetObject call. Cannot be used with + * a successful StatusCode header or when the transformed object is provided in + * body. + */ + errorMessage?: string + /** + * If the object expiration is configured (see PUT Bucket lifecycle), the response + * includes this header. It includes the expiry-date and rule-id key-value pairs + * that provide the object expiration information. The value of the rule-id is + * URL-encoded. + */ + expiration?: string + /** + * The date and time at which the object is no longer cacheable. + */ + expires?: time.Time + /** + * The date and time that the object was last modified. + */ + lastModified?: time.Time + /** + * A map of metadata to store with the object in S3. + */ + metadata: _TygojaDict + /** + * Set to the number of metadata entries not returned in x-amz-meta headers. This + * can happen if you create metadata using an API like SOAP that supports more + * flexible metadata than the REST API. For example, using SOAP, you can create + * metadata whose values are not legal HTTP headers. + */ + missingMeta?: number + /** + * Indicates whether an object stored in Amazon S3 has an active legal hold. + */ + objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus + /** + * Indicates whether an object stored in Amazon S3 has Object Lock enabled. For + * more information about S3 Object Lock, see [Object Lock]. + * + * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html + */ + objectLockMode: types.ObjectLockMode + /** + * The date and time when Object Lock is configured to expire. + */ + objectLockRetainUntilDate?: time.Time + /** + * The count of parts this object has. + */ + partsCount?: number + /** + * Indicates if request involves bucket that is either a source or destination in + * a Replication rule. For more information about S3 Replication, see [Replication]. + * + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html + */ + replicationStatus: types.ReplicationStatus + /** + * If present, indicates that the requester was successfully charged for the + * request. + * + * This functionality is not supported for directory buckets. + */ + requestCharged: types.RequestCharged + /** + * Provides information about object restoration operation and expiration time of + * the restored object copy. + */ + restore?: string + /** + * Encryption algorithm used if server-side encryption with a customer-provided + * encryption key was specified for object stored in Amazon S3. + */ + sseCustomerAlgorithm?: string + /** + * 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 to + * encrypt data stored in S3. For more information, see [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]. + * + * [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html + */ + sseCustomerKeyMD5?: string + /** + * If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web + * Services Key Management Service (Amazon Web Services KMS) symmetric encryption + * customer managed key that was used for stored in Amazon S3 object. + */ + ssekmsKeyId?: string + /** + * The server-side encryption algorithm used when storing requested object in + * Amazon S3 (for example, AES256, aws:kms ). + */ + serverSideEncryption: types.ServerSideEncryption + /** + * The integer status code for an HTTP response of a corresponding GetObject + * request. The following is a list of status codes. + * + * ``` + * - 200 - OK + * + * - 206 - Partial Content + * + * - 304 - Not Modified + * + * - 400 - Bad Request + * + * - 401 - Unauthorized + * + * - 403 - Forbidden + * + * - 404 - Not Found + * + * - 405 - Method Not Allowed + * + * - 409 - Conflict + * + * - 411 - Length Required + * + * - 412 - Precondition Failed + * + * - 416 - Range Not Satisfiable + * + * - 500 - Internal Server Error + * + * - 503 - Service Unavailable + * ``` + */ + statusCode?: number + /** + * Provides storage class information of the object. Amazon S3 returns this header + * for all objects except for S3 Standard storage class objects. + * + * For more information, see [Storage Classes]. + * + * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + */ + storageClass: types.StorageClass + /** + * The number of tags, if any, on the object. + */ + tagCount?: number + /** + * An ID used to reference a specific version of the object. + */ + versionId?: string + } + type _subqFpGs = noSmithyDocumentSerde + interface WriteGetObjectResponseOutput extends _subqFpGs { + /** + * Metadata pertaining to the operation's result. + */ + resultMetadata: middleware.Metadata + } + // @ts-ignore + import internalcontext = context + // @ts-ignore + import awsxml = xml + // @ts-ignore + import internalendpoints = endpoints + // @ts-ignore + import smithyendpoints = endpoints + interface Options { + /** + * Set of options to modify how an operation is invoked. These apply to all + * operations invoked for this client. Use functional options on operation call to + * modify this list for per operation behavior. + */ + apiOptions: Array<(_arg0: middleware.Stack) => void> + /** + * The optional application specific identifier appended to the User-Agent header. + */ + appID: string + /** + * This endpoint will be given as input to an EndpointResolverV2. It is used for + * providing a custom base endpoint that is subject to modifications by the + * processing EndpointResolverV2. + */ + baseEndpoint?: string + /** + * Configures the events that will be sent to the configured logger. + */ + clientLogMode: aws.ClientLogMode + /** + * The threshold ContentLength in bytes for HTTP PUT request to receive {Expect: + * 100-continue} header. Setting to -1 will disable adding the Expect header to + * requests; setting to 0 will set the threshold to default 2MB + */ + continueHeaderThresholdBytes: number + /** + * The credentials object to use when signing requests. + */ + credentials: aws.CredentialsProvider + /** + * The configuration DefaultsMode that the SDK should use when constructing the + * clients initial default settings. + */ + defaultsMode: aws.DefaultsMode + /** + * Allows you to disable S3 Multi-Region access points feature. + */ + disableMultiRegionAccessPoints: boolean + /** + * Disables this client's usage of Session Auth for S3Express buckets and reverts + * to using conventional SigV4 for those. + */ + disableS3ExpressSessionAuth?: boolean + /** + * The endpoint options to be used when attempting to resolve an endpoint. + */ + endpointOptions: EndpointResolverOptions + /** + * The service endpoint resolver. + * + * Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + * value for this field will likely prevent you from using any endpoint-related + * service features released after the introduction of EndpointResolverV2 and + * BaseEndpoint. + * + * To migrate an EndpointResolver implementation that uses a custom endpoint, set + * the client option BaseEndpoint instead. + */ + endpointResolver: EndpointResolver + /** + * Resolves the endpoint used for a particular service operation. This should be + * used over the deprecated EndpointResolver. + */ + endpointResolverV2: EndpointResolverV2 + /** + * The credentials provider for S3Express requests. + */ + expressCredentials: ExpressCredentialsProvider + /** + * Signature Version 4 (SigV4) Signer + */ + httpSignerV4: HTTPSignerV4 + /** + * The logger writer interface to write logging messages to. + */ + logger: logging.Logger + /** + * The client meter provider. + */ + meterProvider: metrics.MeterProvider + /** + * The region to send requests to. (Required) + */ + region: string + /** + * RetryMaxAttempts specifies the maximum number attempts an API client will call + * an operation that fails with a retryable error. A value of 0 is ignored, and + * will not be used to configure the API client created default retryer, or modify + * per operation call's retry max attempts. + * + * If specified in an operation call's functional options with a value that is + * different than the constructed client's Options, the Client's Retryer will be + * wrapped to use the operation's specific RetryMaxAttempts value. + */ + retryMaxAttempts: number + /** + * RetryMode specifies the retry mode the API client will be created with, if + * Retryer option is not also specified. + * + * When creating a new API Clients this member will only be used if the Retryer + * Options member is nil. This value will be ignored if Retryer is not nil. + * + * Currently does not support per operation call overrides, may in the future. + */ + retryMode: aws.RetryMode + /** + * Retryer guides how HTTP requests should be retried in case of recoverable + * failures. When nil the API client will use a default retryer. The kind of + * default retry created by the API client can be changed with the RetryMode + * option. + */ + retryer: aws.Retryer + /** + * The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + * to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + * should not populate this structure programmatically, or rely on the values here + * within your applications. + */ + runtimeEnvironment: aws.RuntimeEnvironment + /** + * The client tracer provider. + */ + tracerProvider: tracing.TracerProvider + /** + * Allows you to enable arn region support for the service. + */ + useARNRegion: boolean + /** + * Allows you to enable S3 Accelerate feature. All operations compatible with S3 + * Accelerate will use the accelerate endpoint for requests. Requests not + * compatible will fall back to normal S3 requests. The bucket must be enabled for + * accelerate to be used with S3 client with accelerate enabled. If the bucket is + * not enabled for accelerate an error will be returned. The bucket name must be + * DNS compatible to work with accelerate. + */ + useAccelerate: boolean + /** + * Allows you to enable dual-stack endpoint support for the service. + * + * Deprecated: Set dual-stack by setting UseDualStackEndpoint on + * EndpointResolverOptions. When EndpointResolverOptions' UseDualStackEndpoint + * field is set it overrides this field value. + */ + useDualstack: boolean + /** + * Allows you to enable the client to use path-style addressing, i.e., + * https://s3.amazonaws.com/BUCKET/KEY . By default, the S3 client will use virtual + * hosted bucket addressing when possible( https://BUCKET.s3.amazonaws.com/KEY ). + */ + usePathStyle: boolean + /** + * The HTTP client to invoke API calls with. Defaults to client's default HTTP + * implementation if nil. + */ + httpClient: HTTPClient + /** + * The auth scheme resolver which determines how to authenticate for each + * operation. + */ + authSchemeResolver: AuthSchemeResolver + /** + * The list of auth schemes supported by the client. + */ + authSchemes: Array + } + interface Options { + /** + * Copy creates a clone where the APIOptions list is deep copied. + */ + copy(): Options + } + interface Options { + getIdentityResolver(schemeID: string): smithyauth.IdentityResolver + } + // @ts-ignore + import v4 = signer +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation + /** + * SchemaField defines a single schema field structure. + */ + interface SchemaField { + system: boolean + id: string + name: string + type: string + required: boolean + /** + * Presentable indicates whether the field is suitable for + * visualization purposes (eg. in the Admin UI relation views). + */ + presentable: boolean + /** + * Deprecated: This field is no-op and will be removed in future versions. + * Please use the collection.Indexes field to define a unique constraint. + */ + unique: boolean + options: any + } + interface SchemaField { + /** + * ColDefinition returns the field db column type definition as string. + */ + colDefinition(): string + } + interface SchemaField { + /** + * String serializes and returns the current field as string. + */ + string(): string + } + interface SchemaField { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface SchemaField { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + * + * The schema field options are auto initialized on success. + */ + unmarshalJSON(data: string|Array): void + } + interface SchemaField { + /** + * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface SchemaField { + /** + * InitOptions initializes the current field options based on its type. + * + * Returns error on unknown field type. + */ + initOptions(): void + } + interface SchemaField { + /** + * PrepareValue returns normalized and properly formatted field value. + */ + prepareValue(value: any): any + } + interface SchemaField { + /** + * PrepareValueWithModifier returns normalized and properly formatted field value + * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). + */ + prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any + } +} + +/** + * Package models implements all PocketBase DB models and DTOs. + */ +namespace models { + /** + * Model defines an interface with common methods that all db models should have. + */ + interface Model { + [key:string]: any; + tableName(): string + isNew(): boolean + markAsNew(): void + markAsNotNew(): void + hasId(): boolean + getId(): string + setId(id: string): void + getCreated(): types.DateTime + getUpdated(): types.DateTime + refreshId(): void + refreshCreated(): void + refreshUpdated(): void + } + /** + * BaseModel defines common fields and methods used by all other models. + */ + interface BaseModel { + id: string + created: types.DateTime + updated: types.DateTime + } + interface BaseModel { + /** + * HasId returns whether the model has a nonzero id. + */ + hasId(): boolean + } + interface BaseModel { + /** + * GetId returns the model id. + */ + getId(): string + } + interface BaseModel { + /** + * SetId sets the model id to the provided string value. + */ + setId(id: string): void + } + interface BaseModel { + /** + * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). + */ + markAsNew(): void + } + interface BaseModel { + /** + * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) + */ + markAsNotNew(): void + } + interface BaseModel { + /** + * IsNew indicates what type of db query (insert or update) + * should be used with the model instance. + */ + isNew(): boolean + } + interface BaseModel { + /** + * GetCreated returns the model Created datetime. + */ + getCreated(): types.DateTime + } + interface BaseModel { + /** + * GetUpdated returns the model Updated datetime. + */ + getUpdated(): types.DateTime + } + interface BaseModel { + /** + * RefreshId generates and sets a new model id. + * + * The generated id is a cryptographically random 15 characters length string. + */ + refreshId(): void + } + interface BaseModel { + /** + * RefreshCreated updates the model Created field with the current datetime. + */ + refreshCreated(): void + } + interface BaseModel { + /** + * RefreshUpdated updates the model Updated field with the current datetime. + */ + refreshUpdated(): void + } + interface BaseModel { + /** + * PostScan implements the [dbx.PostScanner] interface. + * + * It is executed right after the model was populated with the db row values. + */ + postScan(): void + } + // @ts-ignore + import validation = ozzo_validation + /** + * CollectionBaseOptions defines the "base" Collection.Options fields. + */ + interface CollectionBaseOptions { + } + interface CollectionBaseOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + /** + * CollectionAuthOptions defines the "auth" Collection.Options fields. + */ + interface CollectionAuthOptions { + manageRule?: string + allowOAuth2Auth: boolean + allowUsernameAuth: boolean + allowEmailAuth: boolean + requireEmail: boolean + exceptEmailDomains: Array + onlyVerified: boolean + onlyEmailDomains: Array + minPasswordLength: number + } + interface CollectionAuthOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + /** + * CollectionViewOptions defines the "view" Collection.Options fields. + */ + interface CollectionViewOptions { + query: string + } + interface CollectionViewOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + type _subOHEED = BaseModel + interface Log extends _subOHEED { + data: types.JsonMap + message: string + level: number + } + interface Log { + tableName(): string + } + type _subpuOmJ = BaseModel + interface Param extends _subpuOmJ { + key: string + value: types.JsonRaw + } + interface Param { + tableName(): string + } + interface TableInfoRow { + /** + * the `db:"pk"` tag has special semantic so we cannot rename + * the original field without specifying a custom mapper + */ + pk: number + index: number + name: string + type: string + notNull: boolean + defaultValue: types.JsonRaw + } +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + /** + * Binder is the interface that wraps the Bind method. + */ + interface Binder { + [key:string]: any; + bind(c: Context, i: { + }): void + } + /** + * ServableContext is interface that Echo context implementation must implement to be usable in middleware/handlers and + * be able to be routed by Router. + */ + interface ServableContext { + [key:string]: any; + /** + * Reset resets the context after request completes. It must be called along + * with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. + * See `Echo#ServeHTTP()` + */ + reset(r: http.Request, w: http.ResponseWriter): void + } + // @ts-ignore + import stdContext = context + /** + * JSONSerializer is the interface that encodes and decodes JSON to and from interfaces. + */ + interface JSONSerializer { + [key:string]: any; + serialize(c: Context, i: { + }, indent: string): void + deserialize(c: Context, i: { + }): void + } + /** + * HTTPErrorHandler is a centralized HTTP error handler. + */ + interface HTTPErrorHandler {(c: Context, err: Error): void } + /** + * Validator is the interface that wraps the Validate function. + */ + interface Validator { + [key:string]: any; + validate(i: { + }): void + } + /** + * Renderer is the interface that wraps the Render function. + */ + interface Renderer { + [key:string]: any; + render(_arg0: io.Writer, _arg1: string, _arg2: { + }, _arg3: Context): void + } + /** + * Group is a set of sub-routes for a specified route. It can be used for inner + * routes that share a common middleware or functionality that should be separate + * from the parent echo instance while still inheriting from it. + */ + interface Group { + } + interface Group { + /** + * Use implements `Echo#Use()` for sub-routes within the Group. + * Group middlewares are not executed on request when there is no matching route found. + */ + use(...middleware: MiddlewareFunc[]): void + } + interface Group { + /** + * CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. Panics on error. + */ + connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * DELETE implements `Echo#DELETE()` for sub-routes within the Group. Panics on error. + */ + delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * GET implements `Echo#GET()` for sub-routes within the Group. Panics on error. + */ + get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * HEAD implements `Echo#HEAD()` for sub-routes within the Group. Panics on error. + */ + head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * OPTIONS implements `Echo#OPTIONS()` for sub-routes within the Group. Panics on error. + */ + options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * PATCH implements `Echo#PATCH()` for sub-routes within the Group. Panics on error. + */ + patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * POST implements `Echo#POST()` for sub-routes within the Group. Panics on error. + */ + post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * PUT implements `Echo#PUT()` for sub-routes within the Group. Panics on error. + */ + put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * TRACE implements `Echo#TRACE()` for sub-routes within the Group. Panics on error. + */ + trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * Any implements `Echo#Any()` for sub-routes within the Group. Panics on error. + */ + any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + } + interface Group { + /** + * Match implements `Echo#Match()` for sub-routes within the Group. Panics on error. + */ + match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + } + interface Group { + /** + * Group creates a new sub-group with prefix and optional sub-group-level middleware. + * Important! Group middlewares are only executed in case there was exact route match and not + * for 404 (not found) or 405 (method not allowed) cases. If this kind of behaviour is needed then add + * a catch-all route `/*` for the group which handler returns always 404 + */ + group(prefix: string, ...middleware: MiddlewareFunc[]): (Group) + } + interface Group { + /** + * Static implements `Echo#Static()` for sub-routes within the Group. + */ + static(pathPrefix: string, fsRoot: string): RouteInfo + } + interface Group { + /** + * StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. + * + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. + */ + staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo + } + interface Group { + /** + * FileFS implements `Echo#FileFS()` for sub-routes within the Group. + */ + fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * File implements `Echo#File()` for sub-routes within the Group. Panics on error. + */ + file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group. + * + * Example: `g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` + */ + routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * Add implements `Echo#Add()` for sub-routes within the Group. Panics on error. + */ + add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo + } + interface Group { + /** + * AddRoute registers a new Routable with Router + */ + addRoute(route: Routable): RouteInfo + } + /** + * IPExtractor is a function to extract IP addr from http.Request. + * Set appropriate one to Echo#IPExtractor. + * See https://echo.labstack.com/guide/ip-address for more details. + */ + interface IPExtractor {(_arg0: http.Request): string } + /** + * Logger defines the logging interface that Echo uses internally in few places. + * For logging in handlers use your own logger instance (dependency injected or package/public variable) from logging framework of your choice. + */ + interface Logger { + [key:string]: any; + /** + * Write provides writer interface for http.Server `ErrorLog` and for logging startup messages. + * `http.Server.ErrorLog` logs errors from accepting connections, unexpected behavior from handlers, + * and underlying FileSystem errors. + * `logger` middleware will use this method to write its JSON payload. + */ + write(p: string|Array): number + /** + * Error logs the error + */ + error(err: Error): void + } + /** + * Response wraps an http.ResponseWriter and implements its interface to be used + * by an HTTP handler to construct an HTTP response. + * See: https://golang.org/pkg/net/http/#ResponseWriter + */ + interface Response { + writer: http.ResponseWriter + status: number + size: number + committed: boolean + } + interface Response { + /** + * Header returns the header map for the writer that will be sent by + * WriteHeader. Changing the header after a call to WriteHeader (or Write) has + * no effect unless the modified headers were declared as trailers by setting + * the "Trailer" header before the call to WriteHeader (see example) + * To suppress implicit response headers, set their value to nil. + * Example: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers + */ + header(): http.Header + } + interface Response { + /** + * Before registers a function which is called just before the response is written. + */ + before(fn: () => void): void + } + interface Response { + /** + * After registers a function which is called just after the response is written. + * If the `Content-Length` is unknown, none of the after function is executed. + */ + after(fn: () => void): void + } + interface Response { + /** + * WriteHeader sends an HTTP response header with status code. If WriteHeader is + * not called explicitly, the first call to Write will trigger an implicit + * WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly + * used to send error codes. + */ + writeHeader(code: number): void + } + interface Response { + /** + * Write writes the data to the connection as part of an HTTP reply. + */ + write(b: string|Array): number + } + interface Response { + /** + * Flush implements the http.Flusher interface to allow an HTTP handler to flush + * buffered data to the client. + * See [http.Flusher](https://golang.org/pkg/net/http/#Flusher) + */ + flush(): void + } + interface Response { + /** + * Hijack implements the http.Hijacker interface to allow an HTTP handler to + * take over the connection. + * See [http.Hijacker](https://golang.org/pkg/net/http/#Hijacker) + */ + hijack(): [net.Conn, (bufio.ReadWriter)] + } + interface Response { + /** + * Unwrap returns the original http.ResponseWriter. + * ResponseController can be used to access the original http.ResponseWriter. + * See [https://go.dev/blog/go1.20] + */ + unwrap(): http.ResponseWriter + } + interface Routes { + /** + * Reverse reverses route to URL string by replacing path parameters with given params values. + */ + reverse(name: string, ...params: { + }[]): string + } + interface Routes { + /** + * FindByMethodPath searched for matching route info by method and path + */ + findByMethodPath(method: string, path: string): RouteInfo + } + interface Routes { + /** + * FilterByMethod searched for matching route info by method + */ + filterByMethod(method: string): Routes + } + interface Routes { + /** + * FilterByPath searched for matching route info by path + */ + filterByPath(path: string): Routes + } + interface Routes { + /** + * FilterByName searched for matching route info by name + */ + filterByName(name: string): Routes + } + /** + * Router is interface for routing request contexts to registered routes. + * + * Contract between Echo/Context instance and the router: + * ``` + * - all routes must be added through methods on echo.Echo instance. + * Reason: Echo instance uses RouteInfo.Params() length to allocate slice for paths parameters (see `Echo.contextPathParamAllocSize`). + * - Router must populate Context during Router.Route call with: + * - RoutableContext.SetPath + * - RoutableContext.SetRawPathParams (IMPORTANT! with same slice pointer that c.RawPathParams() returns) + * - RoutableContext.SetRouteInfo + * And optionally can set additional information to Context with RoutableContext.Set + * ``` + */ + interface Router { + [key:string]: any; + /** + * Add registers Routable with the Router and returns registered RouteInfo + */ + add(routable: Routable): RouteInfo + /** + * Remove removes route from the Router + */ + remove(method: string, path: string): void + /** + * Routes returns information about all registered routes + */ + routes(): Routes + /** + * Route searches Router for matching route and applies it to the given context. In case when no matching method + * was not found (405) or no matching route exists for path (404), router will return its implementation of 405/404 + * handler function. + */ + route(c: RoutableContext): HandlerFunc + } + /** + * Routable is interface for registering Route with Router. During route registration process the Router will + * convert Routable to RouteInfo with ToRouteInfo method. By creating custom implementation of Routable additional + * information about registered route can be stored in Routes (i.e. privileges used with route etc.) + */ + interface Routable { + [key:string]: any; + /** + * ToRouteInfo converts Routable to RouteInfo + * + * This method is meant to be used by Router after it parses url for path parameters, to store information about + * route just added. + */ + toRouteInfo(params: Array): RouteInfo + /** + * ToRoute converts Routable to Route which Router uses to register the method handler for path. + * + * This method is meant to be used by Router to get fields (including handler and middleware functions) needed to + * add Route to Router. + */ + toRoute(): Route + /** + * ForGroup recreates routable with added group prefix and group middlewares it is grouped to. + * + * Is necessary for Echo.Group to be able to add/register Routable with Router and having group prefix and group + * middlewares included in actually registered Route. + */ + forGroup(pathPrefix: string, middlewares: Array): Routable + } + /** + * Routes is collection of RouteInfo instances with various helper methods. + */ + interface Routes extends Array{} + /** + * RouteInfo describes registered route base fields. + * Method+Path pair uniquely identifies the Route. Name can have duplicates. + */ + interface RouteInfo { + [key:string]: any; + method(): string + path(): string + name(): string + params(): Array + /** + * Reverse reverses route to URL string by replacing path parameters with given params values. + */ + reverse(...params: { + }[]): string + } + /** + * PathParams is collections of PathParam instances with various helper methods + */ + interface PathParams extends Array{} + interface PathParams { + /** + * Get returns path parameter value for given name or default value. + */ + get(name: string, defaultValue: string): string + } +} + +/** + * Package oauth2 provides support for making + * OAuth2 authorized and authenticated HTTP requests, + * as specified in RFC 6749. + * It can additionally grant authorization with Bearer JWT. + */ +/** + * Copyright 2023 The Go Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ +namespace oauth2 { + /** + * An AuthCodeOption is passed to Config.AuthCodeURL. + */ + interface AuthCodeOption { + [key:string]: any; + } + /** + * Token represents the credentials used to authorize + * the requests to access protected resources on the OAuth 2.0 + * provider's backend. + * + * Most users of this package should not access fields of Token + * directly. They're exported mostly for use by related packages + * implementing derivative OAuth2 flows. + */ + interface Token { + /** + * AccessToken is the token that authorizes and authenticates + * the requests. + */ + accessToken: string + /** + * TokenType is the type of token. + * The Type method returns either this or "Bearer", the default. + */ + tokenType: string + /** + * RefreshToken is a token that's used by the application + * (as opposed to the user) to refresh the access token + * if it expires. + */ + refreshToken: string + /** + * Expiry is the optional expiration time of the access token. + * + * If zero, TokenSource implementations will reuse the same + * token forever and RefreshToken or equivalent + * mechanisms for that TokenSource will not be used. + */ + expiry: time.Time + /** + * ExpiresIn is the OAuth2 wire format "expires_in" field, + * which specifies how many seconds later the token expires, + * relative to an unknown time base approximately around "now". + * It is the application's responsibility to populate + * `Expiry` from `ExpiresIn` when required. + */ + expiresIn: number + } + interface Token { + /** + * Type returns t.TokenType if non-empty, else "Bearer". + */ + type(): string + } + interface Token { + /** + * SetAuthHeader sets the Authorization header to r using the access + * token in t. + * + * This method is unnecessary when using Transport or an HTTP Client + * returned by this package. + */ + setAuthHeader(r: http.Request): void + } + interface Token { + /** + * WithExtra returns a new Token that's a clone of t, but using the + * provided raw extra map. This is only intended for use by packages + * implementing derivative OAuth2 flows. + */ + withExtra(extra: { + }): (Token) + } + interface Token { + /** + * Extra returns an extra field. + * Extra fields are key-value pairs returned by the server as a + * part of the token retrieval response. + */ + extra(key: string): { + } + } + interface Token { + /** + * Valid reports whether t is non-nil, has an AccessToken, and is not expired. + */ + valid(): boolean + } +} + +namespace mailer { + /** + * Mailer defines a base mail client interface. + */ + interface Mailer { + [key:string]: any; + /** + * Send sends an email with the provided Message. + */ + send(message: Message): void + } +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + interface TokenConfig { + secret: string + duration: number + } + interface TokenConfig { + /** + * Validate makes TokenConfig validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface SmtpConfig { + enabled: boolean + host: string + port: number + username: string + password: string + /** + * SMTP AUTH - PLAIN (default) or LOGIN + */ + authMethod: string + /** + * Whether to enforce TLS encryption for the mail server connection. + * + * When set to false StartTLS command is send, leaving the server + * to decide whether to upgrade the connection or not. + */ + tls: boolean + /** + * LocalName is optional domain name or IP address used for the + * EHLO/HELO exchange (if not explicitly set, defaults to "localhost"). + * + * This is required only by some SMTP servers, such as Gmail SMTP-relay. + */ + localName: string + } + interface SmtpConfig { + /** + * Validate makes SmtpConfig validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface S3Config { + enabled: boolean + bucket: string + region: string + endpoint: string + accessKey: string + secret: string + forcePathStyle: boolean + } + interface S3Config { + /** + * Validate makes S3Config validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface BackupsConfig { + /** + * Cron is a cron expression to schedule auto backups, eg. "* * * * *". + * + * Leave it empty to disable the auto backups functionality. + */ + cron: string + /** + * CronMaxKeep is the max number of cron generated backups to + * keep before removing older entries. + * + * This field works only when the cron config has valid cron expression. + */ + cronMaxKeep: number + /** + * S3 is an optional S3 storage config specifying where to store the app backups. + */ + s3: S3Config + } + interface BackupsConfig { + /** + * Validate makes BackupsConfig validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface MetaConfig { + appName: string + appUrl: string + hideControls: boolean + senderName: string + senderAddress: string + verificationTemplate: EmailTemplate + resetPasswordTemplate: EmailTemplate + confirmEmailChangeTemplate: EmailTemplate + } + interface MetaConfig { + /** + * Validate makes MetaConfig validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface LogsConfig { + maxDays: number + minLevel: number + logIp: boolean + } + interface LogsConfig { + /** + * Validate makes LogsConfig validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface AuthProviderConfig { + enabled: boolean + clientId: string + clientSecret: string + authUrl: string + tokenUrl: string + userApiUrl: string + displayName: string + pkce?: boolean + } + interface AuthProviderConfig { + /** + * Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface AuthProviderConfig { + /** + * SetupProvider loads the current AuthProviderConfig into the specified provider. + */ + setupProvider(provider: auth.Provider): void + } + /** + * Deprecated: Will be removed in v0.9+ + */ + interface EmailAuthConfig { + enabled: boolean + exceptDomains: Array + onlyDomains: Array + minPasswordLength: number + } + interface EmailAuthConfig { + /** + * Deprecated: Will be removed in v0.9+ + */ + validate(): void + } +} + +/** + * Package daos handles common PocketBase DB model manipulations. + * + * Think of daos as DB repository and service layer in one. + */ +namespace daos { + interface LogsStatsItem { + total: number + date: types.DateTime + } + /** + * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. + */ + interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } + // @ts-ignore + import validation = ozzo_validation +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * A Logger records structured information about each call to its + * Log, Debug, Info, Warn, and Error methods. + * For each call, it creates a [Record] and passes it to a [Handler]. + * + * To create a new Logger, call [New] or a Logger method + * that begins "With". + */ + interface Logger { + } + interface Logger { + /** + * Handler returns l's Handler. + */ + handler(): Handler + } + interface Logger { + /** + * With returns a Logger that includes the given attributes + * in each output operation. Arguments are converted to + * attributes as if by [Logger.Log]. + */ + with(...args: any[]): (Logger) + } + interface Logger { + /** + * WithGroup returns a Logger that starts a group, if name is non-empty. + * The keys of all attributes added to the Logger will be qualified by the given + * name. (How that qualification happens depends on the [Handler.WithGroup] + * method of the Logger's Handler.) + * + * If name is empty, WithGroup returns the receiver. + */ + withGroup(name: string): (Logger) + } + interface Logger { + /** + * Enabled reports whether l emits log records at the given context and level. + */ + enabled(ctx: context.Context, level: Level): boolean + } + interface Logger { + /** + * Log emits a log record with the current time and the given level and message. + * The Record's Attrs consist of the Logger's attributes followed by + * the Attrs specified by args. + * + * The attribute arguments are processed as follows: + * ``` + * - If an argument is an Attr, it is used as is. + * - If an argument is a string and this is not the last argument, + * the following argument is treated as the value and the two are combined + * into an Attr. + * - Otherwise, the argument is treated as a value with key "!BADKEY". + * ``` + */ + log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void + } + interface Logger { + /** + * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. + */ + logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void + } + interface Logger { + /** + * Debug logs at [LevelDebug]. + */ + debug(msg: string, ...args: any[]): void + } + interface Logger { + /** + * DebugContext logs at [LevelDebug] with the given context. + */ + debugContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Info logs at [LevelInfo]. + */ + info(msg: string, ...args: any[]): void + } + interface Logger { + /** + * InfoContext logs at [LevelInfo] with the given context. + */ + infoContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Warn logs at [LevelWarn]. + */ + warn(msg: string, ...args: any[]): void + } + interface Logger { + /** + * WarnContext logs at [LevelWarn] with the given context. + */ + warnContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Error logs at [LevelError]. + */ + error(msg: string, ...args: any[]): void + } + interface Logger { + /** + * ErrorContext logs at [LevelError] with the given context. + */ + errorContext(ctx: context.Context, msg: string, ...args: any[]): void + } +} + +namespace subscriptions { + /** + * Broker defines a struct for managing subscriptions clients. + */ + interface Broker { + } + interface Broker { + /** + * Clients returns a shallow copy of all registered clients indexed + * with their connection id. + */ + clients(): _TygojaDict + } + interface Broker { + /** + * ClientById finds a registered client by its id. + * + * Returns non-nil error when client with clientId is not registered. + */ + clientById(clientId: string): Client + } + interface Broker { + /** + * Register adds a new client to the broker instance. + */ + register(client: Client): void + } + interface Broker { + /** + * Unregister removes a single client by its id. + * + * If client with clientId doesn't exist, this method does nothing. + */ + unregister(clientId: string): void + } +} + +/** + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. + */ +namespace core { + interface BootstrapEvent { + app: App + } + interface TerminateEvent { + app: App + isRestart: boolean + } + interface ServeEvent { + app: App + router?: echo.Echo + server?: http.Server + certManager?: any + } + interface ApiErrorEvent { + httpContext: echo.Context + error: Error + } + type _subyaEim = BaseModelEvent + interface ModelEvent extends _subyaEim { + dao?: daos.Dao + } + type _subskeUa = BaseCollectionEvent + interface MailerRecordEvent extends _subskeUa { + mailClient: mailer.Mailer + message?: mailer.Message + record?: models.Record + meta: _TygojaDict + } + interface MailerAdminEvent { + mailClient: mailer.Mailer + message?: mailer.Message + admin?: models.Admin + meta: _TygojaDict + } + interface RealtimeConnectEvent { + httpContext: echo.Context + client: subscriptions.Client + idleTimeout: time.Duration + } + interface RealtimeDisconnectEvent { + httpContext: echo.Context + client: subscriptions.Client + } + interface RealtimeMessageEvent { + httpContext: echo.Context + client: subscriptions.Client + message?: subscriptions.Message + } + interface RealtimeSubscribeEvent { + httpContext: echo.Context + client: subscriptions.Client + subscriptions: Array + } + interface SettingsListEvent { + httpContext: echo.Context + redactedSettings?: settings.Settings + } + interface SettingsUpdateEvent { + httpContext: echo.Context + oldSettings?: settings.Settings + newSettings?: settings.Settings + } + type _subwpEYD = BaseCollectionEvent + interface RecordsListEvent extends _subwpEYD { + httpContext: echo.Context + records: Array<(models.Record | undefined)> + result?: search.Result + } + type _subtaOqT = BaseCollectionEvent + interface RecordViewEvent extends _subtaOqT { + httpContext: echo.Context + record?: models.Record + } + type _subxKFWr = BaseCollectionEvent + interface RecordCreateEvent extends _subxKFWr { + httpContext: echo.Context + record?: models.Record + uploadedFiles: _TygojaDict + } + type _subciQwE = BaseCollectionEvent + interface RecordUpdateEvent extends _subciQwE { + httpContext: echo.Context + record?: models.Record + uploadedFiles: _TygojaDict + } + type _sublAvhJ = BaseCollectionEvent + interface RecordDeleteEvent extends _sublAvhJ { + httpContext: echo.Context + record?: models.Record + } + type _subxEibi = BaseCollectionEvent + interface RecordAuthEvent extends _subxEibi { + httpContext: echo.Context + record?: models.Record + token: string + meta: any + } + type _subVKrAt = BaseCollectionEvent + interface RecordAuthWithPasswordEvent extends _subVKrAt { + httpContext: echo.Context + record?: models.Record + identity: string + password: string + } + type _subZBmyR = BaseCollectionEvent + interface RecordAuthWithOAuth2Event extends _subZBmyR { + httpContext: echo.Context + providerName: string + providerClient: auth.Provider + record?: models.Record + oAuth2User?: auth.AuthUser + isNewRecord: boolean + } + type _subhzcxC = BaseCollectionEvent + interface RecordAuthRefreshEvent extends _subhzcxC { + httpContext: echo.Context + record?: models.Record + } + type _subiLmJt = BaseCollectionEvent + interface RecordRequestPasswordResetEvent extends _subiLmJt { + httpContext: echo.Context + record?: models.Record + } + type _subGFxjK = BaseCollectionEvent + interface RecordConfirmPasswordResetEvent extends _subGFxjK { + httpContext: echo.Context + record?: models.Record + } + type _subzficU = BaseCollectionEvent + interface RecordRequestVerificationEvent extends _subzficU { + httpContext: echo.Context + record?: models.Record + } + type _subohIST = BaseCollectionEvent + interface RecordConfirmVerificationEvent extends _subohIST { + httpContext: echo.Context + record?: models.Record + } + type _subCykoA = BaseCollectionEvent + interface RecordRequestEmailChangeEvent extends _subCykoA { + httpContext: echo.Context + record?: models.Record + } + type _subnopwl = BaseCollectionEvent + interface RecordConfirmEmailChangeEvent extends _subnopwl { + httpContext: echo.Context + record?: models.Record + } + type _subFAnbA = BaseCollectionEvent + interface RecordListExternalAuthsEvent extends _subFAnbA { + httpContext: echo.Context + record?: models.Record + externalAuths: Array<(models.ExternalAuth | undefined)> + } + type _subfYBlb = BaseCollectionEvent + interface RecordUnlinkExternalAuthEvent extends _subfYBlb { + httpContext: echo.Context + record?: models.Record + externalAuth?: models.ExternalAuth + } + interface AdminsListEvent { + httpContext: echo.Context + admins: Array<(models.Admin | undefined)> + result?: search.Result + } + interface AdminViewEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminCreateEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminUpdateEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminDeleteEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminAuthEvent { + httpContext: echo.Context + admin?: models.Admin + token: string + } + interface AdminAuthWithPasswordEvent { + httpContext: echo.Context + admin?: models.Admin + identity: string + password: string + } + interface AdminAuthRefreshEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminRequestPasswordResetEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminConfirmPasswordResetEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface CollectionsListEvent { + httpContext: echo.Context + collections: Array<(models.Collection | undefined)> + result?: search.Result + } + type _subjPeMq = BaseCollectionEvent + interface CollectionViewEvent extends _subjPeMq { + httpContext: echo.Context + } + type _subXjljn = BaseCollectionEvent + interface CollectionCreateEvent extends _subXjljn { + httpContext: echo.Context + } + type _subnVfEX = BaseCollectionEvent + interface CollectionUpdateEvent extends _subnVfEX { + httpContext: echo.Context + } + type _subMtvMx = BaseCollectionEvent + interface CollectionDeleteEvent extends _subMtvMx { + httpContext: echo.Context + } + interface CollectionsImportEvent { + httpContext: echo.Context + collections: Array<(models.Collection | undefined)> + } + type _subzChAu = BaseModelEvent + interface FileTokenEvent extends _subzChAu { + httpContext: echo.Context + token: string + } + type _subKnVrU = BaseCollectionEvent + interface FileDownloadEvent extends _subKnVrU { + httpContext: echo.Context + record?: models.Record + fileField?: schema.SchemaField + servedPath: string + servedName: string + } +} + +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } + // @ts-ignore + import flag = pflag + /** + * FParseErrWhitelist configures Flag parse errors to be ignored + */ + interface FParseErrWhitelist extends _TygojaAny{} + /** + * Group Structure to manage groups for commands + */ + interface Group { + id: string + title: string + } + /** + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. + */ + interface ShellCompDirective extends Number{} + /** + * CompletionOptions are the options to control shell completion + */ + interface CompletionOptions { + /** + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + */ + disableDefaultCmd: boolean + /** + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions + */ + disableNoDescFlag: boolean + /** + * DisableDescriptions turns off all completion descriptions for shells + * that support them + */ + disableDescriptions: boolean + /** + * HiddenDefaultCmd makes the default 'completion' command hidden + */ + hiddenDefaultCmd: boolean + } +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { + /** + * ReadWriter stores pointers to a [Reader] and a [Writer]. + * It implements [io.ReadWriter]. + */ + type _subNCmDN = Reader&Writer + interface ReadWriter extends _subNCmDN { + } +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { + /** + * Addr represents a network end point address. + * + * The two methods [Addr.Network] and [Addr.String] conventionally return strings + * that can be passed as the arguments to [Dial], but the exact form + * and meaning of the strings is up to the implementation. + */ + interface Addr { + [key:string]: any; + network(): string // name of the network (for example, "tcp", "udp") + string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") + } +} + +/** + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. + */ +namespace multipart { + /** + * A Part represents a single part in a multipart body. + */ + interface Part { + /** + * The headers of the body, if any, with the keys canonicalized + * in the same fashion that the Go http.Request headers are. + * For example, "foo-bar" changes case to "Foo-Bar" + */ + header: textproto.MIMEHeader + } + interface Part { + /** + * FormName returns the name parameter if p has a Content-Disposition + * of type "form-data". Otherwise it returns the empty string. + */ + formName(): string + } + interface Part { + /** + * FileName returns the filename parameter of the [Part]'s Content-Disposition + * header. If not empty, the filename is passed through filepath.Base (which is + * platform dependent) before being returned. + */ + fileName(): string + } + interface Part { + /** + * Read reads the body of a part, after its headers and before the + * next part (if any) begins. + */ + read(d: string|Array): number + } + interface Part { + close(): void + } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + /** + * SameSite allows a server to define a cookie attribute making it impossible for + * the browser to send this cookie along with cross-site requests. The main + * goal is to mitigate the risk of cross-origin information leakage, and provide + * some protection against cross-site request forgery attacks. + * + * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. + */ + interface SameSite extends Number{} + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url +} + +namespace store { +} + +namespace mailer { + /** + * Message defines a generic email message struct. + */ + interface Message { + from: mail.Address + to: Array + bcc: Array + cc: Array + subject: string + html: string + text: string + headers: _TygojaDict + attachments: _TygojaDict + } +} + +namespace logging { + /** + * Classification is the type of the log entry's classification name. + */ + interface Classification extends String{} +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * TracerProvider is the entry point for creating client traces. + */ + interface TracerProvider { + [key:string]: any; + tracer(scope: string, ...opts: TracerOption[]): Tracer + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonRaw defines a json value type that is safe for db read/write. + */ + interface JsonRaw extends Array{} + interface JsonRaw { + /** + * String returns the current JsonRaw instance as a json encoded string. + */ + string(): string + } + interface JsonRaw { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JsonRaw { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string|Array): void + } + interface JsonRaw { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonRaw { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonRaw instance. + */ + scan(value: any): void + } +} + +namespace search { + /** + * Result defines the returned search result structure. + */ + interface Result { + page: number + perPage: number + totalItems: number + totalPages: number + items: any + } +} + +namespace hook { + /** + * Handler defines a hook handler function. + */ + interface Handler {(e: T): void } + /** + * wrapped local Hook embedded struct to limit the public API surface. + */ + type _suboKSlp = Hook + interface mainHook extends _suboKSlp { + } +} + +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { + /** + * MeterProvider is the entry point for creating a Meter. + */ + interface MeterProvider { + [key:string]: any; + meter(scope: string, ...opts: MeterOption[]): Meter + } +} + +/** + * Package auth defines protocol-agnostic authentication types for smithy + * clients. + */ +namespace auth { + /** + * IdentityResolver defines the interface through which an Identity is + * retrieved. + */ + interface IdentityResolver { + [key:string]: any; + getIdentity(_arg0: context.Context, _arg1: smithy.Properties): Identity + } +} + +/** + * Package middleware provides transport agnostic middleware for decorating SDK + * handlers. + * + * The Smithy middleware stack provides ordered behavior to be invoked on an + * underlying handler. The stack is separated into steps that are invoked in a + * static order. A step is a collection of middleware that are injected into a + * ordered list defined by the user. The user may add, insert, swap, and remove a + * step's middleware. When the stack is invoked the step middleware become static, + * and their order cannot be modified. + * + * A stack and its step middleware are **not** safe to modify concurrently. + * + * A stack will use the ordered list of middleware to decorate a underlying + * handler. A handler could be something like an HTTP Client that round trips an + * API operation over HTTP. + * + * Smithy Middleware Stack + * + * A Stack is a collection of middleware that wrap a handler. The stack can be + * broken down into discreet steps. Each step may contain zero or more middleware + * specific to that stack's step. + * + * A Stack Step is a predefined set of middleware that are invoked in a static + * order by the Stack. These steps represent fixed points in the middleware stack + * for organizing specific behavior, such as serialize and build. A Stack Step is + * composed of zero or more middleware that are specific to that step. A step may + * define its own set of input/output parameters the generic input/output + * parameters are cast from. A step calls its middleware recursively, before + * calling the next step in the stack returning the result or error of the step + * middleware decorating the underlying handler. + * + * * Initialize: Prepares the input, and sets any default parameters as needed, + * (e.g. idempotency token, and presigned URLs). + * + * * Serialize: Serializes the prepared input into a data structure that can be + * consumed by the target transport's message, (e.g. REST-JSON serialization). + * + * * Build: Adds additional metadata to the serialized transport message, (e.g. + * HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. + * + * * Finalize: Performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated to + * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request + * signing). + * + * * Deserialize: Reacts to the handler's response returned by the recipient of + * the request message. Deserializes the response into a structured type or + * error above stacks can react to. + * + * Adding Middleware to a Stack Step + * + * Middleware can be added to a step front or back, or relative, by name, to an + * existing middleware in that stack. If a middleware does not have a name, a + * unique name will be generated at the middleware and be added to the step. + * + * ``` + * // Create middleware stack + * stack := middleware.NewStack() + * + * // Add middleware to stack steps + * stack.Initialize.Add(paramValidationMiddleware, middleware.After) + * stack.Serialize.Add(marshalOperationFoo, middleware.After) + * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) + * + * // Invoke middleware on handler. + * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) + * ``` + */ +namespace middleware { + /** + * Metadata provides storing and reading metadata values. Keys may be any + * comparable value type. Get and set will panic if key is not a comparable + * value type. + * + * Metadata uses lazy initialization, and Set method must be called as an + * addressable value, or pointer. Not doing so may cause key/value pair to not + * be set. + */ + interface Metadata { + } + interface Metadata { + /** + * Get attempts to retrieve the value the key points to. Returns nil if the + * key was not found. + * + * Panics if key type is not comparable. + */ + get(key: { + }): { + } + } + interface Metadata { + /** + * Clone creates a shallow copy of Metadata entries, returning a new Metadata + * value with the original entries copied into it. + */ + clone(): Metadata + } + interface Metadata { + /** + * Set stores the value pointed to by the key. If a value already exists at + * that key it will be replaced with the new value. + * + * Set method must be called as an addressable value, or pointer. If Set is not + * called as an addressable value or pointer, the key value pair being set may + * be lost. + * + * Panics if the key type is not comparable. + */ + set(key: { + }, value: { + }): void + } + interface Metadata { + /** + * Has returns whether the key exists in the metadata. + * + * Panics if the key type is not comparable. + */ + has(key: { + }): boolean + } + /** + * Handler provides the interface for performing the logic to obtain an output, + * or error for the given input. + */ + interface Handler { + [key:string]: any; + /** + * Handle performs logic to obtain an output for the given input. Handler + * should be decorated with middleware to perform input specific behavior. + */ + handle(ctx: context.Context, input: { + }): [{ + }, Metadata] + } + /** + * BuildStep provides the ordered grouping of BuildMiddleware to be invoked on + * a handler. + */ + interface BuildStep { + } + interface BuildStep { + /** + * ID returns the unique name of the step as a middleware. + */ + id(): string + } + interface BuildStep { + /** + * HandleMiddleware invokes the middleware by decorating the next handler + * provided. Returns the result of the middleware and handler being invoked. + * + * Implements Middleware interface. + */ + handleMiddleware(ctx: context.Context, _arg10: { + }, next: Handler): [{ + }, Metadata] + } + interface BuildStep { + /** + * Get retrieves the middleware identified by id. If the middleware is not present, returns false. + */ + get(id: string): [BuildMiddleware, boolean] + } + interface BuildStep { + /** + * Add injects the middleware to the relative position of the middleware group. + * Returns an error if the middleware already exists. + */ + add(m: BuildMiddleware, pos: RelativePosition): void + } + interface BuildStep { + /** + * Insert injects the middleware relative to an existing middleware id. + * Returns an error if the original middleware does not exist, or the middleware + * being added already exists. + */ + insert(m: BuildMiddleware, relativeTo: string, pos: RelativePosition): void + } + interface BuildStep { + /** + * Swap removes the middleware by id, replacing it with the new middleware. + * Returns the middleware removed, or an error if the middleware to be removed + * doesn't exist. + */ + swap(id: string, m: BuildMiddleware): BuildMiddleware + } + interface BuildStep { + /** + * Remove removes the middleware by id. Returns error if the middleware + * doesn't exist. + */ + remove(id: string): BuildMiddleware + } + interface BuildStep { + /** + * List returns a list of the middleware in the step. + */ + list(): Array + } + interface BuildStep { + /** + * Clear removes all middleware in the step. + */ + clear(): void + } + /** + * DeserializeStep provides the ordered grouping of DeserializeMiddleware to be + * invoked on a handler. + */ + interface DeserializeStep { + } + interface DeserializeStep { + /** + * ID returns the unique ID of the step as a middleware. + */ + id(): string + } + interface DeserializeStep { + /** + * HandleMiddleware invokes the middleware by decorating the next handler + * provided. Returns the result of the middleware and handler being invoked. + * + * Implements Middleware interface. + */ + handleMiddleware(ctx: context.Context, _arg10: { + }, next: Handler): [{ + }, Metadata] + } + interface DeserializeStep { + /** + * Get retrieves the middleware identified by id. If the middleware is not present, returns false. + */ + get(id: string): [DeserializeMiddleware, boolean] + } + interface DeserializeStep { + /** + * Add injects the middleware to the relative position of the middleware group. + * Returns an error if the middleware already exists. + */ + add(m: DeserializeMiddleware, pos: RelativePosition): void + } + interface DeserializeStep { + /** + * Insert injects the middleware relative to an existing middleware ID. + * Returns error if the original middleware does not exist, or the middleware + * being added already exists. + */ + insert(m: DeserializeMiddleware, relativeTo: string, pos: RelativePosition): void + } + interface DeserializeStep { + /** + * Swap removes the middleware by id, replacing it with the new middleware. + * Returns the middleware removed, or error if the middleware to be removed + * doesn't exist. + */ + swap(id: string, m: DeserializeMiddleware): DeserializeMiddleware + } + interface DeserializeStep { + /** + * Remove removes the middleware by id. Returns error if the middleware + * doesn't exist. + */ + remove(id: string): DeserializeMiddleware + } + interface DeserializeStep { + /** + * List returns a list of the middleware in the step. + */ + list(): Array + } + interface DeserializeStep { + /** + * Clear removes all middleware in the step. + */ + clear(): void + } + /** + * FinalizeStep provides the ordered grouping of FinalizeMiddleware to be + * invoked on a handler. + */ + interface FinalizeStep { + } + interface FinalizeStep { + /** + * ID returns the unique id of the step as a middleware. + */ + id(): string + } + interface FinalizeStep { + /** + * HandleMiddleware invokes the middleware by decorating the next handler + * provided. Returns the result of the middleware and handler being invoked. + * + * Implements Middleware interface. + */ + handleMiddleware(ctx: context.Context, _arg10: { + }, next: Handler): [{ + }, Metadata] + } + interface FinalizeStep { + /** + * Get retrieves the middleware identified by id. If the middleware is not present, returns false. + */ + get(id: string): [FinalizeMiddleware, boolean] + } + interface FinalizeStep { + /** + * Add injects the middleware to the relative position of the middleware group. + * Returns an error if the middleware already exists. + */ + add(m: FinalizeMiddleware, pos: RelativePosition): void + } + interface FinalizeStep { + /** + * Insert injects the middleware relative to an existing middleware ID. + * Returns error if the original middleware does not exist, or the middleware + * being added already exists. + */ + insert(m: FinalizeMiddleware, relativeTo: string, pos: RelativePosition): void + } + interface FinalizeStep { + /** + * Swap removes the middleware by id, replacing it with the new middleware. + * Returns the middleware removed, or error if the middleware to be removed + * doesn't exist. + */ + swap(id: string, m: FinalizeMiddleware): FinalizeMiddleware + } + interface FinalizeStep { + /** + * Remove removes the middleware by id. Returns error if the middleware + * doesn't exist. + */ + remove(id: string): FinalizeMiddleware + } + interface FinalizeStep { + /** + * List returns a list of the middleware in the step. + */ + list(): Array + } + interface FinalizeStep { + /** + * Clear removes all middleware in the step. + */ + clear(): void + } + /** + * InitializeStep provides the ordered grouping of InitializeMiddleware to be + * invoked on a handler. + */ + interface InitializeStep { + } + interface InitializeStep { + /** + * ID returns the unique ID of the step as a middleware. + */ + id(): string + } + interface InitializeStep { + /** + * HandleMiddleware invokes the middleware by decorating the next handler + * provided. Returns the result of the middleware and handler being invoked. + * + * Implements Middleware interface. + */ + handleMiddleware(ctx: context.Context, _arg10: { + }, next: Handler): [{ + }, Metadata] + } + interface InitializeStep { + /** + * Get retrieves the middleware identified by id. If the middleware is not present, returns false. + */ + get(id: string): [InitializeMiddleware, boolean] + } + interface InitializeStep { + /** + * Add injects the middleware to the relative position of the middleware group. + * Returns an error if the middleware already exists. + */ + add(m: InitializeMiddleware, pos: RelativePosition): void + } + interface InitializeStep { + /** + * Insert injects the middleware relative to an existing middleware ID. + * Returns error if the original middleware does not exist, or the middleware + * being added already exists. + */ + insert(m: InitializeMiddleware, relativeTo: string, pos: RelativePosition): void + } + interface InitializeStep { + /** + * Swap removes the middleware by id, replacing it with the new middleware. + * Returns the middleware removed, or error if the middleware to be removed + * doesn't exist. + */ + swap(id: string, m: InitializeMiddleware): InitializeMiddleware + } + interface InitializeStep { + /** + * Remove removes the middleware by id. Returns error if the middleware + * doesn't exist. + */ + remove(id: string): InitializeMiddleware + } + interface InitializeStep { + /** + * List returns a list of the middleware in the step. + */ + list(): Array + } + interface InitializeStep { + /** + * Clear removes all middleware in the step. + */ + clear(): void + } + /** + * SerializeStep provides the ordered grouping of SerializeMiddleware to be + * invoked on a handler. + */ + interface SerializeStep { + } + interface SerializeStep { + /** + * ID returns the unique ID of the step as a middleware. + */ + id(): string + } + interface SerializeStep { + /** + * HandleMiddleware invokes the middleware by decorating the next handler + * provided. Returns the result of the middleware and handler being invoked. + * + * Implements Middleware interface. + */ + handleMiddleware(ctx: context.Context, _arg10: { + }, next: Handler): [{ + }, Metadata] + } + interface SerializeStep { + /** + * Get retrieves the middleware identified by id. If the middleware is not present, returns false. + */ + get(id: string): [SerializeMiddleware, boolean] + } + interface SerializeStep { + /** + * Add injects the middleware to the relative position of the middleware group. + * Returns an error if the middleware already exists. + */ + add(m: SerializeMiddleware, pos: RelativePosition): void + } + interface SerializeStep { + /** + * Insert injects the middleware relative to an existing middleware ID. + * Returns error if the original middleware does not exist, or the middleware + * being added already exists. + */ + insert(m: SerializeMiddleware, relativeTo: string, pos: RelativePosition): void + } + interface SerializeStep { + /** + * Swap removes the middleware by id, replacing it with the new middleware. + * Returns the middleware removed, or error if the middleware to be removed + * doesn't exist. + */ + swap(id: string, m: SerializeMiddleware): SerializeMiddleware + } + interface SerializeStep { + /** + * Remove removes the middleware by id. Returns error if the middleware + * doesn't exist. + */ + remove(id: string): SerializeMiddleware + } + interface SerializeStep { + /** + * List returns a list of the middleware in the step. + */ + list(): Array + } + interface SerializeStep { + /** + * Clear removes all middleware in the step. + */ + clear(): void + } +} + +/** + * Package http provides the HTTP transport client and request/response types + * needed to round trip API operation calls with an service. + */ +namespace http { + // @ts-ignore + import smithy = smithy_go + /** + * AuthScheme defines an HTTP authentication scheme. + */ + interface AuthScheme { + [key:string]: any; + schemeID(): string + identityResolver(_arg0: auth.IdentityResolverOptions): auth.IdentityResolver + signer(): Signer + } + // @ts-ignore + import iointernal = io + // @ts-ignore + import smithytime = time +} + +namespace subscriptions { + /** + * Message defines a client's channel data. + */ + interface Message { + name: string + data: string|Array + } + /** + * Client is an interface for a generic subscription client. + */ + interface Client { + [key:string]: any; + /** + * Id Returns the unique id of the client. + */ + id(): string + /** + * Channel returns the client's communication channel. + */ + channel(): undefined + /** + * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. + * If no prefix is specified, returns all subscriptions. + */ + subscriptions(...prefixes: string[]): _TygojaDict + /** + * Subscribe subscribes the client to the provided subscriptions list. + * + * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. + * + * Example: + * + * ``` + * Subscribe( + * "subscriptionA", + * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, + * ) + * ``` + */ + subscribe(...subs: string[]): void + /** + * Unsubscribe unsubscribes the client from the provided subscriptions list. + */ + unsubscribe(...subs: string[]): void + /** + * HasSubscription checks if the client is subscribed to `sub`. + */ + hasSubscription(sub: string): boolean + /** + * Set stores any value to the client's context. + */ + set(key: string, value: any): void + /** + * Unset removes a single value from the client's context. + */ + unset(key: string): void + /** + * Get retrieves the key value from the client's context. + */ + get(key: string): any + /** + * Discard marks the client as "discarded", meaning that it + * shouldn't be used anymore for sending new messages. + * + * It is safe to call Discard() multiple times. + */ + discard(): void + /** + * IsDiscarded indicates whether the client has been "discarded" + * and should no longer be used. + */ + isDiscarded(): boolean + /** + * Send sends the specified message to the client's channel (if not discarded). + */ + send(m: Message): void + } +} + +namespace types { + interface ArchiveStatus extends String{} + interface ArchiveStatus { + /** + * Values returns all known values for ArchiveStatus. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface BucketAccelerateStatus extends String{} + interface BucketAccelerateStatus { + /** + * Values returns all known values for BucketAccelerateStatus. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface BucketCannedACL extends String{} + interface BucketCannedACL { + /** + * Values returns all known values for BucketCannedACL. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface BucketLocationConstraint extends String{} + interface BucketLocationConstraint { + /** + * Values returns all known values for BucketLocationConstraint. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface BucketVersioningStatus extends String{} + interface BucketVersioningStatus { + /** + * Values returns all known values for BucketVersioningStatus. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ChecksumAlgorithm extends String{} + interface ChecksumAlgorithm { + /** + * Values returns all known values for ChecksumAlgorithm. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ChecksumMode extends String{} + interface ChecksumMode { + /** + * Values returns all known values for ChecksumMode. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface EncodingType extends String{} + interface EncodingType { + /** + * Values returns all known values for EncodingType. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ExpressionType extends String{} + interface ExpressionType { + /** + * Values returns all known values for ExpressionType. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface LocationType extends String{} + interface LocationType { + /** + * Values returns all known values for LocationType. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface MetadataDirective extends String{} + interface MetadataDirective { + /** + * Values returns all known values for MetadataDirective. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface MFADeleteStatus extends String{} + interface MFADeleteStatus { + /** + * Values returns all known values for MFADeleteStatus. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectAttributes extends String{} + interface ObjectAttributes { + /** + * Values returns all known values for ObjectAttributes. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectCannedACL extends String{} + interface ObjectCannedACL { + /** + * Values returns all known values for ObjectCannedACL. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectLockLegalHoldStatus extends String{} + interface ObjectLockLegalHoldStatus { + /** + * Values returns all known values for ObjectLockLegalHoldStatus. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectLockMode extends String{} + interface ObjectLockMode { + /** + * Values returns all known values for ObjectLockMode. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectOwnership extends String{} + interface ObjectOwnership { + /** + * Values returns all known values for ObjectOwnership. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface OptionalObjectAttributes extends String{} + interface OptionalObjectAttributes { + /** + * Values returns all known values for OptionalObjectAttributes. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface Payer extends String{} + interface Payer { + /** + * Values returns all known values for Payer. Note that this can be expanded in + * the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ReplicationStatus extends String{} + interface ReplicationStatus { + /** + * Values returns all known values for ReplicationStatus. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface RequestCharged extends String{} + interface RequestCharged { + /** + * Values returns all known values for RequestCharged. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface RequestPayer extends String{} + interface RequestPayer { + /** + * Values returns all known values for RequestPayer. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ServerSideEncryption extends String{} + interface ServerSideEncryption { + /** + * Values returns all known values for ServerSideEncryption. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface SessionMode extends String{} + interface SessionMode { + /** + * Values returns all known values for SessionMode. Note that this can be expanded + * in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface StorageClass extends String{} + interface StorageClass { + /** + * Values returns all known values for StorageClass. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface TaggingDirective extends String{} + interface TaggingDirective { + /** + * Values returns all known values for TaggingDirective. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface TransitionDefaultMinimumObjectSize extends String{} + interface TransitionDefaultMinimumObjectSize { + /** + * Values returns all known values for TransitionDefaultMinimumObjectSize. Note + * that this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document + /** + * Configures the transfer acceleration state for an Amazon S3 bucket. For more + * information, see [Amazon S3 Transfer Acceleration]in the Amazon S3 User Guide. + * + * [Amazon S3 Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html + */ + type _subAdQMO = noSmithyDocumentSerde + interface AccelerateConfiguration extends _subAdQMO { + /** + * Specifies the transfer acceleration status of the bucket. + */ + status: BucketAccelerateStatus + } + /** + * Contains the elements that set the ACL permissions for an object per grantee. + */ + type _subvBLGU = noSmithyDocumentSerde + interface AccessControlPolicy extends _subvBLGU { + /** + * A list of grants. + */ + grants: Array + /** + * Container for the bucket owner's display name and ID. + */ + owner?: Owner + } + /** + * Specifies the configuration and any analyses for the analytics filter of an + * Amazon S3 bucket. + */ + type _subgdymU = noSmithyDocumentSerde + interface AnalyticsConfiguration extends _subgdymU { + /** + * The ID that identifies the analytics configuration. + * + * This member is required. + */ + id?: string + /** + * Contains data related to access patterns to be collected and made available to + * analyze the tradeoffs between different storage classes. + * + * This member is required. + */ + storageClassAnalysis?: StorageClassAnalysis + /** + * The filter used to describe a set of objects for analyses. A filter must have + * exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no + * filter is provided, all objects will be considered in any analysis. + */ + filter: AnalyticsFilter + } + /** + * In terms of implementation, a Bucket is a resource. + */ + type _subnVWkk = noSmithyDocumentSerde + interface Bucket extends _subnVWkk { + /** + * Date the bucket was created. This date can change when making changes to your + * bucket, such as editing its bucket policy. + */ + creationDate?: time.Time + /** + * The name of the bucket. + */ + name?: string + } + /** + * Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For + * more information, see [Object Lifecycle Management]in the Amazon S3 User Guide. + * + * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html + */ + type _subJAxMi = noSmithyDocumentSerde + interface BucketLifecycleConfiguration extends _subJAxMi { + /** + * A lifecycle rule for individual objects in an Amazon S3 bucket. + * + * This member is required. + */ + rules: Array + } + /** + * Container for logging status information. + */ + type _subednLl = noSmithyDocumentSerde + interface BucketLoggingStatus extends _subednLl { + /** + * Describes where logs are stored and the prefix that Amazon S3 assigns to all + * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API + * Reference. + * + * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html + */ + loggingEnabled?: LoggingEnabled + } + /** + * Contains all the possible checksum or digest values for an object. + */ + type _subwHZAb = noSmithyDocumentSerde + interface Checksum extends _subwHZAb { + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + } + /** + * Container for all (if there are any) keys between Prefix and the next + * occurrence of the string specified by a delimiter. CommonPrefixes lists keys + * that act like subdirectories in the directory specified by Prefix. For example, + * if the prefix is notes/ and the delimiter is a slash (/) as in + * notes/summer/july, the common prefix is notes/summer/. + */ + type _subatVOG = noSmithyDocumentSerde + interface CommonPrefix extends _subatVOG { + /** + * Container for the specified common prefix. + */ + prefix?: string + } + /** + * The container for the completed multipart upload details. + */ + type _subSccUS = noSmithyDocumentSerde + interface CompletedMultipartUpload extends _subSccUS { + /** + * Array of CompletedPart data types. + * + * If you do not supply a valid Part with your request, the service sends back an + * HTTP 400 response. + */ + parts: Array + } + /** + * Container for all response elements. + */ + type _subIajoo = noSmithyDocumentSerde + interface CopyObjectResult extends _subIajoo { + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. For more information, see [Checking object integrity]in the + * Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * Returns the ETag of the new object. The ETag reflects only changes to the + * contents of an object, not its metadata. + */ + eTag?: string + /** + * Creation date of the object. + */ + lastModified?: time.Time + } + /** + * Container for all response elements. + */ + type _subOurrh = noSmithyDocumentSerde + interface CopyPartResult extends _subOurrh { + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * Entity tag of the object. + */ + eTag?: string + /** + * Date and time at which the object was uploaded. + */ + lastModified?: time.Time + } + /** + * Describes the cross-origin access configuration for objects in an Amazon S3 + * bucket. For more information, see [Enabling Cross-Origin Resource Sharing]in the Amazon S3 User Guide. + * + * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html + */ + type _submJiRs = noSmithyDocumentSerde + interface CORSConfiguration extends _submJiRs { + /** + * A set of origins and methods (cross-origin access that you want to allow). You + * can add up to 100 rules to the configuration. + * + * This member is required. + */ + corsRules: Array + } + /** + * Specifies a cross-origin access rule for an Amazon S3 bucket. + */ + type _subXkLgD = noSmithyDocumentSerde + interface CORSRule extends _subXkLgD { + /** + * An HTTP method that you allow the origin to execute. Valid values are GET , PUT + * , HEAD , POST , and DELETE . + * + * This member is required. + */ + allowedMethods: Array + /** + * One or more origins you want customers to be able to access the bucket from. + * + * This member is required. + */ + allowedOrigins: Array + /** + * Headers that are specified in the Access-Control-Request-Headers header. These + * headers are allowed in a preflight OPTIONS request. In response to any preflight + * OPTIONS request, Amazon S3 returns any requested headers that are allowed. + */ + allowedHeaders: Array + /** + * One or more headers in the response that you want customers to be able to + * access from their applications (for example, from a JavaScript XMLHttpRequest + * object). + */ + exposeHeaders: Array + /** + * Unique identifier for the rule. The value cannot be longer than 255 characters. + */ + id?: string + /** + * The time in seconds that your browser is to cache the preflight response for + * the specified resource. + */ + maxAgeSeconds?: number + } + /** + * The configuration information for the bucket. + */ + type _subUJNvK = noSmithyDocumentSerde + interface CreateBucketConfiguration extends _subUJNvK { + /** + * Specifies the information about the bucket that will be created. + * + * This functionality is only supported by directory buckets. + */ + bucket?: BucketInfo + /** + * Specifies the location where the bucket will be created. + * + * For directory buckets, the location type is Availability Zone. + * + * This functionality is only supported by directory buckets. + */ + location?: LocationInfo + /** + * Specifies the Region where the bucket will be created. You might choose a + * Region to optimize latency, minimize costs, or address regulatory requirements. + * For example, if you reside in Europe, you will probably find it advantageous to + * create buckets in the Europe (Ireland) Region. For more information, see [Accessing a bucket]in the + * Amazon S3 User Guide. + * + * If you don't specify a Region, the bucket is created in the US East (N. + * Virginia) Region (us-east-1) by default. + * + * This functionality is not supported for directory buckets. + * + * [Accessing a bucket]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro + */ + locationConstraint: BucketLocationConstraint + } + /** + * Container for the objects to delete. + */ + type _subTMlPO = noSmithyDocumentSerde + interface Delete extends _subTMlPO { + /** + * The object to delete. + * + * Directory buckets - For directory buckets, an object that's composed entirely + * of whitespace characters is not supported by the DeleteObjects API operation. + * The request will receive a 400 Bad Request error and none of the objects in the + * request will be deleted. + * + * This member is required. + */ + objects: Array + /** + * Element to enable quiet mode for the request. When you add this element, you + * must set its value to true . + */ + quiet?: boolean + } + /** + * Information about the deleted object. + */ + type _submlJyi = noSmithyDocumentSerde + interface DeletedObject extends _submlJyi { + /** + * Indicates whether the specified object version that was permanently deleted was + * (true) or was not (false) a delete marker before deletion. In a simple DELETE, + * this header indicates whether (true) or not (false) the current version of the + * object is a delete marker. + * + * This functionality is not supported for directory buckets. + */ + deleteMarker?: boolean + /** + * The version ID of the delete marker created as a result of the DELETE + * operation. If you delete a specific object version, the value returned by this + * header is the version ID of the object version deleted. + * + * This functionality is not supported for directory buckets. + */ + deleteMarkerVersionId?: string + /** + * The name of the deleted object. + */ + key?: string + /** + * The version ID of the deleted object. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + } + /** + * Information about the delete marker. + */ + type _submPJJq = noSmithyDocumentSerde + interface DeleteMarkerEntry extends _submPJJq { + /** + * Specifies whether the object is (true) or is not (false) the latest version of + * an object. + */ + isLatest?: boolean + /** + * The object key. + */ + key?: string + /** + * Date and time when the object was last modified. + */ + lastModified?: time.Time + /** + * The account that created the delete marker.> + */ + owner?: Owner + /** + * Version ID of an object. + */ + versionId?: string + } + /** + * Container for all error elements. + */ + type _subIGHMu = noSmithyDocumentSerde + interface Error extends _subIGHMu { + /** + * The error code is a string that uniquely identifies an error condition. It is + * meant to be read and understood by programs that detect and handle errors by + * type. The following is a list of Amazon S3 error codes. For more information, + * see [Error responses]. + * + * ``` + * - Code: AccessDenied + * + * - Description: Access Denied + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: AccountProblem + * + * - Description: There is a problem with your Amazon Web Services account that + * prevents the action from completing successfully. Contact Amazon Web Services + * Support for further assistance. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: AllAccessDisabled + * + * - Description: All access to this Amazon S3 resource has been disabled. + * Contact Amazon Web Services Support for further assistance. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: AmbiguousGrantByEmailAddress + * + * - Description: The email address you provided is associated with more than + * one account. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: AuthorizationHeaderMalformed + * + * - Description: The authorization header you provided is invalid. + * + * - HTTP Status Code: 400 Bad Request + * + * - HTTP Status Code: N/A + * + * - Code: BadDigest + * + * - Description: The Content-MD5 you specified did not match what we received. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: BucketAlreadyExists + * + * - Description: The requested bucket name is not available. The bucket + * namespace is shared by all users of the system. Please select a different name + * and try again. + * + * - HTTP Status Code: 409 Conflict + * + * - SOAP Fault Code Prefix: Client + * + * - Code: BucketAlreadyOwnedByYou + * + * - Description: The bucket you tried to create already exists, and you own it. + * Amazon S3 returns this error in all Amazon Web Services Regions except in the + * North Virginia Region. For legacy compatibility, if you re-create an existing + * bucket that you already own in the North Virginia Region, Amazon S3 returns 200 + * OK and resets the bucket access control lists (ACLs). + * + * - Code: 409 Conflict (in all Regions except the North Virginia Region) + * + * - SOAP Fault Code Prefix: Client + * + * - Code: BucketNotEmpty + * + * - Description: The bucket you tried to delete is not empty. + * + * - HTTP Status Code: 409 Conflict + * + * - SOAP Fault Code Prefix: Client + * + * - Code: CredentialsNotSupported + * + * - Description: This request does not support credentials. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: CrossLocationLoggingProhibited + * + * - Description: Cross-location logging not allowed. Buckets in one geographic + * location cannot log information to a bucket in another location. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: EntityTooSmall + * + * - Description: Your proposed upload is smaller than the minimum allowed + * object size. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: EntityTooLarge + * + * - Description: Your proposed upload exceeds the maximum allowed object size. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: ExpiredToken + * + * - Description: The provided token has expired. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: IllegalVersioningConfigurationException + * + * - Description: Indicates that the versioning configuration specified in the + * request is invalid. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: IncompleteBody + * + * - Description: You did not provide the number of bytes specified by the + * Content-Length HTTP header + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: IncorrectNumberOfFilesInPostRequest + * + * - Description: POST requires exactly one file upload per request. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InlineDataTooLarge + * + * - Description: Inline data exceeds the maximum allowed size. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InternalError + * + * - Description: We encountered an internal error. Please try again. + * + * - HTTP Status Code: 500 Internal Server Error + * + * - SOAP Fault Code Prefix: Server + * + * - Code: InvalidAccessKeyId + * + * - Description: The Amazon Web Services access key ID you provided does not + * exist in our records. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidAddressingHeader + * + * - Description: You must specify the Anonymous role. + * + * - HTTP Status Code: N/A + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidArgument + * + * - Description: Invalid Argument + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidBucketName + * + * - Description: The specified bucket is not valid. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidBucketState + * + * - Description: The request is not valid with the current state of the bucket. + * + * - HTTP Status Code: 409 Conflict + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidDigest + * + * - Description: The Content-MD5 you specified is not valid. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidEncryptionAlgorithmError + * + * - Description: The encryption request you specified is not valid. The valid + * value is AES256. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidLocationConstraint + * + * - Description: The specified location constraint is not valid. For more + * information about Regions, see [How to Select a Region for Your Buckets]. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidObjectState + * + * - Description: The action is not valid for the current state of the object. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidPart + * + * - Description: One or more of the specified parts could not be found. The + * part might not have been uploaded, or the specified entity tag might not have + * matched the part's entity tag. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidPartOrder + * + * - Description: The list of parts was not in ascending order. Parts list must + * be specified in order by part number. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidPayer + * + * - Description: All access to this object has been disabled. Please contact + * Amazon Web Services Support for further assistance. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidPolicyDocument + * + * - Description: The content of the form does not meet the conditions specified + * in the policy document. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidRange + * + * - Description: The requested range cannot be satisfied. + * + * - HTTP Status Code: 416 Requested Range Not Satisfiable + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidRequest + * + * - Description: Please use AWS4-HMAC-SHA256 . + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: SOAP requests must be made over an HTTPS connection. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Acceleration is not supported for buckets + * with non-DNS compliant names. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Acceleration is not supported for buckets + * with periods (.) in their names. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Accelerate endpoint only supports virtual + * style requests. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Accelerate is not configured on this bucket. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Accelerate is disabled on this bucket. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Acceleration is not supported on this + * bucket. Contact Amazon Web Services Support for more information. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidRequest + * + * - Description: Amazon S3 Transfer Acceleration cannot be enabled on this + * bucket. Contact Amazon Web Services Support for more information. + * + * - HTTP Status Code: 400 Bad Request + * + * - Code: N/A + * + * - Code: InvalidSecurity + * + * - Description: The provided security credentials are not valid. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidSOAPRequest + * + * - Description: The SOAP request body is invalid. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidStorageClass + * + * - Description: The storage class you specified is not valid. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidTargetBucketForLogging + * + * - Description: The target bucket for logging does not exist, is not owned by + * you, or does not have the appropriate grants for the log-delivery group. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidToken + * + * - Description: The provided token is malformed or otherwise invalid. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: InvalidURI + * + * - Description: Couldn't parse the specified URI. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: KeyTooLongError + * + * - Description: Your key is too long. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MalformedACLError + * + * - Description: The XML you provided was not well-formed or did not validate + * against our published schema. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MalformedPOSTRequest + * + * - Description: The body of your POST request is not well-formed + * multipart/form-data. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MalformedXML + * + * - Description: This happens when the user sends malformed XML (XML that + * doesn't conform to the published XSD) for the configuration. The error message + * is, "The XML you provided was not well-formed or did not validate against our + * published schema." + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MaxMessageLengthExceeded + * + * - Description: Your request was too big. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MaxPostPreDataLengthExceededError + * + * - Description: Your POST request fields preceding the upload file were too + * large. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MetadataTooLarge + * + * - Description: Your metadata headers exceed the maximum allowed metadata size. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MethodNotAllowed + * + * - Description: The specified method is not allowed against this resource. + * + * - HTTP Status Code: 405 Method Not Allowed + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MissingAttachment + * + * - Description: A SOAP attachment was expected, but none were found. + * + * - HTTP Status Code: N/A + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MissingContentLength + * + * - Description: You must provide the Content-Length HTTP header. + * + * - HTTP Status Code: 411 Length Required + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MissingRequestBodyError + * + * - Description: This happens when the user sends an empty XML document as a + * request. The error message is, "Request body is empty." + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MissingSecurityElement + * + * - Description: The SOAP 1.1 request is missing a security element. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: MissingSecurityHeader + * + * - Description: Your request is missing a required header. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoLoggingStatusForKey + * + * - Description: There is no such thing as a logging status subresource for a + * key. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoSuchBucket + * + * - Description: The specified bucket does not exist. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoSuchBucketPolicy + * + * - Description: The specified bucket does not have a bucket policy. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoSuchKey + * + * - Description: The specified key does not exist. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoSuchLifecycleConfiguration + * + * - Description: The lifecycle configuration does not exist. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoSuchUpload + * + * - Description: The specified multipart upload does not exist. The upload ID + * might be invalid, or the multipart upload might have been aborted or completed. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NoSuchVersion + * + * - Description: Indicates that the version ID specified in the request does + * not match an existing version. + * + * - HTTP Status Code: 404 Not Found + * + * - SOAP Fault Code Prefix: Client + * + * - Code: NotImplemented + * + * - Description: A header you provided implies functionality that is not + * implemented. + * + * - HTTP Status Code: 501 Not Implemented + * + * - SOAP Fault Code Prefix: Server + * + * - Code: NotSignedUp + * + * - Description: Your account is not signed up for the Amazon S3 service. You + * must sign up before you can use Amazon S3. You can sign up at the following URL: + * [Amazon S3] + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: OperationAborted + * + * - Description: A conflicting conditional action is currently in progress + * against this resource. Try again. + * + * - HTTP Status Code: 409 Conflict + * + * - SOAP Fault Code Prefix: Client + * + * - Code: PermanentRedirect + * + * - Description: The bucket you are attempting to access must be addressed + * using the specified endpoint. Send all future requests to this endpoint. + * + * - HTTP Status Code: 301 Moved Permanently + * + * - SOAP Fault Code Prefix: Client + * + * - Code: PreconditionFailed + * + * - Description: At least one of the preconditions you specified did not hold. + * + * - HTTP Status Code: 412 Precondition Failed + * + * - SOAP Fault Code Prefix: Client + * + * - Code: Redirect + * + * - Description: Temporary redirect. + * + * - HTTP Status Code: 307 Moved Temporarily + * + * - SOAP Fault Code Prefix: Client + * + * - Code: RestoreAlreadyInProgress + * + * - Description: Object restore is already in progress. + * + * - HTTP Status Code: 409 Conflict + * + * - SOAP Fault Code Prefix: Client + * + * - Code: RequestIsNotMultiPartContent + * + * - Description: Bucket POST must be of the enclosure-type multipart/form-data. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: RequestTimeout + * + * - Description: Your socket connection to the server was not read from or + * written to within the timeout period. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: RequestTimeTooSkewed + * + * - Description: The difference between the request time and the server's time + * is too large. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: RequestTorrentOfBucketError + * + * - Description: Requesting the torrent file of a bucket is not permitted. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: SignatureDoesNotMatch + * + * - Description: The request signature we calculated does not match the + * signature you provided. Check your Amazon Web Services secret access key and + * signing method. For more information, see [REST Authentication]and [SOAP Authentication]for details. + * + * - HTTP Status Code: 403 Forbidden + * + * - SOAP Fault Code Prefix: Client + * + * - Code: ServiceUnavailable + * + * - Description: Service is unable to handle request. + * + * - HTTP Status Code: 503 Service Unavailable + * + * - SOAP Fault Code Prefix: Server + * + * - Code: SlowDown + * + * - Description: Reduce your request rate. + * + * - HTTP Status Code: 503 Slow Down + * + * - SOAP Fault Code Prefix: Server + * + * - Code: TemporaryRedirect + * + * - Description: You are being redirected to the bucket while DNS updates. + * + * - HTTP Status Code: 307 Moved Temporarily + * + * - SOAP Fault Code Prefix: Client + * + * - Code: TokenRefreshRequired + * + * - Description: The provided token must be refreshed. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: TooManyBuckets + * + * - Description: You have attempted to create more buckets than allowed. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: UnexpectedContent + * + * - Description: This request does not support content. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: UnresolvableGrantByEmailAddress + * + * - Description: The email address you provided does not match any account on + * record. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * + * - Code: UserKeyMustBeSpecified + * + * - Description: The bucket POST must contain the specified field name. If it + * is specified, check the order of the fields. + * + * - HTTP Status Code: 400 Bad Request + * + * - SOAP Fault Code Prefix: Client + * ``` + * + * [How to Select a Region for Your Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro + * [Error responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html + * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + * [Amazon S3]: http://aws.amazon.com/s3 + * [SOAP Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/SOAPAuthentication.html + */ + code?: string + /** + * The error key. + */ + key?: string + /** + * The error message contains a generic description of the error condition in + * English. It is intended for a human audience. Simple programs display the + * message directly to the end user if they encounter an error condition they don't + * know how or don't care to handle. Sophisticated programs with more exhaustive + * error handling and proper internationalization are more likely to ignore the + * error message. + */ + message?: string + /** + * The version ID of the error. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + } + /** + * The error information. + */ + type _subQUEOW = noSmithyDocumentSerde + interface ErrorDocument extends _subQUEOW { + /** + * The object key name to use when a 4XX class error occurs. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * This member is required. + */ + key?: string + } + /** + * A container for specifying the configuration for Amazon EventBridge. + */ + type _subUGNlL = noSmithyDocumentSerde + interface EventBridgeConfiguration extends _subUGNlL { + } + /** + * A collection of parts associated with a multipart upload. + */ + type _subblghU = noSmithyDocumentSerde + interface GetObjectAttributesParts extends _subblghU { + /** + * Indicates whether the returned list of parts is truncated. A value of true + * indicates that the list was truncated. A list can be truncated if the number of + * parts exceeds the limit returned in the MaxParts element. + */ + isTruncated?: boolean + /** + * The maximum number of parts allowed in the response. + */ + maxParts?: number + /** + * When a list is truncated, this element specifies the last part in the list, as + * well as the value to use for the PartNumberMarker request parameter in a + * subsequent request. + */ + nextPartNumberMarker?: string + /** + * The marker for the current part. + */ + partNumberMarker?: string + /** + * A container for elements related to a particular part. A response can contain + * zero or more Parts elements. + * + * ``` + * - General purpose buckets - For GetObjectAttributes , if a additional checksum + * (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , x-amz-checksum-sha1 + * , or x-amz-checksum-sha256 ) isn't applied to the object specified in the + * request, the response doesn't return Part . + * + * - Directory buckets - For GetObjectAttributes , no matter whether a additional + * checksum is applied to the object specified in the request, the response returns + * Part . + * ``` + */ + parts: Array + /** + * The total number of parts. + */ + totalPartsCount?: number + } + /** + * Container for grant information. + */ + type _subwnudN = noSmithyDocumentSerde + interface Grant extends _subwnudN { + /** + * The person being granted permissions. + */ + grantee?: Grantee + /** + * Specifies the permission given to the grantee. + */ + permission: Permission + } + /** + * Container for the Suffix element. + */ + type _subEyvCu = noSmithyDocumentSerde + interface IndexDocument extends _subEyvCu { + /** + * A suffix that is appended to a request that is for a directory on the website + * endpoint. (For example, if the suffix is index.html and you make a request to + * samplebucket/images/ , the data that is returned will be for the object with the + * key name images/index.html .) The suffix must not be empty and must not include + * a slash character. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * This member is required. + */ + suffix?: string + } + /** + * Container element that identifies who initiated the multipart upload. + */ + type _sublRNgr = noSmithyDocumentSerde + interface Initiator extends _sublRNgr { + /** + * Name of the Principal. + * + * This functionality is not supported for directory buckets. + */ + displayName?: string + /** + * If the principal is an Amazon Web Services account, it provides the Canonical + * User ID. If the principal is an IAM User, it provides a user ARN value. + * + * Directory buckets - If the principal is an Amazon Web Services account, it + * provides the Amazon Web Services account ID. If the principal is an IAM User, it + * provides a user ARN value. + */ + id?: string + } + /** + * Describes the serialization format of the object. + */ + type _subfCWeH = noSmithyDocumentSerde + interface InputSerialization extends _subfCWeH { + /** + * Describes the serialization of a CSV-encoded object. + */ + csv?: CSVInput + /** + * Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default + * Value: NONE. + */ + compressionType: CompressionType + /** + * Specifies JSON as object's input serialization format. + */ + json?: JSONInput + /** + * Specifies Parquet as object's input serialization format. + */ + parquet?: ParquetInput + } + /** + * Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. + * + * For information about the S3 Intelligent-Tiering storage class, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. + * + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + */ + type _subtWzGE = noSmithyDocumentSerde + interface IntelligentTieringConfiguration extends _subtWzGE { + /** + * The ID used to identify the S3 Intelligent-Tiering configuration. + * + * This member is required. + */ + id?: string + /** + * Specifies the status of the configuration. + * + * This member is required. + */ + status: IntelligentTieringStatus + /** + * Specifies the S3 Intelligent-Tiering storage class tier of the configuration. + * + * This member is required. + */ + tierings: Array + /** + * Specifies a bucket filter. The configuration only includes objects that meet + * the filter's criteria. + */ + filter?: IntelligentTieringFilter + } + /** + * Specifies the inventory configuration for an Amazon S3 bucket. For more + * information, see [GET Bucket inventory]in the Amazon S3 API Reference. + * + * [GET Bucket inventory]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html + */ + type _subrcUOK = noSmithyDocumentSerde + interface InventoryConfiguration extends _subrcUOK { + /** + * Contains information about where to publish the inventory results. + * + * This member is required. + */ + destination?: InventoryDestination + /** + * The ID used to identify the inventory configuration. + * + * This member is required. + */ + id?: string + /** + * Object versions to include in the inventory list. If set to All , the list + * includes all the object versions, which adds the version-related fields + * VersionId , IsLatest , and DeleteMarker to the list. If set to Current , the + * list does not contain these version-related fields. + * + * This member is required. + */ + includedObjectVersions: InventoryIncludedObjectVersions + /** + * Specifies whether the inventory is enabled or disabled. If set to True , an + * inventory list is generated. If set to False , no inventory list is generated. + * + * This member is required. + */ + isEnabled?: boolean + /** + * Specifies the schedule for generating inventory results. + * + * This member is required. + */ + schedule?: InventorySchedule + /** + * Specifies an inventory filter. The inventory only includes objects that meet + * the filter's criteria. + */ + filter?: InventoryFilter + /** + * Contains the optional fields that are included in the inventory results. + */ + optionalFields: Array + } + /** + * A container for specifying the configuration for Lambda notifications. + */ + type _subyrYtM = noSmithyDocumentSerde + interface LambdaFunctionConfiguration extends _subyrYtM { + /** + * The Amazon S3 bucket event for which to invoke the Lambda function. For more + * information, see [Supported Event Types]in the Amazon S3 User Guide. + * + * [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + * + * This member is required. + */ + events: Array + /** + * The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes + * when the specified event type occurs. + * + * This member is required. + */ + lambdaFunctionArn?: string + /** + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + * + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html + */ + filter?: NotificationConfigurationFilter + /** + * An optional unique identifier for configurations in a notification + * configuration. If you don't provide one, Amazon S3 will assign an ID. + */ + id?: string + } + /** + * A lifecycle rule for individual objects in an Amazon S3 bucket. + * + * For more information see, [Managing your storage lifecycle] in the Amazon S3 User Guide. + * + * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html + */ + type _subjZLim = noSmithyDocumentSerde + interface LifecycleRule extends _subjZLim { + /** + * If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is + * not currently being applied. + * + * This member is required. + */ + status: ExpirationStatus + /** + * Specifies the days since the initiation of an incomplete multipart upload that + * Amazon S3 will wait before permanently removing all parts of the upload. For + * more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. + * + * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config + */ + abortIncompleteMultipartUpload?: AbortIncompleteMultipartUpload + /** + * Specifies the expiration for the lifecycle of the object in the form of date, + * days and, whether the object has a delete marker. + */ + expiration?: LifecycleExpiration + /** + * The Filter is used to identify objects that a Lifecycle Rule applies to. A + * Filter must have exactly one of Prefix , Tag , or And specified. Filter is + * required if the LifecycleRule does not contain a Prefix element. + */ + filter: LifecycleRuleFilter + /** + * Unique identifier for the rule. The value cannot be longer than 255 characters. + */ + id?: string + /** + * Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 + * permanently deletes the noncurrent object versions. You set this lifecycle + * configuration action on a bucket that has versioning enabled (or suspended) to + * request that Amazon S3 delete noncurrent object versions at a specific period in + * the object's lifetime. + */ + noncurrentVersionExpiration?: NoncurrentVersionExpiration + /** + * Specifies the transition rule for the lifecycle rule that describes when + * noncurrent objects transition to a specific storage class. If your bucket is + * versioning-enabled (or versioning is suspended), you can set this action to + * request that Amazon S3 transition noncurrent object versions to a specific + * storage class at a set period in the object's lifetime. + */ + noncurrentVersionTransitions: Array + /** + * Prefix identifying one or more objects to which the rule applies. This is no + * longer used; use Filter instead. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * Deprecated: This member has been deprecated. + */ + prefix?: string + /** + * Specifies when an Amazon S3 object transitions to a specified storage class. + */ + transitions: Array + } + /** + * Describes where logs are stored and the prefix that Amazon S3 assigns to all + * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API + * Reference. + * + * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html + */ + type _subkbPlf = noSmithyDocumentSerde + interface LoggingEnabled extends _subkbPlf { + /** + * Specifies the bucket where you want Amazon S3 to store server access logs. You + * can have your logs delivered to any bucket that you own, including the same + * bucket that is being logged. You can also configure multiple buckets to deliver + * their logs to the same target bucket. In this case, you should choose a + * different TargetPrefix for each source bucket so that the delivered log files + * can be distinguished by key. + * + * This member is required. + */ + targetBucket?: string + /** + * A prefix for all log object keys. If you store log files from multiple Amazon + * S3 buckets in a single bucket, you can use a prefix to distinguish which log + * files came from which bucket. + * + * This member is required. + */ + targetPrefix?: string + /** + * Container for granting information. + * + * Buckets that use the bucket owner enforced setting for Object Ownership don't + * support target grants. For more information, see [Permissions for server access log delivery]in the Amazon S3 User Guide. + * + * [Permissions for server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general + */ + targetGrants: Array + /** + * Amazon S3 key format for log objects. + */ + targetObjectKeyFormat?: TargetObjectKeyFormat + } + /** + * Specifies a metrics configuration for the CloudWatch request metrics (specified + * by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an + * existing metrics configuration, note that this is a full replacement of the + * existing metrics configuration. If you don't include the elements you want to + * keep, they are erased. For more information, see [PutBucketMetricsConfiguration]. + * + * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html + */ + type _subVyqCh = noSmithyDocumentSerde + interface MetricsConfiguration extends _subVyqCh { + /** + * The ID used to identify the metrics configuration. The ID has a 64 character + * limit and can only contain letters, numbers, periods, dashes, and underscores. + * + * This member is required. + */ + id?: string + /** + * Specifies a metrics configuration filter. The metrics configuration will only + * include objects that meet the filter's criteria. A filter must be a prefix, an + * object tag, an access point ARN, or a conjunction (MetricsAndOperator). + */ + filter: MetricsFilter + } + /** + * Container for the MultipartUpload for the Amazon S3 object. + */ + type _subJfQNT = noSmithyDocumentSerde + interface MultipartUpload extends _subJfQNT { + /** + * The algorithm that was used to create a checksum of the object. + */ + checksumAlgorithm: ChecksumAlgorithm + /** + * Date and time at which the multipart upload was initiated. + */ + initiated?: time.Time + /** + * Identifies who initiated the multipart upload. + */ + initiator?: Initiator + /** + * Key of the object for which the multipart upload was initiated. + */ + key?: string + /** + * Specifies the owner of the object that is part of the multipart upload. + * + * Directory buckets - The bucket owner is returned as the object owner for all + * the objects. + */ + owner?: Owner + /** + * The class of storage used to store the object. + * + * Directory buckets - Only the S3 Express One Zone storage class is supported by + * directory buckets to store objects. + */ + storageClass: StorageClass + /** + * Upload ID that identifies the multipart upload. + */ + uploadId?: string + } + /** + * A container for specifying the notification configuration of the bucket. If + * this element is empty, notifications are turned off for the bucket. + */ + type _submfUYx = noSmithyDocumentSerde + interface NotificationConfiguration extends _submfUYx { + /** + * Enables delivery of events to Amazon EventBridge. + */ + eventBridgeConfiguration?: EventBridgeConfiguration + /** + * Describes the Lambda functions to invoke and the events for which to invoke + * them. + */ + lambdaFunctionConfigurations: Array + /** + * The Amazon Simple Queue Service queues to publish messages to and the events + * for which to publish messages. + */ + queueConfigurations: Array + /** + * The topic to which notifications are sent and the events for which + * notifications are generated. + */ + topicConfigurations: Array + } + /** + * An object consists of data and its descriptive metadata. + */ + type _subKzNJK = noSmithyDocumentSerde + interface Object extends _subKzNJK { + /** + * The algorithm that was used to create a checksum of the object. + */ + checksumAlgorithm: Array + /** + * The entity tag is a hash of the object. The ETag reflects changes only to the + * contents of an object, not its metadata. The ETag may or may not be an MD5 + * digest of the object data. Whether or not it is depends on how the object was + * created and how it is encrypted as described below: + * + * ``` + * - Objects created by the PUT Object, POST Object, or Copy operation, or + * through the Amazon Web Services Management Console, and are encrypted by SSE-S3 + * or plaintext, have ETags that are an MD5 digest of their object data. + * + * - Objects created by the PUT Object, POST Object, or Copy operation, or + * through the Amazon Web Services Management Console, and are encrypted by SSE-C + * or SSE-KMS, have ETags that are not an MD5 digest of their object data. + * + * - If an object is created by either the Multipart Upload or Part Copy + * operation, the ETag is not an MD5 digest, regardless of the method of + * encryption. If an object is larger than 16 MB, the Amazon Web Services + * Management Console will upload or copy that object as a Multipart Upload, and + * therefore the ETag will not be an MD5 digest. + * ``` + * + * Directory buckets - MD5 is not supported by directory buckets. + */ + eTag?: string + /** + * The name that you assign to an object. You use the object key to retrieve the + * object. + */ + key?: string + /** + * Creation date of the object. + */ + lastModified?: time.Time + /** + * The owner of the object + * + * Directory buckets - The bucket owner is returned as the object owner. + */ + owner?: Owner + /** + * Specifies the restoration status of an object. Objects in certain storage + * classes must be restored before they can be retrieved. For more information + * about these storage classes and how to work with archived objects, see [Working with archived objects]in the + * Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. Only the S3 Express + * One Zone storage class is supported by directory buckets to store objects. + * + * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html + */ + restoreStatus?: RestoreStatus + /** + * Size in bytes of the object + */ + size?: number + /** + * The class of storage used to store the object. + * + * Directory buckets - Only the S3 Express One Zone storage class is supported by + * directory buckets to store objects. + */ + storageClass: ObjectStorageClass + } + /** + * The container element for Object Lock configuration parameters. + */ + type _subslJnE = noSmithyDocumentSerde + interface ObjectLockConfiguration extends _subslJnE { + /** + * Indicates whether this bucket has an Object Lock configuration enabled. Enable + * ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket. + */ + objectLockEnabled: ObjectLockEnabled + /** + * Specifies the Object Lock rule for the specified object. Enable the this rule + * when you apply ObjectLockConfiguration to a bucket. Bucket settings require + * both a mode and a period. The period can be either Days or Years but you must + * select one. You cannot specify Days and Years at the same time. + */ + rule?: ObjectLockRule + } + /** + * A legal hold configuration for an object. + */ + type _subQNweC = noSmithyDocumentSerde + interface ObjectLockLegalHold extends _subQNweC { + /** + * Indicates whether the specified object has a legal hold in place. + */ + status: ObjectLockLegalHoldStatus + } + /** + * A Retention configuration for an object. + */ + type _sublHSUJ = noSmithyDocumentSerde + interface ObjectLockRetention extends _sublHSUJ { + /** + * Indicates the Retention mode for the specified object. + */ + mode: ObjectLockRetentionMode + /** + * The date on which this Object Lock Retention will expire. + */ + retainUntilDate?: time.Time + } + /** + * The version of an object. + */ + type _subuWjvD = noSmithyDocumentSerde + interface ObjectVersion extends _subuWjvD { + /** + * The algorithm that was used to create a checksum of the object. + */ + checksumAlgorithm: Array + /** + * The entity tag is an MD5 hash of that version of the object. + */ + eTag?: string + /** + * Specifies whether the object is (true) or is not (false) the latest version of + * an object. + */ + isLatest?: boolean + /** + * The object key. + */ + key?: string + /** + * Date and time when the object was last modified. + */ + lastModified?: time.Time + /** + * Specifies the owner of the object. + */ + owner?: Owner + /** + * Specifies the restoration status of an object. Objects in certain storage + * classes must be restored before they can be retrieved. For more information + * about these storage classes and how to work with archived objects, see [Working with archived objects]in the + * Amazon S3 User Guide. + * + * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html + */ + restoreStatus?: RestoreStatus + /** + * Size in bytes of the object. + */ + size?: number + /** + * The class of storage used to store the object. + */ + storageClass: ObjectVersionStorageClass + /** + * Version ID of an object. + */ + versionId?: string + } + /** + * Describes how results of the Select job are serialized. + */ + type _subgSPBp = noSmithyDocumentSerde + interface OutputSerialization extends _subgSPBp { + /** + * Describes the serialization of CSV-encoded Select results. + */ + csv?: CSVOutput + /** + * Specifies JSON as request's output serialization format. + */ + json?: JSONOutput + } + /** + * Container for the owner's display name and ID. + */ + type _subEdbjx = noSmithyDocumentSerde + interface Owner extends _subEdbjx { + /** + * Container for the display name of the owner. This value is only supported in + * the following Amazon Web Services Regions: + * + * ``` + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * This functionality is not supported for directory buckets. + */ + displayName?: string + /** + * Container for the ID of the owner. + */ + id?: string + } + /** + * The container element for a bucket's ownership controls. + */ + type _subpHgpP = noSmithyDocumentSerde + interface OwnershipControls extends _subpHgpP { + /** + * The container element for an ownership control rule. + * + * This member is required. + */ + rules: Array + } + /** + * Container for elements related to a part. + */ + type _subhxloO = noSmithyDocumentSerde + interface Part extends _subhxloO { + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumSHA256?: string + /** + * Entity tag returned when the part was uploaded. + */ + eTag?: string + /** + * Date and time at which the part was uploaded. + */ + lastModified?: time.Time + /** + * Part number identifying the part. This is a positive integer between 1 and + * 10,000. + */ + partNumber?: number + /** + * Size in bytes of the uploaded part data. + */ + size?: number + } + /** + * The container element for a bucket's policy status. + */ + type _subodOuo = noSmithyDocumentSerde + interface PolicyStatus extends _subodOuo { + /** + * The policy status for this bucket. TRUE indicates that this bucket is public. + * FALSE indicates that the bucket is not public. + */ + isPublic?: boolean + } + /** + * The PublicAccessBlock configuration that you want to apply to this Amazon S3 + * bucket. You can enable the configuration options in any combination. For more + * information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in + * the Amazon S3 User Guide. + * + * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + */ + type _subabDMY = noSmithyDocumentSerde + interface PublicAccessBlockConfiguration extends _subabDMY { + /** + * Specifies whether Amazon S3 should block public access control lists (ACLs) for + * this bucket and objects in this bucket. Setting this element to TRUE causes the + * following behavior: + * + * ``` + * - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + * + * - PUT Object calls fail if the request includes a public ACL. + * + * - PUT Bucket calls fail if the request includes a public ACL. + * ``` + * + * Enabling this setting doesn't affect existing policies or ACLs. + */ + blockPublicAcls?: boolean + /** + * Specifies whether Amazon S3 should block public bucket policies for this + * bucket. Setting this element to TRUE causes Amazon S3 to reject calls to PUT + * Bucket policy if the specified bucket policy allows public access. + * + * Enabling this setting doesn't affect existing bucket policies. + */ + blockPublicPolicy?: boolean + /** + * Specifies whether Amazon S3 should ignore public ACLs for this bucket and + * objects in this bucket. Setting this element to TRUE causes Amazon S3 to ignore + * all public ACLs on this bucket and objects in this bucket. + * + * Enabling this setting doesn't affect the persistence of any existing ACLs and + * doesn't prevent new public ACLs from being set. + */ + ignorePublicAcls?: boolean + /** + * Specifies whether Amazon S3 should restrict public bucket policies for this + * bucket. Setting this element to TRUE restricts access to this bucket to only + * Amazon Web Servicesservice principals and authorized users within this account + * if the bucket has a public policy. + * + * Enabling this setting doesn't affect previously stored bucket policies, except + * that public and cross-account access within any public bucket policy, including + * non-public delegation to specific accounts, is blocked. + */ + restrictPublicBuckets?: boolean + } + /** + * Specifies the configuration for publishing messages to an Amazon Simple Queue + * Service (Amazon SQS) queue when Amazon S3 detects specified events. + */ + type _subtAqlQ = noSmithyDocumentSerde + interface QueueConfiguration extends _subtAqlQ { + /** + * A collection of bucket events for which to send notifications + * + * This member is required. + */ + events: Array + /** + * The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 + * publishes a message when it detects events of the specified type. + * + * This member is required. + */ + queueArn?: string + /** + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + * + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html + */ + filter?: NotificationConfigurationFilter + /** + * An optional unique identifier for configurations in a notification + * configuration. If you don't provide one, Amazon S3 will assign an ID. + */ + id?: string + } + /** + * Specifies the redirect behavior of all requests to a website endpoint of an + * Amazon S3 bucket. + */ + type _subTXThv = noSmithyDocumentSerde + interface RedirectAllRequestsTo extends _subTXThv { + /** + * Name of the host where requests are redirected. + * + * This member is required. + */ + hostName?: string + /** + * Protocol to use when redirecting requests. The default is the protocol that is + * used in the original request. + */ + protocol: Protocol + } + /** + * A container for replication rules. You can add up to 1,000 rules. The maximum + * size of a replication configuration is 2 MB. + */ + type _subiVRed = noSmithyDocumentSerde + interface ReplicationConfiguration extends _subiVRed { + /** + * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role + * that Amazon S3 assumes when replicating objects. For more information, see [How to Set Up Replication]in + * the Amazon S3 User Guide. + * + * [How to Set Up Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html + * + * This member is required. + */ + role?: string + /** + * A container for one or more replication rules. A replication configuration must + * have at least one rule and can contain a maximum of 1,000 rules. + * + * This member is required. + */ + rules: Array + } + /** + * Container for Payer. + */ + type _subsnwVf = noSmithyDocumentSerde + interface RequestPaymentConfiguration extends _subsnwVf { + /** + * Specifies who pays for the download and request fees. + * + * This member is required. + */ + payer: Payer + } + /** + * Container for specifying if periodic QueryProgress messages should be sent. + */ + type _subefJEa = noSmithyDocumentSerde + interface RequestProgress extends _subefJEa { + /** + * Specifies whether periodic QueryProgress frames should be sent. Valid values: + * TRUE, FALSE. Default value: FALSE. + */ + enabled?: boolean + } + /** + * Container for restore job parameters. + */ + type _subiBseV = noSmithyDocumentSerde + interface RestoreRequest extends _subiBseV { + /** + * Lifetime of the active copy in days. Do not use with restores that specify + * OutputLocation . + * + * The Days element is required for regular restores, and must not be provided for + * select requests. + */ + days?: number + /** + * The optional description for the job. + */ + description?: string + /** + * S3 Glacier related parameters pertaining to this job. Do not use with restores + * that specify OutputLocation . + */ + glacierJobParameters?: GlacierJobParameters + /** + * Describes the location where the restore job's output is stored. + */ + outputLocation?: OutputLocation + /** + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Describes the parameters for Select job types. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + */ + selectParameters?: SelectParameters + /** + * Retrieval tier at which the restore will be processed. + */ + tier: Tier + /** + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Type of restore request. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + */ + type: RestoreRequestType + } + /** + * Specifies the redirect behavior and when a redirect is applied. For more + * information about routing rules, see [Configuring advanced conditional redirects]in the Amazon S3 User Guide. + * + * [Configuring advanced conditional redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects + */ + type _submoxtI = noSmithyDocumentSerde + interface RoutingRule extends _submoxtI { + /** + * Container for redirect information. You can redirect requests to another host, + * to another page, or with another protocol. In the event of an error, you can + * specify a different error code to return. + * + * This member is required. + */ + redirect?: Redirect + /** + * A container for describing a condition that must be met for the specified + * redirect to apply. For example, 1. If request is for pages in the /docs folder, + * redirect to the /documents folder. 2. If request results in HTTP error 4xx, + * redirect request to another host where you might process the error. + */ + condition?: Condition + } + /** + * Specifies the byte range of the object to get the records from. A record is + * processed when its first byte is contained by the range. This parameter is + * optional, but when specified, it must not be empty. See RFC 2616, Section + * 14.35.1 about how to specify the start and end of the range. + */ + type _subRivjC = noSmithyDocumentSerde + interface ScanRange extends _subRivjC { + /** + * Specifies the end of the byte range. This parameter is optional. Valid values: + * non-negative integers. The default value is one less than the size of the object + * being queried. If only the End parameter is supplied, it is interpreted to mean + * scan the last N bytes of the file. For example, 50 means scan the last 50 bytes. + */ + end?: number + /** + * Specifies the start of the byte range. This parameter is optional. Valid + * values: non-negative integers. The default value is 0. If only start is + * supplied, it means scan from that point to the end of the file. For example, 50 + * means scan from byte 50 until the end of the file. + */ + start?: number + } + /** + * Specifies the default server-side-encryption configuration. + */ + type _subVPqsj = noSmithyDocumentSerde + interface ServerSideEncryptionConfiguration extends _subVPqsj { + /** + * Container for information about a particular server-side encryption + * configuration rule. + * + * This member is required. + */ + rules: Array + } + /** + * The established temporary security credentials of the session. + * + * Directory buckets - These session credentials are only supported for the + * authentication and authorization of Zonal endpoint API operations on directory + * buckets. + */ + type _subCZMxI = noSmithyDocumentSerde + interface SessionCredentials extends _subCZMxI { + /** + * A unique identifier that's associated with a secret access key. The access key + * ID and the secret access key are used together to sign programmatic Amazon Web + * Services requests cryptographically. + * + * This member is required. + */ + accessKeyId?: string + /** + * Temporary security credentials expire after a specified interval. After + * temporary credentials expire, any calls that you make with those credentials + * will fail. So you must generate a new set of temporary credentials. Temporary + * credentials cannot be extended or refreshed beyond the original specified + * interval. + * + * This member is required. + */ + expiration?: time.Time + /** + * A key that's used with the access key ID to cryptographically sign programmatic + * Amazon Web Services requests. Signing a request identifies the sender and + * prevents the request from being altered. + * + * This member is required. + */ + secretAccessKey?: string + /** + * A part of the temporary security credentials. The session token is used to + * validate the temporary security credentials. + * + * This member is required. + */ + sessionToken?: string + } + /** + * A container of a key value name pair. + */ + type _sublEKMb = noSmithyDocumentSerde + interface Tag extends _sublEKMb { + /** + * Name of the object key. + * + * This member is required. + */ + key?: string + /** + * Value of the tag. + * + * This member is required. + */ + value?: string + } + /** + * Container for TagSet elements. + */ + type _subDFXKG = noSmithyDocumentSerde + interface Tagging extends _subDFXKG { + /** + * A collection for a set of tags + * + * This member is required. + */ + tagSet: Array + } + /** + * A container for specifying the configuration for publication of messages to an + * Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects + * specified events. + */ + type _subBtArW = noSmithyDocumentSerde + interface TopicConfiguration extends _subBtArW { + /** + * The Amazon S3 bucket event about which to send notifications. For more + * information, see [Supported Event Types]in the Amazon S3 User Guide. + * + * [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + * + * This member is required. + */ + events: Array + /** + * The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 + * publishes a message when it detects events of the specified type. + * + * This member is required. + */ + topicArn?: string + /** + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + * + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html + */ + filter?: NotificationConfigurationFilter + /** + * An optional unique identifier for configurations in a notification + * configuration. If you don't provide one, Amazon S3 will assign an ID. + */ + id?: string + } + /** + * Describes the versioning state of an Amazon S3 bucket. For more information, + * see [PUT Bucket versioning]in the Amazon S3 API Reference. + * + * [PUT Bucket versioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html + */ + type _subVyFBK = noSmithyDocumentSerde + interface VersioningConfiguration extends _subVyFBK { + /** + * Specifies whether MFA delete is enabled in the bucket versioning configuration. + * This element is only returned if the bucket has been configured with MFA delete. + * If the bucket has never been so configured, this element is not returned. + */ + mfaDelete: MFADelete + /** + * The versioning state of the bucket. + */ + status: BucketVersioningStatus + } + /** + * Specifies website configuration parameters for an Amazon S3 bucket. + */ + type _submmRKx = noSmithyDocumentSerde + interface WebsiteConfiguration extends _submmRKx { + /** + * The name of the error document for the website. + */ + errorDocument?: ErrorDocument + /** + * The name of the index document for the website. + */ + indexDocument?: IndexDocument + /** + * The redirect behavior for every request to this bucket's website endpoint. + * + * If you specify this property, you can't specify any other property. + */ + redirectAllRequestsTo?: RedirectAllRequestsTo + /** + * Rules that define when a redirect is applied and the redirect behavior. + */ + routingRules: Array + } +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + // @ts-ignore + import stdContext = context + /** + * Route contains information to adding/registering new route with the router. + * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. + */ + interface Route { + method: string + path: string + handler: HandlerFunc + middlewares: Array + name: string + } + interface Route { + /** + * ToRouteInfo converts Route to RouteInfo + */ + toRouteInfo(params: Array): RouteInfo + } + interface Route { + /** + * ToRoute returns Route which Router uses to register the method handler for path. + */ + toRoute(): Route + } + interface Route { + /** + * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. + */ + forGroup(pathPrefix: string, middlewares: Array): Routable + } + /** + * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this + * interface are meant for request routing purposes and should not be used in middlewares. + */ + interface RoutableContext { + [key:string]: any; + /** + * Request returns `*http.Request`. + */ + request(): (http.Request) + /** + * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. + */ + rawPathParams(): (PathParams) + /** + * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). + * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. + */ + setRawPathParams(params: PathParams): void + /** + * SetPath sets the registered path for the handler. + */ + setPath(p: string): void + /** + * SetRouteInfo sets the route info of this request to the context. + */ + setRouteInfo(ri: RouteInfo): void + /** + * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context + * for later use in middlewares/handler. + */ + set(key: string, val: { + }): void + } + /** + * PathParam is tuple pf path parameter name and its value in request path + */ + interface PathParam { + name: string + value: string + } +} + +/** + * Package bearer provides middleware and utilities for authenticating API + * operation calls with a Bearer Token. + */ +namespace bearer { + // @ts-ignore + import smithyhttp = http + /** + * Token provides a type wrapping a bearer token and expiration metadata. + */ + interface Token { + value: string + canExpire: boolean + expires: time.Time + } + interface Token { + /** + * Expired returns if the token's Expires time is before or equal to the time + * provided. If CanExpires is false, Expired will always return false. + */ + expired(now: time.Time): boolean + } + // @ts-ignore + import smithycontext = context +} + +/** + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. + * + * # Value and Pointer Conversion Utilities + * + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. + * + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. + * + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. + * + * ``` + * var strPtr *string + * + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str + * + * // With the SDK's conversion functions + * strPtr = aws.String("my string") + * + * // Convert *string to string value + * str = aws.ToString(strPtr) + * ``` + * + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. + * + * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} + * + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) + * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) + * ``` + * + * # SDK Default HTTP Client + * + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. + * + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. + */ +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + // @ts-ignore + import smithybearer = bearer + // @ts-ignore + import sdkrand = rand + /** + * A Credentials is the AWS credentials value for individual credential fields. + */ + interface Credentials { + /** + * AWS Access key ID + */ + accessKeyID: string + /** + * AWS Secret Access Key + */ + secretAccessKey: string + /** + * AWS Session Token + */ + sessionToken: string + /** + * Source of the credentials + */ + source: string + /** + * States if the credentials can expire or not. + */ + canExpire: boolean + /** + * The time the credentials will expire at. Should be ignored if CanExpire + * is false. + */ + expires: time.Time + /** + * The ID of the account for the credentials. + */ + accountID: string + } + interface Credentials { + /** + * Expired returns if the credentials have expired. + */ + expired(): boolean + } + interface Credentials { + /** + * HasKeys returns if the credentials keys are set. + */ + hasKeys(): boolean + } + /** + * Endpoint represents the endpoint a service client should make API operation + * calls to. + * + * The SDK will automatically resolve these endpoints per API client using an + * internal endpoint resolvers. If you'd like to provide custom endpoint + * resolving behavior you can implement the EndpointResolver interface. + * + * Deprecated: This structure was used with the global [EndpointResolver] + * interface, which has been deprecated in favor of service-specific endpoint + * resolution. See the deprecation docs on that interface for more information. + */ + interface Endpoint { + /** + * The base URL endpoint the SDK API clients will use to make API calls to. + * The SDK will suffix URI path and query elements to this endpoint. + */ + url: string + /** + * Specifies if the endpoint's hostname can be modified by the SDK's API + * client. + * + * If the hostname is mutable the SDK API clients may modify any part of + * the hostname based on the requirements of the API, (e.g. adding, or + * removing content in the hostname). Such as, Amazon S3 API client + * prefixing "bucketname" to the hostname, or changing the + * hostname service name component from "s3." to "s3-accesspoint.dualstack." + * for the dualstack endpoint of an S3 Accesspoint resource. + * + * Care should be taken when providing a custom endpoint for an API. If the + * endpoint hostname is mutable, and the client cannot modify the endpoint + * correctly, the operation call will most likely fail, or have undefined + * behavior. + * + * If hostname is immutable, the SDK API clients will not modify the + * hostname of the URL. This may cause the API client not to function + * correctly if the API requires the operation specific hostname values + * to be used by the client. + * + * This flag does not modify the API client's behavior if this endpoint + * will be used instead of Endpoint Discovery, or if the endpoint will be + * used to perform Endpoint Discovery. That behavior is configured via the + * API Client's Options. + */ + hostnameImmutable: boolean + /** + * The AWS partition the endpoint belongs to. + */ + partitionID: string + /** + * The service name that should be used for signing the requests to the + * endpoint. + */ + signingName: string + /** + * The region that should be used for signing the request to the endpoint. + */ + signingRegion: string + /** + * The signing method that should be used for signing the requests to the + * endpoint. + */ + signingMethod: string + /** + * The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata. + * When providing a custom endpoint, you should set the source as EndpointSourceCustom. + * If source is not provided when providing a custom endpoint, the SDK may not + * perform required host mutations correctly. Source should be used along with + * HostnameImmutable property as per the usage requirement. + */ + source: EndpointSource + } + /** + * ExecutionEnvironmentID is the AWS execution environment runtime identifier. + */ + interface ExecutionEnvironmentID extends String{} +} + +/** + * Package s3 provides the API client, operations, and parameter types for Amazon + * Simple Storage Service. + */ +namespace s3 { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import awshttp = http + // @ts-ignore + import internalauth = auth + // @ts-ignore + import internalauthsmithy = smithy + // @ts-ignore + import internalConfig = configsources + // @ts-ignore + import internalmiddleware = middleware + // @ts-ignore + import acceptencodingcust = accept_encoding + // @ts-ignore + import internalChecksum = checksum + // @ts-ignore + import presignedurlcust = presigned_url + // @ts-ignore + import s3sharedconfig = config + // @ts-ignore + import s3cust = customizations + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithyauth = auth + // @ts-ignore + import smithydocument = document + // @ts-ignore + import smithyhttp = http + interface noSmithyDocumentSerde extends smithydocument.NoSerde{} + interface HTTPSignerV4 { + [key:string]: any; + signHTTP(ctx: context.Context, credentials: aws.Credentials, r: http.Request, payloadHash: string, service: string, region: string, signingTime: time.Time, ...optFns: ((_arg0: v4.SignerOptions) => void)[]): void + } + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import smithyio = io + // @ts-ignore + import smithytime = time + // @ts-ignore + import smithywaiter = waiter + // @ts-ignore + import smithysync = sync + /** + * SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent operation. + * + * For testing and mocking the event stream this type should be initialized via + * the NewSelectObjectContentEventStream constructor function. Using the functional options + * to pass in nested mock behavior. + */ + interface SelectObjectContentEventStream { + /** + * SelectObjectContentEventStreamReader is the EventStream reader for the + * SelectObjectContentEventStream events. This value is automatically set by the + * SDK when the API call is made Use this member when unit testing your code with + * the SDK to mock out the EventStream Reader. + * + * Must not be nil. + */ + reader: SelectObjectContentEventStreamReader + } + interface SelectObjectContentEventStream { + /** + * Events returns a channel to read events from. + */ + events(): undefined + } + interface SelectObjectContentEventStream { + /** + * Close closes the stream. This will also cause the stream to be closed. + * Close must be called when done using the stream API. Not calling Close + * may result in resource leaks. + * + * Will close the underlying EventStream writer and reader, and no more events can be + * sent or received. + */ + close(): void + } + interface SelectObjectContentEventStream { + /** + * Err returns any error that occurred while reading or writing EventStream Events + * from the service API's response. Returns nil if there were no errors. + */ + err(): void + } + /** + * AuthSchemeResolver returns a set of possible authentication options for an + * operation. + */ + interface AuthSchemeResolver { + [key:string]: any; + resolveAuthSchemes(_arg0: context.Context, _arg1: AuthResolverParameters): Array<(smithyauth.Option | undefined)> + } + // @ts-ignore + import internalcontext = context + // @ts-ignore + import awsxml = xml + // @ts-ignore + import internalendpoints = endpoints + // @ts-ignore + import smithyendpoints = endpoints + /** + * EndpointResolverOptions is the service endpoint resolver options + */ + interface EndpointResolverOptions extends internalendpoints.Options{} + /** + * EndpointResolver interface for resolving service endpoints. + */ + interface EndpointResolver { + [key:string]: any; + resolveEndpoint(region: string, options: EndpointResolverOptions): aws.Endpoint + } + /** + * EndpointResolverV2 provides the interface for resolving service endpoints. + */ + interface EndpointResolverV2 { + [key:string]: any; + /** + * ResolveEndpoint attempts to resolve the endpoint with the provided options, + * returning the endpoint if found. Otherwise an error is returned. + */ + resolveEndpoint(ctx: context.Context, params: EndpointParameters): smithyendpoints.Endpoint + } + /** + * ExpressCredentialsProvider retrieves credentials for operations against the + * S3Express storage class. + */ + interface ExpressCredentialsProvider extends customizations.S3ExpressCredentialsProvider{} + interface HTTPClient { + [key:string]: any; + do(_arg0: http.Request): (http.Response) + } + // @ts-ignore + import v4 = signer +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + interface EmailTemplate { + body: string + subject: string + actionUrl: string + hidden: boolean + } + interface EmailTemplate { + /** + * Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface EmailTemplate { + /** + * Resolve replaces the placeholder parameters in the current email + * template and returns its components as ready-to-use strings. + */ + resolve(appName: string, appUrl: string, token: string): [string, string, string] + } +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + /** + * An Attr is a key-value pair. + */ + interface Attr { + key: string + value: Value + } + interface Attr { + /** + * Equal reports whether a and b have equal keys and values. + */ + equal(b: Attr): boolean + } + interface Attr { + string(): string + } + /** + * A Handler handles log records produced by a Logger. + * + * A typical handler may print log records to standard error, + * or write them to a file or database, or perhaps augment them + * with additional attributes and pass them on to another handler. + * + * Any of the Handler's methods may be called concurrently with itself + * or with other methods. It is the responsibility of the Handler to + * manage this concurrency. + * + * Users of the slog package should not invoke Handler methods directly. + * They should use the methods of [Logger] instead. + */ + interface Handler { + [key:string]: any; + /** + * Enabled reports whether the handler handles records at the given level. + * The handler ignores records whose level is lower. + * It is called early, before any arguments are processed, + * to save effort if the log event should be discarded. + * If called from a Logger method, the first argument is the context + * passed to that method, or context.Background() if nil was passed + * or the method does not take a context. + * The context is passed so Enabled can use its values + * to make a decision. + */ + enabled(_arg0: context.Context, _arg1: Level): boolean + /** + * Handle handles the Record. + * It will only be called when Enabled returns true. + * The Context argument is as for Enabled. + * It is present solely to provide Handlers access to the context's values. + * Canceling the context should not affect record processing. + * (Among other things, log messages may be necessary to debug a + * cancellation-related problem.) + * + * Handle methods that produce output should observe the following rules: + * ``` + * - If r.Time is the zero time, ignore the time. + * - If r.PC is zero, ignore it. + * - Attr's values should be resolved. + * - If an Attr's key and value are both the zero value, ignore the Attr. + * This can be tested with attr.Equal(Attr{}). + * - If a group's key is empty, inline the group's Attrs. + * - If a group has no Attrs (even if it has a non-empty key), + * ignore it. + * ``` + */ + handle(_arg0: context.Context, _arg1: Record): void + /** + * WithAttrs returns a new Handler whose attributes consist of + * both the receiver's attributes and the arguments. + * The Handler owns the slice: it may retain, modify or discard it. + */ + withAttrs(attrs: Array): Handler + /** + * WithGroup returns a new Handler with the given group appended to + * the receiver's existing groups. + * The keys of all subsequent attributes, whether added by With or in a + * Record, should be qualified by the sequence of group names. + * + * How this qualification happens is up to the Handler, so long as + * this Handler's attribute keys differ from those of another Handler + * with a different sequence of group names. + * + * A Handler should treat WithGroup as starting a Group of Attrs that ends + * at the end of the log event. That is, + * + * ``` + * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) + * ``` + * + * should behave like + * + * ``` + * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) + * ``` + * + * If the name is empty, WithGroup returns the receiver. + */ + withGroup(name: string): Handler + } + /** + * A Level is the importance or severity of a log event. + * The higher the level, the more important or severe the event. + */ + interface Level extends Number{} + interface Level { + /** + * String returns a name for the level. + * If the level has a name, then that name + * in uppercase is returned. + * If the level is between named values, then + * an integer is appended to the uppercased name. + * Examples: + * + * ``` + * LevelWarn.String() => "WARN" + * (LevelInfo+2).String() => "INFO+2" + * ``` + */ + string(): string + } + interface Level { + /** + * MarshalJSON implements [encoding/json.Marshaler] + * by quoting the output of [Level.String]. + */ + marshalJSON(): string|Array + } + interface Level { + /** + * UnmarshalJSON implements [encoding/json.Unmarshaler] + * It accepts any string produced by [Level.MarshalJSON], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". + */ + unmarshalJSON(data: string|Array): void + } + interface Level { + /** + * MarshalText implements [encoding.TextMarshaler] + * by calling [Level.String]. + */ + marshalText(): string|Array + } + interface Level { + /** + * UnmarshalText implements [encoding.TextUnmarshaler]. + * It accepts any string produced by [Level.MarshalText], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". + */ + unmarshalText(data: string|Array): void + } + interface Level { + /** + * Level returns the receiver. + * It implements [Leveler]. + */ + level(): Level + } + // @ts-ignore + import loginternal = internal +} + +/** + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. + */ +namespace core { + interface BaseModelEvent { + model: models.Model + } + interface BaseModelEvent { + tags(): Array + } + interface BaseCollectionEvent { + collection?: models.Collection + } + interface BaseCollectionEvent { + tags(): Array + } +} + +namespace subscriptions { +} + +/** + * Package middleware provides transport agnostic middleware for decorating SDK + * handlers. + * + * The Smithy middleware stack provides ordered behavior to be invoked on an + * underlying handler. The stack is separated into steps that are invoked in a + * static order. A step is a collection of middleware that are injected into a + * ordered list defined by the user. The user may add, insert, swap, and remove a + * step's middleware. When the stack is invoked the step middleware become static, + * and their order cannot be modified. + * + * A stack and its step middleware are **not** safe to modify concurrently. + * + * A stack will use the ordered list of middleware to decorate a underlying + * handler. A handler could be something like an HTTP Client that round trips an + * API operation over HTTP. + * + * Smithy Middleware Stack + * + * A Stack is a collection of middleware that wrap a handler. The stack can be + * broken down into discreet steps. Each step may contain zero or more middleware + * specific to that stack's step. + * + * A Stack Step is a predefined set of middleware that are invoked in a static + * order by the Stack. These steps represent fixed points in the middleware stack + * for organizing specific behavior, such as serialize and build. A Stack Step is + * composed of zero or more middleware that are specific to that step. A step may + * define its own set of input/output parameters the generic input/output + * parameters are cast from. A step calls its middleware recursively, before + * calling the next step in the stack returning the result or error of the step + * middleware decorating the underlying handler. + * + * * Initialize: Prepares the input, and sets any default parameters as needed, + * (e.g. idempotency token, and presigned URLs). + * + * * Serialize: Serializes the prepared input into a data structure that can be + * consumed by the target transport's message, (e.g. REST-JSON serialization). + * + * * Build: Adds additional metadata to the serialized transport message, (e.g. + * HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. + * + * * Finalize: Performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated to + * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request + * signing). + * + * * Deserialize: Reacts to the handler's response returned by the recipient of + * the request message. Deserializes the response into a structured type or + * error above stacks can react to. + * + * Adding Middleware to a Stack Step + * + * Middleware can be added to a step front or back, or relative, by name, to an + * existing middleware in that stack. If a middleware does not have a name, a + * unique name will be generated at the middleware and be added to the step. + * + * ``` + * // Create middleware stack + * stack := middleware.NewStack() + * + * // Add middleware to stack steps + * stack.Initialize.Add(paramValidationMiddleware, middleware.After) + * stack.Serialize.Add(marshalOperationFoo, middleware.After) + * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) + * + * // Invoke middleware on handler. + * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) + * ``` + */ +namespace middleware { + /** + * RelativePosition provides specifying the relative position of a middleware + * in an ordered group. + */ + interface RelativePosition extends Number{} + /** + * BuildMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next BuildHandler for further + * processing. + */ + interface BuildMiddleware { + [key:string]: any; + /** + * Unique ID for the middleware in theBuildStep. The step does not allow + * duplicate IDs. + */ + id(): string + /** + * Invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleBuild(ctx: context.Context, _arg10: BuildInput, next: BuildHandler): [BuildOutput, Metadata] + } + /** + * DeserializeMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next DeserializeHandler for further + * processing. + */ + interface DeserializeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the DeserializeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleDeserialize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleDeserialize(ctx: context.Context, _arg10: DeserializeInput, next: DeserializeHandler): [DeserializeOutput, Metadata] + } + /** + * FinalizeMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next FinalizeHandler for further + * processing. + */ + interface FinalizeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the FinalizeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleFinalize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleFinalize(ctx: context.Context, _arg10: FinalizeInput, next: FinalizeHandler): [FinalizeOutput, Metadata] + } + /** + * InitializeMiddleware provides the interface for middleware specific to the + * initialize step. Delegates to the next InitializeHandler for further + * processing. + */ + interface InitializeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the InitializeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleInitialize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleInitialize(ctx: context.Context, _arg10: InitializeInput, next: InitializeHandler): [InitializeOutput, Metadata] + } + /** + * SerializeMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next SerializeHandler for further + * processing. + */ + interface SerializeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the SerializeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleSerialize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleSerialize(ctx: context.Context, _arg10: SerializeInput, next: SerializeHandler): [SerializeOutput, Metadata] + } +} + +/** + * Package auth defines protocol-agnostic authentication types for smithy + * clients. + */ +namespace auth { + /** + * Identity contains information that identifies who the user making the + * request is. + */ + interface Identity { + [key:string]: any; + expiration(): time.Time + } + /** + * IdentityResolverOptions defines the interface through which an entity can be + * queried to retrieve an IdentityResolver for a given auth scheme. + */ + interface IdentityResolverOptions { + [key:string]: any; + getIdentityResolver(schemeID: string): IdentityResolver + } + /** + * Option represents a possible authentication method for an operation. + */ + interface Option { + schemeID: string + identityProperties: smithy.Properties + signerProperties: smithy.Properties + } +} + +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { + /** + * MeterOption applies configuration to a Meter. + */ + interface MeterOption {(o: MeterOptions): void } + /** + * Meter is the entry point for creation of measurement instruments. + */ + interface Meter { + [key:string]: any; + /** + * integer/synchronous + */ + int64Counter(name: string, ...opts: InstrumentOption[]): Int64Counter + int64UpDownCounter(name: string, ...opts: InstrumentOption[]): Int64UpDownCounter + int64Gauge(name: string, ...opts: InstrumentOption[]): Int64Gauge + int64Histogram(name: string, ...opts: InstrumentOption[]): Int64Histogram + /** + * integer/asynchronous + */ + int64AsyncCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + int64AsyncUpDownCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + int64AsyncGauge(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + /** + * floating-point/synchronous + */ + float64Counter(name: string, ...opts: InstrumentOption[]): Float64Counter + float64UpDownCounter(name: string, ...opts: InstrumentOption[]): Float64UpDownCounter + float64Gauge(name: string, ...opts: InstrumentOption[]): Float64Gauge + float64Histogram(name: string, ...opts: InstrumentOption[]): Float64Histogram + /** + * floating-point/asynchronous + */ + float64AsyncCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + float64AsyncUpDownCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + float64AsyncGauge(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + } +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * TracerOption applies configuration to a tracer. + */ + interface TracerOption {(o: TracerOptions): void } + /** + * Tracer is the entry point for creating observed client Spans. + * + * Spans created by tracers propagate by existing on the Context. Consumers of + * the API can use [GetSpan] to pull the active Span from a Context. + * + * Creation of child Spans is implicit through Context persistence. If + * CreateSpan is called with a Context that holds a Span, the result will be a + * child of that Span. + */ + interface Tracer { + [key:string]: any; + startSpan(ctx: context.Context, name: string, ...opts: SpanOption[]): [context.Context, Span] + } +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { + /** + * Reader implements buffering for an io.Reader object. + */ + interface Reader { + } + interface Reader { + /** + * Size returns the size of the underlying buffer in bytes. + */ + size(): number + } + interface Reader { + /** + * Reset discards any buffered data, resets all state, and switches + * the buffered reader to read from r. + * Calling Reset on the zero value of [Reader] initializes the internal buffer + * to the default size. + * Calling b.Reset(b) (that is, resetting a [Reader] to itself) does nothing. + */ + reset(r: io.Reader): void + } + interface Reader { + /** + * Peek returns the next n bytes without advancing the reader. The bytes stop + * being valid at the next read call. If Peek returns fewer than n bytes, it + * also returns an error explaining why the read is short. The error is + * [ErrBufferFull] if n is larger than b's buffer size. + * + * Calling Peek prevents a [Reader.UnreadByte] or [Reader.UnreadRune] call from succeeding + * until the next read operation. + */ + peek(n: number): string|Array + } + interface Reader { + /** + * Discard skips the next n bytes, returning the number of bytes discarded. + * + * If Discard skips fewer than n bytes, it also returns an error. + * If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without + * reading from the underlying io.Reader. + */ + discard(n: number): number + } + interface Reader { + /** + * Read reads data into p. + * It returns the number of bytes read into p. + * The bytes are taken from at most one Read on the underlying [Reader], + * hence n may be less than len(p). + * To read exactly len(p) bytes, use io.ReadFull(b, p). + * If the underlying [Reader] can return a non-zero count with io.EOF, + * then this Read method can do so as well; see the [io.Reader] docs. + */ + read(p: string|Array): number + } + interface Reader { + /** + * ReadByte reads and returns a single byte. + * If no byte is available, returns an error. + */ + readByte(): number + } + interface Reader { + /** + * UnreadByte unreads the last byte. Only the most recently read byte can be unread. + * + * UnreadByte returns an error if the most recent method called on the + * [Reader] was not a read operation. Notably, [Reader.Peek], [Reader.Discard], and [Reader.WriteTo] are not + * considered read operations. + */ + unreadByte(): void + } + interface Reader { + /** + * ReadRune reads a single UTF-8 encoded Unicode character and returns the + * rune and its size in bytes. If the encoded rune is invalid, it consumes one byte + * and returns unicode.ReplacementChar (U+FFFD) with a size of 1. + */ + readRune(): [number, number] + } + interface Reader { + /** + * UnreadRune unreads the last rune. If the most recent method called on + * the [Reader] was not a [Reader.ReadRune], [Reader.UnreadRune] returns an error. (In this + * regard it is stricter than [Reader.UnreadByte], which will unread the last byte + * from any read operation.) + */ + unreadRune(): void + } + interface Reader { + /** + * Buffered returns the number of bytes that can be read from the current buffer. + */ + buffered(): number + } + interface Reader { + /** + * ReadSlice reads until the first occurrence of delim in the input, + * returning a slice pointing at the bytes in the buffer. + * The bytes stop being valid at the next read. + * If ReadSlice encounters an error before finding a delimiter, + * it returns all the data in the buffer and the error itself (often io.EOF). + * ReadSlice fails with error [ErrBufferFull] if the buffer fills without a delim. + * Because the data returned from ReadSlice will be overwritten + * by the next I/O operation, most clients should use + * [Reader.ReadBytes] or ReadString instead. + * ReadSlice returns err != nil if and only if line does not end in delim. + */ + readSlice(delim: number): string|Array + } + interface Reader { + /** + * ReadLine is a low-level line-reading primitive. Most callers should use + * [Reader.ReadBytes]('\n') or [Reader.ReadString]('\n') instead or use a [Scanner]. + * + * ReadLine tries to return a single line, not including the end-of-line bytes. + * If the line was too long for the buffer then isPrefix is set and the + * beginning of the line is returned. The rest of the line will be returned + * from future calls. isPrefix will be false when returning the last fragment + * of the line. The returned buffer is only valid until the next call to + * ReadLine. ReadLine either returns a non-nil line or it returns an error, + * never both. + * + * The text returned from ReadLine does not include the line end ("\r\n" or "\n"). + * No indication or error is given if the input ends without a final line end. + * Calling [Reader.UnreadByte] after ReadLine will always unread the last byte read + * (possibly a character belonging to the line end) even if that byte is not + * part of the line returned by ReadLine. + */ + readLine(): [string|Array, boolean] + } + interface Reader { + /** + * ReadBytes reads until the first occurrence of delim in the input, + * returning a slice containing the data up to and including the delimiter. + * If ReadBytes encounters an error before finding a delimiter, + * it returns the data read before the error and the error itself (often io.EOF). + * ReadBytes returns err != nil if and only if the returned data does not end in + * delim. + * For simple uses, a Scanner may be more convenient. + */ + readBytes(delim: number): string|Array + } + interface Reader { + /** + * ReadString reads until the first occurrence of delim in the input, + * returning a string containing the data up to and including the delimiter. + * If ReadString encounters an error before finding a delimiter, + * it returns the data read before the error and the error itself (often io.EOF). + * ReadString returns err != nil if and only if the returned data does not end in + * delim. + * For simple uses, a Scanner may be more convenient. + */ + readString(delim: number): string + } + interface Reader { + /** + * WriteTo implements io.WriterTo. + * This may make multiple calls to the [Reader.Read] method of the underlying [Reader]. + * If the underlying reader supports the [Reader.WriteTo] method, + * this calls the underlying [Reader.WriteTo] without buffering. + */ + writeTo(w: io.Writer): number + } + /** + * Writer implements buffering for an [io.Writer] object. + * If an error occurs writing to a [Writer], no more data will be + * accepted and all subsequent writes, and [Writer.Flush], will return the error. + * After all data has been written, the client should call the + * [Writer.Flush] method to guarantee all data has been forwarded to + * the underlying [io.Writer]. + */ + interface Writer { + } + interface Writer { + /** + * Size returns the size of the underlying buffer in bytes. + */ + size(): number + } + interface Writer { + /** + * Reset discards any unflushed buffered data, clears any error, and + * resets b to write its output to w. + * Calling Reset on the zero value of [Writer] initializes the internal buffer + * to the default size. + * Calling w.Reset(w) (that is, resetting a [Writer] to itself) does nothing. + */ + reset(w: io.Writer): void + } + interface Writer { + /** + * Flush writes any buffered data to the underlying [io.Writer]. + */ + flush(): void + } + interface Writer { + /** + * Available returns how many bytes are unused in the buffer. + */ + available(): number + } + interface Writer { + /** + * AvailableBuffer returns an empty buffer with b.Available() capacity. + * This buffer is intended to be appended to and + * passed to an immediately succeeding [Writer.Write] call. + * The buffer is only valid until the next write operation on b. + */ + availableBuffer(): string|Array + } + interface Writer { + /** + * Buffered returns the number of bytes that have been written into the current buffer. + */ + buffered(): number + } + interface Writer { + /** + * Write writes the contents of p into the buffer. + * It returns the number of bytes written. + * If nn < len(p), it also returns an error explaining + * why the write is short. + */ + write(p: string|Array): number + } + interface Writer { + /** + * WriteByte writes a single byte. + */ + writeByte(c: number): void + } + interface Writer { + /** + * WriteRune writes a single Unicode code point, returning + * the number of bytes written and any error. + */ + writeRune(r: number): number + } + interface Writer { + /** + * WriteString writes a string. + * It returns the number of bytes written. + * If the count is less than len(s), it also returns an error explaining + * why the write is short. + */ + writeString(s: string): number + } + interface Writer { + /** + * ReadFrom implements [io.ReaderFrom]. If the underlying writer + * supports the ReadFrom method, this calls the underlying ReadFrom. + * If there is buffered data and an underlying ReadFrom, this fills + * the buffer and writes it before calling ReadFrom. + */ + readFrom(r: io.Reader): number + } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url +} + +/** + * Package http provides the HTTP transport client and request/response types + * needed to round trip API operation calls with an service. + */ +namespace http { + // @ts-ignore + import smithy = smithy_go + /** + * Signer defines the interface through which HTTP requests are supplemented + * with an Identity. + */ + interface Signer { + [key:string]: any; + signRequest(_arg0: context.Context, _arg1: Request, _arg2: auth.Identity, _arg3: smithy.Properties): void + } + // @ts-ignore + import iointernal = io + // @ts-ignore + import smithytime = time +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` * slog.SetDefault(logger) * ``` * @@ -18885,1310 +41381,2810 @@ namespace subscriptions { * The program's `main` function typically does this. * The default value is LevelInfo. * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. * - * Then use the LevelVar to construct a handler, and make it the default: + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call * * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily * ``` * - * Now the program can change its logging level with a single statement: + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: * * ``` - * programLevel.Set(slog.LevelDebug) + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed * ``` * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: * * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) * ``` * - * TextHandler would display this group as + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: * * ``` - * request.method=GET request.url=http://example.com - * ``` - * - * JSONHandler would display it as + * type expensive struct { arg int } * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: + * Then use a value of that type in log calls: * * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) + * slog.Debug("frobbing", "value", expensive{arg}) * ``` * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. + * Now computeExpensiveValue will only be called when the line is enabled. * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. * - * ``` - * slog.InfoContext(ctx, "message") - * ``` + * # Writing a handler * - * It is recommended to pass a context to an output method if one is available. + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * A Record holds information about a log event. + * Copies of a Record share state. + * Do not modify a Record after handing out a copy to it. + * Call [NewRecord] to create a new Record. + * Use [Record.Clone] to create a copy with no shared state. + */ + interface Record { + /** + * The time at which the output method (Log, Info, etc.) was called. + */ + time: time.Time + /** + * The log message. + */ + message: string + /** + * The level of the event. + */ + level: Level + /** + * The program counter at the time the record was constructed, as determined + * by runtime.Callers. If zero, no program counter is available. + * + * The only valid use for this value is as an argument to + * [runtime.CallersFrames]. In particular, it must not be passed to + * [runtime.FuncForPC]. + */ + pc: number + } + interface Record { + /** + * Clone returns a copy of the record with no shared state. + * The original record and the clone can both be modified + * without interfering with each other. + */ + clone(): Record + } + interface Record { + /** + * NumAttrs returns the number of attributes in the [Record]. + */ + numAttrs(): number + } + interface Record { + /** + * Attrs calls f on each Attr in the [Record]. + * Iteration stops if f returns false. + */ + attrs(f: (_arg0: Attr) => boolean): void + } + interface Record { + /** + * AddAttrs appends the given Attrs to the [Record]'s list of Attrs. + * It omits empty groups. + */ + addAttrs(...attrs: Attr[]): void + } + interface Record { + /** + * Add converts the args to Attrs as described in [Logger.Log], + * then appends the Attrs to the [Record]'s list of Attrs. + * It omits empty groups. + */ + add(...args: any[]): void + } + /** + * A Value can represent any Go value, but unlike type any, + * it can represent most small values without an allocation. + * The zero Value corresponds to nil. + */ + interface Value { + } + interface Value { + /** + * Kind returns v's Kind. + */ + kind(): Kind + } + interface Value { + /** + * Any returns v's value as an any. + */ + any(): any + } + interface Value { + /** + * String returns Value's value as a string, formatted like [fmt.Sprint]. Unlike + * the methods Int64, Float64, and so on, which panic if v is of the + * wrong kind, String never panics. + */ + string(): string + } + interface Value { + /** + * Int64 returns v's value as an int64. It panics + * if v is not a signed integer. + */ + int64(): number + } + interface Value { + /** + * Uint64 returns v's value as a uint64. It panics + * if v is not an unsigned integer. + */ + uint64(): number + } + interface Value { + /** + * Bool returns v's value as a bool. It panics + * if v is not a bool. + */ + bool(): boolean + } + interface Value { + /** + * Duration returns v's value as a [time.Duration]. It panics + * if v is not a time.Duration. + */ + duration(): time.Duration + } + interface Value { + /** + * Float64 returns v's value as a float64. It panics + * if v is not a float64. + */ + float64(): number + } + interface Value { + /** + * Time returns v's value as a [time.Time]. It panics + * if v is not a time.Time. + */ + time(): time.Time + } + interface Value { + /** + * LogValuer returns v's value as a LogValuer. It panics + * if v is not a LogValuer. + */ + logValuer(): LogValuer + } + interface Value { + /** + * Group returns v's value as a []Attr. + * It panics if v's [Kind] is not [KindGroup]. + */ + group(): Array + } + interface Value { + /** + * Equal reports whether v and w represent the same Go value. + */ + equal(w: Value): boolean + } + interface Value { + /** + * Resolve repeatedly calls LogValue on v while it implements [LogValuer], + * and returns the result. + * If v resolves to a group, the group's attributes' values are not recursively + * resolved. + * If the number of LogValue calls exceeds a threshold, a Value containing an + * error is returned. + * Resolve's return value is guaranteed not to be of Kind [KindLogValuer]. + */ + resolve(): Value + } +} + +/** + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. * - * # Attrs and Values + * # Value and Pointer Conversion Utilities * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. * - * behaves the same as + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. * * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call + * var strPtr *string * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str * - * is the most efficient way to achieve the same output as + * // With the SDK's conversion functions + * strPtr = aws.String("my string") * + * // Convert *string to string value + * str = aws.ToString(strPtr) * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. * * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} * - * and you call it like this in main.go: + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. + * # SDK Default HTTP Client * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. + */ +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + // @ts-ignore + import smithybearer = bearer + // @ts-ignore + import sdkrand = rand + /** + * EndpointSource is the endpoint source type. + * + * Deprecated: The global [Endpoint] structure is deprecated. + */ + interface EndpointSource extends Number{} +} + +namespace endpoints { + // @ts-ignore + import endpoints = endpoints + /** + * Options is the endpoint resolver configuration options + */ + interface Options { + /** + * Logger is a logging implementation that log events should be sent to. + */ + logger: logging.Logger + /** + * LogDeprecated indicates that deprecated endpoints should be logged to the + * provided logger. + */ + logDeprecated: boolean + /** + * ResolvedRegion is used to override the region to be resolved, rather then the + * using the value passed to the ResolveEndpoint method. This value is used by the + * SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + * name. You must not set this value directly in your application. + */ + resolvedRegion: string + /** + * DisableHTTPS informs the resolver to return an endpoint that does not use the + * HTTPS scheme. + */ + disableHTTPS: boolean + /** + * UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + */ + useDualStackEndpoint: aws.DualStackEndpointState + /** + * UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + */ + useFIPSEndpoint: aws.FIPSEndpointState + } + interface Options { + getResolvedRegion(): string + } + interface Options { + getDisableHTTPS(): boolean + } + interface Options { + getUseDualStackEndpoint(): aws.DualStackEndpointState + } + interface Options { + getUseFIPSEndpoint(): aws.FIPSEndpointState + } +} + +/** + * Package v4 implements the AWS signature version 4 algorithm (commonly known + * as SigV4). * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` + * For more information about SigV4, see [Signing AWS API requests] in the IAM + * user guide. * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: + * While this implementation CAN work in an external context, it is developed + * primarily for SDK use and you may encounter fringe behaviors around header + * canonicalization. * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` + * # Pre-escaping a request URI * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * AWS v4 signature validation requires that the canonical string's URI path + * component must be the escaped form of the HTTP request's path. * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: + * The Go HTTP client will perform escaping automatically on the HTTP request. + * This may cause signature validation errors because the request differs from + * the URI path or query from which the signature was generated. * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` + * Because of this, we recommend that you explicitly escape the request when + * using this signer outside of the SDK to prevent possible signature mismatch. + * This can be done by setting URL.Opaque on the request. The signer will + * prefer that value, falling back to the return of URL.EscapedPath if unset. * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: + * When setting URL.Opaque you must do so in the form of: * * ``` - * type expensive struct { arg int } + * "///" * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } + * // e.g. + * "//example.com/some/path" * ``` * - * Then use a value of that type in log calls: + * The leading "//" and hostname are required or the escaping will not work + * correctly. * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` + * The TestStandaloneSign unit test provides a complete example of using the + * signer outside of the SDK and pre-escaping the URI path. * - * Now computeExpensiveValue will only be called when the line is enabled. + * [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html + */ +namespace signer { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import v4Internal = internal + // @ts-ignore + import internalauth = auth + // @ts-ignore + import smithyhttp = http + // @ts-ignore + import smithyHTTP = http + /** + * SignerOptions is the SigV4 Signer options. + */ + interface SignerOptions { + /** + * Disables the Signer's moving HTTP header key/value pairs from the HTTP + * request header to the request's query string. This is most commonly used + * with pre-signed requests preventing headers from being added to the + * request's query string. + */ + disableHeaderHoisting: boolean + /** + * Disables the automatic escaping of the URI path of the request for the + * siganture's canonical string's path. For services that do not need additional + * escaping then use this to disable the signer escaping the path. + * + * S3 is an example of a service that does not need additional escaping. + * + * http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html + */ + disableURIPathEscaping: boolean + /** + * The logger to send log messages to. + */ + logger: logging.Logger + /** + * Enable logging of signed requests. + * This will enable logging of the canonical request, the string to sign, and for presigning the subsequent + * presigned URL. + */ + logSigning: boolean + /** + * Disables setting the session token on the request as part of signing + * through X-Amz-Security-Token. This is needed for variations of v4 that + * present the token elsewhere. + */ + disableSessionToken: boolean + } +} + +/** + * Package document provides interface definitions and error types for document types. * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that each record is written in one piece. User-defined - * handlers are responsible for their own locking. + * A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send + * UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 + * strings to these values. * - * # Writing a handler + * API Clients expose document constructors in their respective client document packages which must be used to + * Marshal and Unmarshal Go types to and from their respective protocol representations. * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + * See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from + * document types. */ -namespace slog { +namespace document { /** - * An Attr is a key-value pair. + * NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled + * into a protocol document. */ - interface Attr { - key: string - value: Value + interface NoSerde { + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { +} + +namespace types { + interface CompressionType extends String{} + interface CompressionType { + /** + * Values returns all known values for CompressionType. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface Event extends String{} + interface Event { + /** + * Values returns all known values for Event. Note that this can be expanded in + * the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ExpirationStatus extends String{} + interface ExpirationStatus { + /** + * Values returns all known values for ExpirationStatus. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface IntelligentTieringStatus extends String{} + interface IntelligentTieringStatus { + /** + * Values returns all known values for IntelligentTieringStatus. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface InventoryIncludedObjectVersions extends String{} + interface InventoryIncludedObjectVersions { + /** + * Values returns all known values for InventoryIncludedObjectVersions. Note that + * this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface InventoryOptionalField extends String{} + interface InventoryOptionalField { + /** + * Values returns all known values for InventoryOptionalField. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface MFADelete extends String{} + interface MFADelete { + /** + * Values returns all known values for MFADelete. Note that this can be expanded + * in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectLockEnabled extends String{} + interface ObjectLockEnabled { + /** + * Values returns all known values for ObjectLockEnabled. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectLockRetentionMode extends String{} + interface ObjectLockRetentionMode { + /** + * Values returns all known values for ObjectLockRetentionMode. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectStorageClass extends String{} + interface ObjectStorageClass { + /** + * Values returns all known values for ObjectStorageClass. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ObjectVersionStorageClass extends String{} + interface ObjectVersionStorageClass { + /** + * Values returns all known values for ObjectVersionStorageClass. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array } - interface Attr { + interface Permission extends String{} + interface Permission { /** - * Equal reports whether a and b have equal keys and values. + * Values returns all known values for Permission. Note that this can be expanded + * in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. */ - equal(b: Attr): boolean + values(): Array } - interface Attr { - string(): string + interface Protocol extends String{} + interface Protocol { + /** + * Values returns all known values for Protocol. Note that this can be expanded in + * the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface RestoreRequestType extends String{} + interface RestoreRequestType { + /** + * Values returns all known values for RestoreRequestType. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface Tier extends String{} + interface Tier { + /** + * Values returns all known values for Tier. Note that this can be expanded in the + * future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document /** - * A Handler handles log records produced by a Logger. + * Specifies the days since the initiation of an incomplete multipart upload that + * Amazon S3 will wait before permanently removing all parts of the upload. For + * more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. * - * A typical handler may print log records to standard error, - * or write them to a file or database, or perhaps augment them - * with additional attributes and pass them on to another handler. + * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config + */ + type _subTtsCE = noSmithyDocumentSerde + interface AbortIncompleteMultipartUpload extends _subTtsCE { + /** + * Specifies the number of days after which Amazon S3 aborts an incomplete + * multipart upload. + */ + daysAfterInitiation?: number + } + /** + * The filter used to describe a set of objects for analyses. A filter must have + * exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no + * filter is provided, all objects will be considered in any analysis. * - * Any of the Handler's methods may be called concurrently with itself - * or with other methods. It is the responsibility of the Handler to - * manage this concurrency. + * The following types satisfy this interface: * - * Users of the slog package should not invoke Handler methods directly. - * They should use the methods of [Logger] instead. + * ``` + * AnalyticsFilterMemberAnd + * AnalyticsFilterMemberPrefix + * AnalyticsFilterMemberTag + * ``` */ - interface Handler { + interface AnalyticsFilter { [key:string]: any; + } + /** + * Specifies the information about the bucket that will be created. For more + * information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. + * + * This functionality is only supported by directory buckets. + * + * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + */ + type _suboDMoj = noSmithyDocumentSerde + interface BucketInfo extends _suboDMoj { /** - * Enabled reports whether the handler handles records at the given level. - * The handler ignores records whose level is lower. - * It is called early, before any arguments are processed, - * to save effort if the log event should be discarded. - * If called from a Logger method, the first argument is the context - * passed to that method, or context.Background() if nil was passed - * or the method does not take a context. - * The context is passed so Enabled can use its values - * to make a decision. + * The number of Availability Zone that's used for redundancy for the bucket. */ - enabled(_arg0: context.Context, _arg1: Level): boolean + dataRedundancy: DataRedundancy /** - * Handle handles the Record. - * It will only be called when Enabled returns true. - * The Context argument is as for Enabled. - * It is present solely to provide Handlers access to the context's values. - * Canceling the context should not affect record processing. - * (Among other things, log messages may be necessary to debug a - * cancellation-related problem.) + * The type of bucket. + */ + type: BucketType + } + /** + * Details of the parts that were uploaded. + */ + type _subThMsH = noSmithyDocumentSerde + interface CompletedPart extends _subThMsH { + /** + * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * Entity tag returned when the part was uploaded. + */ + eTag?: string + /** + * Part number that identifies the part. This is a positive integer between 1 and + * 10,000. * - * Handle methods that produce output should observe the following rules: * ``` - * - If r.Time is the zero time, ignore the time. - * - If r.PC is zero, ignore it. - * - Attr's values should be resolved. - * - If an Attr's key and value are both the zero value, ignore the Attr. - * This can be tested with attr.Equal(Attr{}). - * - If a group's key is empty, inline the group's Attrs. - * - If a group has no Attrs (even if it has a non-empty key), - * ignore it. + * - General purpose buckets - In CompleteMultipartUpload , when a additional + * checksum (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , + * x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is applied to each part, the + * PartNumber must start at 1 and the part numbers must be consecutive. + * Otherwise, Amazon S3 generates an HTTP 400 Bad Request status code and an + * InvalidPartOrder error code. + * + * - Directory buckets - In CompleteMultipartUpload , the PartNumber must start + * at 1 and the part numbers must be consecutive. * ``` */ - handle(_arg0: context.Context, _arg1: Record): void + partNumber?: number + } + /** + * A container for describing a condition that must be met for the specified + * redirect to apply. For example, 1. If request is for pages in the /docs folder, + * redirect to the /documents folder. 2. If request results in HTTP error 4xx, + * redirect request to another host where you might process the error. + */ + type _subslzCU = noSmithyDocumentSerde + interface Condition extends _subslzCU { /** - * WithAttrs returns a new Handler whose attributes consist of - * both the receiver's attributes and the arguments. - * The Handler owns the slice: it may retain, modify or discard it. + * The HTTP error code when the redirect is applied. In the event of an error, if + * the error code equals this value, then the specified redirect is applied. + * Required when parent element Condition is specified and sibling KeyPrefixEquals + * is not specified. If both are specified, then both must be true for the redirect + * to be applied. */ - withAttrs(attrs: Array): Handler + httpErrorCodeReturnedEquals?: string /** - * WithGroup returns a new Handler with the given group appended to - * the receiver's existing groups. - * The keys of all subsequent attributes, whether added by With or in a - * Record, should be qualified by the sequence of group names. + * The object key name prefix when the redirect is applied. For example, to + * redirect requests for ExamplePage.html , the key prefix will be ExamplePage.html + * . To redirect request for all pages with the prefix docs/ , the key prefix will + * be /docs , which identifies all objects in the docs/ folder. Required when the + * parent element Condition is specified and sibling HttpErrorCodeReturnedEquals + * is not specified. If both conditions are specified, both must be true for the + * redirect to be applied. * - * How this qualification happens is up to the Handler, so long as - * this Handler's attribute keys differ from those of another Handler - * with a different sequence of group names. + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. * - * A Handler should treat WithGroup as starting a Group of Attrs that ends - * at the end of the log event. That is, + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + */ + keyPrefixEquals?: string + } + /** + * Describes how an uncompressed comma-separated values (CSV)-formatted input + * object is formatted. + */ + type _subpoDVL = noSmithyDocumentSerde + interface CSVInput extends _subpoDVL { + /** + * Specifies that CSV field values may contain quoted record delimiters and such + * records should be allowed. Default value is FALSE. Setting this value to TRUE + * may lower performance. + */ + allowQuotedRecordDelimiter?: boolean + /** + * A single character used to indicate that a row should be ignored when the + * character is present at the start of that row. You can specify any character to + * indicate a comment line. The default character is # . + * + * Default: # + */ + comments?: string + /** + * A single character used to separate individual fields in a record. You can + * specify an arbitrary delimiter. + */ + fieldDelimiter?: string + /** + * Describes the first line of input. Valid values are: * * ``` - * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) + * - NONE : First line is not a header. + * + * - IGNORE : First line is a header, but you can't use the header values to + * indicate the column in an expression. You can use column position (such as _1, + * _2, …) to indicate the column ( SELECT s._1 FROM OBJECT s ). + * + * - Use : First line is a header, and you can use the header value to identify a + * column in an expression ( SELECT "name" FROM OBJECT ). * ``` + */ + fileHeaderInfo: FileHeaderInfo + /** + * A single character used for escaping when the field delimiter is part of the + * value. For example, if the value is a, b , Amazon S3 wraps this field value in + * quotation marks, as follows: " a , b " . * - * should behave like + * Type: String + * + * Default: " + * + * Ancestors: CSV + */ + quoteCharacter?: string + /** + * A single character used for escaping the quotation mark character inside an + * already escaped value. For example, the value """ a , b """ is parsed as " a , + * b " . + */ + quoteEscapeCharacter?: string + /** + * A single character used to separate individual records in the input. Instead of + * the default value, you can specify an arbitrary delimiter. + */ + recordDelimiter?: string + } + /** + * Describes how uncompressed comma-separated values (CSV)-formatted results are + * formatted. + */ + type _subADOJI = noSmithyDocumentSerde + interface CSVOutput extends _subADOJI { + /** + * The value used to separate individual fields in a record. You can specify an + * arbitrary delimiter. + */ + fieldDelimiter?: string + /** + * A single character used for escaping when the field delimiter is part of the + * value. For example, if the value is a, b , Amazon S3 wraps this field value in + * quotation marks, as follows: " a , b " . + */ + quoteCharacter?: string + /** + * The single character used for escaping the quote character inside an already + * escaped value. + */ + quoteEscapeCharacter?: string + /** + * Indicates whether to use quotation marks around output fields. * * ``` - * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) + * - ALWAYS : Always use quotation marks for output fields. + * + * - ASNEEDED : Use quotation marks for output fields when needed. * ``` + */ + quoteFields: QuoteFields + /** + * A single character used to separate individual records in the output. Instead + * of the default value, you can specify an arbitrary delimiter. + */ + recordDelimiter?: string + } + /** + * Container for S3 Glacier job parameters. + */ + type _subdFnGf = noSmithyDocumentSerde + interface GlacierJobParameters extends _subdFnGf { + /** + * Retrieval tier at which the restore will be processed. * - * If the name is empty, WithGroup returns the receiver. + * This member is required. */ - withGroup(name: string): Handler + tier: Tier + } + /** + * Container for the person being granted permissions. + */ + type _subWGHQu = noSmithyDocumentSerde + interface Grantee extends _subWGHQu { + /** + * Type of grantee + * + * This member is required. + */ + type: Type + /** + * Screen name of the grantee. + */ + displayName?: string + /** + * Email address of the grantee. + * + * Using email addresses to specify a grantee is only supported in the following + * Amazon Web Services Regions: + * + * ``` + * - US East (N. Virginia) + * + * - US West (N. California) + * + * - US West (Oregon) + * + * - Asia Pacific (Singapore) + * + * - Asia Pacific (Sydney) + * + * - Asia Pacific (Tokyo) + * + * - Europe (Ireland) + * + * - South America (São Paulo) + * ``` + * + * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints] in the + * Amazon Web Services General Reference. + * + * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + */ + emailAddress?: string + /** + * The canonical user ID of the grantee. + */ + id?: string + /** + * URI of the grantee group. + */ + uri?: string + } + /** + * The Filter is used to identify objects that the S3 Intelligent-Tiering + * configuration applies to. + */ + type _subjMqFn = noSmithyDocumentSerde + interface IntelligentTieringFilter extends _subjMqFn { + /** + * A conjunction (logical AND) of predicates, which is used in evaluating a + * metrics filter. The operator must have at least two predicates, and an object + * must match all of the predicates in order for the filter to apply. + */ + and?: IntelligentTieringAndOperator + /** + * An object key name prefix that identifies the subset of objects to which the + * rule applies. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + */ + prefix?: string + /** + * A container of a key value name pair. + */ + tag?: Tag + } + /** + * Specifies the inventory configuration for an Amazon S3 bucket. + */ + type _subNhQFG = noSmithyDocumentSerde + interface InventoryDestination extends _subNhQFG { + /** + * Contains the bucket name, file format, bucket owner (optional), and prefix + * (optional) where inventory results are published. + * + * This member is required. + */ + s3BucketDestination?: InventoryS3BucketDestination + } + /** + * Specifies an inventory filter. The inventory only includes objects that meet + * the filter's criteria. + */ + type _subaXFzR = noSmithyDocumentSerde + interface InventoryFilter extends _subaXFzR { + /** + * The prefix that an object must have to be included in the inventory results. + * + * This member is required. + */ + prefix?: string + } + /** + * Specifies the schedule for generating inventory results. + */ + type _subApprQ = noSmithyDocumentSerde + interface InventorySchedule extends _subApprQ { + /** + * Specifies how frequently inventory results are produced. + * + * This member is required. + */ + frequency: InventoryFrequency + } + /** + * Specifies JSON as object's input serialization format. + */ + type _subNlzgt = noSmithyDocumentSerde + interface JSONInput extends _subNlzgt { + /** + * The type of JSON. Valid values: Document, Lines. + */ + type: JSONType + } + /** + * Specifies JSON as request's output serialization format. + */ + type _subQMtYm = noSmithyDocumentSerde + interface JSONOutput extends _subQMtYm { + /** + * The value used to separate individual records in the output. If no value is + * specified, Amazon S3 uses a newline character ('\n'). + */ + recordDelimiter?: string + } + /** + * Container for the expiration for the lifecycle of the object. + * + * For more information see, [Managing your storage lifecycle] in the Amazon S3 User Guide. + * + * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html + */ + type _subvVmSu = noSmithyDocumentSerde + interface LifecycleExpiration extends _subvVmSu { + /** + * Indicates at what date the object is to be moved or deleted. The date value + * must conform to the ISO 8601 format. The time is always midnight UTC. + */ + date?: time.Time + /** + * Indicates the lifetime, in days, of the objects that are subject to the rule. + * The value must be a non-zero positive integer. + */ + days?: number + /** + * Indicates whether Amazon S3 will remove a delete marker with no noncurrent + * versions. If set to true, the delete marker will be expired; if set to false the + * policy takes no action. This cannot be specified with Days or Date in a + * Lifecycle Expiration Policy. + */ + expiredObjectDeleteMarker?: boolean + } + /** + * The Filter is used to identify objects that a Lifecycle Rule applies to. A + * Filter can have exactly one of Prefix , Tag , ObjectSizeGreaterThan , + * ObjectSizeLessThan , or And specified. If the Filter element is left empty, the + * Lifecycle Rule applies to all objects in the bucket. + * + * The following types satisfy this interface: + * + * ``` + * LifecycleRuleFilterMemberAnd + * LifecycleRuleFilterMemberObjectSizeGreaterThan + * LifecycleRuleFilterMemberObjectSizeLessThan + * LifecycleRuleFilterMemberPrefix + * LifecycleRuleFilterMemberTag + * ``` + */ + interface LifecycleRuleFilter { + [key:string]: any; + } + /** + * Specifies the location where the bucket will be created. + * + * For directory buckets, the location type is Availability Zone. For more + * information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. + * + * This functionality is only supported by directory buckets. + * + * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + */ + type _subGUAJG = noSmithyDocumentSerde + interface LocationInfo extends _subGUAJG { + /** + * The name of the location where the bucket will be created. + * + * For directory buckets, the name of the location is the AZ ID of the + * Availability Zone where the bucket will be created. An example AZ ID value is + * usw2-az1 . + */ + name?: string + /** + * The type of location where the bucket will be created. + */ + type: LocationType + } + /** + * Specifies a metrics configuration filter. The metrics configuration only + * includes objects that meet the filter's criteria. A filter must be a prefix, an + * object tag, an access point ARN, or a conjunction (MetricsAndOperator). For more + * information, see [PutBucketMetricsConfiguration]. + * + * The following types satisfy this interface: + * + * ``` + * MetricsFilterMemberAccessPointArn + * MetricsFilterMemberAnd + * MetricsFilterMemberPrefix + * MetricsFilterMemberTag + * ``` + * + * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + */ + interface MetricsFilter { + [key:string]: any; } /** - * A Level is the importance or severity of a log event. - * The higher the level, the more important or severe the event. + * Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 + * permanently deletes the noncurrent object versions. You set this lifecycle + * configuration action on a bucket that has versioning enabled (or suspended) to + * request that Amazon S3 delete noncurrent object versions at a specific period in + * the object's lifetime. */ - interface Level extends Number{} - interface Level { + type _subPKzco = noSmithyDocumentSerde + interface NoncurrentVersionExpiration extends _subPKzco { /** - * String returns a name for the level. - * If the level has a name, then that name - * in uppercase is returned. - * If the level is between named values, then - * an integer is appended to the uppercased name. - * Examples: + * Specifies how many noncurrent versions Amazon S3 will retain. You can specify + * up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any + * additional noncurrent versions beyond the specified number to retain. For more + * information about noncurrent versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. * - * ``` - * LevelWarn.String() => "WARN" - * (LevelInfo+2).String() => "INFO+2" - * ``` + * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html */ - string(): string - } - interface Level { + newerNoncurrentVersions?: number /** - * MarshalJSON implements [encoding/json.Marshaler] - * by quoting the output of [Level.String]. + * Specifies the number of days an object is noncurrent before Amazon S3 can + * perform the associated action. The value must be a non-zero positive integer. + * For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent]in the Amazon S3 + * User Guide. + * + * [How Amazon S3 Calculates When an Object Became Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations */ - marshalJSON(): string|Array + noncurrentDays?: number } - interface Level { + /** + * Container for the transition rule that describes when noncurrent objects + * transition to the STANDARD_IA , ONEZONE_IA , INTELLIGENT_TIERING , GLACIER_IR , + * GLACIER , or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled + * (or versioning is suspended), you can set this action to request that Amazon S3 + * transition noncurrent object versions to the STANDARD_IA , ONEZONE_IA , + * INTELLIGENT_TIERING , GLACIER_IR , GLACIER , or DEEP_ARCHIVE storage class at a + * specific period in the object's lifetime. + */ + type _subDHdHp = noSmithyDocumentSerde + interface NoncurrentVersionTransition extends _subDHdHp { /** - * UnmarshalJSON implements [encoding/json.Unmarshaler] - * It accepts any string produced by [Level.MarshalJSON], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". + * Specifies how many noncurrent versions Amazon S3 will retain in the same + * storage class before transitioning objects. You can specify up to 100 noncurrent + * versions to retain. Amazon S3 will transition any additional noncurrent versions + * beyond the specified number to retain. For more information about noncurrent + * versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. + * + * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html */ - unmarshalJSON(data: string|Array): void - } - interface Level { + newerNoncurrentVersions?: number /** - * MarshalText implements [encoding.TextMarshaler] - * by calling [Level.String]. + * Specifies the number of days an object is noncurrent before Amazon S3 can + * perform the associated action. For information about the noncurrent days + * calculations, see [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]in the Amazon S3 User Guide. + * + * [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations */ - marshalText(): string|Array - } - interface Level { + noncurrentDays?: number /** - * UnmarshalText implements [encoding.TextUnmarshaler]. - * It accepts any string produced by [Level.MarshalText], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". + * The class of storage used to store the object. */ - unmarshalText(data: string|Array): void + storageClass: TransitionStorageClass } - interface Level { + /** + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + * + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html + */ + type _sublsXwL = noSmithyDocumentSerde + interface NotificationConfigurationFilter extends _sublsXwL { /** - * Level returns the receiver. - * It implements [Leveler]. + * A container for object key name prefix and suffix filtering rules. */ - level(): Level + key?: S3KeyFilter } - // @ts-ignore - import loginternal = internal -} - -namespace hook { /** - * Handler defines a hook handler function. + * Object Identifier is unique value to identify objects. */ - interface Handler {(e: T): void } + type _subUoIpQ = noSmithyDocumentSerde + interface ObjectIdentifier extends _subUoIpQ { + /** + * Key name of the object. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * This member is required. + */ + key?: string + /** + * Version ID for the specific version of the object to delete. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + } /** - * wrapped local Hook embedded struct to limit the public API surface. + * The container element for an Object Lock rule. */ - type _subBldse = Hook - interface mainHook extends _subBldse { - } -} - -/** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. - */ -namespace core { - interface BaseModelEvent { - model: models.Model - } - interface BaseModelEvent { - tags(): Array - } - interface BaseCollectionEvent { - collection?: models.Collection - } - interface BaseCollectionEvent { - tags(): Array + type _subBMdqo = noSmithyDocumentSerde + interface ObjectLockRule extends _subBMdqo { + /** + * The default Object Lock retention mode and period that you want to apply to new + * objects placed in the specified bucket. Bucket settings require both a mode and + * a period. The period can be either Days or Years but you must select one. You + * cannot specify Days and Years at the same time. + */ + defaultRetention?: DefaultRetention } -} - -/** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. - */ -namespace bufio { /** - * Reader implements buffering for an io.Reader object. + * A container for elements related to an individual part. */ - interface Reader { - } - interface Reader { + type _subfIADH = noSmithyDocumentSerde + interface ObjectPart extends _subfIADH { /** - * Size returns the size of the underlying buffer in bytes. + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html */ - size(): number - } - interface Reader { + checksumCRC32?: string /** - * Reset discards any buffered data, resets all state, and switches - * the buffered reader to read from r. - * Calling Reset on the zero value of [Reader] initializes the internal buffer - * to the default size. - * Calling b.Reset(b) (that is, resetting a [Reader] to itself) does nothing. + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums */ - reset(r: io.Reader): void - } - interface Reader { + checksumCRC32C?: string /** - * Peek returns the next n bytes without advancing the reader. The bytes stop - * being valid at the next read call. If Peek returns fewer than n bytes, it - * also returns an error explaining why the read is short. The error is - * [ErrBufferFull] if n is larger than b's buffer size. + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. * - * Calling Peek prevents a [Reader.UnreadByte] or [Reader.UnreadRune] call from succeeding - * until the next read operation. + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums */ - peek(n: number): string|Array - } - interface Reader { + checksumSHA1?: string /** - * Discard skips the next n bytes, returning the number of bytes discarded. + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. * - * If Discard skips fewer than n bytes, it also returns an error. - * If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without - * reading from the underlying io.Reader. + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums */ - discard(n: number): number - } - interface Reader { + checksumSHA256?: string /** - * Read reads data into p. - * It returns the number of bytes read into p. - * The bytes are taken from at most one Read on the underlying [Reader], - * hence n may be less than len(p). - * To read exactly len(p) bytes, use io.ReadFull(b, p). - * If the underlying [Reader] can return a non-zero count with io.EOF, - * then this Read method can do so as well; see the [io.Reader] docs. + * The part number identifying the part. This value is a positive integer between + * 1 and 10,000. */ - read(p: string|Array): number + partNumber?: number + /** + * The size of the uploaded part in bytes. + */ + size?: number } - interface Reader { + /** + * Describes the location where the restore job's output is stored. + */ + type _subPZwEh = noSmithyDocumentSerde + interface OutputLocation extends _subPZwEh { /** - * ReadByte reads and returns a single byte. - * If no byte is available, returns an error. + * Describes an S3 location that will receive the results of the restore request. */ - readByte(): number + s3?: S3Location } - interface Reader { + /** + * The container element for an ownership control rule. + */ + type _subfpwaA = noSmithyDocumentSerde + interface OwnershipControlsRule extends _subfpwaA { /** - * UnreadByte unreads the last byte. Only the most recently read byte can be unread. + * The container element for object ownership for a bucket's ownership controls. * - * UnreadByte returns an error if the most recent method called on the - * [Reader] was not a read operation. Notably, [Reader.Peek], [Reader.Discard], and [Reader.WriteTo] are not - * considered read operations. + * BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the + * bucket owner if the objects are uploaded with the bucket-owner-full-control + * canned ACL. + * + * ObjectWriter - The uploading account will own the object if the object is + * uploaded with the bucket-owner-full-control canned ACL. + * + * BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer + * affect permissions. The bucket owner automatically owns and has full control + * over every object in the bucket. The bucket only accepts PUT requests that don't + * specify an ACL or specify bucket owner full control ACLs (such as the predefined + * bucket-owner-full-control canned ACL or a custom ACL in XML format that grants + * the same permissions). + * + * By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are + * disabled. We recommend keeping ACLs disabled, except in uncommon use cases where + * you must control access for each object individually. For more information about + * S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. Directory buckets + * use the bucket owner enforced setting for S3 Object Ownership. + * + * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * + * This member is required. */ - unreadByte(): void + objectOwnership: ObjectOwnership } - interface Reader { + /** + * Container for Parquet. + */ + type _subpytOv = noSmithyDocumentSerde + interface ParquetInput extends _subpytOv { + } + /** + * Specifies how requests are redirected. In the event of an error, you can + * specify a different error code to return. + */ + type _subJWrUl = noSmithyDocumentSerde + interface Redirect extends _subJWrUl { /** - * ReadRune reads a single UTF-8 encoded Unicode character and returns the - * rune and its size in bytes. If the encoded rune is invalid, it consumes one byte - * and returns unicode.ReplacementChar (U+FFFD) with a size of 1. + * The host name to use in the redirect request. */ - readRune(): [number, number] - } - interface Reader { + hostName?: string /** - * UnreadRune unreads the last rune. If the most recent method called on - * the [Reader] was not a [Reader.ReadRune], [Reader.UnreadRune] returns an error. (In this - * regard it is stricter than [Reader.UnreadByte], which will unread the last byte - * from any read operation.) + * The HTTP redirect code to use on the response. Not required if one of the + * siblings is present. */ - unreadRune(): void - } - interface Reader { + httpRedirectCode?: string /** - * Buffered returns the number of bytes that can be read from the current buffer. + * Protocol to use when redirecting requests. The default is the protocol that is + * used in the original request. */ - buffered(): number - } - interface Reader { + protocol: Protocol /** - * ReadSlice reads until the first occurrence of delim in the input, - * returning a slice pointing at the bytes in the buffer. - * The bytes stop being valid at the next read. - * If ReadSlice encounters an error before finding a delimiter, - * it returns all the data in the buffer and the error itself (often io.EOF). - * ReadSlice fails with error [ErrBufferFull] if the buffer fills without a delim. - * Because the data returned from ReadSlice will be overwritten - * by the next I/O operation, most clients should use - * [Reader.ReadBytes] or ReadString instead. - * ReadSlice returns err != nil if and only if line does not end in delim. + * The object key prefix to use in the redirect request. For example, to redirect + * requests for all pages with prefix docs/ (objects in the docs/ folder) to + * documents/ , you can set a condition block with KeyPrefixEquals set to docs/ + * and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one + * of the siblings is present. Can be present only if ReplaceKeyWith is not + * provided. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints */ - readSlice(delim: number): string|Array - } - interface Reader { + replaceKeyPrefixWith?: string /** - * ReadLine is a low-level line-reading primitive. Most callers should use - * [Reader.ReadBytes]('\n') or [Reader.ReadString]('\n') instead or use a [Scanner]. + * The specific object key to use in the redirect request. For example, redirect + * request to error.html . Not required if one of the siblings is present. Can be + * present only if ReplaceKeyPrefixWith is not provided. * - * ReadLine tries to return a single line, not including the end-of-line bytes. - * If the line was too long for the buffer then isPrefix is set and the - * beginning of the line is returned. The rest of the line will be returned - * from future calls. isPrefix will be false when returning the last fragment - * of the line. The returned buffer is only valid until the next call to - * ReadLine. ReadLine either returns a non-nil line or it returns an error, - * never both. + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. * - * The text returned from ReadLine does not include the line end ("\r\n" or "\n"). - * No indication or error is given if the input ends without a final line end. - * Calling [Reader.UnreadByte] after ReadLine will always unread the last byte read - * (possibly a character belonging to the line end) even if that byte is not - * part of the line returned by ReadLine. + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints */ - readLine(): [string|Array, boolean] + replaceKeyWith?: string } - interface Reader { + /** + * Specifies which Amazon S3 objects to replicate and where to store the replicas. + */ + type _subXbQuq = noSmithyDocumentSerde + interface ReplicationRule extends _subXbQuq { /** - * ReadBytes reads until the first occurrence of delim in the input, - * returning a slice containing the data up to and including the delimiter. - * If ReadBytes encounters an error before finding a delimiter, - * it returns the data read before the error and the error itself (often io.EOF). - * ReadBytes returns err != nil if and only if the returned data does not end in - * delim. - * For simple uses, a Scanner may be more convenient. + * A container for information about the replication destination and its + * configurations including enabling the S3 Replication Time Control (S3 RTC). + * + * This member is required. */ - readBytes(delim: number): string|Array - } - interface Reader { + destination?: Destination /** - * ReadString reads until the first occurrence of delim in the input, - * returning a string containing the data up to and including the delimiter. - * If ReadString encounters an error before finding a delimiter, - * it returns the data read before the error and the error itself (often io.EOF). - * ReadString returns err != nil if and only if the returned data does not end in - * delim. - * For simple uses, a Scanner may be more convenient. + * Specifies whether the rule is enabled. + * + * This member is required. + */ + status: ReplicationRuleStatus + /** + * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter + * in your replication configuration, you must also include a + * DeleteMarkerReplication element. If your Filter includes a Tag element, the + * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does + * not support replicating delete markers for tag-based rules. For an example + * configuration, see [Basic Rule Configuration]. + * + * For more information about delete marker replication, see [Basic Rule Configuration]. + * + * If you are using an earlier version of the replication configuration, Amazon S3 + * handles replication of delete markers differently. For more information, see [Backward Compatibility]. + * + * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html + * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations + */ + deleteMarkerReplication?: DeleteMarkerReplication + /** + * Optional configuration to replicate existing source bucket objects. + * + * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in + * the Amazon S3 User Guide. + * + * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html + */ + existingObjectReplication?: ExistingObjectReplication + /** + * A filter that identifies the subset of objects to which the replication rule + * applies. A Filter must specify exactly one Prefix , Tag , or an And child + * element. + */ + filter: ReplicationRuleFilter + /** + * A unique identifier for the rule. The maximum value is 255 characters. + */ + id?: string + /** + * An object key name prefix that identifies the object or objects to which the + * rule applies. The maximum prefix length is 1,024 characters. To include all + * objects in a bucket, specify an empty string. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * Deprecated: This member has been deprecated. */ - readString(delim: number): string - } - interface Reader { + prefix?: string /** - * WriteTo implements io.WriterTo. - * This may make multiple calls to the [Reader.Read] method of the underlying [Reader]. - * If the underlying reader supports the [Reader.WriteTo] method, - * this calls the underlying [Reader.WriteTo] without buffering. + * The priority indicates which rule has precedence whenever two or more + * replication rules conflict. Amazon S3 will attempt to replicate objects + * according to all replication rules. However, if there are two or more rules with + * the same destination bucket, then objects will be replicated according to the + * rule with the highest priority. The higher the number, the higher the priority. + * + * For more information, see [Replication] in the Amazon S3 User Guide. + * + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html */ - writeTo(w: io.Writer): number + priority?: number + /** + * A container that describes additional filters for identifying the source + * objects that you want to replicate. You can choose to enable or disable the + * replication of these objects. Currently, Amazon S3 supports only the filter that + * you can specify for objects created with server-side encryption using a customer + * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). + */ + sourceSelectionCriteria?: SourceSelectionCriteria } /** - * Writer implements buffering for an [io.Writer] object. - * If an error occurs writing to a [Writer], no more data will be - * accepted and all subsequent writes, and [Writer.Flush], will return the error. - * After all data has been written, the client should call the - * [Writer.Flush] method to guarantee all data has been forwarded to - * the underlying [io.Writer]. + * Specifies the restoration status of an object. Objects in certain storage + * classes must be restored before they can be retrieved. For more information + * about these storage classes and how to work with archived objects, see [Working with archived objects]in the + * Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. Only the S3 Express + * One Zone storage class is supported by directory buckets to store objects. + * + * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html */ - interface Writer { - } - interface Writer { + type _subFCSIN = noSmithyDocumentSerde + interface RestoreStatus extends _subFCSIN { /** - * Size returns the size of the underlying buffer in bytes. + * Specifies whether the object is currently being restored. If the object + * restoration is in progress, the header returns the value TRUE . For example: + * + * ``` + * x-amz-optional-object-attributes: IsRestoreInProgress="true" + * ``` + * + * If the object restoration has completed, the header returns the value FALSE . + * For example: + * + * ``` + * x-amz-optional-object-attributes: IsRestoreInProgress="false", + * RestoreExpiryDate="2012-12-21T00:00:00.000Z" + * ``` + * + * If the object hasn't been restored, there is no header response. */ - size(): number - } - interface Writer { + isRestoreInProgress?: boolean /** - * Reset discards any unflushed buffered data, clears any error, and - * resets b to write its output to w. - * Calling Reset on the zero value of [Writer] initializes the internal buffer - * to the default size. - * Calling w.Reset(w) (that is, resetting a [Writer] to itself) does nothing. + * Indicates when the restored copy will expire. This value is populated only if + * the object has already been restored. For example: + * + * ``` + * x-amz-optional-object-attributes: IsRestoreInProgress="false", + * RestoreExpiryDate="2012-12-21T00:00:00.000Z" + * ``` */ - reset(w: io.Writer): void + restoreExpiryDate?: time.Time } - interface Writer { + /** + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Describes the parameters for Select job types. + * + * Learn [How to optimize querying your data in Amazon S3] using [Amazon Athena], [S3 Object Lambda], or client-side filtering. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [How to optimize querying your data in Amazon S3]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [Amazon Athena]: https://docs.aws.amazon.com/athena/latest/ug/what-is.html + * [S3 Object Lambda]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html + */ + type _subrGrMG = noSmithyDocumentSerde + interface SelectParameters extends _subrGrMG { /** - * Flush writes any buffered data to the underlying [io.Writer]. + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * The expression that is used to query the object. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * + * This member is required. */ - flush(): void - } - interface Writer { + expression?: string /** - * Available returns how many bytes are unused in the buffer. + * The type of the provided expression (for example, SQL). + * + * This member is required. */ - available(): number - } - interface Writer { + expressionType: ExpressionType /** - * AvailableBuffer returns an empty buffer with b.Available() capacity. - * This buffer is intended to be appended to and - * passed to an immediately succeeding [Writer.Write] call. - * The buffer is only valid until the next write operation on b. + * Describes the serialization format of the object. + * + * This member is required. */ - availableBuffer(): string|Array - } - interface Writer { + inputSerialization?: InputSerialization /** - * Buffered returns the number of bytes that have been written into the current buffer. + * Describes how the results of the Select job are serialized. + * + * This member is required. */ - buffered(): number + outputSerialization?: OutputSerialization } - interface Writer { + /** + * Specifies the default server-side encryption configuration. + * + * ``` + * - General purpose buckets - If you're specifying a customer managed KMS key, + * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias + * instead, then KMS resolves the key within the requester’s account. This behavior + * can result in data that's encrypted with a KMS key that belongs to the + * requester, and not the bucket owner. + * + * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory + * bucket, only use the key ID or key ARN. The key alias format of the KMS key + * isn't supported. + * ``` + * + * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + */ + type _subdvukF = noSmithyDocumentSerde + interface ServerSideEncryptionRule extends _subdvukF { /** - * Write writes the contents of p into the buffer. - * It returns the number of bytes written. - * If nn < len(p), it also returns an error explaining - * why the write is short. + * Specifies the default server-side encryption to apply to new objects in the + * bucket. If a PUT Object request doesn't specify any server-side encryption, this + * default encryption will be applied. */ - write(p: string|Array): number - } - interface Writer { + applyServerSideEncryptionByDefault?: ServerSideEncryptionByDefault /** - * WriteByte writes a single byte. + * Specifies whether Amazon S3 should use an S3 Bucket Key with server-side + * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects + * are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 + * to use an S3 Bucket Key. + * + * ``` + * - General purpose buckets - By default, S3 Bucket Key is not enabled. For + * more information, see [Amazon S3 Bucket Keys]in the Amazon S3 User Guide. + * + * - Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + * supported, when you copy SSE-KMS encrypted objects from general purpose buckets + * to directory buckets, from directory buckets to general purpose buckets, or + * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + * call to KMS every time a copy request is made for a KMS-encrypted object. + * ``` + * + * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops */ - writeByte(c: number): void + bucketKeyEnabled?: boolean } - interface Writer { + /** + * Specifies data related to access patterns to be collected and made available to + * analyze the tradeoffs between different storage classes for an Amazon S3 bucket. + */ + type _subsJjAW = noSmithyDocumentSerde + interface StorageClassAnalysis extends _subsJjAW { /** - * WriteRune writes a single Unicode code point, returning - * the number of bytes written and any error. + * Specifies how data related to the storage class analysis for an Amazon S3 + * bucket should be exported. */ - writeRune(r: number): number + dataExport?: StorageClassAnalysisDataExport } - interface Writer { + /** + * Container for granting information. + * + * Buckets that use the bucket owner enforced setting for Object Ownership don't + * support target grants. For more information, see [Permissions server access log delivery]in the Amazon S3 User Guide. + * + * [Permissions server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general + */ + type _subZctQi = noSmithyDocumentSerde + interface TargetGrant extends _subZctQi { /** - * WriteString writes a string. - * It returns the number of bytes written. - * If the count is less than len(s), it also returns an error explaining - * why the write is short. + * Container for the person being granted permissions. */ - writeString(s: string): number - } - interface Writer { + grantee?: Grantee /** - * ReadFrom implements [io.ReaderFrom]. If the underlying writer - * supports the ReadFrom method, this calls the underlying ReadFrom. - * If there is buffered data and an underlying ReadFrom, this fills - * the buffer and writes it before calling ReadFrom. + * Logging permissions assigned to the grantee for the bucket. */ - readFrom(r: io.Reader): number + permission: BucketLogsPermission } -} - -/** - * Package mail implements parsing of mail messages. - * - * For the most part, this package follows the syntax as specified by RFC 5322 and - * extended by RFC 6532. - * Notable divergences: - * ``` - * - Obsolete address formats are not parsed, including addresses with - * embedded route information. - * - The full range of spacing (the CFWS syntax element) is not supported, - * such as breaking addresses across lines. - * - No unicode normalization is performed. - * - The special characters ()[]:;@\, are allowed to appear unquoted in names. - * - A leading From line is permitted, as in mbox format (RFC 4155). - * ``` - */ -namespace mail { /** - * Address represents a single mail address. - * An address such as "Barry Gibbs " is represented - * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. + * Amazon S3 key format for log objects. Only one format, PartitionedPrefix or + * SimplePrefix, is allowed. */ - interface Address { - name: string // Proper name; may be empty. - address: string // user@domain - } - interface Address { + type _subGqccM = noSmithyDocumentSerde + interface TargetObjectKeyFormat extends _subGqccM { /** - * String formats the address as a valid RFC 5322 address. - * If the address's name contains non-ASCII characters - * the name will be rendered according to RFC 2047. + * Partitioned S3 key for log objects. */ - string(): string - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { -} - -namespace search { -} - -namespace subscriptions { -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` - * slog.SetDefault(logger) - * ``` - * - * will cause the top-level functions like [Info] to use it. - * [SetDefault] also updates the default logger used by the [log] package, - * so that existing applications that use [log.Printf] and related functions - * will send log records to the logger's handler without needing to be rewritten. + partitionedPrefix?: PartitionedPrefix + /** + * To use the simple format for S3 keys for log objects. To specify SimplePrefix + * format, set SimplePrefix to {}. + */ + simplePrefix?: SimplePrefix + } + /** + * The S3 Intelligent-Tiering storage class is designed to optimize storage costs + * by automatically moving data to the most cost-effective storage access tier, + * without additional operational overhead. + */ + type _subpntPW = noSmithyDocumentSerde + interface Tiering extends _subpntPW { + /** + * S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently accessed objects] for a list of access tiers in the S3 + * Intelligent-Tiering storage class. + * + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + * + * This member is required. + */ + accessTier: IntelligentTieringAccessTier + /** + * The number of consecutive days of no access after which an object will be + * eligible to be transitioned to the corresponding tier. The minimum number of + * days specified for Archive Access tier must be at least 90 days and Deep Archive + * Access tier must be at least 180 days. The maximum can be up to 2 years (730 + * days). + * + * This member is required. + */ + days?: number + } + /** + * Specifies when an object transitions to a specified storage class. For more + * information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 Lifecycle]in the Amazon S3 + * User Guide. + * + * [Transitioning Objects Using Amazon S3 Lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html + */ + type _subTFGzr = noSmithyDocumentSerde + interface Transition extends _subTFGzr { + /** + * Indicates when objects are transitioned to the specified storage class. The + * date value must be in ISO 8601 format. The time is always midnight UTC. + */ + date?: time.Time + /** + * Indicates the number of days after creation when objects are transitioned to + * the specified storage class. The value must be a positive integer. + */ + days?: number + /** + * The storage class to which you want the object to transition. + */ + storageClass: TransitionStorageClass + } + interface noSmithyDocumentSerde extends smithydocument.NoSerde{} +} + +/** + * Package customizations provides customizations for the Amazon S3 API client. * - * Some attributes are common to many log calls. - * For example, you may wish to include the URL or trace identifier of a server request - * with all log events arising from the request. - * Rather than repeat the attribute with every log call, you can use [Logger.With] - * to construct a new Logger containing the attributes: + * This package provides support for following S3 customizations * * ``` - * logger2 := logger.With("url", r.URL) - * ``` - * - * The arguments to With are the same key-value pairs used in [Logger.Info]. - * The result is a new Logger with the same handler as the original, but additional - * attributes that will appear in the output of every call. - * - * # Levels - * - * A [Level] is an integer representing the importance or severity of a log event. - * The higher the level, the more severe the event. - * This package defines constants for the most common levels, - * but any int can be used as a level. + * ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type * - * In an application, you may wish to log messages only at a certain level or greater. - * One common configuration is to log messages at Info or higher levels, - * suppressing debug logging until it is needed. - * The built-in handlers can be configured with the minimum level to output by - * setting [HandlerOptions.Level]. - * The program's `main` function typically does this. - * The default value is LevelInfo. + * UpdateEndpoint Middleware: resolves a custom endpoint as per s3 config options * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: + * RemoveBucket Middleware: removes a serialized bucket name from request url path * + * processResponseWith200Error Middleware: Deserializing response error with 200 status code * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` + * # Virtual Host style url addressing * - * Now the program can change its logging level with a single statement: + * Since serializers serialize by default as path style url, we use customization + * to modify the endpoint url when `UsePathStyle` option on S3Client is unset or + * false. This flag will be ignored if `UseAccelerate` option is set to true. * - * ``` - * programLevel.Set(slog.LevelDebug) - * ``` + * If UseAccelerate is not enabled, and the bucket name is not a valid hostname + * label, they SDK will fallback to forcing the request to be made as if + * UsePathStyle was enabled. This behavior is also used if UseDualStackEndpoint is enabled. * - * # Groups + * https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html#dual-stack-endpoints-description * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * # Transfer acceleration * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * By default S3 Transfer acceleration support is disabled. By enabling `UseAccelerate` + * option on S3Client, one can enable s3 transfer acceleration support. Transfer + * acceleration only works with Virtual Host style addressing, and thus `UsePathStyle` + * option if set is ignored. Transfer acceleration is not supported for S3 operations + * DeleteBucket, ListBuckets, and CreateBucket. * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` + * # Dualstack support * - * TextHandler would display this group as + * By default dualstack support for s3 client is disabled. By enabling `UseDualstack` + * option on s3 client, you can enable dualstack endpoint support. * - * ``` - * request.method=GET request.url=http://example.com - * ``` + * # Endpoint customizations * - * JSONHandler would display it as + * Customizations to lookup ARN, process ARN needs to happen before request serialization. + * UpdateEndpoint middleware which mutates resources based on Options such as + * UseDualstack, UseAccelerate for modifying resolved endpoint are executed after + * request serialization. Remove bucket middleware is executed after + * an request is serialized, and removes the serialized bucket name from request path * * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. + * Middleware layering: * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: + * Initialize : HTTP Request -> ARN Lookup -> Input-Validation -> Serialize step * + * Serialize : HTTP Request -> Process ARN -> operation serializer -> Update-Endpoint customization -> Remove-Bucket -> next middleware * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, + * Customization options: * * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement + * UseARNRegion (Disabled by Default) * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` + * UsePathStyle (Disabled by Default) * - * behaves the same as + * UseAccelerate (Disabled by Default) * + * UseDualstack (Disabled by Default) * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. * - * The call + * # Handle Error response with 200 status code * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` + * S3 operations: CopyObject, CompleteMultipartUpload, UploadPartCopy can have an + * error Response with status code 2xx. The processResponseWith200Error middleware + * customizations enables SDK to check for an error within response body prior to + * deserialization. * - * is the most efficient way to achieve the same output as + * As the check for 2xx response containing an error needs to be performed earlier + * than response deserialization. Since the behavior of Deserialization is in + * reverse order to the other stack steps its easier to consider that "after" means + * "before". * * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: + * Middleware layering: * + * HTTP Response -> handle 200 error customization -> deserialize * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: + */ +namespace customizations { + // @ts-ignore + import internalauthsmithy = smithy + /** + * S3ExpressCredentialsProvider retrieves credentials for the S3Express storage + * class. + */ + interface S3ExpressCredentialsProvider { + [key:string]: any; + retrieve(ctx: context.Context, bucket: string): aws.Credentials + } + // @ts-ignore + import ictx = context + // @ts-ignore + import v4 = signer + // @ts-ignore + import smithyhttp = http + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import s3arn = arn + // @ts-ignore + import internalendpoints = endpoints +} + +/** + * Package mail implements parsing of mail messages. * + * For the most part, this package follows the syntax as specified by RFC 5322 and + * extended by RFC 6532. + * Notable divergences: * ``` - * Infof(slog.Default(), "hello, %s", "world") + * - Obsolete address formats are not parsed, including addresses with + * embedded route information. + * - The full range of spacing (the CFWS syntax element) is not supported, + * such as breaking addresses across lines. + * - No unicode normalization is performed. + * - A leading From line is permitted, as in mbox format (RFC 4155). * ``` + */ +namespace mail { + /** + * Address represents a single mail address. + * An address such as "Barry Gibbs " is represented + * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. + */ + interface Address { + name: string // Proper name; may be empty. + address: string // user@domain + } + interface Address { + /** + * String formats the address as a valid RFC 5322 address. + * If the address's name contains non-ASCII characters + * the name will be rendered according to RFC 2047. + */ + string(): string + } +} + +namespace endpoints { + /** + * Endpoint is the endpoint object returned by Endpoint resolution V2 + */ + interface Endpoint { + /** + * The complete URL minimally specfiying the scheme and host. + * May optionally specify the port and base path component. + */ + uri: url.URL + /** + * An optional set of headers to be sent using transport layer headers. + */ + headers: http.Header + /** + * A grab-bag property map of endpoint attributes. The + * values present here are subject to change, or being add/removed at any + * time. + */ + properties: smithy.Properties + } +} + +/** + * Package s3 provides the API client, operations, and parameter types for Amazon + * Simple Storage Service. + */ +namespace s3 { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import awshttp = http + // @ts-ignore + import internalauth = auth + // @ts-ignore + import internalauthsmithy = smithy + // @ts-ignore + import internalConfig = configsources + // @ts-ignore + import internalmiddleware = middleware + // @ts-ignore + import acceptencodingcust = accept_encoding + // @ts-ignore + import internalChecksum = checksum + // @ts-ignore + import presignedurlcust = presigned_url + // @ts-ignore + import s3sharedconfig = config + // @ts-ignore + import s3cust = customizations + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithyauth = auth + // @ts-ignore + import smithydocument = document + // @ts-ignore + import smithyhttp = http + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import smithyio = io + // @ts-ignore + import smithytime = time + // @ts-ignore + import smithywaiter = waiter + // @ts-ignore + import smithysync = sync + /** + * AuthResolverParameters contains the set of inputs necessary for auth scheme + * resolution. + */ + interface AuthResolverParameters { + /** + * The name of the operation being invoked. + */ + operation: string + /** + * The region in which the operation is being invoked. + */ + region: string + } + // @ts-ignore + import internalcontext = context + // @ts-ignore + import awsxml = xml + // @ts-ignore + import internalendpoints = endpoints + // @ts-ignore + import smithyendpoints = endpoints + /** + * EndpointParameters provides the parameters that influence how endpoints are + * resolved. + */ + interface EndpointParameters { + /** + * The S3 bucket used to send the request. This is an optional parameter that will + * be set automatically for operations that are scoped to an S3 bucket. + * + * Parameter + * is required. + */ + bucket?: string + /** + * The AWS region used to dispatch the request. + * + * Parameter is + * required. + * + * AWS::Region + */ + region?: string + /** + * When true, send this request to the FIPS-compliant regional endpoint. If the + * configured endpoint does not have a FIPS compliant endpoint, dispatching the + * request will return an error. + * + * Defaults to false if no value is + * provided. + * + * AWS::UseFIPS + */ + useFIPS?: boolean + /** + * When true, use the dual-stack endpoint. If the configured endpoint does not + * support dual-stack, dispatching the request MAY return an error. + * + * Defaults to + * false if no value is provided. + * + * AWS::UseDualStack + */ + useDualStack?: boolean + /** + * Override the endpoint used to send this request + * + * Parameter is + * required. + * + * SDK::Endpoint + */ + endpoint?: string + /** + * When true, force a path-style endpoint to be used where the bucket name is part + * of the path. + * + * Defaults to false if no value is + * provided. + * + * AWS::S3::ForcePathStyle + */ + forcePathStyle?: boolean + /** + * When true, use S3 Accelerate. NOTE: Not all regions support S3 + * accelerate. + * + * Defaults to false if no value is provided. + * + * AWS::S3::Accelerate + */ + accelerate?: boolean + /** + * Whether the global endpoint should be used, rather then the regional endpoint + * for us-east-1. + * + * Defaults to false if no value is + * provided. + * + * AWS::S3::UseGlobalEndpoint + */ + useGlobalEndpoint?: boolean + /** + * Internal parameter to use object lambda endpoint for an operation (eg: + * WriteGetObjectResponse) + * + * Parameter is required. + */ + useObjectLambdaEndpoint?: boolean + /** + * The S3 Key used to send the request. This is an optional parameter that will be + * set automatically for operations that are scoped to an S3 Key. + * + * Parameter is + * required. + */ + key?: string + /** + * The S3 Prefix used to send the request. This is an optional parameter that will + * be set automatically for operations that are scoped to an S3 Prefix. + * + * Parameter + * is required. + */ + prefix?: string + /** + * The Copy Source used for Copy Object request. This is an optional parameter that + * will be set automatically for operations that are scoped to Copy + * Source. + * + * Parameter is required. + */ + copySource?: string + /** + * Internal parameter to disable Access Point Buckets + * + * Parameter is required. + */ + disableAccessPoints?: boolean + /** + * Whether multi-region access points (MRAP) should be disabled. + * + * Defaults to false + * if no value is provided. + * + * AWS::S3::DisableMultiRegionAccessPoints + */ + disableMultiRegionAccessPoints?: boolean + /** + * When an Access Point ARN is provided and this flag is enabled, the SDK MUST use + * the ARN's region when constructing the endpoint instead of the client's + * configured region. + * + * Parameter is required. + * + * AWS::S3::UseArnRegion + */ + useArnRegion?: boolean + /** + * Internal parameter to indicate whether S3Express operation should use control + * plane, (ex. CreateBucket) + * + * Parameter is required. + */ + useS3ExpressControlEndpoint?: boolean + /** + * Parameter to indicate whether S3Express session auth should be + * disabled + * + * Parameter is required. + */ + disableS3ExpressSessionAuth?: boolean + } + interface EndpointParameters { + /** + * ValidateRequired validates required parameters are set. + */ + validateRequired(): void + } + interface EndpointParameters { + /** + * WithDefaults returns a shallow copy of EndpointParameterswith default values + * applied to members where applicable. + */ + withDefaults(): EndpointParameters + } + /** + * SelectObjectContentEventStreamReader provides the interface for reading events + * from a stream. + * + * The writer's Close method must allow multiple concurrent calls. + */ + interface SelectObjectContentEventStreamReader { + [key:string]: any; + events(): undefined + close(): void + err(): void + } + // @ts-ignore + import v4 = signer +} + +namespace search { +} + +/** + * Package middleware provides transport agnostic middleware for decorating SDK + * handlers. * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * The Smithy middleware stack provides ordered behavior to be invoked on an + * underlying handler. The stack is separated into steps that are invoked in a + * static order. A step is a collection of middleware that are injected into a + * ordered list defined by the user. The user may add, insert, swap, and remove a + * step's middleware. When the stack is invoked the step middleware become static, + * and their order cannot be modified. * - * # Performance considerations + * A stack and its step middleware are **not** safe to modify concurrently. * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. + * A stack will use the ordered list of middleware to decorate a underlying + * handler. A handler could be something like an HTTP Client that round trips an + * API operation over HTTP. * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. + * Smithy Middleware Stack * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call + * A Stack is a collection of middleware that wrap a handler. The stack can be + * broken down into discreet steps. Each step may contain zero or more middleware + * specific to that stack's step. * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` + * A Stack Step is a predefined set of middleware that are invoked in a static + * order by the Stack. These steps represent fixed points in the middleware stack + * for organizing specific behavior, such as serialize and build. A Stack Step is + * composed of zero or more middleware that are specific to that step. A step may + * define its own set of input/output parameters the generic input/output + * parameters are cast from. A step calls its middleware recursively, before + * calling the next step in the stack returning the result or error of the step + * middleware decorating the underlying handler. * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: + * * Initialize: Prepares the input, and sets any default parameters as needed, + * (e.g. idempotency token, and presigned URLs). * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` + * * Serialize: Serializes the prepared input into a data structure that can be + * consumed by the target transport's message, (e.g. REST-JSON serialization). * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * * Build: Adds additional metadata to the serialized transport message, (e.g. + * HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: + * * Finalize: Performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated to + * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request + * signing). * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` + * * Deserialize: Reacts to the handler's response returned by the recipient of + * the request message. Deserializes the response into a structured type or + * error above stacks can react to. * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: + * Adding Middleware to a Stack Step * - * ``` - * type expensive struct { arg int } + * Middleware can be added to a step front or back, or relative, by name, to an + * existing middleware in that stack. If a middleware does not have a name, a + * unique name will be generated at the middleware and be added to the step. * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } * ``` + * // Create middleware stack + * stack := middleware.NewStack() * - * Then use a value of that type in log calls: + * // Add middleware to stack steps + * stack.Initialize.Add(paramValidationMiddleware, middleware.After) + * stack.Serialize.Add(marshalOperationFoo, middleware.After) + * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) * + * // Invoke middleware on handler. + * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that each record is written in one piece. User-defined - * handlers are responsible for their own locking. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. */ -namespace slog { - // @ts-ignore - import loginternal = internal +namespace middleware { /** - * A Record holds information about a log event. - * Copies of a Record share state. - * Do not modify a Record after handing out a copy to it. - * Call [NewRecord] to create a new Record. - * Use [Record.Clone] to create a copy with no shared state. + * BuildInput provides the input parameters for the BuildMiddleware to consume. + * BuildMiddleware may modify the Request value before forwarding the input + * along to the next BuildHandler. */ - interface Record { - /** - * The time at which the output method (Log, Info, etc.) was called. - */ - time: time.Time - /** - * The log message. - */ - message: string - /** - * The level of the event. - */ - level: Level + interface BuildInput { + request: { + } + } + /** + * BuildOutput provides the result returned by the next BuildHandler. + */ + interface BuildOutput { + result: { + } + } + /** + * BuildHandler provides the interface for the next handler the + * BuildMiddleware will call in the middleware chain. + */ + interface BuildHandler { + [key:string]: any; + handleBuild(ctx: context.Context, _arg10: BuildInput): [BuildOutput, Metadata] + } + /** + * DeserializeInput provides the input parameters for the DeserializeInput to + * consume. DeserializeMiddleware should not modify the Request, and instead + * forward it along to the next DeserializeHandler. + */ + interface DeserializeInput { + request: { + } + } + /** + * DeserializeOutput provides the result returned by the next + * DeserializeHandler. The DeserializeMiddleware should deserialize the + * RawResponse into a Result that can be consumed by middleware higher up in + * the stack. + */ + interface DeserializeOutput { + rawResponse: { + } + result: { + } + } + /** + * DeserializeHandler provides the interface for the next handler the + * DeserializeMiddleware will call in the middleware chain. + */ + interface DeserializeHandler { + [key:string]: any; + handleDeserialize(ctx: context.Context, _arg10: DeserializeInput): [DeserializeOutput, Metadata] + } + /** + * FinalizeInput provides the input parameters for the FinalizeMiddleware to + * consume. FinalizeMiddleware may modify the Request value before forwarding + * the FinalizeInput along to the next next FinalizeHandler. + */ + interface FinalizeInput { + request: { + } + } + /** + * FinalizeOutput provides the result returned by the next FinalizeHandler. + */ + interface FinalizeOutput { + result: { + } + } + /** + * FinalizeHandler provides the interface for the next handler the + * FinalizeMiddleware will call in the middleware chain. + */ + interface FinalizeHandler { + [key:string]: any; + handleFinalize(ctx: context.Context, _arg10: FinalizeInput): [FinalizeOutput, Metadata] + } + /** + * InitializeInput wraps the input parameters for the InitializeMiddlewares to + * consume. InitializeMiddleware may modify the parameter value before + * forwarding it along to the next InitializeHandler. + */ + interface InitializeInput { + parameters: { + } + } + /** + * InitializeOutput provides the result returned by the next InitializeHandler. + */ + interface InitializeOutput { + result: { + } + } + /** + * InitializeHandler provides the interface for the next handler the + * InitializeMiddleware will call in the middleware chain. + */ + interface InitializeHandler { + [key:string]: any; + handleInitialize(ctx: context.Context, _arg10: InitializeInput): [InitializeOutput, Metadata] + } + /** + * SerializeInput provides the input parameters for the SerializeMiddleware to + * consume. SerializeMiddleware may modify the Request value before forwarding + * SerializeInput along to the next SerializeHandler. The Parameters member + * should not be modified by SerializeMiddleware, InitializeMiddleware should + * be responsible for modifying the provided Parameter value. + */ + interface SerializeInput { + parameters: { + } + request: { + } + } + /** + * SerializeOutput provides the result returned by the next SerializeHandler. + */ + interface SerializeOutput { + result: { + } + } + /** + * SerializeHandler provides the interface for the next handler the + * SerializeMiddleware will call in the middleware chain. + */ + interface SerializeHandler { + [key:string]: any; + handleSerialize(ctx: context.Context, _arg10: SerializeInput): [SerializeOutput, Metadata] + } +} + +/** + * Package smithy provides the core components for a Smithy SDK. + */ +namespace smithy_go { + /** + * Properties provides storing and reading metadata values. Keys may be any + * comparable value type. Get and Set will panic if a key is not comparable. + * + * The zero value for a Properties instance is ready for reads/writes without + * any additional initialization. + */ + interface Properties { + } + interface Properties { /** - * The program counter at the time the record was constructed, as determined - * by runtime.Callers. If zero, no program counter is available. + * Get attempts to retrieve the value the key points to. Returns nil if the + * key was not found. * - * The only valid use for this value is as an argument to - * [runtime.CallersFrames]. In particular, it must not be passed to - * [runtime.FuncForPC]. + * Panics if key type is not comparable. */ - pc: number + get(key: any): any } - interface Record { + interface Properties { /** - * Clone returns a copy of the record with no shared state. - * The original record and the clone can both be modified - * without interfering with each other. + * Set stores the value pointed to by the key. If a value already exists at + * that key it will be replaced with the new value. + * + * Panics if the key type is not comparable. */ - clone(): Record + set(key: any, value: any): void } - interface Record { + interface Properties { /** - * NumAttrs returns the number of attributes in the [Record]. + * Has returns whether the key exists in the metadata. + * + * Panics if the key type is not comparable. */ - numAttrs(): number + has(key: any): boolean } - interface Record { + interface Properties { /** - * Attrs calls f on each Attr in the [Record]. - * Iteration stops if f returns false. + * SetAll accepts all of the given Properties into the receiver, overwriting + * any existing keys in the case of conflicts. */ - attrs(f: (_arg0: Attr) => boolean): void + setAll(other: Properties): void } - interface Record { + interface Properties { /** - * AddAttrs appends the given Attrs to the [Record]'s list of Attrs. - * It omits empty groups. + * Values returns a shallow clone of the property set's values. */ - addAttrs(...attrs: Attr[]): void + values(): _TygojaDict } - interface Record { - /** - * Add converts the args to Attrs as described in [Logger.Log], - * then appends the Attrs to the [Record]'s list of Attrs. - * It omits empty groups. - */ - add(...args: any[]): void +} + +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { + /** + * MeterOptions represents configuration for a Meter. + */ + interface MeterOptions { + properties: smithy.Properties } /** - * A Value can represent any Go value, but unlike type any, - * it can represent most small values without an allocation. - * The zero Value corresponds to nil. + * InstrumentOption applies configuration to an instrument. */ - interface Value { + interface InstrumentOption {(o: InstrumentOptions): void } + /** + * Int64Counter measures a monotonically increasing int64 value. + */ + interface Int64Counter { + [key:string]: any; + add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void } - interface Value { - /** - * Kind returns v's Kind. - */ - kind(): Kind + /** + * Int64UpDownCounter measures a fluctuating int64 value. + */ + interface Int64UpDownCounter { + [key:string]: any; + add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void } - interface Value { - /** - * Any returns v's value as an any. - */ - any(): any + /** + * Int64Gauge samples a discrete int64 value. + */ + interface Int64Gauge { + [key:string]: any; + sample(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void } - interface Value { - /** - * String returns Value's value as a string, formatted like [fmt.Sprint]. Unlike - * the methods Int64, Float64, and so on, which panic if v is of the - * wrong kind, String never panics. - */ - string(): string + /** + * Int64Histogram records multiple data points for an int64 value. + */ + interface Int64Histogram { + [key:string]: any; + record(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void } - interface Value { - /** - * Int64 returns v's value as an int64. It panics - * if v is not a signed integer. - */ - int64(): number + /** + * Float64Counter measures a monotonically increasing float64 value. + */ + interface Float64Counter { + [key:string]: any; + add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void } - interface Value { - /** - * Uint64 returns v's value as a uint64. It panics - * if v is not an unsigned integer. - */ - uint64(): number + /** + * Float64UpDownCounter measures a fluctuating float64 value. + */ + interface Float64UpDownCounter { + [key:string]: any; + add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void } - interface Value { + /** + * Float64Gauge samples a discrete float64 value. + */ + interface Float64Gauge { + [key:string]: any; + sample(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + } + /** + * Float64Histogram records multiple data points for an float64 value. + */ + interface Float64Histogram { + [key:string]: any; + record(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + } + /** + * AsyncInstrument is the universal handle returned for creation of all async + * instruments. + * + * Callers use the Stop() API to unregister the callback passed at instrument + * creation. + */ + interface AsyncInstrument { + [key:string]: any; + stop(): void + } + /** + * Int64Callback describes a function invoked when an async int64 instrument is + * read. + */ + interface Int64Callback {(_arg0: context.Context, _arg1: Int64Observer): void } + /** + * Float64Callback describes a function invoked when an async float64 + * instrument is read. + */ + interface Float64Callback {(_arg0: context.Context, _arg1: Float64Observer): void } +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * TracerOptions represent configuration for tracers. + */ + interface TracerOptions { + properties: smithy.Properties + } + /** + * SpanOption applies configuration to a span. + */ + interface SpanOption {(o: SpanOptions): void } + /** + * Span records a conceptually individual unit of work that takes place in a + * Smithy client operation. + */ + interface Span { + [key:string]: any; + name(): string + context(): SpanContext + addEvent(name: string, ...opts: EventOption[]): void + setStatus(status: SpanStatus): void + setProperty(k: any, v: any): void + end(): void + } +} + +/** + * Package http provides the HTTP transport client and request/response types + * needed to round trip API operation calls with an service. + */ +namespace http { + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import iointernal = io + /** + * Request provides the HTTP specific request structure for HTTP specific + * middleware steps to use to serialize input, and send an operation's request. + */ + type _subOtvso = http.Request + interface Request extends _subOtvso { + } + interface Request { /** - * Bool returns v's value as a bool. It panics - * if v is not a bool. + * IsHTTPS returns if the request is HTTPS. Returns false if no endpoint URL is set. */ - bool(): boolean + isHTTPS(): boolean } - interface Value { + interface Request { /** - * Duration returns v's value as a [time.Duration]. It panics - * if v is not a time.Duration. + * Clone returns a deep copy of the Request for the new context. A reference to + * the Stream is copied, but the underlying stream is not copied. */ - duration(): time.Duration + clone(): (Request) } - interface Value { + interface Request { /** - * Float64 returns v's value as a float64. It panics - * if v is not a float64. + * StreamLength returns the number of bytes of the serialized stream attached + * to the request and ok set. If the length cannot be determined, an error will + * be returned. */ - float64(): number + streamLength(): [number, boolean] } - interface Value { + interface Request { /** - * Time returns v's value as a [time.Time]. It panics - * if v is not a time.Time. + * RewindStream will rewind the io.Reader to the relative start position if it + * is an io.Seeker. */ - time(): time.Time + rewindStream(): void } - interface Value { + interface Request { /** - * LogValuer returns v's value as a LogValuer. It panics - * if v is not a LogValuer. + * GetStream returns the request stream io.Reader if a stream is set. If no + * stream is present nil will be returned. */ - logValuer(): LogValuer + getStream(): io.Reader } - interface Value { + interface Request { /** - * Group returns v's value as a []Attr. - * It panics if v's [Kind] is not [KindGroup]. + * IsStreamSeekable returns whether the stream is seekable. */ - group(): Array + isStreamSeekable(): boolean } - interface Value { + interface Request { /** - * Equal reports whether v and w represent the same Go value. + * SetStream returns a clone of the request with the stream set to the provided + * reader. May return an error if the provided reader is seekable but returns + * an error. */ - equal(w: Value): boolean + setStream(reader: io.Reader): (Request) } - interface Value { + interface Request { /** - * Resolve repeatedly calls LogValue on v while it implements [LogValuer], - * and returns the result. - * If v resolves to a group, the group's attributes' values are not recursively - * resolved. - * If the number of LogValue calls exceeds a threshold, a Value containing an - * error is returned. - * Resolve's return value is guaranteed not to be of Kind [KindLogValuer]. + * Build returns a build standard HTTP request value from the Smithy request. + * The request's stream is wrapped in a safe container that allows it to be + * reused for subsequent attempts. */ - resolve(): Value + build(ctx: context.Context): (http.Request) } + // @ts-ignore + import smithytime = time } /** @@ -20505,81 +44501,1231 @@ namespace slog { * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, * and a well-written Handler should take advantage of it. * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * Kind is the kind of a [Value]. + */ + interface Kind extends Number{} + interface Kind { + string(): string + } + /** + * A LogValuer is any Go value that can convert itself into a Value for logging. + * + * This mechanism may be used to defer expensive operations until they are + * needed, or to expand a single value into a sequence of components. + */ + interface LogValuer { + [key:string]: any; + logValue(): Value + } +} + +/** + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. + * + * # Value and Pointer Conversion Utilities * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. + * + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. * * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` + * var strPtr *string * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: + * // With the SDK's conversion functions + * strPtr = aws.String("my string") * + * // Convert *string to string value + * str = aws.ToString(strPtr) * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: * - * ``` - * type expensive struct { arg int } + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} * - * Then use a value of that type in log calls: + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that each record is written in one piece. User-defined - * handlers are responsible for their own locking. + * # SDK Default HTTP Client * - * # Writing a handler + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. + */ +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + // @ts-ignore + import smithybearer = bearer + // @ts-ignore + import sdkrand = rand + /** + * DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior. + */ + interface DualStackEndpointState extends Number{} + /** + * FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. + */ + interface FIPSEndpointState extends Number{} +} + +namespace types { + interface BucketLogsPermission extends String{} + interface BucketLogsPermission { + /** + * Values returns all known values for BucketLogsPermission. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface BucketType extends String{} + interface BucketType { + /** + * Values returns all known values for BucketType. Note that this can be expanded + * in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface DataRedundancy extends String{} + interface DataRedundancy { + /** + * Values returns all known values for DataRedundancy. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface FileHeaderInfo extends String{} + interface FileHeaderInfo { + /** + * Values returns all known values for FileHeaderInfo. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface IntelligentTieringAccessTier extends String{} + interface IntelligentTieringAccessTier { + /** + * Values returns all known values for IntelligentTieringAccessTier. Note that + * this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface InventoryFrequency extends String{} + interface InventoryFrequency { + /** + * Values returns all known values for InventoryFrequency. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface JSONType extends String{} + interface JSONType { + /** + * Values returns all known values for JSONType. Note that this can be expanded in + * the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface QuoteFields extends String{} + interface QuoteFields { + /** + * Values returns all known values for QuoteFields. Note that this can be expanded + * in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ReplicationRuleStatus extends String{} + interface ReplicationRuleStatus { + /** + * Values returns all known values for ReplicationRuleStatus. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface TransitionStorageClass extends String{} + interface TransitionStorageClass { + /** + * Values returns all known values for TransitionStorageClass. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface Type extends String{} + interface Type { + /** + * Values returns all known values for Type. Note that this can be expanded in the + * future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document + /** + * The container element for optionally specifying the default Object Lock + * retention settings for new objects placed in the specified bucket. + * + * ``` + * - The DefaultRetention settings require both a mode and a period. + * + * - The DefaultRetention period can be either Days or Years but you must select + * one. You cannot specify Days and Years at the same time. + * ``` + */ + type _subrbktc = noSmithyDocumentSerde + interface DefaultRetention extends _subrbktc { + /** + * The number of days that you want to specify for the default retention period. + * Must be used with Mode . + */ + days?: number + /** + * The default Object Lock retention mode you want to apply to new objects placed + * in the specified bucket. Must be used with either Days or Years . + */ + mode: ObjectLockRetentionMode + /** + * The number of years that you want to specify for the default retention period. + * Must be used with Mode . + */ + years?: number + } + /** + * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter + * in your replication configuration, you must also include a + * DeleteMarkerReplication element. If your Filter includes a Tag element, the + * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does + * not support replicating delete markers for tag-based rules. For an example + * configuration, see [Basic Rule Configuration]. + * + * For more information about delete marker replication, see [Basic Rule Configuration]. + * + * If you are using an earlier version of the replication configuration, Amazon S3 + * handles replication of delete markers differently. For more information, see [Backward Compatibility]. + * + * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html + * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations + */ + type _subFrndK = noSmithyDocumentSerde + interface DeleteMarkerReplication extends _subFrndK { + /** + * Indicates whether to replicate delete markers. + * + * Indicates whether to replicate delete markers. + */ + status: DeleteMarkerReplicationStatus + } + /** + * Specifies information about where to publish analysis or configuration results + * for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). + */ + type _subOaKdq = noSmithyDocumentSerde + interface Destination extends _subOaKdq { + /** + * The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store + * the results. + * + * This member is required. + */ + bucket?: string + /** + * Specify this only in a cross-account scenario (where source and destination + * bucket owners are not the same), and you want to change replica ownership to the + * Amazon Web Services account that owns the destination bucket. If this is not + * specified in the replication configuration, the replicas are owned by same + * Amazon Web Services account that owns the source object. + */ + accessControlTranslation?: AccessControlTranslation + /** + * Destination bucket owner account ID. In a cross-account scenario, if you direct + * Amazon S3 to change replica ownership to the Amazon Web Services account that + * owns the destination bucket by specifying the AccessControlTranslation + * property, this is the account ID of the destination bucket owner. For more + * information, see [Replication Additional Configuration: Changing the Replica Owner]in the Amazon S3 User Guide. + * + * [Replication Additional Configuration: Changing the Replica Owner]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html + */ + account?: string + /** + * A container that provides information about encryption. If + * SourceSelectionCriteria is specified, you must specify this element. + */ + encryptionConfiguration?: EncryptionConfiguration + /** + * A container specifying replication metrics-related settings enabling + * replication metrics and events. + */ + metrics?: Metrics + /** + * A container specifying S3 Replication Time Control (S3 RTC), including whether + * S3 RTC is enabled and the time when all objects and operations on objects must + * be replicated. Must be specified together with a Metrics block. + */ + replicationTime?: ReplicationTime + /** + * The storage class to use when replicating objects, such as S3 Standard or + * reduced redundancy. By default, Amazon S3 uses the storage class of the source + * object to create the object replica. + * + * For valid values, see the StorageClass element of the [PUT Bucket replication] action in the Amazon S3 + * API Reference. + * + * [PUT Bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html + */ + storageClass: StorageClass + } + /** + * Optional configuration to replicate existing source bucket objects. + * + * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in + * the Amazon S3 User Guide. + * + * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html + */ + type _subVHygh = noSmithyDocumentSerde + interface ExistingObjectReplication extends _subVHygh { + /** + * Specifies whether Amazon S3 replicates existing source bucket objects. + * + * This member is required. + */ + status: ExistingObjectReplicationStatus + } + /** + * A container for specifying S3 Intelligent-Tiering filters. The filters + * determine the subset of objects to which the rule applies. + */ + type _subocteQ = noSmithyDocumentSerde + interface IntelligentTieringAndOperator extends _subocteQ { + /** + * An object key name prefix that identifies the subset of objects to which the + * configuration applies. + */ + prefix?: string + /** + * All of these tags must exist in the object's tag set in order for the + * configuration to apply. + */ + tags: Array + } + /** + * Contains the bucket name, file format, bucket owner (optional), and prefix + * (optional) where inventory results are published. + */ + type _subPmIjs = noSmithyDocumentSerde + interface InventoryS3BucketDestination extends _subPmIjs { + /** + * The Amazon Resource Name (ARN) of the bucket where inventory results will be + * published. + * + * This member is required. + */ + bucket?: string + /** + * Specifies the output format of the inventory results. + * + * This member is required. + */ + format: InventoryFormat + /** + * The account ID that owns the destination S3 bucket. If no account ID is + * provided, the owner is not validated before exporting data. + * + * Although this value is optional, we strongly recommend that you set it to help + * prevent problems if the destination bucket ownership changes. + */ + accountId?: string + /** + * Contains the type of server-side encryption used to encrypt the inventory + * results. + */ + encryption?: InventoryEncryption + /** + * The prefix that is prepended to all inventory results. + */ + prefix?: string + } + /** + * Amazon S3 keys for log objects are partitioned in the following format: + * + * ``` + * [DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] + * ``` + * + * PartitionedPrefix defaults to EventTime delivery when server access logs are + * delivered. + */ + type _subyQbYy = noSmithyDocumentSerde + interface PartitionedPrefix extends _subyQbYy { + /** + * Specifies the partition date source for the partitioned prefix. + * PartitionDateSource can be EventTime or DeliveryTime . + * + * For DeliveryTime , the time in the log file names corresponds to the delivery + * time for the log files. + * + * For EventTime , The logs delivered are for a specific day only. The year, month, + * and day correspond to the day on which the event occurred, and the hour, minutes + * and seconds are set to 00 in the key. + */ + partitionDateSource: PartitionDateSource + } + /** + * A filter that identifies the subset of objects to which the replication rule + * applies. A Filter must specify exactly one Prefix , Tag , or an And child + * element. + * + * The following types satisfy this interface: + * + * ``` + * ReplicationRuleFilterMemberAnd + * ReplicationRuleFilterMemberPrefix + * ReplicationRuleFilterMemberTag + * ``` + */ + interface ReplicationRuleFilter { + [key:string]: any; + } + /** + * A container for object key name prefix and suffix filtering rules. + */ + type _subADdoW = noSmithyDocumentSerde + interface S3KeyFilter extends _subADdoW { + /** + * A list of containers for the key-value pair that defines the criteria for the + * filter rule. + */ + filterRules: Array + } + /** + * Describes an Amazon S3 location that will receive the results of the restore + * request. + */ + type _subKacLP = noSmithyDocumentSerde + interface S3Location extends _subKacLP { + /** + * The name of the bucket where the restore results will be placed. + * + * This member is required. + */ + bucketName?: string + /** + * The prefix that is prepended to the restore results for this request. + * + * This member is required. + */ + prefix?: string + /** + * A list of grants that control access to the staged results. + */ + accessControlList: Array + /** + * The canned ACL to apply to the restore results. + */ + cannedACL: ObjectCannedACL + /** + * Contains the type of server-side encryption used. + */ + encryption?: Encryption + /** + * The class of storage used to store the restore results. + */ + storageClass: StorageClass + /** + * The tag-set that is applied to the restore results. + */ + tagging?: Tagging + /** + * A list of metadata to store with the restore results in S3. + */ + userMetadata: Array + } + /** + * Describes the default server-side encryption to apply to new objects in the + * bucket. If a PUT Object request doesn't specify any server-side encryption, this + * default encryption will be applied. For more information, see [PutBucketEncryption]. + * + * ``` + * - General purpose buckets - If you don't specify a customer managed key at + * configuration, Amazon S3 automatically creates an Amazon Web Services KMS key ( + * aws/s3 ) in your Amazon Web Services account the first time that you add an + * object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS + * key for SSE-KMS. + * + * - Directory buckets - Your SSE-KMS configuration can only support 1 [customer managed key]per + * directory bucket for the lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: SSE-S3 and SSE-KMS. + * ``` + * + * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + type _subTvCNQ = noSmithyDocumentSerde + interface ServerSideEncryptionByDefault extends _subTvCNQ { + /** + * Server-side encryption algorithm to use for the default encryption. + * + * For directory buckets, there are only two supported values for server-side + * encryption: AES256 and aws:kms . + * + * This member is required. + */ + sseAlgorithm: ServerSideEncryption + /** + * Amazon Web Services Key Management Service (KMS) customer managed key ID to use + * for the default encryption. + * + * ``` + * - General purpose buckets - This parameter is allowed if and only if + * SSEAlgorithm is set to aws:kms or aws:kms:dsse . + * + * - Directory buckets - This parameter is allowed if and only if SSEAlgorithm is + * set to aws:kms . + * ``` + * + * You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the + * KMS key. + * + * ``` + * - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + * + * - Key ARN: + * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + * + * - Key Alias: alias/alias-name + * ``` + * + * If you are using encryption with cross-account or Amazon Web Services service + * operations, you must use a fully qualified KMS key ARN. For more information, + * see [Using encryption for cross-account operations]. + * + * ``` + * - General purpose buckets - If you're specifying a customer managed KMS key, + * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias + * instead, then KMS resolves the key within the requester’s account. This behavior + * can result in data that's encrypted with a KMS key that belongs to the + * requester, and not the bucket owner. Also, if you use a key ID, you can run into + * a LogDestination undeliverable error when creating a VPC flow log. + * + * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory + * bucket, only use the key ID or key ARN. The key alias format of the KMS key + * isn't supported. + * ``` + * + * Amazon S3 only supports symmetric encryption KMS keys. For more information, + * see [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. + * + * [Using encryption for cross-account operations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy + * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html + */ + kmsMasterKeyID?: string + } + /** + * To use simple format for S3 keys for log objects, set SimplePrefix to an empty + * object. + * + * ``` + * [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] + * ``` + */ + type _subXYSdU = noSmithyDocumentSerde + interface SimplePrefix extends _subXYSdU { + } + /** + * A container that describes additional filters for identifying the source + * objects that you want to replicate. You can choose to enable or disable the + * replication of these objects. Currently, Amazon S3 supports only the filter that + * you can specify for objects created with server-side encryption using a customer + * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). + */ + type _subhEJDM = noSmithyDocumentSerde + interface SourceSelectionCriteria extends _subhEJDM { + /** + * A filter that you can specify for selections for modifications on replicas. + * Amazon S3 doesn't replicate replica modifications by default. In the latest + * version of replication configuration (when Filter is specified), you can + * specify this element and set the status to Enabled to replicate modifications + * on replicas. + * + * If you don't specify the Filter element, Amazon S3 assumes that the replication + * configuration is the earlier version, V1. In the earlier version, this element + * is not allowed + */ + replicaModifications?: ReplicaModifications + /** + * A container for filter information for the selection of Amazon S3 objects + * encrypted with Amazon Web Services KMS. If you include SourceSelectionCriteria + * in the replication configuration, this element is required. + */ + sseKmsEncryptedObjects?: SseKmsEncryptedObjects + } + /** + * Container for data related to the storage class analysis for an Amazon S3 + * bucket for export. + */ + type _subaCjhj = noSmithyDocumentSerde + interface StorageClassAnalysisDataExport extends _subaCjhj { + /** + * The place to store the data for an analysis. + * + * This member is required. + */ + destination?: AnalyticsExportDestination + /** + * The version of the output schema to use when exporting data. Must be V_1 . + * + * This member is required. + */ + outputSchemaVersion: StorageClassAnalysisSchemaVersion + } +} + +/** + * Package smithy provides the core components for a Smithy SDK. */ -namespace slog { - // @ts-ignore - import loginternal = internal +namespace smithy_go { +} + +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { /** - * Kind is the kind of a [Value]. + * InstrumentOptions represents configuration for an instrument. */ - interface Kind extends Number{} - interface Kind { - string(): string + interface InstrumentOptions { + unitLabel: string + description: string } /** - * A LogValuer is any Go value that can convert itself into a Value for logging. + * Int64Observer is the interface passed to async int64 instruments. * - * This mechanism may be used to defer expensive operations until they are - * needed, or to expand a single value into a sequence of components. + * Callers use the Observe() API of this interface to report metrics to the + * underlying collector. */ - interface LogValuer { + interface Int64Observer { [key:string]: any; - logValue(): Value + observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + } + /** + * Float64Observer is the interface passed to async int64 instruments. + * + * Callers use the Observe() API of this interface to report metrics to the + * underlying collector. + */ + interface Float64Observer { + [key:string]: any; + observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + } + /** + * RecordMetricOption applies configuration to a recorded metric. + */ + interface RecordMetricOption {(o: RecordMetricOptions): void } +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * SpanStatus records the "success" state of an observed span. + */ + interface SpanStatus extends Number{} + /** + * SpanOptions represent configuration for span events. + */ + interface SpanOptions { + kind: SpanKind + properties: smithy.Properties + } + /** + * EventOption applies configuration to a span event. + */ + interface EventOption {(o: EventOptions): void } + /** + * SpanContext uniquely identifies a Span. + */ + interface SpanContext { + traceID: string + spanID: string + isRemote: boolean + } + interface SpanContext { + /** + * IsValid is true when a span has nonzero trace and span IDs. + */ + isValid(): boolean + } +} + +namespace types { + interface DeleteMarkerReplicationStatus extends String{} + interface DeleteMarkerReplicationStatus { + /** + * Values returns all known values for DeleteMarkerReplicationStatus. Note that + * this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ExistingObjectReplicationStatus extends String{} + interface ExistingObjectReplicationStatus { + /** + * Values returns all known values for ExistingObjectReplicationStatus. Note that + * this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface InventoryFormat extends String{} + interface InventoryFormat { + /** + * Values returns all known values for InventoryFormat. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface PartitionDateSource extends String{} + interface PartitionDateSource { + /** + * Values returns all known values for PartitionDateSource. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface StorageClassAnalysisSchemaVersion extends String{} + interface StorageClassAnalysisSchemaVersion { + /** + * Values returns all known values for StorageClassAnalysisSchemaVersion. Note + * that this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document + /** + * A container for information about access control for replicas. + */ + type _subRSwvp = noSmithyDocumentSerde + interface AccessControlTranslation extends _subRSwvp { + /** + * Specifies the replica ownership. For default and valid values, see [PUT bucket replication] in the + * Amazon S3 API Reference. + * + * [PUT bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html + * + * This member is required. + */ + owner: OwnerOverride + } + /** + * Where to publish the analytics results. + */ + type _subEfedq = noSmithyDocumentSerde + interface AnalyticsExportDestination extends _subEfedq { + /** + * A destination signifying output to an S3 bucket. + * + * This member is required. + */ + s3BucketDestination?: AnalyticsS3BucketDestination + } + /** + * Contains the type of server-side encryption used. + */ + type _subMKWRi = noSmithyDocumentSerde + interface Encryption extends _subMKWRi { + /** + * The server-side encryption algorithm used when storing job results in Amazon S3 + * (for example, AES256, aws:kms ). + * + * This member is required. + */ + encryptionType: ServerSideEncryption + /** + * If the encryption type is aws:kms , this optional value can be used to specify + * the encryption context for the restore results. + */ + kmsContext?: string + /** + * If the encryption type is aws:kms , this optional value specifies the ID of the + * symmetric encryption customer managed key to use for encryption of job results. + * Amazon S3 only supports symmetric encryption KMS keys. For more information, see + * [Asymmetric keys in KMS]in the Amazon Web Services Key Management Service Developer Guide. + * + * [Asymmetric keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html + */ + kmsKeyId?: string + } + /** + * Specifies encryption-related information for an Amazon S3 bucket that is a + * destination for replicated objects. + * + * If you're specifying a customer managed KMS key, we recommend using a fully + * qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the + * key within the requester’s account. This behavior can result in data that's + * encrypted with a KMS key that belongs to the requester, and not the bucket + * owner. + */ + type _subYdcWm = noSmithyDocumentSerde + interface EncryptionConfiguration extends _subYdcWm { + /** + * Specifies the ID (Key ARN or Alias ARN) of the customer managed Amazon Web + * Services KMS key stored in Amazon Web Services Key Management Service (KMS) for + * the destination bucket. Amazon S3 uses this key to encrypt replica objects. + * Amazon S3 only supports symmetric encryption KMS keys. For more information, see + * [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. + * + * [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html + */ + replicaKmsKeyID?: string + } + /** + * Specifies the Amazon S3 object key name to filter on. An object key name is the + * name assigned to an object in your Amazon S3 bucket. You specify whether to + * filter on the suffix or prefix of the object key name. A prefix is a specific + * string of characters at the beginning of an object key name, which you can use + * to organize objects. For example, you can start the key names of related objects + * with a prefix, such as 2023- or engineering/ . Then, you can use FilterRule to + * find objects in a bucket with key names that have the same prefix. A suffix is + * similar to a prefix, but it is at the end of the object key name instead of at + * the beginning. + */ + type _subhdpnQ = noSmithyDocumentSerde + interface FilterRule extends _subhdpnQ { + /** + * The object key name prefix or suffix identifying one or more objects to which + * the filtering rule applies. The maximum length is 1,024 characters. Overlapping + * prefixes and suffixes are not supported. For more information, see [Configuring Event Notifications]in the + * Amazon S3 User Guide. + * + * [Configuring Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + */ + name: FilterRuleName + /** + * The value that the filter searches for in object key names. + */ + value?: string + } + /** + * Contains the type of server-side encryption used to encrypt the inventory + * results. + */ + type _subCOgLz = noSmithyDocumentSerde + interface InventoryEncryption extends _subCOgLz { + /** + * Specifies the use of SSE-KMS to encrypt delivered inventory reports. + */ + ssekms?: SSEKMS + /** + * Specifies the use of SSE-S3 to encrypt delivered inventory reports. + */ + sses3?: SSES3 + } + /** + * A metadata key-value pair to store with an object. + */ + type _subEsbzQ = noSmithyDocumentSerde + interface MetadataEntry extends _subEsbzQ { + /** + * Name of the object. + */ + name?: string + /** + * Value of the object. + */ + value?: string + } + /** + * ``` + * A container specifying replication metrics-related settings enabling + * ``` + * + * replication metrics and events. + */ + type _subvDzQN = noSmithyDocumentSerde + interface Metrics extends _subvDzQN { + /** + * Specifies whether the replication metrics are enabled. + * + * This member is required. + */ + status: MetricsStatus + /** + * A container specifying the time threshold for emitting the + * s3:Replication:OperationMissedThreshold event. + */ + eventThreshold?: ReplicationTimeValue + } + /** + * A filter that you can specify for selection for modifications on replicas. + * Amazon S3 doesn't replicate replica modifications by default. In the latest + * version of replication configuration (when Filter is specified), you can + * specify this element and set the status to Enabled to replicate modifications + * on replicas. + * + * If you don't specify the Filter element, Amazon S3 assumes that the replication + * configuration is the earlier version, V1. In the earlier version, this element + * is not allowed. + */ + type _subtrUmI = noSmithyDocumentSerde + interface ReplicaModifications extends _subtrUmI { + /** + * Specifies whether Amazon S3 replicates modifications on replicas. + * + * This member is required. + */ + status: ReplicaModificationsStatus + } + /** + * ``` + * A container specifying S3 Replication Time Control (S3 RTC) related + * ``` + * + * information, including whether S3 RTC is enabled and the time when all objects + * and operations on objects must be replicated. Must be specified together with a + * Metrics block. + */ + type _subozwUW = noSmithyDocumentSerde + interface ReplicationTime extends _subozwUW { + /** + * Specifies whether the replication time is enabled. + * + * This member is required. + */ + status: ReplicationTimeStatus + /** + * A container specifying the time by which replication should be complete for + * all objects and operations on objects. + * + * This member is required. + */ + time?: ReplicationTimeValue + } + /** + * A container for filter information for the selection of S3 objects encrypted + * with Amazon Web Services KMS. + */ + type _subEQxoY = noSmithyDocumentSerde + interface SseKmsEncryptedObjects extends _subEQxoY { + /** + * Specifies whether Amazon S3 replicates objects created with server-side + * encryption using an Amazon Web Services KMS key stored in Amazon Web Services + * Key Management Service. + * + * This member is required. + */ + status: SseKmsEncryptedObjectsStatus + } +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * SpanKind indicates the nature of the work being performed. + */ + interface SpanKind extends Number{} + /** + * EventOptions represent configuration for span events. + */ + interface EventOptions { + properties: smithy.Properties + } +} + +namespace types { + interface FilterRuleName extends String{} + interface FilterRuleName { + /** + * Values returns all known values for FilterRuleName. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface MetricsStatus extends String{} + interface MetricsStatus { + /** + * Values returns all known values for MetricsStatus. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface OwnerOverride extends String{} + interface OwnerOverride { + /** + * Values returns all known values for OwnerOverride. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ReplicaModificationsStatus extends String{} + interface ReplicaModificationsStatus { + /** + * Values returns all known values for ReplicaModificationsStatus. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface ReplicationTimeStatus extends String{} + interface ReplicationTimeStatus { + /** + * Values returns all known values for ReplicationTimeStatus. Note that this can + * be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface SseKmsEncryptedObjectsStatus extends String{} + interface SseKmsEncryptedObjectsStatus { + /** + * Values returns all known values for SseKmsEncryptedObjectsStatus. Note that + * this can be expanded in the future, and so it is only as up to date as the + * client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document + /** + * Contains information about where to publish the analytics results. + */ + type _subFeyfr = noSmithyDocumentSerde + interface AnalyticsS3BucketDestination extends _subFeyfr { + /** + * The Amazon Resource Name (ARN) of the bucket to which data is exported. + * + * This member is required. + */ + bucket?: string + /** + * Specifies the file format used when exporting data to Amazon S3. + * + * This member is required. + */ + format: AnalyticsS3ExportFileFormat + /** + * The account ID that owns the destination S3 bucket. If no account ID is + * provided, the owner is not validated before exporting data. + * + * Although this value is optional, we strongly recommend that you set it to help + * prevent problems if the destination bucket ownership changes. + */ + bucketAccountId?: string + /** + * The prefix to use when exporting data. The prefix is prepended to all results. + */ + prefix?: string + } + /** + * ``` + * A container specifying the time value for S3 Replication Time Control (S3 RTC) + * ``` + * + * and replication metrics EventThreshold . + */ + type _subSvvgY = noSmithyDocumentSerde + interface ReplicationTimeValue extends _subSvvgY { + /** + * Contains an integer specifying time in minutes. + * + * Valid value: 15 + */ + minutes?: number + } + /** + * Specifies the use of SSE-KMS to encrypt delivered inventory reports. + */ + type _subtGWME = noSmithyDocumentSerde + interface SSEKMS extends _subtGWME { + /** + * Specifies the ID of the Key Management Service (KMS) symmetric encryption + * customer managed key to use for encrypting inventory reports. + * + * This member is required. + */ + keyId?: string + } + /** + * Specifies the use of SSE-S3 to encrypt delivered inventory reports. + */ + type _subfwKrU = noSmithyDocumentSerde + interface SSES3 extends _subfwKrU { } } + +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { + /** + * RecordMetricOptions represents configuration for a recorded metric. + */ + interface RecordMetricOptions { + properties: smithy.Properties + } +} + +namespace types { + interface AnalyticsS3ExportFileFormat extends String{} + interface AnalyticsS3ExportFileFormat { + /** + * Values returns all known values for AnalyticsS3ExportFileFormat. Note that this + * can be expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document +} From cbc88d7a012c61dfdee9d3463dcd9cdb6b647700 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 16:03:49 +0300 Subject: [PATCH 03/44] backported some of the v0.23.0 form validators, fixes and tests --- forms/realtime_subscribe.go | 1 + forms/realtime_subscribe_test.go | 79 +++++++++++++++++++++++----- forms/validators/record_data.go | 5 ++ forms/validators/record_data_test.go | 10 ++++ tools/rest/multi_binder.go | 23 +++++--- 5 files changed, 98 insertions(+), 20 deletions(-) diff --git a/forms/realtime_subscribe.go b/forms/realtime_subscribe.go index fc852fc807..def6534200 100644 --- a/forms/realtime_subscribe.go +++ b/forms/realtime_subscribe.go @@ -19,5 +19,6 @@ func NewRealtimeSubscribe() *RealtimeSubscribe { func (form *RealtimeSubscribe) Validate() error { return validation.ValidateStruct(form, validation.Field(&form.ClientId, validation.Required, validation.Length(1, 255)), + validation.Field(&form.Subscriptions, validation.Length(0, 1000)), ) } diff --git a/forms/realtime_subscribe_test.go b/forms/realtime_subscribe_test.go index d4f8b1e751..d615c41411 100644 --- a/forms/realtime_subscribe_test.go +++ b/forms/realtime_subscribe_test.go @@ -1,33 +1,86 @@ package forms_test import ( + "encoding/json" + "fmt" "strings" "testing" + validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/pocketbase/pocketbase/forms" ) func TestRealtimeSubscribeValidate(t *testing.T) { t.Parallel() + validSubscriptionsLimit := make([]string, 1000) + for i := 0; i < len(validSubscriptionsLimit); i++ { + validSubscriptionsLimit[i] = fmt.Sprintf(`"%d"`, i) + } + invalidSubscriptionsLimit := make([]string, 1001) + for i := 0; i < len(invalidSubscriptionsLimit); i++ { + invalidSubscriptionsLimit[i] = fmt.Sprintf(`"%d"`, i) + } + scenarios := []struct { - clientId string - expectError bool + name string + data string + expectedErrors []string }{ - {"", true}, - {strings.Repeat("a", 256), true}, - {"test", false}, + { + "empty data", + `{}`, + []string{"clientId"}, + }, + { + "clientId > max chars limit", + `{"clientId":"` + strings.Repeat("a", 256) + `"}`, + []string{"clientId"}, + }, + { + "clientId <= max chars limit", + `{"clientId":"` + strings.Repeat("a", 255) + `"}`, + []string{}, + }, + { + "subscriptions > max limit", + `{"clientId":"test", "subscriptions":[` + strings.Join(invalidSubscriptionsLimit, ",") + `]}`, + []string{"subscriptions"}, + }, + { + "subscriptions <= max limit", + `{"clientId":"test", "subscriptions":[` + strings.Join(validSubscriptionsLimit, ",") + `]}`, + []string{}, + }, } - for i, s := range scenarios { - form := forms.NewRealtimeSubscribe() - form.ClientId = s.clientId + for _, s := range scenarios { + t.Run(s.name, func(t *testing.T) { + form := forms.NewRealtimeSubscribe() + + err := json.Unmarshal([]byte(s.data), &form) + if err != nil { + t.Fatal(err) + } + + result := form.Validate() - err := form.Validate() + // parse errors + errs, ok := result.(validation.Errors) + if !ok && result != nil { + t.Fatalf("Failed to parse errors %v", result) + return + } - hasErr := err != nil - if hasErr != s.expectError { - t.Errorf("(%d) Expected hasErr to be %v, got %v (%v)", i, s.expectError, hasErr, err) - } + // check errors + if len(errs) > len(s.expectedErrors) { + t.Fatalf("Expected error keys %v, got %v", s.expectedErrors, errs) + } + for _, k := range s.expectedErrors { + if _, ok := errs[k]; !ok { + t.Fatalf("Missing expected error key %q in %v", k, errs) + } + } + }) } } diff --git a/forms/validators/record_data.go b/forms/validators/record_data.go index 9c4232f8a7..b1d8359dc0 100644 --- a/forms/validators/record_data.go +++ b/forms/validators/record_data.go @@ -2,6 +2,7 @@ package validators import ( "fmt" + "math" "net/url" "regexp" "strings" @@ -159,6 +160,10 @@ func (validator *RecordDataValidator) checkNumberValue(field *schema.SchemaField return nil // nothing to check (skip zero-defaults) } + if math.IsInf(val, 0) || math.IsNaN(val) { + return validation.NewError("validation_nan", "The submitted number is not properly formatted") + } + options, _ := field.Options.(*schema.NumberOptions) if options.NoDecimal && val != float64(int64(val)) { diff --git a/forms/validators/record_data_test.go b/forms/validators/record_data_test.go index 9dc5869232..029dc6ea39 100644 --- a/forms/validators/record_data_test.go +++ b/forms/validators/record_data_test.go @@ -248,6 +248,16 @@ func TestRecordDataValidatorValidateNumber(t *testing.T) { nil, []string{"field2"}, }, + { + "(number) check infinities and NaN", + map[string]any{ + "field1": "Inf", + "field2": "-Inf", + "field4": "NaN", + }, + nil, + []string{"field1", "field2", "field4"}, + }, { "(number) check min constraint", map[string]any{ diff --git a/tools/rest/multi_binder.go b/tools/rest/multi_binder.go index 6fcc2e29e5..4df6255919 100644 --- a/tools/rest/multi_binder.go +++ b/tools/rest/multi_binder.go @@ -6,10 +6,11 @@ import ( "io" "net/http" "reflect" + "regexp" + "strconv" "strings" "github.com/labstack/echo/v5" - "github.com/spf13/cast" ) // MultipartJsonKey is the key for the special multipart/form-data @@ -144,12 +145,16 @@ func bindFormData(c echo.Context, i any) error { return echo.BindBody(c, i) } +var inferNumberCharsRegex = regexp.MustCompile(`^[\-\.\d]+$`) + // In order to support more seamlessly both json and multipart/form-data requests, // the following normalization rules are applied for plain multipart string values: -// - "true" is converted to the json `true` -// - "false" is converted to the json `false` -// - numeric (non-scientific) strings are converted to json number -// - any other string (empty string too) is left as it is +// - "true" is converted to the json "true" +// - "false" is converted to the json "false" +// - numeric strings are converted to json number ONLY if the resulted +// minimal number string representation is the same as the provided raw string +// (aka. scientific notations, "Infinity", "0.0", "0001", etc. are kept as string) +// - any other string (empty string too) is left as it is func normalizeMultipartValue(raw string) any { switch raw { case "": @@ -159,8 +164,12 @@ func normalizeMultipartValue(raw string) any { case "false": return false default: - if raw[0] == '-' || (raw[0] >= '0' && raw[0] <= '9') { - if v, err := cast.ToFloat64E(raw); err == nil { + // try to convert to number + // + // note: expects the provided raw string to match exactly with the minimal string representation of the parsed float + if raw[0] == '-' || (raw[0] >= '0' && raw[0] <= '9') && inferNumberCharsRegex.Match([]byte(raw)) { + v, err := strconv.ParseFloat(raw, 64) + if err == nil && strconv.FormatFloat(v, 'f', -1, 64) == raw { return v } } From 3786e0816dee6d4dc3882cc25d1383144854ed83 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 16:05:36 +0300 Subject: [PATCH 04/44] added Instagram OAuth2 provider deprecation log --- forms/record_oauth2_login.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/forms/record_oauth2_login.go b/forms/record_oauth2_login.go index 6747e1baaf..1e31bb94fd 100644 --- a/forms/record_oauth2_login.go +++ b/forms/record_oauth2_login.go @@ -129,6 +129,10 @@ func (form *RecordOAuth2Login) Submit( return nil, nil, err } + if form.Provider == auth.NameInstagram { + form.app.Logger().Warn("Instagram OAuth2 provider is deprecated and will stop working after December 4th. For more details please check https://github.com/pocketbase/pocketbase/discussions/5652.") + } + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() From e18ea881133c4ae1a759a332492b2c65a2f2a7bd Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 16:06:24 +0300 Subject: [PATCH 05/44] updated ghupdate to prevent downloading unnecessary v0.23+ since it contains breaking changes --- plugins/ghupdate/ghupdate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/ghupdate/ghupdate.go b/plugins/ghupdate/ghupdate.go index f85a771c79..368ea91234 100644 --- a/plugins/ghupdate/ghupdate.go +++ b/plugins/ghupdate/ghupdate.go @@ -164,6 +164,11 @@ func (p *plugin) update(withBackup bool) error { return nil } + if compareVersions(strings.TrimPrefix(latest.Tag, "v"), "0.23.0") <= 0 { + color.Green("%s contains breaking changes and cannot be updated directly from v0.22.x. Please check the releases CHANGELOG for more details.", latest.Tag) + return nil + } + suffix := archiveSuffix(runtime.GOOS, runtime.GOARCH) if suffix == "" { return errors.New("unsupported platform") From cffbe83399473320450421fcebc119211c9348d6 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 16:32:43 +0300 Subject: [PATCH 06/44] backported JSVM toString --- plugins/jsvm/binds.go | 28 + plugins/jsvm/binds_test.go | 37 +- .../jsvm/internal/types/generated/types.d.ts | 18832 ++++++++-------- plugins/jsvm/internal/types/types.go | 26 +- 4 files changed, 9505 insertions(+), 9418 deletions(-) diff --git a/plugins/jsvm/binds.go b/plugins/jsvm/binds.go index d85962a004..9c77c2d8ab 100644 --- a/plugins/jsvm/binds.go +++ b/plugins/jsvm/binds.go @@ -301,6 +301,34 @@ func baseBinds(vm *goja.Runtime) { return string(bodyBytes), nil }) + vm.Set("toString", func(raw any, maxReaderBytes int) (string, error) { + switch v := raw.(type) { + case io.Reader: + if maxReaderBytes == 0 { + maxReaderBytes = rest.DefaultMaxMemory + } + + limitReader := io.LimitReader(v, int64(maxReaderBytes)) + + bodyBytes, readErr := io.ReadAll(limitReader) + if readErr != nil { + return "", readErr + } + + return string(bodyBytes), nil + default: + str, err := cast.ToStringE(v) + if err == nil { + return str, nil + } + + // as a last attempt try to json encode the value + rawBytes, _ := json.Marshal(raw) + + return string(rawBytes), nil + } + }) + vm.Set("sleep", func(milliseconds int64) { time.Sleep(time.Duration(milliseconds) * time.Millisecond) }) diff --git a/plugins/jsvm/binds_test.go b/plugins/jsvm/binds_test.go index d2568dc627..0c973930a1 100644 --- a/plugins/jsvm/binds_test.go +++ b/plugins/jsvm/binds_test.go @@ -47,7 +47,7 @@ func TestBaseBindsCount(t *testing.T) { vm := goja.New() baseBinds(vm) - testBindsCount(vm, "this", 17, t) + testBindsCount(vm, "this", 18, t) } func TestBaseBindsSleep(t *testing.T) { @@ -92,6 +92,41 @@ func TestBaseBindsReaderToString(t *testing.T) { } } +func TestBaseBindsToString(t *testing.T) { + vm := goja.New() + baseBinds(vm) + vm.Set("scenarios", []struct { + Name string + Value any + Expected string + }{ + {"null", nil, ""}, + {"string", "test", "test"}, + {"number", -12.4, "-12.4"}, + {"bool", true, "true"}, + {"arr", []int{1, 2, 3}, `[1,2,3]`}, + {"obj", map[string]any{"test": 123}, `{"test":123}`}, + {"reader", strings.NewReader("test"), "test"}, + {"struct", struct { + Name string + private string + }{Name: "123", private: "456"}, `{"Name":"123"}`}, + }) + + _, err := vm.RunString(` + for (let s of scenarios) { + let result = toString(s.value) + + if (result != s.expected) { + throw new Error('[' + s.name + '] Expected string ' + s.expected + ', got ' + result); + } + } + `) + if err != nil { + t.Fatal(err) + } +} + func TestBaseBindsCookie(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index 9c1ad8cbb7..748f815302 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -1,4 +1,4 @@ -// 1729250457 +// 1729258253 // GENERATED CODE - DO NOT MODIFY BY HAND // ------------------------------------------------------------------- @@ -178,22 +178,34 @@ declare var $app: PocketBase declare var $template: template.Registry /** - * readerToString reads the content of the specified io.Reader until - * EOF or maxBytes are reached. + * This method is superseded by toString. * - * If maxBytes is not specified it will read up to 32MB. + * @deprecated + * @group PocketBase + */ +declare function readerToString(reader: any, maxBytes?: number): string; + +/** + * toString stringifies the specified value. + * + * Support optional second maxBytes argument to limit the max read bytes + * when the value is a io.Reader (default to 32MB). * - * Note that after this call the reader can't be used anymore. + * Types that don't have explicit string representation are json serialized. * * Example: * * ```js - * const rawBody = readerToString(c.request().body) + * // io.Reader + * const ex1 = toString(e.request.body) + * + * // slice of bytes ("hello") + * const ex2 = toString([104 101 108 108 111]) * ``` * * @group PocketBase */ -declare function readerToString(reader: any, maxBytes?: number): string; +declare function toString(val: any, maxBytes?: number): string; /** * sleep pauses the current goroutine for at least the specified user duration (in ms). @@ -697,7 +709,7 @@ declare namespace $os { * const cmd = $os.cmd('ls', '-sl') * * // execute the command and return its standard output as string - * const output = String.fromCharCode(...cmd.output()); + * const output = toString(cmd.output()); * ``` */ export let cmd: exec.command @@ -1709,8 +1721,8 @@ namespace os { * than ReadFrom. This is used to permit ReadFrom to call io.Copy * without leading to a recursive call to ReadFrom. */ - type _subomlSs = noReadFrom&File - interface fileWithoutReadFrom extends _subomlSs { + type _subGmEUB = noReadFrom&File + interface fileWithoutReadFrom extends _subGmEUB { } interface File { /** @@ -1754,8 +1766,8 @@ namespace os { * than WriteTo. This is used to permit WriteTo to call io.Copy * without leading to a recursive call to WriteTo. */ - type _subTMSnU = noWriteTo&File - interface fileWithoutWriteTo extends _subTMSnU { + type _subnBkIH = noWriteTo&File + interface fileWithoutWriteTo extends _subnBkIH { } interface File { /** @@ -2399,8 +2411,8 @@ namespace os { * * The methods of File are safe for concurrent use. */ - type _subOKBJQ = file - interface File extends _subOKBJQ { + type _subQXiyH = file + interface File extends _subQXiyH { } /** * A FileInfo describes a file and is returned by [Stat] and [Lstat]. @@ -2792,132 +2804,6 @@ namespace filepath { } } -/** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the [path/filepath] package's Glob function. - * To expand environment variables, use package os's ExpandEnv. - * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. - * - * # Executables in the current directory - * - * The functions [Command] and [LookPath] look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. - * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run [LookPath]("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying [errors.Is](err, [ErrDot]). - * - * For example, consider these two program snippets: - * - * ``` - * path, err := exec.LookPath("prog") - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * These will not find and run ./prog or .\prog.exe, - * no matter how the current path is configured. - * - * Code that always wants to run a program from the current directory - * can be rewritten to say "./prog" instead of "prog". - * - * Code that insists on including results from relative path entries - * can instead override the error using an errors.Is check: - * - * ``` - * path, err := exec.LookPath("prog") - * if errors.Is(err, exec.ErrDot) { - * err = nil - * } - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if errors.Is(cmd.Err, exec.ErrDot) { - * cmd.Err = nil - * } - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * Setting the environment variable GODEBUG=execerrdot=0 - * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 - * behavior for programs that are unable to apply more targeted fixes. - * A future version of Go may remove support for this variable. - * - * Before adding such overrides, make sure you understand the - * security implications of doing so. - * See https://go.dev/blog/path-security for more information. - */ -namespace exec { - interface command { - /** - * Command returns the [Cmd] struct to execute the named program with - * the given arguments. - * - * It sets only the Path and Args in the returned structure. - * - * If name contains no path separators, Command uses [LookPath] to - * resolve name to a complete path if possible. Otherwise it uses name - * directly as Path. - * - * The returned Cmd's Args field is constructed from the command name - * followed by the elements of arg, so arg should not include the - * command name itself. For example, Command("echo", "hello"). - * Args[0] is always name, not the possibly resolved Path. - * - * On Windows, processes receive the whole command line as a single string - * and do their own parsing. Command combines and quotes Args into a command - * line string with an algorithm compatible with applications using - * CommandLineToArgvW (which is the most common way). Notable exceptions are - * msiexec.exe and cmd.exe (and thus, all batch files), which have a different - * unquoting algorithm. In these or other similar cases, you can do the - * quoting yourself and provide the full command line in SysProcAttr.CmdLine, - * leaving Args empty. - */ - (name: string, ...arg: string[]): (Cmd) - } -} - namespace security { interface s256Challenge { /** @@ -3054,575 +2940,622 @@ namespace security { } } -namespace filesystem { +/** + * Package validation provides configurable and extensible rules for validating data of various types. + */ +namespace ozzo_validation { /** - * FileReader defines an interface for a file resource reader. + * Error interface represents an validation error */ - interface FileReader { + interface Error { [key:string]: any; - open(): io.ReadSeekCloser + error(): string + code(): string + message(): string + setMessage(_arg0: string): Error + params(): _TygojaDict + setParams(_arg0: _TygojaDict): Error } +} + +/** + * Package dbx provides a set of DB-agnostic and easy-to-use query building methods for relational databases. + */ +namespace dbx { /** - * File defines a single file [io.ReadSeekCloser] resource. - * - * The file could be from a local path, multipart/form-data header, etc. + * Builder supports building SQL statements in a DB-agnostic way. + * Builder mainly provides two sets of query building methods: those building SELECT statements + * and those manipulating DB data or schema (e.g. INSERT statements, CREATE TABLE statements). */ - interface File { - reader: FileReader - name: string - originalName: string - size: number - } - interface newFileFromPath { + interface Builder { + [key:string]: any; /** - * NewFileFromPath creates a new File instance from the provided local file path. + * NewQuery creates a new Query object with the given SQL statement. + * The SQL statement may contain parameter placeholders which can be bound with actual parameter + * values before the statement is executed. */ - (path: string): (File) - } - interface newFileFromBytes { + newQuery(_arg0: string): (Query) /** - * NewFileFromBytes creates a new File instance from the provided byte slice. + * Select returns a new SelectQuery object that can be used to build a SELECT statement. + * The parameters to this method should be the list column names to be selected. + * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - (b: string|Array, name: string): (File) - } - interface newFileFromMultipart { + select(..._arg0: string[]): (SelectQuery) /** - * NewFileFromMultipart creates a new File from the provided multipart header. + * ModelQuery returns a new ModelQuery object that can be used to perform model insertion, update, and deletion. + * The parameter to this method should be a pointer to the model struct that needs to be inserted, updated, or deleted. */ - (mh: multipart.FileHeader): (File) - } - interface newFileFromUrl { + model(_arg0: { + }): (ModelQuery) /** - * NewFileFromUrl creates a new File from the provided url by - * downloading the resource and load it as BytesReader. - * - * Example - * - * ``` - * ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - * defer cancel() - * - * file, err := filesystem.NewFileFromUrl(ctx, "https://example.com/image.png") - * ``` + * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. */ - (ctx: context.Context, url: string): (File) - } - /** - * MultipartReader defines a FileReader from [multipart.FileHeader]. - */ - interface MultipartReader { - header?: multipart.FileHeader - } - interface MultipartReader { + generatePlaceholder(_arg0: number): string /** - * Open implements the [filesystem.FileReader] interface. + * Quote quotes a string so that it can be embedded in a SQL statement as a string value. */ - open(): io.ReadSeekCloser + quote(_arg0: string): string + /** + * QuoteSimpleTableName quotes a simple table name. + * A simple table name does not contain any schema prefix. + */ + quoteSimpleTableName(_arg0: string): string + /** + * QuoteSimpleColumnName quotes a simple column name. + * A simple column name does not contain any table prefix. + */ + quoteSimpleColumnName(_arg0: string): string + /** + * QueryBuilder returns the query builder supporting the current DB. + */ + queryBuilder(): QueryBuilder + /** + * Insert creates a Query that represents an INSERT SQL statement. + * The keys of cols are the column names, while the values of cols are the corresponding column + * values to be inserted. + */ + insert(table: string, cols: Params): (Query) + /** + * Upsert creates a Query that represents an UPSERT SQL statement. + * Upsert inserts a row into the table if the primary key or unique index is not found. + * Otherwise it will update the row with the new values. + * The keys of cols are the column names, while the values of cols are the corresponding column + * values to be inserted. + */ + upsert(table: string, cols: Params, ...constraints: string[]): (Query) + /** + * Update creates a Query that represents an UPDATE SQL statement. + * The keys of cols are the column names, while the values of cols are the corresponding new column + * values. If the "where" expression is nil, the UPDATE SQL statement will have no WHERE clause + * (be careful in this case as the SQL statement will update ALL rows in the table). + */ + update(table: string, cols: Params, where: Expression): (Query) + /** + * Delete creates a Query that represents a DELETE SQL statement. + * If the "where" expression is nil, the DELETE SQL statement will have no WHERE clause + * (be careful in this case as the SQL statement will delete ALL rows in the table). + */ + delete(table: string, where: Expression): (Query) + /** + * CreateTable creates a Query that represents a CREATE TABLE SQL statement. + * The keys of cols are the column names, while the values of cols are the corresponding column types. + * The optional "options" parameters will be appended to the generated SQL statement. + */ + createTable(table: string, cols: _TygojaDict, ...options: string[]): (Query) + /** + * RenameTable creates a Query that can be used to rename a table. + */ + renameTable(oldName: string, newName: string): (Query) + /** + * DropTable creates a Query that can be used to drop a table. + */ + dropTable(table: string): (Query) + /** + * TruncateTable creates a Query that can be used to truncate a table. + */ + truncateTable(table: string): (Query) + /** + * AddColumn creates a Query that can be used to add a column to a table. + */ + addColumn(table: string, col: string, typ: string): (Query) + /** + * DropColumn creates a Query that can be used to drop a column from a table. + */ + dropColumn(table: string, col: string): (Query) + /** + * RenameColumn creates a Query that can be used to rename a column in a table. + */ + renameColumn(table: string, oldName: string, newName: string): (Query) + /** + * AlterColumn creates a Query that can be used to change the definition of a table column. + */ + alterColumn(table: string, col: string, typ: string): (Query) + /** + * AddPrimaryKey creates a Query that can be used to specify primary key(s) for a table. + * The "name" parameter specifies the name of the primary key constraint. + */ + addPrimaryKey(table: string, name: string, ...cols: string[]): (Query) + /** + * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. + */ + dropPrimaryKey(table: string, name: string): (Query) + /** + * AddForeignKey creates a Query that can be used to add a foreign key constraint to a table. + * The length of cols and refCols must be the same as they refer to the primary and referential columns. + * The optional "options" parameters will be appended to the SQL statement. They can be used to + * specify options such as "ON DELETE CASCADE". + */ + addForeignKey(table: string, name: string, cols: Array, refCols: Array, refTable: string, ...options: string[]): (Query) + /** + * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. + */ + dropForeignKey(table: string, name: string): (Query) + /** + * CreateIndex creates a Query that can be used to create an index for a table. + */ + createIndex(table: string, name: string, ...cols: string[]): (Query) + /** + * CreateUniqueIndex creates a Query that can be used to create a unique index for a table. + */ + createUniqueIndex(table: string, name: string, ...cols: string[]): (Query) + /** + * DropIndex creates a Query that can be used to remove the named index from a table. + */ + dropIndex(table: string, name: string): (Query) } /** - * PathReader defines a FileReader from a local file path. + * BaseBuilder provides a basic implementation of the Builder interface. */ - interface PathReader { - path: string + interface BaseBuilder { } - interface PathReader { + interface newBaseBuilder { /** - * Open implements the [filesystem.FileReader] interface. + * NewBaseBuilder creates a new BaseBuilder instance. */ - open(): io.ReadSeekCloser + (db: DB, executor: Executor): (BaseBuilder) } - /** - * BytesReader defines a FileReader from bytes content. - */ - interface BytesReader { - bytes: string|Array + interface BaseBuilder { + /** + * DB returns the DB instance that this builder is associated with. + */ + db(): (DB) } - interface BytesReader { + interface BaseBuilder { /** - * Open implements the [filesystem.FileReader] interface. + * Executor returns the executor object (a DB instance or a transaction) for executing SQL statements. */ - open(): io.ReadSeekCloser + executor(): Executor } - type _subShExs = bytes.Reader - interface bytesReadSeekCloser extends _subShExs { + interface BaseBuilder { + /** + * NewQuery creates a new Query object with the given SQL statement. + * The SQL statement may contain parameter placeholders which can be bound with actual parameter + * values before the statement is executed. + */ + newQuery(sql: string): (Query) } - interface bytesReadSeekCloser { + interface BaseBuilder { /** - * Close implements the [io.ReadSeekCloser] interface. + * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. */ - close(): void + generatePlaceholder(_arg0: number): string } - interface System { + interface BaseBuilder { + /** + * Quote quotes a string so that it can be embedded in a SQL statement as a string value. + */ + quote(s: string): string } - interface newS3 { + interface BaseBuilder { /** - * NewS3 initializes an S3 filesystem instance. - * - * NB! Make sure to call `Close()` after you are done working with it. + * QuoteSimpleTableName quotes a simple table name. + * A simple table name does not contain any schema prefix. */ - (bucketName: string, region: string, endpoint: string, accessKey: string, secretKey: string, s3ForcePathStyle: boolean): (System) + quoteSimpleTableName(s: string): string } - interface newLocal { + interface BaseBuilder { /** - * NewLocal initializes a new local filesystem instance. - * - * NB! Make sure to call `Close()` after you are done working with it. + * QuoteSimpleColumnName quotes a simple column name. + * A simple column name does not contain any table prefix. */ - (dirPath: string): (System) + quoteSimpleColumnName(s: string): string } - interface System { + interface BaseBuilder { /** - * SetContext assigns the specified context to the current filesystem. + * Insert creates a Query that represents an INSERT SQL statement. + * The keys of cols are the column names, while the values of cols are the corresponding column + * values to be inserted. */ - setContext(ctx: context.Context): void + insert(table: string, cols: Params): (Query) } - interface System { + interface BaseBuilder { /** - * Close releases any resources used for the related filesystem. + * Upsert creates a Query that represents an UPSERT SQL statement. + * Upsert inserts a row into the table if the primary key or unique index is not found. + * Otherwise it will update the row with the new values. + * The keys of cols are the column names, while the values of cols are the corresponding column + * values to be inserted. */ - close(): void + upsert(table: string, cols: Params, ...constraints: string[]): (Query) } - interface System { + interface BaseBuilder { /** - * Exists checks if file with fileKey path exists or not. + * Update creates a Query that represents an UPDATE SQL statement. + * The keys of cols are the column names, while the values of cols are the corresponding new column + * values. If the "where" expression is nil, the UPDATE SQL statement will have no WHERE clause + * (be careful in this case as the SQL statement will update ALL rows in the table). */ - exists(fileKey: string): boolean + update(table: string, cols: Params, where: Expression): (Query) } - interface System { + interface BaseBuilder { /** - * Attributes returns the attributes for the file with fileKey path. + * Delete creates a Query that represents a DELETE SQL statement. + * If the "where" expression is nil, the DELETE SQL statement will have no WHERE clause + * (be careful in this case as the SQL statement will delete ALL rows in the table). */ - attributes(fileKey: string): (blob.Attributes) + delete(table: string, where: Expression): (Query) } - interface System { + interface BaseBuilder { /** - * GetFile returns a file content reader for the given fileKey. - * - * NB! Make sure to call `Close()` after you are done working with it. + * CreateTable creates a Query that represents a CREATE TABLE SQL statement. + * The keys of cols are the column names, while the values of cols are the corresponding column types. + * The optional "options" parameters will be appended to the generated SQL statement. */ - getFile(fileKey: string): (blob.Reader) + createTable(table: string, cols: _TygojaDict, ...options: string[]): (Query) } - interface System { + interface BaseBuilder { /** - * Copy copies the file stored at srcKey to dstKey. - * - * If dstKey file already exists, it is overwritten. + * RenameTable creates a Query that can be used to rename a table. */ - copy(srcKey: string, dstKey: string): void + renameTable(oldName: string, newName: string): (Query) } - interface System { + interface BaseBuilder { /** - * List returns a flat list with info for all files under the specified prefix. + * DropTable creates a Query that can be used to drop a table. */ - list(prefix: string): Array<(blob.ListObject | undefined)> + dropTable(table: string): (Query) } - interface System { + interface BaseBuilder { /** - * Upload writes content into the fileKey location. + * TruncateTable creates a Query that can be used to truncate a table. */ - upload(content: string|Array, fileKey: string): void + truncateTable(table: string): (Query) } - interface System { + interface BaseBuilder { /** - * UploadFile uploads the provided multipart file to the fileKey location. + * AddColumn creates a Query that can be used to add a column to a table. */ - uploadFile(file: File, fileKey: string): void + addColumn(table: string, col: string, typ: string): (Query) } - interface System { + interface BaseBuilder { /** - * UploadMultipart uploads the provided multipart file to the fileKey location. + * DropColumn creates a Query that can be used to drop a column from a table. */ - uploadMultipart(fh: multipart.FileHeader, fileKey: string): void + dropColumn(table: string, col: string): (Query) } - interface System { + interface BaseBuilder { /** - * Delete deletes stored file at fileKey location. + * RenameColumn creates a Query that can be used to rename a column in a table. */ - delete(fileKey: string): void + renameColumn(table: string, oldName: string, newName: string): (Query) } - interface System { + interface BaseBuilder { /** - * DeletePrefix deletes everything starting with the specified prefix. - * - * The prefix could be subpath (ex. "/a/b/") or filename prefix (ex. "/a/b/file_"). + * AlterColumn creates a Query that can be used to change the definition of a table column. */ - deletePrefix(prefix: string): Array + alterColumn(table: string, col: string, typ: string): (Query) } - interface System { + interface BaseBuilder { /** - * Serve serves the file at fileKey location to an HTTP response. - * - * If the `download` query parameter is used the file will be always served for - * download no matter of its type (aka. with "Content-Disposition: attachment"). + * AddPrimaryKey creates a Query that can be used to specify primary key(s) for a table. + * The "name" parameter specifies the name of the primary key constraint. */ - serve(res: http.ResponseWriter, req: http.Request, fileKey: string, name: string): void + addPrimaryKey(table: string, name: string, ...cols: string[]): (Query) } - interface System { + interface BaseBuilder { /** - * CreateThumb creates a new thumb image for the file at originalKey location. - * The new thumb file is stored at thumbKey location. - * - * thumbSize is in the format: - * - 0xH (eg. 0x100) - resize to H height preserving the aspect ratio - * - Wx0 (eg. 300x0) - resize to W width preserving the aspect ratio - * - WxH (eg. 300x100) - resize and crop to WxH viewbox (from center) - * - WxHt (eg. 300x100t) - resize and crop to WxH viewbox (from top) - * - WxHb (eg. 300x100b) - resize and crop to WxH viewbox (from bottom) - * - WxHf (eg. 300x100f) - fit inside a WxH viewbox (without cropping) + * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. */ - createThumb(originalKey: string, thumbKey: string, thumbSize: string): void + dropPrimaryKey(table: string, name: string): (Query) } - // @ts-ignore - import v4 = signer - // @ts-ignore - import smithyhttp = http - interface ignoredHeadersKey { + interface BaseBuilder { + /** + * AddForeignKey creates a Query that can be used to add a foreign key constraint to a table. + * The length of cols and refCols must be the same as they refer to the primary and referential columns. + * The optional "options" parameters will be appended to the SQL statement. They can be used to + * specify options such as "ON DELETE CASCADE". + */ + addForeignKey(table: string, name: string, cols: Array, refCols: Array, refTable: string, ...options: string[]): (Query) } - // @ts-ignore - import awsv2 = aws - // @ts-ignore - import awsv2cfg = config - // @ts-ignore - import s3managerv2 = manager - // @ts-ignore - import s3v2 = s3 - // @ts-ignore - import typesv2 = types - interface hexEscape { + interface BaseBuilder { /** - * HexEscape returns s, with all runes for which shouldEscape returns true - * escaped to "__0xXXX__", where XXX is the hex representation of the rune - * value. For example, " " would escape to "__0x20__". - * - * Non-UTF-8 strings will have their non-UTF-8 characters escaped to - * unicode.ReplacementChar; the original value is lost. Please file an - * issue if you need non-UTF8 support. - * - * Note: shouldEscape takes the whole string as a slice of runes and an - * index. Passing it a single byte or a single rune doesn't provide - * enough context for some escape decisions; for example, the caller might - * want to escape the second "/" in "//" but not the first one. - * We pass a slice of runes instead of the string or a slice of bytes - * because some decisions will be made on a rune basis (e.g., encode - * all non-ASCII runes). + * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. */ - (s: string, shouldEscape: (s: Array, i: number) => boolean): string + dropForeignKey(table: string, name: string): (Query) } - interface hexUnescape { + interface BaseBuilder { /** - * HexUnescape reverses HexEscape. + * CreateIndex creates a Query that can be used to create an index for a table. */ - (s: string): string + createIndex(table: string, name: string, ...cols: string[]): (Query) } - interface urlEscape { + interface BaseBuilder { /** - * URLEscape uses url.PathEscape to escape s. + * CreateUniqueIndex creates a Query that can be used to create a unique index for a table. */ - (s: string): string + createUniqueIndex(table: string, name: string, ...cols: string[]): (Query) } - interface urlUnescape { + interface BaseBuilder { /** - * URLUnescape reverses URLEscape using url.PathUnescape. If the unescape - * returns an error, it returns s. + * DropIndex creates a Query that can be used to remove the named index from a table. */ - (s: string): string + dropIndex(table: string, name: string): (Query) } - interface useV2 { + /** + * MssqlBuilder is the builder for SQL Server databases. + */ + type _subycxul = BaseBuilder + interface MssqlBuilder extends _subycxul { + } + /** + * MssqlQueryBuilder is the query builder for SQL Server databases. + */ + type _subxozvl = BaseQueryBuilder + interface MssqlQueryBuilder extends _subxozvl { + } + interface newMssqlBuilder { /** - * UseV2 returns true iff the URL parameters indicate that the provider - * should use the AWS SDK v2. - * - * "awssdk=v1" will force V1. - * "awssdk=v2" will force V2. - * No "awssdk" parameter (or any other value) will return the default, currently V1. - * Note that the default may change in the future. + * NewMssqlBuilder creates a new MssqlBuilder instance. */ - (q: url.Values): boolean + (db: DB, executor: Executor): Builder } - interface newDefaultV2Config { + interface MssqlBuilder { /** - * NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options. + * QueryBuilder returns the query builder supporting the current DB. */ - (ctx: context.Context): awsv2.Config + queryBuilder(): QueryBuilder } - interface v2ConfigFromURLParams { + interface MssqlBuilder { /** - * V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL - * parameters in q. It is intended to be used by URLOpeners for AWS services if - * UseV2 returns true. - * - * https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config - * - * It returns an error if q contains any unknown query parameters; callers - * should remove any query parameters they know about from q before calling - * V2ConfigFromURLParams. - * - * The following query options are supported: - * ``` - * - region: The AWS region for requests; sets WithRegion. - * - profile: The shared config profile to use; sets SharedConfigProfile. - * - endpoint: The AWS service endpoint to send HTTP request. - * ``` + * Select returns a new SelectQuery object that can be used to build a SELECT statement. + * The parameters to this method should be the list column names to be selected. + * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - (ctx: context.Context, q: url.Values): awsv2.Config + select(...cols: string[]): (SelectQuery) } - interface urlSessionOpener { + interface MssqlBuilder { + /** + * Model returns a new ModelQuery object that can be used to perform model-based DB operations. + * The model passed to this method should be a pointer to a model struct. + */ + model(model: { + }): (ModelQuery) } - interface urlSessionOpener { - openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) + interface MssqlBuilder { + /** + * QuoteSimpleTableName quotes a simple table name. + * A simple table name does not contain any schema prefix. + */ + quoteSimpleTableName(s: string): string } - /** - * URLOpener opens S3 URLs like "s3://mybucket". - * - * The URL host is used as the bucket name. - * - * Use "awssdk=v1" to force using AWS SDK v1, "awssdk=v2" to force using AWS SDK v2, - * or anything else to accept the default. - * - * For V1, see gocloud.dev/aws/ConfigFromURLParams for supported query parameters - * for overriding the aws.Session from the URL. - * For V2, see gocloud.dev/aws/V2ConfigFromURLParams. - */ - interface URLOpener { + interface MssqlBuilder { /** - * UseV2 indicates whether the AWS SDK V2 should be used. + * QuoteSimpleColumnName quotes a simple column name. + * A simple column name does not contain any table prefix. */ - useV2: boolean + quoteSimpleColumnName(s: string): string + } + interface MssqlBuilder { /** - * Options specifies the options to pass to OpenBucket. + * RenameTable creates a Query that can be used to rename a table. */ - options: Options + renameTable(oldName: string, newName: string): (Query) } - interface URLOpener { + interface MssqlBuilder { /** - * OpenBucketURL opens a blob.Bucket based on u. + * RenameColumn creates a Query that can be used to rename a column in a table. */ - openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) + renameColumn(table: string, oldName: string, newName: string): (Query) } - /** - * Options sets options for constructing a *blob.Bucket backed by fileblob. - */ - interface Options { + interface MssqlBuilder { /** - * UseLegacyList forces the use of ListObjects instead of ListObjectsV2. - * Some S3-compatible services (like CEPH) do not currently support - * ListObjectsV2. + * AlterColumn creates a Query that can be used to change the definition of a table column. */ - useLegacyList: boolean + alterColumn(table: string, col: string, typ: string): (Query) } - interface openBucketV2 { + interface MssqlQueryBuilder { /** - * OpenBucketV2 returns a *blob.Bucket backed by S3, using AWS SDK v2. + * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. */ - (ctx: context.Context, client: s3v2.Client, bucketName: string, opts: Options): (blob.Bucket) + buildOrderByAndLimit(sql: string, cols: Array, limit: number, offset: number): string } /** - * reader reads an S3 object. It implements io.ReadCloser. + * MysqlBuilder is the builder for MySQL databases. */ - interface reader { - } - interface reader { - read(p: string|Array): number + type _subuBlWt = BaseBuilder + interface MysqlBuilder extends _subuBlWt { } - interface reader { + interface newMysqlBuilder { /** - * Close closes the reader itself. It must be called when done reading. + * NewMysqlBuilder creates a new MysqlBuilder instance. */ - close(): void - } - interface reader { - as(i: { - }): boolean - } - interface reader { - attributes(): (any) - } - /** - * writer writes an S3 object, it implements io.WriteCloser. - */ - interface writer { + (db: DB, executor: Executor): Builder } - interface writer { + interface MysqlBuilder { /** - * Write appends p to w.pw. User must call Close to close the w after done writing. + * QueryBuilder returns the query builder supporting the current DB. */ - write(p: string|Array): number + queryBuilder(): QueryBuilder } - interface writer { + interface MysqlBuilder { /** - * Upload reads from r. Per the driver, it is guaranteed to be the only - * write call for this writer. + * Select returns a new SelectQuery object that can be used to build a SELECT statement. + * The parameters to this method should be the list column names to be selected. + * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - upload(r: io.Reader): void + select(...cols: string[]): (SelectQuery) } - interface writer { + interface MysqlBuilder { /** - * Close completes the writer and closes it. Any error occurring during write - * will be returned. If a writer is closed before any Write is called, Close - * will create an empty file at the given key. + * Model returns a new ModelQuery object that can be used to perform model-based DB operations. + * The model passed to this method should be a pointer to a model struct. */ - close(): void + model(model: { + }): (ModelQuery) } - /** - * bucket represents an S3 bucket and handles read, write and delete operations. - */ - interface bucket { + interface MysqlBuilder { + /** + * QuoteSimpleTableName quotes a simple table name. + * A simple table name does not contain any schema prefix. + */ + quoteSimpleTableName(s: string): string } - interface bucket { - close(): void + interface MysqlBuilder { + /** + * QuoteSimpleColumnName quotes a simple column name. + * A simple column name does not contain any table prefix. + */ + quoteSimpleColumnName(s: string): string } - interface bucket { - errorCode(err: Error): gcerrors.ErrorCode + interface MysqlBuilder { + /** + * Upsert creates a Query that represents an UPSERT SQL statement. + * Upsert inserts a row into the table if the primary key or unique index is not found. + * Otherwise it will update the row with the new values. + * The keys of cols are the column names, while the values of cols are the corresponding column + * values to be inserted. + */ + upsert(table: string, cols: Params, ...constraints: string[]): (Query) } - interface bucket { + interface MysqlBuilder { /** - * ListPaged implements driver.ListPaged. + * RenameColumn creates a Query that can be used to rename a column in a table. */ - listPaged(ctx: context.Context, opts: any): (any) + renameColumn(table: string, oldName: string, newName: string): (Query) } - interface bucket { + interface MysqlBuilder { /** - * As implements driver.As. + * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. */ - as(i: { - }): boolean + dropPrimaryKey(table: string, name: string): (Query) } - interface bucket { + interface MysqlBuilder { /** - * As implements driver.ErrorAs. + * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. */ - errorAs(err: Error, i: { - }): boolean + dropForeignKey(table: string, name: string): (Query) } - interface bucket { + /** + * OciBuilder is the builder for Oracle databases. + */ + type _submEsSq = BaseBuilder + interface OciBuilder extends _submEsSq { + } + /** + * OciQueryBuilder is the query builder for Oracle databases. + */ + type _subSwOZs = BaseQueryBuilder + interface OciQueryBuilder extends _subSwOZs { + } + interface newOciBuilder { /** - * Attributes implements driver.Attributes. + * NewOciBuilder creates a new OciBuilder instance. */ - attributes(ctx: context.Context, key: string): (any) + (db: DB, executor: Executor): Builder } - interface bucket { + interface OciBuilder { /** - * NewRangeReader implements driver.NewRangeReader. + * Select returns a new SelectQuery object that can be used to build a SELECT statement. + * The parameters to this method should be the list column names to be selected. + * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - newRangeReader(ctx: context.Context, key: string, offset: number, length: number, opts: any): any + select(...cols: string[]): (SelectQuery) } - interface bucket { + interface OciBuilder { /** - * NewTypedWriter implements driver.NewTypedWriter. + * Model returns a new ModelQuery object that can be used to perform model-based DB operations. + * The model passed to this method should be a pointer to a model struct. */ - newTypedWriter(ctx: context.Context, key: string, contentType: string, opts: any): any + model(model: { + }): (ModelQuery) } - interface bucket { + interface OciBuilder { /** - * Copy implements driver.Copy. + * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. */ - copy(ctx: context.Context, dstKey: string, srcKey: string, opts: any): void + generatePlaceholder(i: number): string } - interface bucket { + interface OciBuilder { /** - * Delete implements driver.Delete. + * QueryBuilder returns the query builder supporting the current DB. */ - delete(ctx: context.Context, key: string): void + queryBuilder(): QueryBuilder } - interface bucket { - signedURL(ctx: context.Context, key: string, opts: any): string + interface OciBuilder { + /** + * DropIndex creates a Query that can be used to remove the named index from a table. + */ + dropIndex(table: string, name: string): (Query) } -} - -/** - * Package validation provides configurable and extensible rules for validating data of various types. - */ -namespace ozzo_validation { - /** - * Error interface represents an validation error - */ - interface Error { - [key:string]: any; - error(): string - code(): string - message(): string - setMessage(_arg0: string): Error - params(): _TygojaDict - setParams(_arg0: _TygojaDict): Error + interface OciBuilder { + /** + * RenameTable creates a Query that can be used to rename a table. + */ + renameTable(oldName: string, newName: string): (Query) } -} - -namespace middleware { - interface bodyLimit { + interface OciBuilder { /** - * BodyLimit returns a BodyLimit middleware. - * - * BodyLimit middleware sets the maximum allowed size for a request body, if the size exceeds the configured limit, it - * sends "413 - Request Entity Too Large" response. The BodyLimit is determined based on both `Content-Length` request - * header and actual content read, which makes it super secure. + * AlterColumn creates a Query that can be used to change the definition of a table column. */ - (limitBytes: number): echo.MiddlewareFunc + alterColumn(table: string, col: string, typ: string): (Query) } - interface gzip { + interface OciQueryBuilder { /** - * Gzip returns a middleware which compresses HTTP response using gzip compression scheme. + * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. */ - (): echo.MiddlewareFunc + buildOrderByAndLimit(sql: string, cols: Array, limit: number, offset: number): string } -} - -/** - * Package dbx provides a set of DB-agnostic and easy-to-use query building methods for relational databases. - */ -namespace dbx { /** - * Builder supports building SQL statements in a DB-agnostic way. - * Builder mainly provides two sets of query building methods: those building SELECT statements - * and those manipulating DB data or schema (e.g. INSERT statements, CREATE TABLE statements). + * PgsqlBuilder is the builder for PostgreSQL databases. */ - interface Builder { - [key:string]: any; + type _subJVUHR = BaseBuilder + interface PgsqlBuilder extends _subJVUHR { + } + interface newPgsqlBuilder { /** - * NewQuery creates a new Query object with the given SQL statement. - * The SQL statement may contain parameter placeholders which can be bound with actual parameter - * values before the statement is executed. + * NewPgsqlBuilder creates a new PgsqlBuilder instance. */ - newQuery(_arg0: string): (Query) + (db: DB, executor: Executor): Builder + } + interface PgsqlBuilder { /** * Select returns a new SelectQuery object that can be used to build a SELECT statement. * The parameters to this method should be the list column names to be selected. * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - select(..._arg0: string[]): (SelectQuery) + select(...cols: string[]): (SelectQuery) + } + interface PgsqlBuilder { /** - * ModelQuery returns a new ModelQuery object that can be used to perform model insertion, update, and deletion. - * The parameter to this method should be a pointer to the model struct that needs to be inserted, updated, or deleted. + * Model returns a new ModelQuery object that can be used to perform model-based DB operations. + * The model passed to this method should be a pointer to a model struct. */ - model(_arg0: { - }): (ModelQuery) + model(model: { + }): (ModelQuery) + } + interface PgsqlBuilder { /** * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. */ - generatePlaceholder(_arg0: number): string - /** - * Quote quotes a string so that it can be embedded in a SQL statement as a string value. - */ - quote(_arg0: string): string - /** - * QuoteSimpleTableName quotes a simple table name. - * A simple table name does not contain any schema prefix. - */ - quoteSimpleTableName(_arg0: string): string - /** - * QuoteSimpleColumnName quotes a simple column name. - * A simple column name does not contain any table prefix. - */ - quoteSimpleColumnName(_arg0: string): string + generatePlaceholder(i: number): string + } + interface PgsqlBuilder { /** * QueryBuilder returns the query builder supporting the current DB. */ queryBuilder(): QueryBuilder - /** - * Insert creates a Query that represents an INSERT SQL statement. - * The keys of cols are the column names, while the values of cols are the corresponding column - * values to be inserted. - */ - insert(table: string, cols: Params): (Query) + } + interface PgsqlBuilder { /** * Upsert creates a Query that represents an UPSERT SQL statement. * Upsert inserts a row into the table if the primary key or unique index is not found. @@ -3631,1954 +3564,2014 @@ namespace dbx { * values to be inserted. */ upsert(table: string, cols: Params, ...constraints: string[]): (Query) + } + interface PgsqlBuilder { /** - * Update creates a Query that represents an UPDATE SQL statement. - * The keys of cols are the column names, while the values of cols are the corresponding new column - * values. If the "where" expression is nil, the UPDATE SQL statement will have no WHERE clause - * (be careful in this case as the SQL statement will update ALL rows in the table). - */ - update(table: string, cols: Params, where: Expression): (Query) - /** - * Delete creates a Query that represents a DELETE SQL statement. - * If the "where" expression is nil, the DELETE SQL statement will have no WHERE clause - * (be careful in this case as the SQL statement will delete ALL rows in the table). - */ - delete(table: string, where: Expression): (Query) - /** - * CreateTable creates a Query that represents a CREATE TABLE SQL statement. - * The keys of cols are the column names, while the values of cols are the corresponding column types. - * The optional "options" parameters will be appended to the generated SQL statement. + * DropIndex creates a Query that can be used to remove the named index from a table. */ - createTable(table: string, cols: _TygojaDict, ...options: string[]): (Query) + dropIndex(table: string, name: string): (Query) + } + interface PgsqlBuilder { /** * RenameTable creates a Query that can be used to rename a table. */ renameTable(oldName: string, newName: string): (Query) + } + interface PgsqlBuilder { /** - * DropTable creates a Query that can be used to drop a table. + * AlterColumn creates a Query that can be used to change the definition of a table column. */ - dropTable(table: string): (Query) + alterColumn(table: string, col: string, typ: string): (Query) + } + /** + * SqliteBuilder is the builder for SQLite databases. + */ + type _subRxOcr = BaseBuilder + interface SqliteBuilder extends _subRxOcr { + } + interface newSqliteBuilder { /** - * TruncateTable creates a Query that can be used to truncate a table. + * NewSqliteBuilder creates a new SqliteBuilder instance. */ - truncateTable(table: string): (Query) + (db: DB, executor: Executor): Builder + } + interface SqliteBuilder { /** - * AddColumn creates a Query that can be used to add a column to a table. + * QueryBuilder returns the query builder supporting the current DB. */ - addColumn(table: string, col: string, typ: string): (Query) + queryBuilder(): QueryBuilder + } + interface SqliteBuilder { /** - * DropColumn creates a Query that can be used to drop a column from a table. + * Select returns a new SelectQuery object that can be used to build a SELECT statement. + * The parameters to this method should be the list column names to be selected. + * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - dropColumn(table: string, col: string): (Query) + select(...cols: string[]): (SelectQuery) + } + interface SqliteBuilder { /** - * RenameColumn creates a Query that can be used to rename a column in a table. + * Model returns a new ModelQuery object that can be used to perform model-based DB operations. + * The model passed to this method should be a pointer to a model struct. */ - renameColumn(table: string, oldName: string, newName: string): (Query) + model(model: { + }): (ModelQuery) + } + interface SqliteBuilder { /** - * AlterColumn creates a Query that can be used to change the definition of a table column. + * QuoteSimpleTableName quotes a simple table name. + * A simple table name does not contain any schema prefix. */ - alterColumn(table: string, col: string, typ: string): (Query) + quoteSimpleTableName(s: string): string + } + interface SqliteBuilder { /** - * AddPrimaryKey creates a Query that can be used to specify primary key(s) for a table. - * The "name" parameter specifies the name of the primary key constraint. + * QuoteSimpleColumnName quotes a simple column name. + * A simple column name does not contain any table prefix. */ - addPrimaryKey(table: string, name: string, ...cols: string[]): (Query) + quoteSimpleColumnName(s: string): string + } + interface SqliteBuilder { /** - * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. + * DropIndex creates a Query that can be used to remove the named index from a table. */ - dropPrimaryKey(table: string, name: string): (Query) + dropIndex(table: string, name: string): (Query) + } + interface SqliteBuilder { /** - * AddForeignKey creates a Query that can be used to add a foreign key constraint to a table. - * The length of cols and refCols must be the same as they refer to the primary and referential columns. - * The optional "options" parameters will be appended to the SQL statement. They can be used to - * specify options such as "ON DELETE CASCADE". + * TruncateTable creates a Query that can be used to truncate a table. */ - addForeignKey(table: string, name: string, cols: Array, refCols: Array, refTable: string, ...options: string[]): (Query) - /** - * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. + truncateTable(table: string): (Query) + } + interface SqliteBuilder { + /** + * RenameTable creates a Query that can be used to rename a table. */ - dropForeignKey(table: string, name: string): (Query) + renameTable(oldName: string, newName: string): (Query) + } + interface SqliteBuilder { /** - * CreateIndex creates a Query that can be used to create an index for a table. + * AlterColumn creates a Query that can be used to change the definition of a table column. */ - createIndex(table: string, name: string, ...cols: string[]): (Query) + alterColumn(table: string, col: string, typ: string): (Query) + } + interface SqliteBuilder { /** - * CreateUniqueIndex creates a Query that can be used to create a unique index for a table. + * AddPrimaryKey creates a Query that can be used to specify primary key(s) for a table. + * The "name" parameter specifies the name of the primary key constraint. */ - createUniqueIndex(table: string, name: string, ...cols: string[]): (Query) + addPrimaryKey(table: string, name: string, ...cols: string[]): (Query) + } + interface SqliteBuilder { /** - * DropIndex creates a Query that can be used to remove the named index from a table. + * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. */ - dropIndex(table: string, name: string): (Query) + dropPrimaryKey(table: string, name: string): (Query) + } + interface SqliteBuilder { + /** + * AddForeignKey creates a Query that can be used to add a foreign key constraint to a table. + * The length of cols and refCols must be the same as they refer to the primary and referential columns. + * The optional "options" parameters will be appended to the SQL statement. They can be used to + * specify options such as "ON DELETE CASCADE". + */ + addForeignKey(table: string, name: string, cols: Array, refCols: Array, refTable: string, ...options: string[]): (Query) + } + interface SqliteBuilder { + /** + * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. + */ + dropForeignKey(table: string, name: string): (Query) } /** - * BaseBuilder provides a basic implementation of the Builder interface. + * StandardBuilder is the builder that is used by DB for an unknown driver. */ - interface BaseBuilder { + type _subNMrLZ = BaseBuilder + interface StandardBuilder extends _subNMrLZ { } - interface newBaseBuilder { + interface newStandardBuilder { /** - * NewBaseBuilder creates a new BaseBuilder instance. + * NewStandardBuilder creates a new StandardBuilder instance. */ - (db: DB, executor: Executor): (BaseBuilder) + (db: DB, executor: Executor): Builder } - interface BaseBuilder { + interface StandardBuilder { /** - * DB returns the DB instance that this builder is associated with. + * QueryBuilder returns the query builder supporting the current DB. */ - db(): (DB) + queryBuilder(): QueryBuilder } - interface BaseBuilder { + interface StandardBuilder { /** - * Executor returns the executor object (a DB instance or a transaction) for executing SQL statements. + * Select returns a new SelectQuery object that can be used to build a SELECT statement. + * The parameters to this method should be the list column names to be selected. + * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). */ - executor(): Executor + select(...cols: string[]): (SelectQuery) } - interface BaseBuilder { + interface StandardBuilder { /** - * NewQuery creates a new Query object with the given SQL statement. - * The SQL statement may contain parameter placeholders which can be bound with actual parameter - * values before the statement is executed. + * Model returns a new ModelQuery object that can be used to perform model-based DB operations. + * The model passed to this method should be a pointer to a model struct. */ - newQuery(sql: string): (Query) + model(model: { + }): (ModelQuery) } - interface BaseBuilder { + /** + * LogFunc logs a message for each SQL statement being executed. + * This method takes one or multiple parameters. If a single parameter + * is provided, it will be treated as the log message. If multiple parameters + * are provided, they will be passed to fmt.Sprintf() to generate the log message. + */ + interface LogFunc {(format: string, ...a: { + }[]): void } + /** + * PerfFunc is called when a query finishes execution. + * The query execution time is passed to this function so that the DB performance + * can be profiled. The "ns" parameter gives the number of nanoseconds that the + * SQL statement takes to execute, while the "execute" parameter indicates whether + * the SQL statement is executed or queried (usually SELECT statements). + */ + interface PerfFunc {(ns: number, sql: string, execute: boolean): void } + /** + * QueryLogFunc is called each time when performing a SQL query. + * The "t" parameter gives the time that the SQL statement takes to execute, + * while rows and err are the result of the query. + */ + interface QueryLogFunc {(ctx: context.Context, t: time.Duration, sql: string, rows: sql.Rows, err: Error): void } + /** + * ExecLogFunc is called each time when a SQL statement is executed. + * The "t" parameter gives the time that the SQL statement takes to execute, + * while result and err refer to the result of the execution. + */ + interface ExecLogFunc {(ctx: context.Context, t: time.Duration, sql: string, result: sql.Result, err: Error): void } + /** + * BuilderFunc creates a Builder instance using the given DB instance and Executor. + */ + interface BuilderFunc {(_arg0: DB, _arg1: Executor): Builder } + /** + * DB enhances sql.DB by providing a set of DB-agnostic query building methods. + * DB allows easier query building and population of data into Go variables. + */ + type _subGFJZU = Builder + interface DB extends _subGFJZU { /** - * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. + * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ - generatePlaceholder(_arg0: number): string - } - interface BaseBuilder { + fieldMapper: FieldMapFunc /** - * Quote quotes a string so that it can be embedded in a SQL statement as a string value. + * TableMapper maps structs to table names. Defaults to GetTableName. */ - quote(s: string): string - } - interface BaseBuilder { + tableMapper: TableMapFunc /** - * QuoteSimpleTableName quotes a simple table name. - * A simple table name does not contain any schema prefix. + * LogFunc logs the SQL statements being executed. Defaults to nil, meaning no logging. */ - quoteSimpleTableName(s: string): string - } - interface BaseBuilder { + logFunc: LogFunc /** - * QuoteSimpleColumnName quotes a simple column name. - * A simple column name does not contain any table prefix. + * PerfFunc logs the SQL execution time. Defaults to nil, meaning no performance profiling. + * Deprecated: Please use QueryLogFunc and ExecLogFunc instead. */ - quoteSimpleColumnName(s: string): string - } - interface BaseBuilder { + perfFunc: PerfFunc /** - * Insert creates a Query that represents an INSERT SQL statement. - * The keys of cols are the column names, while the values of cols are the corresponding column - * values to be inserted. + * QueryLogFunc is called each time when performing a SQL query that returns data. */ - insert(table: string, cols: Params): (Query) - } - interface BaseBuilder { + queryLogFunc: QueryLogFunc /** - * Upsert creates a Query that represents an UPSERT SQL statement. - * Upsert inserts a row into the table if the primary key or unique index is not found. - * Otherwise it will update the row with the new values. - * The keys of cols are the column names, while the values of cols are the corresponding column - * values to be inserted. + * ExecLogFunc is called each time when a SQL statement is executed. */ - upsert(table: string, cols: Params, ...constraints: string[]): (Query) + execLogFunc: ExecLogFunc } - interface BaseBuilder { + /** + * Errors represents a list of errors. + */ + interface Errors extends Array{} + interface newFromDB { /** - * Update creates a Query that represents an UPDATE SQL statement. - * The keys of cols are the column names, while the values of cols are the corresponding new column - * values. If the "where" expression is nil, the UPDATE SQL statement will have no WHERE clause - * (be careful in this case as the SQL statement will update ALL rows in the table). + * NewFromDB encapsulates an existing database connection. */ - update(table: string, cols: Params, where: Expression): (Query) + (sqlDB: sql.DB, driverName: string): (DB) } - interface BaseBuilder { + interface open { /** - * Delete creates a Query that represents a DELETE SQL statement. - * If the "where" expression is nil, the DELETE SQL statement will have no WHERE clause - * (be careful in this case as the SQL statement will delete ALL rows in the table). + * Open opens a database specified by a driver name and data source name (DSN). + * Note that Open does not check if DSN is specified correctly. It doesn't try to establish a DB connection either. + * Please refer to sql.Open() for more information. */ - delete(table: string, where: Expression): (Query) + (driverName: string, dsn: string): (DB) } - interface BaseBuilder { + interface mustOpen { /** - * CreateTable creates a Query that represents a CREATE TABLE SQL statement. - * The keys of cols are the column names, while the values of cols are the corresponding column types. - * The optional "options" parameters will be appended to the generated SQL statement. + * MustOpen opens a database and establishes a connection to it. + * Please refer to sql.Open() and sql.Ping() for more information. */ - createTable(table: string, cols: _TygojaDict, ...options: string[]): (Query) + (driverName: string, dsn: string): (DB) } - interface BaseBuilder { + interface DB { /** - * RenameTable creates a Query that can be used to rename a table. + * Clone makes a shallow copy of DB. */ - renameTable(oldName: string, newName: string): (Query) + clone(): (DB) } - interface BaseBuilder { + interface DB { /** - * DropTable creates a Query that can be used to drop a table. + * WithContext returns a new instance of DB associated with the given context. */ - dropTable(table: string): (Query) + withContext(ctx: context.Context): (DB) } - interface BaseBuilder { + interface DB { /** - * TruncateTable creates a Query that can be used to truncate a table. + * Context returns the context associated with the DB instance. + * It returns nil if no context is associated. */ - truncateTable(table: string): (Query) + context(): context.Context } - interface BaseBuilder { + interface DB { /** - * AddColumn creates a Query that can be used to add a column to a table. + * DB returns the sql.DB instance encapsulated by dbx.DB. */ - addColumn(table: string, col: string, typ: string): (Query) + db(): (sql.DB) } - interface BaseBuilder { + interface DB { /** - * DropColumn creates a Query that can be used to drop a column from a table. + * Close closes the database, releasing any open resources. + * It is rare to Close a DB, as the DB handle is meant to be + * long-lived and shared between many goroutines. */ - dropColumn(table: string, col: string): (Query) + close(): void } - interface BaseBuilder { + interface DB { /** - * RenameColumn creates a Query that can be used to rename a column in a table. + * Begin starts a transaction. */ - renameColumn(table: string, oldName: string, newName: string): (Query) + begin(): (Tx) } - interface BaseBuilder { + interface DB { /** - * AlterColumn creates a Query that can be used to change the definition of a table column. + * BeginTx starts a transaction with the given context and transaction options. */ - alterColumn(table: string, col: string, typ: string): (Query) + beginTx(ctx: context.Context, opts: sql.TxOptions): (Tx) } - interface BaseBuilder { + interface DB { /** - * AddPrimaryKey creates a Query that can be used to specify primary key(s) for a table. - * The "name" parameter specifies the name of the primary key constraint. + * Wrap encapsulates an existing transaction. */ - addPrimaryKey(table: string, name: string, ...cols: string[]): (Query) + wrap(sqlTx: sql.Tx): (Tx) } - interface BaseBuilder { + interface DB { /** - * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. + * Transactional starts a transaction and executes the given function. + * If the function returns an error, the transaction will be rolled back. + * Otherwise, the transaction will be committed. */ - dropPrimaryKey(table: string, name: string): (Query) + transactional(f: (_arg0: Tx) => void): void } - interface BaseBuilder { + interface DB { /** - * AddForeignKey creates a Query that can be used to add a foreign key constraint to a table. - * The length of cols and refCols must be the same as they refer to the primary and referential columns. - * The optional "options" parameters will be appended to the SQL statement. They can be used to - * specify options such as "ON DELETE CASCADE". + * TransactionalContext starts a transaction and executes the given function with the given context and transaction options. + * If the function returns an error, the transaction will be rolled back. + * Otherwise, the transaction will be committed. */ - addForeignKey(table: string, name: string, cols: Array, refCols: Array, refTable: string, ...options: string[]): (Query) + transactionalContext(ctx: context.Context, opts: sql.TxOptions, f: (_arg0: Tx) => void): void } - interface BaseBuilder { + interface DB { /** - * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. + * DriverName returns the name of the DB driver. */ - dropForeignKey(table: string, name: string): (Query) + driverName(): string } - interface BaseBuilder { + interface DB { /** - * CreateIndex creates a Query that can be used to create an index for a table. + * QuoteTableName quotes the given table name appropriately. + * If the table name contains DB schema prefix, it will be handled accordingly. + * This method will do nothing if the table name is already quoted or if it contains parenthesis. */ - createIndex(table: string, name: string, ...cols: string[]): (Query) + quoteTableName(s: string): string } - interface BaseBuilder { + interface DB { /** - * CreateUniqueIndex creates a Query that can be used to create a unique index for a table. + * QuoteColumnName quotes the given column name appropriately. + * If the table name contains table name prefix, it will be handled accordingly. + * This method will do nothing if the column name is already quoted or if it contains parenthesis. */ - createUniqueIndex(table: string, name: string, ...cols: string[]): (Query) + quoteColumnName(s: string): string } - interface BaseBuilder { + interface Errors { /** - * DropIndex creates a Query that can be used to remove the named index from a table. + * Error returns the error string of Errors. */ - dropIndex(table: string, name: string): (Query) + error(): string } /** - * MssqlBuilder is the builder for SQL Server databases. + * Expression represents a DB expression that can be embedded in a SQL statement. */ - type _subHvLxi = BaseBuilder - interface MssqlBuilder extends _subHvLxi { + interface Expression { + [key:string]: any; + /** + * Build converts an expression into a SQL fragment. + * If the expression contains binding parameters, they will be added to the given Params. + */ + build(_arg0: DB, _arg1: Params): string } /** - * MssqlQueryBuilder is the query builder for SQL Server databases. + * HashExp represents a hash expression. + * + * A hash expression is a map whose keys are DB column names which need to be filtered according + * to the corresponding values. For example, HashExp{"level": 2, "dept": 10} will generate + * the SQL: "level"=2 AND "dept"=10. + * + * HashExp also handles nil values and slice values. For example, HashExp{"level": []interface{}{1, 2}, "dept": nil} + * will generate: "level" IN (1, 2) AND "dept" IS NULL. */ - type _subVtFMi = BaseQueryBuilder - interface MssqlQueryBuilder extends _subVtFMi { - } - interface newMssqlBuilder { + interface HashExp extends _TygojaDict{} + interface newExp { /** - * NewMssqlBuilder creates a new MssqlBuilder instance. + * NewExp generates an expression with the specified SQL fragment and the optional binding parameters. */ - (db: DB, executor: Executor): Builder + (e: string, ...params: Params[]): Expression } - interface MssqlBuilder { + interface not { /** - * QueryBuilder returns the query builder supporting the current DB. + * Not generates a NOT expression which prefixes "NOT" to the specified expression. */ - queryBuilder(): QueryBuilder + (e: Expression): Expression } - interface MssqlBuilder { + interface and { /** - * Select returns a new SelectQuery object that can be used to build a SELECT statement. - * The parameters to this method should be the list column names to be selected. - * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). + * And generates an AND expression which concatenates the given expressions with "AND". */ - select(...cols: string[]): (SelectQuery) + (...exps: Expression[]): Expression } - interface MssqlBuilder { + interface or { /** - * Model returns a new ModelQuery object that can be used to perform model-based DB operations. - * The model passed to this method should be a pointer to a model struct. + * Or generates an OR expression which concatenates the given expressions with "OR". */ - model(model: { - }): (ModelQuery) + (...exps: Expression[]): Expression } - interface MssqlBuilder { + interface _in { /** - * QuoteSimpleTableName quotes a simple table name. - * A simple table name does not contain any schema prefix. + * In generates an IN expression for the specified column and the list of allowed values. + * If values is empty, a SQL "0=1" will be generated which represents a false expression. */ - quoteSimpleTableName(s: string): string + (col: string, ...values: { + }[]): Expression } - interface MssqlBuilder { + interface notIn { /** - * QuoteSimpleColumnName quotes a simple column name. - * A simple column name does not contain any table prefix. + * NotIn generates an NOT IN expression for the specified column and the list of disallowed values. + * If values is empty, an empty string will be returned indicating a true expression. */ - quoteSimpleColumnName(s: string): string + (col: string, ...values: { + }[]): Expression } - interface MssqlBuilder { + interface like { /** - * RenameTable creates a Query that can be used to rename a table. + * Like generates a LIKE expression for the specified column and the possible strings that the column should be like. + * If multiple values are present, the column should be like *all* of them. For example, Like("name", "key", "word") + * will generate a SQL expression: "name" LIKE "%key%" AND "name" LIKE "%word%". + * + * By default, each value will be surrounded by "%" to enable partial matching. If a value contains special characters + * such as "%", "\", "_", they will also be properly escaped. + * + * You may call Escape() and/or Match() to change the default behavior. For example, Like("name", "key").Match(false, true) + * generates "name" LIKE "key%". */ - renameTable(oldName: string, newName: string): (Query) + (col: string, ...values: string[]): (LikeExp) } - interface MssqlBuilder { + interface notLike { /** - * RenameColumn creates a Query that can be used to rename a column in a table. + * NotLike generates a NOT LIKE expression. + * For example, NotLike("name", "key", "word") will generate a SQL expression: + * "name" NOT LIKE "%key%" AND "name" NOT LIKE "%word%". Please see Like() for more details. */ - renameColumn(table: string, oldName: string, newName: string): (Query) + (col: string, ...values: string[]): (LikeExp) } - interface MssqlBuilder { + interface orLike { /** - * AlterColumn creates a Query that can be used to change the definition of a table column. + * OrLike generates an OR LIKE expression. + * This is similar to Like() except that the column should be like one of the possible values. + * For example, OrLike("name", "key", "word") will generate a SQL expression: + * "name" LIKE "%key%" OR "name" LIKE "%word%". Please see Like() for more details. */ - alterColumn(table: string, col: string, typ: string): (Query) + (col: string, ...values: string[]): (LikeExp) } - interface MssqlQueryBuilder { + interface orNotLike { /** - * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. + * OrNotLike generates an OR NOT LIKE expression. + * For example, OrNotLike("name", "key", "word") will generate a SQL expression: + * "name" NOT LIKE "%key%" OR "name" NOT LIKE "%word%". Please see Like() for more details. */ - buildOrderByAndLimit(sql: string, cols: Array, limit: number, offset: number): string - } - /** - * MysqlBuilder is the builder for MySQL databases. - */ - type _subcGgwD = BaseBuilder - interface MysqlBuilder extends _subcGgwD { + (col: string, ...values: string[]): (LikeExp) } - interface newMysqlBuilder { + interface exists { /** - * NewMysqlBuilder creates a new MysqlBuilder instance. + * Exists generates an EXISTS expression by prefixing "EXISTS" to the given expression. */ - (db: DB, executor: Executor): Builder + (exp: Expression): Expression } - interface MysqlBuilder { + interface notExists { /** - * QueryBuilder returns the query builder supporting the current DB. + * NotExists generates an EXISTS expression by prefixing "NOT EXISTS" to the given expression. */ - queryBuilder(): QueryBuilder + (exp: Expression): Expression } - interface MysqlBuilder { + interface between { /** - * Select returns a new SelectQuery object that can be used to build a SELECT statement. - * The parameters to this method should be the list column names to be selected. - * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). + * Between generates a BETWEEN expression. + * For example, Between("age", 10, 30) generates: "age" BETWEEN 10 AND 30 */ - select(...cols: string[]): (SelectQuery) + (col: string, from: { + }, to: { + }): Expression } - interface MysqlBuilder { + interface notBetween { /** - * Model returns a new ModelQuery object that can be used to perform model-based DB operations. - * The model passed to this method should be a pointer to a model struct. + * NotBetween generates a NOT BETWEEN expression. + * For example, NotBetween("age", 10, 30) generates: "age" NOT BETWEEN 10 AND 30 */ - model(model: { - }): (ModelQuery) + (col: string, from: { + }, to: { + }): Expression } - interface MysqlBuilder { - /** - * QuoteSimpleTableName quotes a simple table name. - * A simple table name does not contain any schema prefix. - */ - quoteSimpleTableName(s: string): string + /** + * Exp represents an expression with a SQL fragment and a list of optional binding parameters. + */ + interface Exp { } - interface MysqlBuilder { + interface Exp { /** - * QuoteSimpleColumnName quotes a simple column name. - * A simple column name does not contain any table prefix. + * Build converts an expression into a SQL fragment. */ - quoteSimpleColumnName(s: string): string + build(db: DB, params: Params): string } - interface MysqlBuilder { + interface HashExp { /** - * Upsert creates a Query that represents an UPSERT SQL statement. - * Upsert inserts a row into the table if the primary key or unique index is not found. - * Otherwise it will update the row with the new values. - * The keys of cols are the column names, while the values of cols are the corresponding column - * values to be inserted. + * Build converts an expression into a SQL fragment. */ - upsert(table: string, cols: Params, ...constraints: string[]): (Query) + build(db: DB, params: Params): string } - interface MysqlBuilder { - /** - * RenameColumn creates a Query that can be used to rename a column in a table. - */ - renameColumn(table: string, oldName: string, newName: string): (Query) + /** + * NotExp represents an expression that should prefix "NOT" to a specified expression. + */ + interface NotExp { } - interface MysqlBuilder { + interface NotExp { /** - * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. + * Build converts an expression into a SQL fragment. */ - dropPrimaryKey(table: string, name: string): (Query) + build(db: DB, params: Params): string } - interface MysqlBuilder { + /** + * AndOrExp represents an expression that concatenates multiple expressions using either "AND" or "OR". + */ + interface AndOrExp { + } + interface AndOrExp { /** - * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. + * Build converts an expression into a SQL fragment. */ - dropForeignKey(table: string, name: string): (Query) + build(db: DB, params: Params): string } /** - * OciBuilder is the builder for Oracle databases. + * InExp represents an "IN" or "NOT IN" expression. */ - type _subPThpx = BaseBuilder - interface OciBuilder extends _subPThpx { + interface InExp { + } + interface InExp { + /** + * Build converts an expression into a SQL fragment. + */ + build(db: DB, params: Params): string } /** - * OciQueryBuilder is the query builder for Oracle databases. + * LikeExp represents a variant of LIKE expressions. */ - type _subNOiLF = BaseQueryBuilder - interface OciQueryBuilder extends _subNOiLF { - } - interface newOciBuilder { + interface LikeExp { /** - * NewOciBuilder creates a new OciBuilder instance. + * Like stores the LIKE operator. It can be "LIKE", "NOT LIKE". + * It may also be customized as something like "ILIKE". */ - (db: DB, executor: Executor): Builder + like: string } - interface OciBuilder { + interface LikeExp { /** - * Select returns a new SelectQuery object that can be used to build a SELECT statement. - * The parameters to this method should be the list column names to be selected. - * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). + * Escape specifies how a LIKE expression should be escaped. + * Each string at position 2i represents a special character and the string at position 2i+1 is + * the corresponding escaped version. */ - select(...cols: string[]): (SelectQuery) + escape(...chars: string[]): (LikeExp) } - interface OciBuilder { + interface LikeExp { /** - * Model returns a new ModelQuery object that can be used to perform model-based DB operations. - * The model passed to this method should be a pointer to a model struct. + * Match specifies whether to do wildcard matching on the left and/or right of given strings. */ - model(model: { - }): (ModelQuery) + match(left: boolean, right: boolean): (LikeExp) } - interface OciBuilder { + interface LikeExp { /** - * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. + * Build converts an expression into a SQL fragment. */ - generatePlaceholder(i: number): string + build(db: DB, params: Params): string } - interface OciBuilder { - /** - * QueryBuilder returns the query builder supporting the current DB. - */ - queryBuilder(): QueryBuilder + /** + * ExistsExp represents an EXISTS or NOT EXISTS expression. + */ + interface ExistsExp { } - interface OciBuilder { + interface ExistsExp { /** - * DropIndex creates a Query that can be used to remove the named index from a table. + * Build converts an expression into a SQL fragment. */ - dropIndex(table: string, name: string): (Query) + build(db: DB, params: Params): string } - interface OciBuilder { + /** + * BetweenExp represents a BETWEEN or a NOT BETWEEN expression. + */ + interface BetweenExp { + } + interface BetweenExp { /** - * RenameTable creates a Query that can be used to rename a table. + * Build converts an expression into a SQL fragment. */ - renameTable(oldName: string, newName: string): (Query) + build(db: DB, params: Params): string } - interface OciBuilder { + interface enclose { /** - * AlterColumn creates a Query that can be used to change the definition of a table column. + * Enclose surrounds the provided nonempty expression with parenthesis "()". */ - alterColumn(table: string, col: string, typ: string): (Query) + (exp: Expression): Expression } - interface OciQueryBuilder { + /** + * EncloseExp represents a parenthesis enclosed expression. + */ + interface EncloseExp { + } + interface EncloseExp { /** - * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. + * Build converts an expression into a SQL fragment. */ - buildOrderByAndLimit(sql: string, cols: Array, limit: number, offset: number): string + build(db: DB, params: Params): string } /** - * PgsqlBuilder is the builder for PostgreSQL databases. + * TableModel is the interface that should be implemented by models which have unconventional table names. */ - type _subwdQYB = BaseBuilder - interface PgsqlBuilder extends _subwdQYB { + interface TableModel { + [key:string]: any; + tableName(): string } - interface newPgsqlBuilder { + /** + * ModelQuery represents a query associated with a struct model. + */ + interface ModelQuery { + } + interface newModelQuery { + (model: { + }, fieldMapFunc: FieldMapFunc, db: DB, builder: Builder): (ModelQuery) + } + interface ModelQuery { /** - * NewPgsqlBuilder creates a new PgsqlBuilder instance. + * Context returns the context associated with the query. */ - (db: DB, executor: Executor): Builder + context(): context.Context } - interface PgsqlBuilder { + interface ModelQuery { /** - * Select returns a new SelectQuery object that can be used to build a SELECT statement. - * The parameters to this method should be the list column names to be selected. - * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). + * WithContext associates a context with the query. */ - select(...cols: string[]): (SelectQuery) + withContext(ctx: context.Context): (ModelQuery) } - interface PgsqlBuilder { + interface ModelQuery { /** - * Model returns a new ModelQuery object that can be used to perform model-based DB operations. - * The model passed to this method should be a pointer to a model struct. + * Exclude excludes the specified struct fields from being inserted/updated into the DB table. */ - model(model: { - }): (ModelQuery) + exclude(...attrs: string[]): (ModelQuery) } - interface PgsqlBuilder { + interface ModelQuery { /** - * GeneratePlaceholder generates an anonymous parameter placeholder with the given parameter ID. + * Insert inserts a row in the table using the struct model associated with this query. + * + * By default, it inserts *all* public fields into the table, including those nil or empty ones. + * You may pass a list of the fields to this method to indicate that only those fields should be inserted. + * You may also call Exclude to exclude some fields from being inserted. + * + * If a model has an empty primary key, it is considered auto-incremental and the corresponding struct + * field will be filled with the generated primary key value after a successful insertion. */ - generatePlaceholder(i: number): string + insert(...attrs: string[]): void } - interface PgsqlBuilder { + interface ModelQuery { /** - * QueryBuilder returns the query builder supporting the current DB. + * Update updates a row in the table using the struct model associated with this query. + * The row being updated has the same primary key as specified by the model. + * + * By default, it updates *all* public fields in the table, including those nil or empty ones. + * You may pass a list of the fields to this method to indicate that only those fields should be updated. + * You may also call Exclude to exclude some fields from being updated. */ - queryBuilder(): QueryBuilder + update(...attrs: string[]): void } - interface PgsqlBuilder { + interface ModelQuery { /** - * Upsert creates a Query that represents an UPSERT SQL statement. - * Upsert inserts a row into the table if the primary key or unique index is not found. - * Otherwise it will update the row with the new values. - * The keys of cols are the column names, while the values of cols are the corresponding column - * values to be inserted. + * Delete deletes a row in the table using the primary key specified by the struct model associated with this query. */ - upsert(table: string, cols: Params, ...constraints: string[]): (Query) + delete(): void } - interface PgsqlBuilder { + /** + * ExecHookFunc executes before op allowing custom handling like auto fail/retry. + */ + interface ExecHookFunc {(q: Query, op: () => void): void } + /** + * OneHookFunc executes right before the query populate the row result from One() call (aka. op). + */ + interface OneHookFunc {(q: Query, a: { + }, op: (b: { + }) => void): void } + /** + * AllHookFunc executes right before the query populate the row result from All() call (aka. op). + */ + interface AllHookFunc {(q: Query, sliceA: { + }, op: (sliceB: { + }) => void): void } + /** + * Params represents a list of parameter values to be bound to a SQL statement. + * The map keys are the parameter names while the map values are the corresponding parameter values. + */ + interface Params extends _TygojaDict{} + /** + * Executor prepares, executes, or queries a SQL statement. + */ + interface Executor { + [key:string]: any; /** - * DropIndex creates a Query that can be used to remove the named index from a table. + * Exec executes a SQL statement */ - dropIndex(table: string, name: string): (Query) - } - interface PgsqlBuilder { + exec(query: string, ...args: { + }[]): sql.Result /** - * RenameTable creates a Query that can be used to rename a table. + * ExecContext executes a SQL statement with the given context */ - renameTable(oldName: string, newName: string): (Query) - } - interface PgsqlBuilder { + execContext(ctx: context.Context, query: string, ...args: { + }[]): sql.Result /** - * AlterColumn creates a Query that can be used to change the definition of a table column. + * Query queries a SQL statement */ - alterColumn(table: string, col: string, typ: string): (Query) + query(query: string, ...args: { + }[]): (sql.Rows) + /** + * QueryContext queries a SQL statement with the given context + */ + queryContext(ctx: context.Context, query: string, ...args: { + }[]): (sql.Rows) + /** + * Prepare creates a prepared statement + */ + prepare(query: string): (sql.Stmt) } /** - * SqliteBuilder is the builder for SQLite databases. + * Query represents a SQL statement to be executed. */ - type _subuwoLq = BaseBuilder - interface SqliteBuilder extends _subuwoLq { - } - interface newSqliteBuilder { + interface Query { /** - * NewSqliteBuilder creates a new SqliteBuilder instance. + * FieldMapper maps struct field names to DB column names. */ - (db: DB, executor: Executor): Builder - } - interface SqliteBuilder { + fieldMapper: FieldMapFunc /** - * QueryBuilder returns the query builder supporting the current DB. + * LastError contains the last error (if any) of the query. + * LastError is cleared by Execute(), Row(), Rows(), One(), and All(). */ - queryBuilder(): QueryBuilder + lastError: Error + /** + * LogFunc is used to log the SQL statement being executed. + */ + logFunc: LogFunc + /** + * PerfFunc is used to log the SQL execution time. It is ignored if nil. + * Deprecated: Please use QueryLogFunc and ExecLogFunc instead. + */ + perfFunc: PerfFunc + /** + * QueryLogFunc is called each time when performing a SQL query that returns data. + */ + queryLogFunc: QueryLogFunc + /** + * ExecLogFunc is called each time when a SQL statement is executed. + */ + execLogFunc: ExecLogFunc } - interface SqliteBuilder { + interface newQuery { /** - * Select returns a new SelectQuery object that can be used to build a SELECT statement. - * The parameters to this method should be the list column names to be selected. - * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). + * NewQuery creates a new Query with the given SQL statement. */ - select(...cols: string[]): (SelectQuery) + (db: DB, executor: Executor, sql: string): (Query) } - interface SqliteBuilder { + interface Query { /** - * Model returns a new ModelQuery object that can be used to perform model-based DB operations. - * The model passed to this method should be a pointer to a model struct. + * SQL returns the original SQL used to create the query. + * The actual SQL (RawSQL) being executed is obtained by replacing the named + * parameter placeholders with anonymous ones. */ - model(model: { - }): (ModelQuery) + sql(): string } - interface SqliteBuilder { + interface Query { /** - * QuoteSimpleTableName quotes a simple table name. - * A simple table name does not contain any schema prefix. + * Context returns the context associated with the query. */ - quoteSimpleTableName(s: string): string + context(): context.Context } - interface SqliteBuilder { + interface Query { /** - * QuoteSimpleColumnName quotes a simple column name. - * A simple column name does not contain any table prefix. + * WithContext associates a context with the query. */ - quoteSimpleColumnName(s: string): string + withContext(ctx: context.Context): (Query) } - interface SqliteBuilder { + interface Query { /** - * DropIndex creates a Query that can be used to remove the named index from a table. + * WithExecHook associates the provided exec hook function with the query. + * + * It is called for every Query resolver (Execute(), One(), All(), Row(), Column()), + * allowing you to implement auto fail/retry or any other additional handling. */ - dropIndex(table: string, name: string): (Query) + withExecHook(fn: ExecHookFunc): (Query) } - interface SqliteBuilder { + interface Query { /** - * TruncateTable creates a Query that can be used to truncate a table. + * WithOneHook associates the provided hook function with the query, + * called on q.One(), allowing you to implement custom struct scan based + * on the One() argument and/or result. */ - truncateTable(table: string): (Query) + withOneHook(fn: OneHookFunc): (Query) } - interface SqliteBuilder { + interface Query { /** - * RenameTable creates a Query that can be used to rename a table. + * WithOneHook associates the provided hook function with the query, + * called on q.All(), allowing you to implement custom slice scan based + * on the All() argument and/or result. */ - renameTable(oldName: string, newName: string): (Query) + withAllHook(fn: AllHookFunc): (Query) } - interface SqliteBuilder { + interface Query { /** - * AlterColumn creates a Query that can be used to change the definition of a table column. + * Params returns the parameters to be bound to the SQL statement represented by this query. */ - alterColumn(table: string, col: string, typ: string): (Query) + params(): Params } - interface SqliteBuilder { + interface Query { /** - * AddPrimaryKey creates a Query that can be used to specify primary key(s) for a table. - * The "name" parameter specifies the name of the primary key constraint. + * Prepare creates a prepared statement for later queries or executions. + * Close() should be called after finishing all queries. */ - addPrimaryKey(table: string, name: string, ...cols: string[]): (Query) + prepare(): (Query) } - interface SqliteBuilder { + interface Query { /** - * DropPrimaryKey creates a Query that can be used to remove the named primary key constraint from a table. + * Close closes the underlying prepared statement. + * Close does nothing if the query has not been prepared before. */ - dropPrimaryKey(table: string, name: string): (Query) + close(): void } - interface SqliteBuilder { + interface Query { /** - * AddForeignKey creates a Query that can be used to add a foreign key constraint to a table. - * The length of cols and refCols must be the same as they refer to the primary and referential columns. - * The optional "options" parameters will be appended to the SQL statement. They can be used to - * specify options such as "ON DELETE CASCADE". + * Bind sets the parameters that should be bound to the SQL statement. + * The parameter placeholders in the SQL statement are in the format of "{:ParamName}". */ - addForeignKey(table: string, name: string, cols: Array, refCols: Array, refTable: string, ...options: string[]): (Query) + bind(params: Params): (Query) } - interface SqliteBuilder { + interface Query { /** - * DropForeignKey creates a Query that can be used to remove the named foreign key constraint from a table. + * Execute executes the SQL statement without retrieving data. */ - dropForeignKey(table: string, name: string): (Query) + execute(): sql.Result } - /** - * StandardBuilder is the builder that is used by DB for an unknown driver. - */ - type _subQKHka = BaseBuilder - interface StandardBuilder extends _subQKHka { + interface Query { + /** + * One executes the SQL statement and populates the first row of the result into a struct or NullStringMap. + * Refer to Rows.ScanStruct() and Rows.ScanMap() for more details on how to specify + * the variable to be populated. + * Note that when the query has no rows in the result set, an sql.ErrNoRows will be returned. + */ + one(a: { + }): void } - interface newStandardBuilder { + interface Query { /** - * NewStandardBuilder creates a new StandardBuilder instance. + * All executes the SQL statement and populates all the resulting rows into a slice of struct or NullStringMap. + * The slice must be given as a pointer. Each slice element must be either a struct or a NullStringMap. + * Refer to Rows.ScanStruct() and Rows.ScanMap() for more details on how each slice element can be. + * If the query returns no row, the slice will be an empty slice (not nil). */ - (db: DB, executor: Executor): Builder + all(slice: { + }): void } - interface StandardBuilder { + interface Query { /** - * QueryBuilder returns the query builder supporting the current DB. + * Row executes the SQL statement and populates the first row of the result into a list of variables. + * Note that the number of the variables should match to that of the columns in the query result. + * Note that when the query has no rows in the result set, an sql.ErrNoRows will be returned. */ - queryBuilder(): QueryBuilder + row(...a: { + }[]): void } - interface StandardBuilder { + interface Query { /** - * Select returns a new SelectQuery object that can be used to build a SELECT statement. - * The parameters to this method should be the list column names to be selected. - * A column name may have an optional alias name. For example, Select("id", "my_name AS name"). + * Column executes the SQL statement and populates the first column of the result into a slice. + * Note that the parameter must be a pointer to a slice. */ - select(...cols: string[]): (SelectQuery) + column(a: { + }): void } - interface StandardBuilder { + interface Query { /** - * Model returns a new ModelQuery object that can be used to perform model-based DB operations. - * The model passed to this method should be a pointer to a model struct. + * Rows executes the SQL statement and returns a Rows object to allow retrieving data row by row. */ - model(model: { - }): (ModelQuery) + rows(): (Rows) } /** - * LogFunc logs a message for each SQL statement being executed. - * This method takes one or multiple parameters. If a single parameter - * is provided, it will be treated as the log message. If multiple parameters - * are provided, they will be passed to fmt.Sprintf() to generate the log message. - */ - interface LogFunc {(format: string, ...a: { - }[]): void } - /** - * PerfFunc is called when a query finishes execution. - * The query execution time is passed to this function so that the DB performance - * can be profiled. The "ns" parameter gives the number of nanoseconds that the - * SQL statement takes to execute, while the "execute" parameter indicates whether - * the SQL statement is executed or queried (usually SELECT statements). - */ - interface PerfFunc {(ns: number, sql: string, execute: boolean): void } - /** - * QueryLogFunc is called each time when performing a SQL query. - * The "t" parameter gives the time that the SQL statement takes to execute, - * while rows and err are the result of the query. - */ - interface QueryLogFunc {(ctx: context.Context, t: time.Duration, sql: string, rows: sql.Rows, err: Error): void } - /** - * ExecLogFunc is called each time when a SQL statement is executed. - * The "t" parameter gives the time that the SQL statement takes to execute, - * while result and err refer to the result of the execution. - */ - interface ExecLogFunc {(ctx: context.Context, t: time.Duration, sql: string, result: sql.Result, err: Error): void } - /** - * BuilderFunc creates a Builder instance using the given DB instance and Executor. - */ - interface BuilderFunc {(_arg0: DB, _arg1: Executor): Builder } - /** - * DB enhances sql.DB by providing a set of DB-agnostic query building methods. - * DB allows easier query building and population of data into Go variables. + * QueryBuilder builds different clauses for a SELECT SQL statement. */ - type _subDKzjR = Builder - interface DB extends _subDKzjR { + interface QueryBuilder { + [key:string]: any; /** - * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. + * BuildSelect generates a SELECT clause from the given selected column names. */ - fieldMapper: FieldMapFunc + buildSelect(cols: Array, distinct: boolean, option: string): string /** - * TableMapper maps structs to table names. Defaults to GetTableName. + * BuildFrom generates a FROM clause from the given tables. */ - tableMapper: TableMapFunc + buildFrom(tables: Array): string /** - * LogFunc logs the SQL statements being executed. Defaults to nil, meaning no logging. + * BuildGroupBy generates a GROUP BY clause from the given group-by columns. */ - logFunc: LogFunc + buildGroupBy(cols: Array): string /** - * PerfFunc logs the SQL execution time. Defaults to nil, meaning no performance profiling. - * Deprecated: Please use QueryLogFunc and ExecLogFunc instead. + * BuildJoin generates a JOIN clause from the given join information. */ - perfFunc: PerfFunc + buildJoin(_arg0: Array, _arg1: Params): string /** - * QueryLogFunc is called each time when performing a SQL query that returns data. + * BuildWhere generates a WHERE clause from the given expression. */ - queryLogFunc: QueryLogFunc + buildWhere(_arg0: Expression, _arg1: Params): string /** - * ExecLogFunc is called each time when a SQL statement is executed. + * BuildHaving generates a HAVING clause from the given expression. */ - execLogFunc: ExecLogFunc + buildHaving(_arg0: Expression, _arg1: Params): string + /** + * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. + */ + buildOrderByAndLimit(_arg0: string, _arg1: Array, _arg2: number, _arg3: number): string + /** + * BuildUnion generates a UNION clause from the given union information. + */ + buildUnion(_arg0: Array, _arg1: Params): string } /** - * Errors represents a list of errors. + * BaseQueryBuilder provides a basic implementation of QueryBuilder. */ - interface Errors extends Array{} - interface newFromDB { + interface BaseQueryBuilder { + } + interface newBaseQueryBuilder { /** - * NewFromDB encapsulates an existing database connection. + * NewBaseQueryBuilder creates a new BaseQueryBuilder instance. */ - (sqlDB: sql.DB, driverName: string): (DB) + (db: DB): (BaseQueryBuilder) } - interface open { + interface BaseQueryBuilder { /** - * Open opens a database specified by a driver name and data source name (DSN). - * Note that Open does not check if DSN is specified correctly. It doesn't try to establish a DB connection either. - * Please refer to sql.Open() for more information. + * DB returns the DB instance associated with the query builder. */ - (driverName: string, dsn: string): (DB) + db(): (DB) } - interface mustOpen { + interface BaseQueryBuilder { /** - * MustOpen opens a database and establishes a connection to it. - * Please refer to sql.Open() and sql.Ping() for more information. + * BuildSelect generates a SELECT clause from the given selected column names. */ - (driverName: string, dsn: string): (DB) + buildSelect(cols: Array, distinct: boolean, option: string): string } - interface DB { + interface BaseQueryBuilder { /** - * Clone makes a shallow copy of DB. + * BuildFrom generates a FROM clause from the given tables. */ - clone(): (DB) + buildFrom(tables: Array): string } - interface DB { + interface BaseQueryBuilder { /** - * WithContext returns a new instance of DB associated with the given context. + * BuildJoin generates a JOIN clause from the given join information. */ - withContext(ctx: context.Context): (DB) + buildJoin(joins: Array, params: Params): string } - interface DB { + interface BaseQueryBuilder { /** - * Context returns the context associated with the DB instance. - * It returns nil if no context is associated. + * BuildWhere generates a WHERE clause from the given expression. */ - context(): context.Context + buildWhere(e: Expression, params: Params): string } - interface DB { + interface BaseQueryBuilder { /** - * DB returns the sql.DB instance encapsulated by dbx.DB. + * BuildHaving generates a HAVING clause from the given expression. */ - db(): (sql.DB) + buildHaving(e: Expression, params: Params): string } - interface DB { + interface BaseQueryBuilder { /** - * Close closes the database, releasing any open resources. - * It is rare to Close a DB, as the DB handle is meant to be - * long-lived and shared between many goroutines. + * BuildGroupBy generates a GROUP BY clause from the given group-by columns. */ - close(): void + buildGroupBy(cols: Array): string } - interface DB { + interface BaseQueryBuilder { /** - * Begin starts a transaction. + * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. */ - begin(): (Tx) + buildOrderByAndLimit(sql: string, cols: Array, limit: number, offset: number): string } - interface DB { + interface BaseQueryBuilder { /** - * BeginTx starts a transaction with the given context and transaction options. + * BuildUnion generates a UNION clause from the given union information. */ - beginTx(ctx: context.Context, opts: sql.TxOptions): (Tx) + buildUnion(unions: Array, params: Params): string } - interface DB { + interface BaseQueryBuilder { /** - * Wrap encapsulates an existing transaction. + * BuildOrderBy generates the ORDER BY clause. */ - wrap(sqlTx: sql.Tx): (Tx) + buildOrderBy(cols: Array): string } - interface DB { + interface BaseQueryBuilder { /** - * Transactional starts a transaction and executes the given function. - * If the function returns an error, the transaction will be rolled back. - * Otherwise, the transaction will be committed. + * BuildLimit generates the LIMIT clause. */ - transactional(f: (_arg0: Tx) => void): void + buildLimit(limit: number, offset: number): string } - interface DB { + /** + * VarTypeError indicates a variable type error when trying to populating a variable with DB result. + */ + interface VarTypeError extends String{} + interface VarTypeError { /** - * TransactionalContext starts a transaction and executes the given function with the given context and transaction options. - * If the function returns an error, the transaction will be rolled back. - * Otherwise, the transaction will be committed. + * Error returns the error message. */ - transactionalContext(ctx: context.Context, opts: sql.TxOptions, f: (_arg0: Tx) => void): void + error(): string } - interface DB { + /** + * NullStringMap is a map of sql.NullString that can be used to hold DB query result. + * The map keys correspond to the DB column names, while the map values are their corresponding column values. + */ + interface NullStringMap extends _TygojaDict{} + /** + * Rows enhances sql.Rows by providing additional data query methods. + * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. + */ + type _submSehx = sql.Rows + interface Rows extends _submSehx { + } + interface Rows { /** - * DriverName returns the name of the DB driver. + * ScanMap populates the current row of data into a NullStringMap. + * Note that the NullStringMap must not be nil, or it will panic. + * The NullStringMap will be populated using column names as keys and their values as + * the corresponding element values. */ - driverName(): string + scanMap(a: NullStringMap): void } - interface DB { + interface Rows { /** - * QuoteTableName quotes the given table name appropriately. - * If the table name contains DB schema prefix, it will be handled accordingly. - * This method will do nothing if the table name is already quoted or if it contains parenthesis. + * ScanStruct populates the current row of data into a struct. + * The struct must be given as a pointer. + * + * ScanStruct associates struct fields with DB table columns through a field mapping function. + * It populates a struct field with the data of its associated column. + * Note that only exported struct fields will be populated. + * + * By default, DefaultFieldMapFunc() is used to map struct fields to table columns. + * This function separates each word in a field name with a underscore and turns every letter into lower case. + * For example, "LastName" is mapped to "last_name", "MyID" is mapped to "my_id", and so on. + * To change the default behavior, set DB.FieldMapper with your custom mapping function. + * You may also set Query.FieldMapper to change the behavior for particular queries. */ - quoteTableName(s: string): string + scanStruct(a: { + }): void } - interface DB { + /** + * BuildHookFunc defines a callback function that is executed on Query creation. + */ + interface BuildHookFunc {(q: Query): void } + /** + * SelectQuery represents a DB-agnostic SELECT query. + * It can be built into a DB-specific query by calling the Build() method. + */ + interface SelectQuery { /** - * QuoteColumnName quotes the given column name appropriately. - * If the table name contains table name prefix, it will be handled accordingly. - * This method will do nothing if the column name is already quoted or if it contains parenthesis. + * FieldMapper maps struct field names to DB column names. */ - quoteColumnName(s: string): string - } - interface Errors { + fieldMapper: FieldMapFunc /** - * Error returns the error string of Errors. + * TableMapper maps structs to DB table names. */ - error(): string + tableMapper: TableMapFunc } /** - * Expression represents a DB expression that can be embedded in a SQL statement. + * JoinInfo contains the specification for a JOIN clause. */ - interface Expression { - [key:string]: any; - /** - * Build converts an expression into a SQL fragment. - * If the expression contains binding parameters, they will be added to the given Params. - */ - build(_arg0: DB, _arg1: Params): string + interface JoinInfo { + join: string + table: string + on: Expression } /** - * HashExp represents a hash expression. - * - * A hash expression is a map whose keys are DB column names which need to be filtered according - * to the corresponding values. For example, HashExp{"level": 2, "dept": 10} will generate - * the SQL: "level"=2 AND "dept"=10. - * - * HashExp also handles nil values and slice values. For example, HashExp{"level": []interface{}{1, 2}, "dept": nil} - * will generate: "level" IN (1, 2) AND "dept" IS NULL. + * UnionInfo contains the specification for a UNION clause. */ - interface HashExp extends _TygojaDict{} - interface newExp { + interface UnionInfo { + all: boolean + query?: Query + } + interface newSelectQuery { /** - * NewExp generates an expression with the specified SQL fragment and the optional binding parameters. + * NewSelectQuery creates a new SelectQuery instance. */ - (e: string, ...params: Params[]): Expression + (builder: Builder, db: DB): (SelectQuery) } - interface not { + interface SelectQuery { /** - * Not generates a NOT expression which prefixes "NOT" to the specified expression. + * WithBuildHook runs the provided hook function with the query created on Build(). */ - (e: Expression): Expression + withBuildHook(fn: BuildHookFunc): (SelectQuery) } - interface and { + interface SelectQuery { /** - * And generates an AND expression which concatenates the given expressions with "AND". + * Context returns the context associated with the query. */ - (...exps: Expression[]): Expression + context(): context.Context } - interface or { + interface SelectQuery { /** - * Or generates an OR expression which concatenates the given expressions with "OR". + * WithContext associates a context with the query. */ - (...exps: Expression[]): Expression + withContext(ctx: context.Context): (SelectQuery) } - interface _in { + interface SelectQuery { /** - * In generates an IN expression for the specified column and the list of allowed values. - * If values is empty, a SQL "0=1" will be generated which represents a false expression. + * Select specifies the columns to be selected. + * Column names will be automatically quoted. */ - (col: string, ...values: { - }[]): Expression + select(...cols: string[]): (SelectQuery) } - interface notIn { + interface SelectQuery { /** - * NotIn generates an NOT IN expression for the specified column and the list of disallowed values. - * If values is empty, an empty string will be returned indicating a true expression. + * AndSelect adds additional columns to be selected. + * Column names will be automatically quoted. */ - (col: string, ...values: { - }[]): Expression + andSelect(...cols: string[]): (SelectQuery) } - interface like { + interface SelectQuery { /** - * Like generates a LIKE expression for the specified column and the possible strings that the column should be like. - * If multiple values are present, the column should be like *all* of them. For example, Like("name", "key", "word") - * will generate a SQL expression: "name" LIKE "%key%" AND "name" LIKE "%word%". - * - * By default, each value will be surrounded by "%" to enable partial matching. If a value contains special characters - * such as "%", "\", "_", they will also be properly escaped. - * - * You may call Escape() and/or Match() to change the default behavior. For example, Like("name", "key").Match(false, true) - * generates "name" LIKE "key%". + * Distinct specifies whether to select columns distinctively. + * By default, distinct is false. */ - (col: string, ...values: string[]): (LikeExp) + distinct(v: boolean): (SelectQuery) } - interface notLike { + interface SelectQuery { /** - * NotLike generates a NOT LIKE expression. - * For example, NotLike("name", "key", "word") will generate a SQL expression: - * "name" NOT LIKE "%key%" AND "name" NOT LIKE "%word%". Please see Like() for more details. + * SelectOption specifies additional option that should be append to "SELECT". */ - (col: string, ...values: string[]): (LikeExp) + selectOption(option: string): (SelectQuery) } - interface orLike { + interface SelectQuery { /** - * OrLike generates an OR LIKE expression. - * This is similar to Like() except that the column should be like one of the possible values. - * For example, OrLike("name", "key", "word") will generate a SQL expression: - * "name" LIKE "%key%" OR "name" LIKE "%word%". Please see Like() for more details. + * From specifies which tables to select from. + * Table names will be automatically quoted. */ - (col: string, ...values: string[]): (LikeExp) + from(...tables: string[]): (SelectQuery) } - interface orNotLike { + interface SelectQuery { /** - * OrNotLike generates an OR NOT LIKE expression. - * For example, OrNotLike("name", "key", "word") will generate a SQL expression: - * "name" NOT LIKE "%key%" OR "name" NOT LIKE "%word%". Please see Like() for more details. + * Where specifies the WHERE condition. */ - (col: string, ...values: string[]): (LikeExp) + where(e: Expression): (SelectQuery) } - interface exists { + interface SelectQuery { /** - * Exists generates an EXISTS expression by prefixing "EXISTS" to the given expression. + * AndWhere concatenates a new WHERE condition with the existing one (if any) using "AND". */ - (exp: Expression): Expression + andWhere(e: Expression): (SelectQuery) } - interface notExists { + interface SelectQuery { /** - * NotExists generates an EXISTS expression by prefixing "NOT EXISTS" to the given expression. + * OrWhere concatenates a new WHERE condition with the existing one (if any) using "OR". */ - (exp: Expression): Expression + orWhere(e: Expression): (SelectQuery) } - interface between { + interface SelectQuery { /** - * Between generates a BETWEEN expression. - * For example, Between("age", 10, 30) generates: "age" BETWEEN 10 AND 30 + * Join specifies a JOIN clause. + * The "typ" parameter specifies the JOIN type (e.g. "INNER JOIN", "LEFT JOIN"). */ - (col: string, from: { - }, to: { - }): Expression + join(typ: string, table: string, on: Expression): (SelectQuery) } - interface notBetween { + interface SelectQuery { /** - * NotBetween generates a NOT BETWEEN expression. - * For example, NotBetween("age", 10, 30) generates: "age" NOT BETWEEN 10 AND 30 + * InnerJoin specifies an INNER JOIN clause. + * This is a shortcut method for Join. */ - (col: string, from: { - }, to: { - }): Expression - } - /** - * Exp represents an expression with a SQL fragment and a list of optional binding parameters. - */ - interface Exp { + innerJoin(table: string, on: Expression): (SelectQuery) } - interface Exp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * LeftJoin specifies a LEFT JOIN clause. + * This is a shortcut method for Join. */ - build(db: DB, params: Params): string + leftJoin(table: string, on: Expression): (SelectQuery) } - interface HashExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * RightJoin specifies a RIGHT JOIN clause. + * This is a shortcut method for Join. */ - build(db: DB, params: Params): string - } - /** - * NotExp represents an expression that should prefix "NOT" to a specified expression. - */ - interface NotExp { + rightJoin(table: string, on: Expression): (SelectQuery) } - interface NotExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * OrderBy specifies the ORDER BY clause. + * Column names will be properly quoted. A column name can contain "ASC" or "DESC" to indicate its ordering direction. */ - build(db: DB, params: Params): string - } - /** - * AndOrExp represents an expression that concatenates multiple expressions using either "AND" or "OR". - */ - interface AndOrExp { + orderBy(...cols: string[]): (SelectQuery) } - interface AndOrExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * AndOrderBy appends additional columns to the existing ORDER BY clause. + * Column names will be properly quoted. A column name can contain "ASC" or "DESC" to indicate its ordering direction. */ - build(db: DB, params: Params): string - } - /** - * InExp represents an "IN" or "NOT IN" expression. - */ - interface InExp { + andOrderBy(...cols: string[]): (SelectQuery) } - interface InExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * GroupBy specifies the GROUP BY clause. + * Column names will be properly quoted. */ - build(db: DB, params: Params): string + groupBy(...cols: string[]): (SelectQuery) } - /** - * LikeExp represents a variant of LIKE expressions. - */ - interface LikeExp { + interface SelectQuery { /** - * Like stores the LIKE operator. It can be "LIKE", "NOT LIKE". - * It may also be customized as something like "ILIKE". + * AndGroupBy appends additional columns to the existing GROUP BY clause. + * Column names will be properly quoted. */ - like: string + andGroupBy(...cols: string[]): (SelectQuery) } - interface LikeExp { + interface SelectQuery { /** - * Escape specifies how a LIKE expression should be escaped. - * Each string at position 2i represents a special character and the string at position 2i+1 is - * the corresponding escaped version. + * Having specifies the HAVING clause. */ - escape(...chars: string[]): (LikeExp) + having(e: Expression): (SelectQuery) } - interface LikeExp { + interface SelectQuery { /** - * Match specifies whether to do wildcard matching on the left and/or right of given strings. + * AndHaving concatenates a new HAVING condition with the existing one (if any) using "AND". */ - match(left: boolean, right: boolean): (LikeExp) + andHaving(e: Expression): (SelectQuery) } - interface LikeExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * OrHaving concatenates a new HAVING condition with the existing one (if any) using "OR". */ - build(db: DB, params: Params): string - } - /** - * ExistsExp represents an EXISTS or NOT EXISTS expression. - */ - interface ExistsExp { + orHaving(e: Expression): (SelectQuery) } - interface ExistsExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * Union specifies a UNION clause. */ - build(db: DB, params: Params): string - } - /** - * BetweenExp represents a BETWEEN or a NOT BETWEEN expression. - */ - interface BetweenExp { + union(q: Query): (SelectQuery) } - interface BetweenExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * UnionAll specifies a UNION ALL clause. */ - build(db: DB, params: Params): string + unionAll(q: Query): (SelectQuery) } - interface enclose { + interface SelectQuery { /** - * Enclose surrounds the provided nonempty expression with parenthesis "()". + * Limit specifies the LIMIT clause. + * A negative limit means no limit. */ - (exp: Expression): Expression - } - /** - * EncloseExp represents a parenthesis enclosed expression. - */ - interface EncloseExp { + limit(limit: number): (SelectQuery) } - interface EncloseExp { + interface SelectQuery { /** - * Build converts an expression into a SQL fragment. + * Offset specifies the OFFSET clause. + * A negative offset means no offset. */ - build(db: DB, params: Params): string - } - /** - * TableModel is the interface that should be implemented by models which have unconventional table names. - */ - interface TableModel { - [key:string]: any; - tableName(): string + offset(offset: number): (SelectQuery) } - /** - * ModelQuery represents a query associated with a struct model. - */ - interface ModelQuery { + interface SelectQuery { + /** + * Bind specifies the parameter values to be bound to the query. + */ + bind(params: Params): (SelectQuery) } - interface newModelQuery { - (model: { - }, fieldMapFunc: FieldMapFunc, db: DB, builder: Builder): (ModelQuery) + interface SelectQuery { + /** + * AndBind appends additional parameters to be bound to the query. + */ + andBind(params: Params): (SelectQuery) } - interface ModelQuery { + interface SelectQuery { /** - * Context returns the context associated with the query. + * Build builds the SELECT query and returns an executable Query object. */ - context(): context.Context + build(): (Query) } - interface ModelQuery { + interface SelectQuery { /** - * WithContext associates a context with the query. + * One executes the SELECT query and populates the first row of the result into the specified variable. + * + * If the query does not specify a "from" clause, the method will try to infer the name of the table + * to be selected from by calling getTableName() which will return either the variable type name + * or the TableName() method if the variable implements the TableModel interface. + * + * Note that when the query has no rows in the result set, an sql.ErrNoRows will be returned. */ - withContext(ctx: context.Context): (ModelQuery) + one(a: { + }): void } - interface ModelQuery { + interface SelectQuery { /** - * Exclude excludes the specified struct fields from being inserted/updated into the DB table. + * Model selects the row with the specified primary key and populates the model with the row data. + * + * The model variable should be a pointer to a struct. If the query does not specify a "from" clause, + * it will use the model struct to determine which table to select data from. It will also use the model + * to infer the name of the primary key column. Only simple primary key is supported. For composite primary keys, + * please use Where() to specify the filtering condition. */ - exclude(...attrs: string[]): (ModelQuery) + model(pk: { + }, model: { + }): void } - interface ModelQuery { + interface SelectQuery { /** - * Insert inserts a row in the table using the struct model associated with this query. + * All executes the SELECT query and populates all rows of the result into a slice. * - * By default, it inserts *all* public fields into the table, including those nil or empty ones. - * You may pass a list of the fields to this method to indicate that only those fields should be inserted. - * You may also call Exclude to exclude some fields from being inserted. + * Note that the slice must be passed in as a pointer. * - * If a model has an empty primary key, it is considered auto-incremental and the corresponding struct - * field will be filled with the generated primary key value after a successful insertion. + * If the query does not specify a "from" clause, the method will try to infer the name of the table + * to be selected from by calling getTableName() which will return either the type name of the slice elements + * or the TableName() method if the slice element implements the TableModel interface. */ - insert(...attrs: string[]): void + all(slice: { + }): void } - interface ModelQuery { + interface SelectQuery { /** - * Update updates a row in the table using the struct model associated with this query. - * The row being updated has the same primary key as specified by the model. - * - * By default, it updates *all* public fields in the table, including those nil or empty ones. - * You may pass a list of the fields to this method to indicate that only those fields should be updated. - * You may also call Exclude to exclude some fields from being updated. + * Rows builds and executes the SELECT query and returns a Rows object for data retrieval purpose. + * This is a shortcut to SelectQuery.Build().Rows() */ - update(...attrs: string[]): void + rows(): (Rows) } - interface ModelQuery { + interface SelectQuery { /** - * Delete deletes a row in the table using the primary key specified by the struct model associated with this query. + * Row builds and executes the SELECT query and populates the first row of the result into the specified variables. + * This is a shortcut to SelectQuery.Build().Row() */ - delete(): void + row(...a: { + }[]): void + } + interface SelectQuery { + /** + * Column builds and executes the SELECT statement and populates the first column of the result into a slice. + * Note that the parameter must be a pointer to a slice. + * This is a shortcut to SelectQuery.Build().Column() + */ + column(a: { + }): void } /** - * ExecHookFunc executes before op allowing custom handling like auto fail/retry. - */ - interface ExecHookFunc {(q: Query, op: () => void): void } - /** - * OneHookFunc executes right before the query populate the row result from One() call (aka. op). + * QueryInfo represents a debug/info struct with exported SelectQuery fields. */ - interface OneHookFunc {(q: Query, a: { - }, op: (b: { - }) => void): void } + interface QueryInfo { + builder: Builder + selects: Array + distinct: boolean + selectOption: string + from: Array + where: Expression + join: Array + orderBy: Array + groupBy: Array + having: Expression + union: Array + limit: number + offset: number + params: Params + context: context.Context + buildHook: BuildHookFunc + } + interface SelectQuery { + /** + * Info exports common SelectQuery fields allowing to inspect the + * current select query options. + */ + info(): (QueryInfo) + } /** - * AllHookFunc executes right before the query populate the row result from All() call (aka. op). + * FieldMapFunc converts a struct field name into a DB column name. */ - interface AllHookFunc {(q: Query, sliceA: { - }, op: (sliceB: { - }) => void): void } + interface FieldMapFunc {(_arg0: string): string } /** - * Params represents a list of parameter values to be bound to a SQL statement. - * The map keys are the parameter names while the map values are the corresponding parameter values. + * TableMapFunc converts a sample struct into a DB table name. */ - interface Params extends _TygojaDict{} + interface TableMapFunc {(a: { + }): string } + interface structInfo { + } + type _subLIODH = structInfo + interface structValue extends _subLIODH { + } + interface fieldInfo { + } + interface structInfoMapKey { + } /** - * Executor prepares, executes, or queries a SQL statement. + * PostScanner is an optional interface used by ScanStruct. */ - interface Executor { + interface PostScanner { [key:string]: any; /** - * Exec executes a SQL statement + * PostScan executes right after the struct has been populated + * with the DB values, allowing you to further normalize or validate + * the loaded data. */ - exec(query: string, ...args: { - }[]): sql.Result + postScan(): void + } + interface defaultFieldMapFunc { /** - * ExecContext executes a SQL statement with the given context - */ - execContext(ctx: context.Context, query: string, ...args: { - }[]): sql.Result - /** - * Query queries a SQL statement - */ - query(query: string, ...args: { - }[]): (sql.Rows) - /** - * QueryContext queries a SQL statement with the given context + * DefaultFieldMapFunc maps a field name to a DB column name. + * The mapping rule set by this method is that words in a field name will be separated by underscores + * and the name will be turned into lower case. For example, "FirstName" maps to "first_name", and "MyID" becomes "my_id". + * See DB.FieldMapper for more details. */ - queryContext(ctx: context.Context, query: string, ...args: { - }[]): (sql.Rows) + (f: string): string + } + interface getTableName { /** - * Prepare creates a prepared statement + * GetTableName implements the default way of determining the table name corresponding to the given model struct + * or slice of structs. To get the actual table name for a model, you should use DB.TableMapFunc() instead. + * Do not call this method in a model's TableName() method because it will cause infinite loop. */ - prepare(query: string): (sql.Stmt) + (a: { + }): string } /** - * Query represents a SQL statement to be executed. + * Tx enhances sql.Tx with additional querying methods. */ - interface Query { - /** - * FieldMapper maps struct field names to DB column names. - */ - fieldMapper: FieldMapFunc - /** - * LastError contains the last error (if any) of the query. - * LastError is cleared by Execute(), Row(), Rows(), One(), and All(). - */ - lastError: Error - /** - * LogFunc is used to log the SQL statement being executed. - */ - logFunc: LogFunc - /** - * PerfFunc is used to log the SQL execution time. It is ignored if nil. - * Deprecated: Please use QueryLogFunc and ExecLogFunc instead. - */ - perfFunc: PerfFunc + type _subYHNBD = Builder + interface Tx extends _subYHNBD { + } + interface Tx { /** - * QueryLogFunc is called each time when performing a SQL query that returns data. + * Commit commits the transaction. */ - queryLogFunc: QueryLogFunc + commit(): void + } + interface Tx { /** - * ExecLogFunc is called each time when a SQL statement is executed. + * Rollback aborts the transaction. */ - execLogFunc: ExecLogFunc + rollback(): void } - interface newQuery { +} + +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions [Command] and [LookPath] look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run [LookPath]("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * These will not find and run ./prog or .\prog.exe, + * no matter how the current path is configured. + * + * Code that always wants to run a program from the current directory + * can be rewritten to say "./prog" instead of "prog". + * + * Code that insists on including results from relative path entries + * can instead override the error using an errors.Is check: + * + * ``` + * path, err := exec.LookPath("prog") + * if errors.Is(err, exec.ErrDot) { + * err = nil + * } + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if errors.Is(cmd.Err, exec.ErrDot) { + * cmd.Err = nil + * } + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * Setting the environment variable GODEBUG=execerrdot=0 + * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 + * behavior for programs that are unable to apply more targeted fixes. + * A future version of Go may remove support for this variable. + * + * Before adding such overrides, make sure you understand the + * security implications of doing so. + * See https://go.dev/blog/path-security for more information. + */ +namespace exec { + interface command { /** - * NewQuery creates a new Query with the given SQL statement. + * Command returns the [Cmd] struct to execute the named program with + * the given arguments. + * + * It sets only the Path and Args in the returned structure. + * + * If name contains no path separators, Command uses [LookPath] to + * resolve name to a complete path if possible. Otherwise it uses name + * directly as Path. + * + * The returned Cmd's Args field is constructed from the command name + * followed by the elements of arg, so arg should not include the + * command name itself. For example, Command("echo", "hello"). + * Args[0] is always name, not the possibly resolved Path. + * + * On Windows, processes receive the whole command line as a single string + * and do their own parsing. Command combines and quotes Args into a command + * line string with an algorithm compatible with applications using + * CommandLineToArgvW (which is the most common way). Notable exceptions are + * msiexec.exe and cmd.exe (and thus, all batch files), which have a different + * unquoting algorithm. In these or other similar cases, you can do the + * quoting yourself and provide the full command line in SysProcAttr.CmdLine, + * leaving Args empty. */ - (db: DB, executor: Executor, sql: string): (Query) + (name: string, ...arg: string[]): (Cmd) } - interface Query { +} + +namespace filesystem { + /** + * FileReader defines an interface for a file resource reader. + */ + interface FileReader { + [key:string]: any; + open(): io.ReadSeekCloser + } + /** + * File defines a single file [io.ReadSeekCloser] resource. + * + * The file could be from a local path, multipart/form-data header, etc. + */ + interface File { + reader: FileReader + name: string + originalName: string + size: number + } + interface newFileFromPath { /** - * SQL returns the original SQL used to create the query. - * The actual SQL (RawSQL) being executed is obtained by replacing the named - * parameter placeholders with anonymous ones. + * NewFileFromPath creates a new File instance from the provided local file path. */ - sql(): string + (path: string): (File) } - interface Query { + interface newFileFromBytes { /** - * Context returns the context associated with the query. + * NewFileFromBytes creates a new File instance from the provided byte slice. */ - context(): context.Context + (b: string|Array, name: string): (File) } - interface Query { + interface newFileFromMultipart { /** - * WithContext associates a context with the query. + * NewFileFromMultipart creates a new File from the provided multipart header. */ - withContext(ctx: context.Context): (Query) + (mh: multipart.FileHeader): (File) } - interface Query { + interface newFileFromUrl { /** - * WithExecHook associates the provided exec hook function with the query. + * NewFileFromUrl creates a new File from the provided url by + * downloading the resource and load it as BytesReader. * - * It is called for every Query resolver (Execute(), One(), All(), Row(), Column()), - * allowing you to implement auto fail/retry or any other additional handling. + * Example + * + * ``` + * ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + * defer cancel() + * + * file, err := filesystem.NewFileFromUrl(ctx, "https://example.com/image.png") + * ``` */ - withExecHook(fn: ExecHookFunc): (Query) + (ctx: context.Context, url: string): (File) } - interface Query { - /** - * WithOneHook associates the provided hook function with the query, - * called on q.One(), allowing you to implement custom struct scan based - * on the One() argument and/or result. - */ - withOneHook(fn: OneHookFunc): (Query) + /** + * MultipartReader defines a FileReader from [multipart.FileHeader]. + */ + interface MultipartReader { + header?: multipart.FileHeader } - interface Query { + interface MultipartReader { /** - * WithOneHook associates the provided hook function with the query, - * called on q.All(), allowing you to implement custom slice scan based - * on the All() argument and/or result. + * Open implements the [filesystem.FileReader] interface. */ - withAllHook(fn: AllHookFunc): (Query) + open(): io.ReadSeekCloser } - interface Query { + /** + * PathReader defines a FileReader from a local file path. + */ + interface PathReader { + path: string + } + interface PathReader { /** - * Params returns the parameters to be bound to the SQL statement represented by this query. + * Open implements the [filesystem.FileReader] interface. */ - params(): Params + open(): io.ReadSeekCloser } - interface Query { + /** + * BytesReader defines a FileReader from bytes content. + */ + interface BytesReader { + bytes: string|Array + } + interface BytesReader { /** - * Prepare creates a prepared statement for later queries or executions. - * Close() should be called after finishing all queries. + * Open implements the [filesystem.FileReader] interface. */ - prepare(): (Query) + open(): io.ReadSeekCloser } - interface Query { + type _subVzkKp = bytes.Reader + interface bytesReadSeekCloser extends _subVzkKp { + } + interface bytesReadSeekCloser { /** - * Close closes the underlying prepared statement. - * Close does nothing if the query has not been prepared before. + * Close implements the [io.ReadSeekCloser] interface. */ close(): void } - interface Query { - /** - * Bind sets the parameters that should be bound to the SQL statement. - * The parameter placeholders in the SQL statement are in the format of "{:ParamName}". - */ - bind(params: Params): (Query) + interface System { } - interface Query { + interface newS3 { /** - * Execute executes the SQL statement without retrieving data. + * NewS3 initializes an S3 filesystem instance. + * + * NB! Make sure to call `Close()` after you are done working with it. */ - execute(): sql.Result + (bucketName: string, region: string, endpoint: string, accessKey: string, secretKey: string, s3ForcePathStyle: boolean): (System) } - interface Query { + interface newLocal { /** - * One executes the SQL statement and populates the first row of the result into a struct or NullStringMap. - * Refer to Rows.ScanStruct() and Rows.ScanMap() for more details on how to specify - * the variable to be populated. - * Note that when the query has no rows in the result set, an sql.ErrNoRows will be returned. + * NewLocal initializes a new local filesystem instance. + * + * NB! Make sure to call `Close()` after you are done working with it. */ - one(a: { - }): void + (dirPath: string): (System) } - interface Query { + interface System { /** - * All executes the SQL statement and populates all the resulting rows into a slice of struct or NullStringMap. - * The slice must be given as a pointer. Each slice element must be either a struct or a NullStringMap. - * Refer to Rows.ScanStruct() and Rows.ScanMap() for more details on how each slice element can be. - * If the query returns no row, the slice will be an empty slice (not nil). + * SetContext assigns the specified context to the current filesystem. */ - all(slice: { - }): void + setContext(ctx: context.Context): void } - interface Query { + interface System { /** - * Row executes the SQL statement and populates the first row of the result into a list of variables. - * Note that the number of the variables should match to that of the columns in the query result. - * Note that when the query has no rows in the result set, an sql.ErrNoRows will be returned. + * Close releases any resources used for the related filesystem. */ - row(...a: { - }[]): void + close(): void } - interface Query { + interface System { /** - * Column executes the SQL statement and populates the first column of the result into a slice. - * Note that the parameter must be a pointer to a slice. + * Exists checks if file with fileKey path exists or not. */ - column(a: { - }): void + exists(fileKey: string): boolean } - interface Query { + interface System { /** - * Rows executes the SQL statement and returns a Rows object to allow retrieving data row by row. + * Attributes returns the attributes for the file with fileKey path. */ - rows(): (Rows) + attributes(fileKey: string): (blob.Attributes) } - /** - * QueryBuilder builds different clauses for a SELECT SQL statement. - */ - interface QueryBuilder { - [key:string]: any; + interface System { /** - * BuildSelect generates a SELECT clause from the given selected column names. + * GetFile returns a file content reader for the given fileKey. + * + * NB! Make sure to call `Close()` after you are done working with it. */ - buildSelect(cols: Array, distinct: boolean, option: string): string + getFile(fileKey: string): (blob.Reader) + } + interface System { /** - * BuildFrom generates a FROM clause from the given tables. + * Copy copies the file stored at srcKey to dstKey. + * + * If dstKey file already exists, it is overwritten. */ - buildFrom(tables: Array): string + copy(srcKey: string, dstKey: string): void + } + interface System { /** - * BuildGroupBy generates a GROUP BY clause from the given group-by columns. + * List returns a flat list with info for all files under the specified prefix. */ - buildGroupBy(cols: Array): string + list(prefix: string): Array<(blob.ListObject | undefined)> + } + interface System { /** - * BuildJoin generates a JOIN clause from the given join information. + * Upload writes content into the fileKey location. */ - buildJoin(_arg0: Array, _arg1: Params): string + upload(content: string|Array, fileKey: string): void + } + interface System { /** - * BuildWhere generates a WHERE clause from the given expression. + * UploadFile uploads the provided multipart file to the fileKey location. */ - buildWhere(_arg0: Expression, _arg1: Params): string + uploadFile(file: File, fileKey: string): void + } + interface System { /** - * BuildHaving generates a HAVING clause from the given expression. + * UploadMultipart uploads the provided multipart file to the fileKey location. */ - buildHaving(_arg0: Expression, _arg1: Params): string + uploadMultipart(fh: multipart.FileHeader, fileKey: string): void + } + interface System { /** - * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. + * Delete deletes stored file at fileKey location. */ - buildOrderByAndLimit(_arg0: string, _arg1: Array, _arg2: number, _arg3: number): string + delete(fileKey: string): void + } + interface System { /** - * BuildUnion generates a UNION clause from the given union information. + * DeletePrefix deletes everything starting with the specified prefix. + * + * The prefix could be subpath (ex. "/a/b/") or filename prefix (ex. "/a/b/file_"). */ - buildUnion(_arg0: Array, _arg1: Params): string - } - /** - * BaseQueryBuilder provides a basic implementation of QueryBuilder. - */ - interface BaseQueryBuilder { + deletePrefix(prefix: string): Array } - interface newBaseQueryBuilder { + interface System { /** - * NewBaseQueryBuilder creates a new BaseQueryBuilder instance. + * Serve serves the file at fileKey location to an HTTP response. + * + * If the `download` query parameter is used the file will be always served for + * download no matter of its type (aka. with "Content-Disposition: attachment"). */ - (db: DB): (BaseQueryBuilder) + serve(res: http.ResponseWriter, req: http.Request, fileKey: string, name: string): void } - interface BaseQueryBuilder { + interface System { /** - * DB returns the DB instance associated with the query builder. + * CreateThumb creates a new thumb image for the file at originalKey location. + * The new thumb file is stored at thumbKey location. + * + * thumbSize is in the format: + * - 0xH (eg. 0x100) - resize to H height preserving the aspect ratio + * - Wx0 (eg. 300x0) - resize to W width preserving the aspect ratio + * - WxH (eg. 300x100) - resize and crop to WxH viewbox (from center) + * - WxHt (eg. 300x100t) - resize and crop to WxH viewbox (from top) + * - WxHb (eg. 300x100b) - resize and crop to WxH viewbox (from bottom) + * - WxHf (eg. 300x100f) - fit inside a WxH viewbox (without cropping) */ - db(): (DB) + createThumb(originalKey: string, thumbKey: string, thumbSize: string): void } - interface BaseQueryBuilder { + // @ts-ignore + import v4 = signer + // @ts-ignore + import smithyhttp = http + interface ignoredHeadersKey { + } + // @ts-ignore + import awsv2 = aws + // @ts-ignore + import awsv2cfg = config + // @ts-ignore + import s3managerv2 = manager + // @ts-ignore + import s3v2 = s3 + // @ts-ignore + import typesv2 = types + interface hexEscape { /** - * BuildSelect generates a SELECT clause from the given selected column names. + * HexEscape returns s, with all runes for which shouldEscape returns true + * escaped to "__0xXXX__", where XXX is the hex representation of the rune + * value. For example, " " would escape to "__0x20__". + * + * Non-UTF-8 strings will have their non-UTF-8 characters escaped to + * unicode.ReplacementChar; the original value is lost. Please file an + * issue if you need non-UTF8 support. + * + * Note: shouldEscape takes the whole string as a slice of runes and an + * index. Passing it a single byte or a single rune doesn't provide + * enough context for some escape decisions; for example, the caller might + * want to escape the second "/" in "//" but not the first one. + * We pass a slice of runes instead of the string or a slice of bytes + * because some decisions will be made on a rune basis (e.g., encode + * all non-ASCII runes). */ - buildSelect(cols: Array, distinct: boolean, option: string): string + (s: string, shouldEscape: (s: Array, i: number) => boolean): string } - interface BaseQueryBuilder { + interface hexUnescape { /** - * BuildFrom generates a FROM clause from the given tables. + * HexUnescape reverses HexEscape. */ - buildFrom(tables: Array): string + (s: string): string } - interface BaseQueryBuilder { + interface urlEscape { /** - * BuildJoin generates a JOIN clause from the given join information. + * URLEscape uses url.PathEscape to escape s. */ - buildJoin(joins: Array, params: Params): string + (s: string): string } - interface BaseQueryBuilder { + interface urlUnescape { /** - * BuildWhere generates a WHERE clause from the given expression. + * URLUnescape reverses URLEscape using url.PathUnescape. If the unescape + * returns an error, it returns s. */ - buildWhere(e: Expression, params: Params): string + (s: string): string } - interface BaseQueryBuilder { + interface useV2 { /** - * BuildHaving generates a HAVING clause from the given expression. + * UseV2 returns true iff the URL parameters indicate that the provider + * should use the AWS SDK v2. + * + * "awssdk=v1" will force V1. + * "awssdk=v2" will force V2. + * No "awssdk" parameter (or any other value) will return the default, currently V1. + * Note that the default may change in the future. */ - buildHaving(e: Expression, params: Params): string + (q: url.Values): boolean } - interface BaseQueryBuilder { + interface newDefaultV2Config { /** - * BuildGroupBy generates a GROUP BY clause from the given group-by columns. + * NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options. */ - buildGroupBy(cols: Array): string + (ctx: context.Context): awsv2.Config } - interface BaseQueryBuilder { - /** - * BuildOrderByAndLimit generates the ORDER BY and LIMIT clauses. - */ - buildOrderByAndLimit(sql: string, cols: Array, limit: number, offset: number): string - } - interface BaseQueryBuilder { + interface v2ConfigFromURLParams { /** - * BuildUnion generates a UNION clause from the given union information. + * V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL + * parameters in q. It is intended to be used by URLOpeners for AWS services if + * UseV2 returns true. + * + * https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config + * + * It returns an error if q contains any unknown query parameters; callers + * should remove any query parameters they know about from q before calling + * V2ConfigFromURLParams. + * + * The following query options are supported: + * ``` + * - region: The AWS region for requests; sets WithRegion. + * - profile: The shared config profile to use; sets SharedConfigProfile. + * - endpoint: The AWS service endpoint to send HTTP request. + * ``` */ - buildUnion(unions: Array, params: Params): string + (ctx: context.Context, q: url.Values): awsv2.Config } - interface BaseQueryBuilder { - /** - * BuildOrderBy generates the ORDER BY clause. - */ - buildOrderBy(cols: Array): string + interface urlSessionOpener { } - interface BaseQueryBuilder { - /** - * BuildLimit generates the LIMIT clause. - */ - buildLimit(limit: number, offset: number): string + interface urlSessionOpener { + openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) } /** - * VarTypeError indicates a variable type error when trying to populating a variable with DB result. + * URLOpener opens S3 URLs like "s3://mybucket". + * + * The URL host is used as the bucket name. + * + * Use "awssdk=v1" to force using AWS SDK v1, "awssdk=v2" to force using AWS SDK v2, + * or anything else to accept the default. + * + * For V1, see gocloud.dev/aws/ConfigFromURLParams for supported query parameters + * for overriding the aws.Session from the URL. + * For V2, see gocloud.dev/aws/V2ConfigFromURLParams. */ - interface VarTypeError extends String{} - interface VarTypeError { + interface URLOpener { /** - * Error returns the error message. + * UseV2 indicates whether the AWS SDK V2 should be used. */ - error(): string - } - /** - * NullStringMap is a map of sql.NullString that can be used to hold DB query result. - * The map keys correspond to the DB column names, while the map values are their corresponding column values. - */ - interface NullStringMap extends _TygojaDict{} - /** - * Rows enhances sql.Rows by providing additional data query methods. - * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. - */ - type _subnAbdX = sql.Rows - interface Rows extends _subnAbdX { - } - interface Rows { + useV2: boolean /** - * ScanMap populates the current row of data into a NullStringMap. - * Note that the NullStringMap must not be nil, or it will panic. - * The NullStringMap will be populated using column names as keys and their values as - * the corresponding element values. + * Options specifies the options to pass to OpenBucket. */ - scanMap(a: NullStringMap): void + options: Options } - interface Rows { + interface URLOpener { /** - * ScanStruct populates the current row of data into a struct. - * The struct must be given as a pointer. - * - * ScanStruct associates struct fields with DB table columns through a field mapping function. - * It populates a struct field with the data of its associated column. - * Note that only exported struct fields will be populated. - * - * By default, DefaultFieldMapFunc() is used to map struct fields to table columns. - * This function separates each word in a field name with a underscore and turns every letter into lower case. - * For example, "LastName" is mapped to "last_name", "MyID" is mapped to "my_id", and so on. - * To change the default behavior, set DB.FieldMapper with your custom mapping function. - * You may also set Query.FieldMapper to change the behavior for particular queries. + * OpenBucketURL opens a blob.Bucket based on u. */ - scanStruct(a: { - }): void + openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) } /** - * BuildHookFunc defines a callback function that is executed on Query creation. - */ - interface BuildHookFunc {(q: Query): void } - /** - * SelectQuery represents a DB-agnostic SELECT query. - * It can be built into a DB-specific query by calling the Build() method. + * Options sets options for constructing a *blob.Bucket backed by fileblob. */ - interface SelectQuery { + interface Options { /** - * FieldMapper maps struct field names to DB column names. + * UseLegacyList forces the use of ListObjects instead of ListObjectsV2. + * Some S3-compatible services (like CEPH) do not currently support + * ListObjectsV2. */ - fieldMapper: FieldMapFunc + useLegacyList: boolean + } + interface openBucketV2 { /** - * TableMapper maps structs to DB table names. + * OpenBucketV2 returns a *blob.Bucket backed by S3, using AWS SDK v2. */ - tableMapper: TableMapFunc - } - /** - * JoinInfo contains the specification for a JOIN clause. - */ - interface JoinInfo { - join: string - table: string - on: Expression + (ctx: context.Context, client: s3v2.Client, bucketName: string, opts: Options): (blob.Bucket) } /** - * UnionInfo contains the specification for a UNION clause. + * reader reads an S3 object. It implements io.ReadCloser. */ - interface UnionInfo { - all: boolean - query?: Query - } - interface newSelectQuery { - /** - * NewSelectQuery creates a new SelectQuery instance. - */ - (builder: Builder, db: DB): (SelectQuery) - } - interface SelectQuery { - /** - * WithBuildHook runs the provided hook function with the query created on Build(). - */ - withBuildHook(fn: BuildHookFunc): (SelectQuery) - } - interface SelectQuery { - /** - * Context returns the context associated with the query. - */ - context(): context.Context - } - interface SelectQuery { - /** - * WithContext associates a context with the query. - */ - withContext(ctx: context.Context): (SelectQuery) - } - interface SelectQuery { - /** - * Select specifies the columns to be selected. - * Column names will be automatically quoted. - */ - select(...cols: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * AndSelect adds additional columns to be selected. - * Column names will be automatically quoted. - */ - andSelect(...cols: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * Distinct specifies whether to select columns distinctively. - * By default, distinct is false. - */ - distinct(v: boolean): (SelectQuery) - } - interface SelectQuery { - /** - * SelectOption specifies additional option that should be append to "SELECT". - */ - selectOption(option: string): (SelectQuery) - } - interface SelectQuery { - /** - * From specifies which tables to select from. - * Table names will be automatically quoted. - */ - from(...tables: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * Where specifies the WHERE condition. - */ - where(e: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * AndWhere concatenates a new WHERE condition with the existing one (if any) using "AND". - */ - andWhere(e: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * OrWhere concatenates a new WHERE condition with the existing one (if any) using "OR". - */ - orWhere(e: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * Join specifies a JOIN clause. - * The "typ" parameter specifies the JOIN type (e.g. "INNER JOIN", "LEFT JOIN"). - */ - join(typ: string, table: string, on: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * InnerJoin specifies an INNER JOIN clause. - * This is a shortcut method for Join. - */ - innerJoin(table: string, on: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * LeftJoin specifies a LEFT JOIN clause. - * This is a shortcut method for Join. - */ - leftJoin(table: string, on: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * RightJoin specifies a RIGHT JOIN clause. - * This is a shortcut method for Join. - */ - rightJoin(table: string, on: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * OrderBy specifies the ORDER BY clause. - * Column names will be properly quoted. A column name can contain "ASC" or "DESC" to indicate its ordering direction. - */ - orderBy(...cols: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * AndOrderBy appends additional columns to the existing ORDER BY clause. - * Column names will be properly quoted. A column name can contain "ASC" or "DESC" to indicate its ordering direction. - */ - andOrderBy(...cols: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * GroupBy specifies the GROUP BY clause. - * Column names will be properly quoted. - */ - groupBy(...cols: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * AndGroupBy appends additional columns to the existing GROUP BY clause. - * Column names will be properly quoted. - */ - andGroupBy(...cols: string[]): (SelectQuery) - } - interface SelectQuery { - /** - * Having specifies the HAVING clause. - */ - having(e: Expression): (SelectQuery) - } - interface SelectQuery { - /** - * AndHaving concatenates a new HAVING condition with the existing one (if any) using "AND". - */ - andHaving(e: Expression): (SelectQuery) + interface reader { } - interface SelectQuery { - /** - * OrHaving concatenates a new HAVING condition with the existing one (if any) using "OR". - */ - orHaving(e: Expression): (SelectQuery) + interface reader { + read(p: string|Array): number } - interface SelectQuery { + interface reader { /** - * Union specifies a UNION clause. + * Close closes the reader itself. It must be called when done reading. */ - union(q: Query): (SelectQuery) + close(): void } - interface SelectQuery { - /** - * UnionAll specifies a UNION ALL clause. - */ - unionAll(q: Query): (SelectQuery) + interface reader { + as(i: { + }): boolean } - interface SelectQuery { - /** - * Limit specifies the LIMIT clause. - * A negative limit means no limit. - */ - limit(limit: number): (SelectQuery) + interface reader { + attributes(): (any) } - interface SelectQuery { - /** - * Offset specifies the OFFSET clause. - * A negative offset means no offset. - */ - offset(offset: number): (SelectQuery) + /** + * writer writes an S3 object, it implements io.WriteCloser. + */ + interface writer { } - interface SelectQuery { + interface writer { /** - * Bind specifies the parameter values to be bound to the query. + * Write appends p to w.pw. User must call Close to close the w after done writing. */ - bind(params: Params): (SelectQuery) + write(p: string|Array): number } - interface SelectQuery { + interface writer { /** - * AndBind appends additional parameters to be bound to the query. + * Upload reads from r. Per the driver, it is guaranteed to be the only + * write call for this writer. */ - andBind(params: Params): (SelectQuery) + upload(r: io.Reader): void } - interface SelectQuery { + interface writer { /** - * Build builds the SELECT query and returns an executable Query object. + * Close completes the writer and closes it. Any error occurring during write + * will be returned. If a writer is closed before any Write is called, Close + * will create an empty file at the given key. */ - build(): (Query) + close(): void } - interface SelectQuery { - /** - * One executes the SELECT query and populates the first row of the result into the specified variable. - * - * If the query does not specify a "from" clause, the method will try to infer the name of the table - * to be selected from by calling getTableName() which will return either the variable type name - * or the TableName() method if the variable implements the TableModel interface. - * - * Note that when the query has no rows in the result set, an sql.ErrNoRows will be returned. - */ - one(a: { - }): void + /** + * bucket represents an S3 bucket and handles read, write and delete operations. + */ + interface bucket { } - interface SelectQuery { - /** - * Model selects the row with the specified primary key and populates the model with the row data. - * - * The model variable should be a pointer to a struct. If the query does not specify a "from" clause, - * it will use the model struct to determine which table to select data from. It will also use the model - * to infer the name of the primary key column. Only simple primary key is supported. For composite primary keys, - * please use Where() to specify the filtering condition. - */ - model(pk: { - }, model: { - }): void + interface bucket { + close(): void } - interface SelectQuery { - /** - * All executes the SELECT query and populates all rows of the result into a slice. - * - * Note that the slice must be passed in as a pointer. - * - * If the query does not specify a "from" clause, the method will try to infer the name of the table - * to be selected from by calling getTableName() which will return either the type name of the slice elements - * or the TableName() method if the slice element implements the TableModel interface. - */ - all(slice: { - }): void + interface bucket { + errorCode(err: Error): gcerrors.ErrorCode } - interface SelectQuery { + interface bucket { /** - * Rows builds and executes the SELECT query and returns a Rows object for data retrieval purpose. - * This is a shortcut to SelectQuery.Build().Rows() + * ListPaged implements driver.ListPaged. */ - rows(): (Rows) + listPaged(ctx: context.Context, opts: any): (any) } - interface SelectQuery { + interface bucket { /** - * Row builds and executes the SELECT query and populates the first row of the result into the specified variables. - * This is a shortcut to SelectQuery.Build().Row() + * As implements driver.As. */ - row(...a: { - }[]): void + as(i: { + }): boolean } - interface SelectQuery { + interface bucket { /** - * Column builds and executes the SELECT statement and populates the first column of the result into a slice. - * Note that the parameter must be a pointer to a slice. - * This is a shortcut to SelectQuery.Build().Column() + * As implements driver.ErrorAs. */ - column(a: { - }): void - } - /** - * QueryInfo represents a debug/info struct with exported SelectQuery fields. - */ - interface QueryInfo { - builder: Builder - selects: Array - distinct: boolean - selectOption: string - from: Array - where: Expression - join: Array - orderBy: Array - groupBy: Array - having: Expression - union: Array - limit: number - offset: number - params: Params - context: context.Context - buildHook: BuildHookFunc + errorAs(err: Error, i: { + }): boolean } - interface SelectQuery { + interface bucket { /** - * Info exports common SelectQuery fields allowing to inspect the - * current select query options. + * Attributes implements driver.Attributes. */ - info(): (QueryInfo) - } - /** - * FieldMapFunc converts a struct field name into a DB column name. - */ - interface FieldMapFunc {(_arg0: string): string } - /** - * TableMapFunc converts a sample struct into a DB table name. - */ - interface TableMapFunc {(a: { - }): string } - interface structInfo { - } - type _subxLLPJ = structInfo - interface structValue extends _subxLLPJ { - } - interface fieldInfo { - } - interface structInfoMapKey { + attributes(ctx: context.Context, key: string): (any) } - /** - * PostScanner is an optional interface used by ScanStruct. - */ - interface PostScanner { - [key:string]: any; + interface bucket { /** - * PostScan executes right after the struct has been populated - * with the DB values, allowing you to further normalize or validate - * the loaded data. + * NewRangeReader implements driver.NewRangeReader. */ - postScan(): void + newRangeReader(ctx: context.Context, key: string, offset: number, length: number, opts: any): any } - interface defaultFieldMapFunc { + interface bucket { /** - * DefaultFieldMapFunc maps a field name to a DB column name. - * The mapping rule set by this method is that words in a field name will be separated by underscores - * and the name will be turned into lower case. For example, "FirstName" maps to "first_name", and "MyID" becomes "my_id". - * See DB.FieldMapper for more details. + * NewTypedWriter implements driver.NewTypedWriter. */ - (f: string): string + newTypedWriter(ctx: context.Context, key: string, contentType: string, opts: any): any } - interface getTableName { + interface bucket { /** - * GetTableName implements the default way of determining the table name corresponding to the given model struct - * or slice of structs. To get the actual table name for a model, you should use DB.TableMapFunc() instead. - * Do not call this method in a model's TableName() method because it will cause infinite loop. + * Copy implements driver.Copy. */ - (a: { - }): string - } - /** - * Tx enhances sql.Tx with additional querying methods. - */ - type _subqhOLL = Builder - interface Tx extends _subqhOLL { + copy(ctx: context.Context, dstKey: string, srcKey: string, opts: any): void } - interface Tx { + interface bucket { /** - * Commit commits the transaction. + * Delete implements driver.Delete. */ - commit(): void + delete(ctx: context.Context, key: string): void } - interface Tx { - /** - * Rollback aborts the transaction. - */ - rollback(): void + interface bucket { + signedURL(ctx: context.Context, key: string, opts: any): string } } @@ -6592,8 +6585,8 @@ namespace forms { /** * SettingsUpsert is a [settings.Settings] upsert (create/update) form. */ - type _subIwjtv = settings.Settings - interface SettingsUpsert extends _subIwjtv { + type _subWkaUd = settings.Settings + interface SettingsUpsert extends _subWkaUd { } interface newSettingsUpsert { /** @@ -6682,6 +6675,25 @@ namespace forms { } } +namespace middleware { + interface bodyLimit { + /** + * BodyLimit returns a BodyLimit middleware. + * + * BodyLimit middleware sets the maximum allowed size for a request body, if the size exceeds the configured limit, it + * sends "413 - Request Entity Too Large" response. The BodyLimit is determined based on both `Content-Length` request + * header and actual content read, which makes it super secure. + */ + (limitBytes: number): echo.MiddlewareFunc + } + interface gzip { + /** + * Gzip returns a middleware which compresses HTTP response using gzip compression scheme. + */ + (): echo.MiddlewareFunc + } +} + /** * Package apis implements the default PocketBase api services and middlewares. */ @@ -7024,8 +7036,8 @@ namespace pocketbase { /** * appWrapper serves as a private CoreApp instance wrapper. */ - type _subRaHzg = CoreApp - interface appWrapper extends _subRaHzg { + type _subVcKSq = CoreApp + interface appWrapper extends _subVcKSq { } /** * PocketBase defines a PocketBase app launcher. @@ -7033,8 +7045,8 @@ namespace pocketbase { * It implements [CoreApp] via embedding and all of the app interface methods * could be accessed directly through the instance (eg. PocketBase.DataDir()). */ - type _subNtXmf = appWrapper - interface PocketBase extends _subNtXmf { + type _subOvaiK = appWrapper + interface PocketBase extends _subOvaiK { /** * RootCmd is the main console command */ @@ -7294,91 +7306,6 @@ namespace io { } } -/** - * Package bytes implements functions for the manipulation of byte slices. - * It is analogous to the facilities of the [strings] package. - */ -namespace bytes { - /** - * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], - * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from - * a byte slice. - * Unlike a [Buffer], a Reader is read-only and supports seeking. - * The zero value for Reader operates like a Reader of an empty slice. - */ - interface Reader { - } - interface Reader { - /** - * Len returns the number of bytes of the unread portion of the - * slice. - */ - len(): number - } - interface Reader { - /** - * Size returns the original length of the underlying byte slice. - * Size is the number of bytes available for reading via [Reader.ReadAt]. - * The result is unaffected by any method calls except [Reader.Reset]. - */ - size(): number - } - interface Reader { - /** - * Read implements the [io.Reader] interface. - */ - read(b: string|Array): number - } - interface Reader { - /** - * ReadAt implements the [io.ReaderAt] interface. - */ - readAt(b: string|Array, off: number): number - } - interface Reader { - /** - * ReadByte implements the [io.ByteReader] interface. - */ - readByte(): number - } - interface Reader { - /** - * UnreadByte complements [Reader.ReadByte] in implementing the [io.ByteScanner] interface. - */ - unreadByte(): void - } - interface Reader { - /** - * ReadRune implements the [io.RuneReader] interface. - */ - readRune(): [number, number] - } - interface Reader { - /** - * UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface. - */ - unreadRune(): void - } - interface Reader { - /** - * Seek implements the [io.Seeker] interface. - */ - seek(offset: number, whence: number): number - } - interface Reader { - /** - * WriteTo implements the [io.WriterTo] interface. - */ - writeTo(w: io.Writer): number - } - interface Reader { - /** - * Reset resets the [Reader] to be reading from b. - */ - reset(b: string|Array): void - } -} - /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -8312,6 +8239,91 @@ namespace fs { interface WalkDirFunc {(path: string, d: DirEntry, err: Error): void } } +/** + * Package bytes implements functions for the manipulation of byte slices. + * It is analogous to the facilities of the [strings] package. + */ +namespace bytes { + /** + * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], + * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from + * a byte slice. + * Unlike a [Buffer], a Reader is read-only and supports seeking. + * The zero value for Reader operates like a Reader of an empty slice. + */ + interface Reader { + } + interface Reader { + /** + * Len returns the number of bytes of the unread portion of the + * slice. + */ + len(): number + } + interface Reader { + /** + * Size returns the original length of the underlying byte slice. + * Size is the number of bytes available for reading via [Reader.ReadAt]. + * The result is unaffected by any method calls except [Reader.Reset]. + */ + size(): number + } + interface Reader { + /** + * Read implements the [io.Reader] interface. + */ + read(b: string|Array): number + } + interface Reader { + /** + * ReadAt implements the [io.ReaderAt] interface. + */ + readAt(b: string|Array, off: number): number + } + interface Reader { + /** + * ReadByte implements the [io.ByteReader] interface. + */ + readByte(): number + } + interface Reader { + /** + * UnreadByte complements [Reader.ReadByte] in implementing the [io.ByteScanner] interface. + */ + unreadByte(): void + } + interface Reader { + /** + * ReadRune implements the [io.RuneReader] interface. + */ + readRune(): [number, number] + } + interface Reader { + /** + * UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface. + */ + unreadRune(): void + } + interface Reader { + /** + * Seek implements the [io.Seeker] interface. + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * WriteTo implements the [io.WriterTo] interface. + */ + writeTo(w: io.Writer): number + } + interface Reader { + /** + * Reset resets the [Reader] to be reading from b. + */ + reset(b: string|Array): void + } +} + /** * Package context defines the Context type, which carries deadlines, * cancellation signals, and other request-scoped values across API boundaries @@ -8714,1626 +8726,1626 @@ namespace url { } /** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. * - * Drivers that do not support context cancellation will not return until - * after the query is completed. + * # Limits * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. */ -namespace sql { +namespace multipart { /** - * TxOptions holds the transaction options to be used in [DB.BeginTx]. + * A FileHeader describes a file part of a multipart request. */ - interface TxOptions { + interface FileHeader { + filename: string + header: textproto.MIMEHeader + size: number + } + interface FileHeader { /** - * Isolation is the transaction isolation level. - * If zero, the driver or database's default level is used. + * Open opens and returns the [FileHeader]'s associated File. */ - isolation: IsolationLevel - readOnly: boolean + open(): File } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url /** - * DB is a database handle representing a pool of zero or more - * underlying connections. It's safe for concurrent use by multiple - * goroutines. + * A Request represents an HTTP request received by a server + * or to be sent by a client. * - * The sql package creates and frees connections automatically; it - * also maintains a free pool of idle connections. If the database has - * a concept of per-connection state, such state can be reliably observed - * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the - * returned [Tx] is bound to a single connection. Once [Tx.Commit] or - * [Tx.Rollback] is called on the transaction, that transaction's - * connection is returned to [DB]'s idle connection pool. The pool size - * can be controlled with [DB.SetMaxIdleConns]. + * The field semantics differ slightly between client and server + * usage. In addition to the notes on the fields below, see the + * documentation for [Request.Write] and [RoundTripper]. */ - interface DB { - } - interface DB { + interface Request { /** - * PingContext verifies a connection to the database is still alive, - * establishing a connection if necessary. + * Method specifies the HTTP method (GET, POST, PUT, etc.). + * For client requests, an empty string means GET. */ - pingContext(ctx: context.Context): void - } - interface DB { + method: string /** - * Ping verifies a connection to the database is still alive, - * establishing a connection if necessary. + * URL specifies either the URI being requested (for server + * requests) or the URL to access (for client requests). * - * Ping uses [context.Background] internally; to specify the context, use - * [DB.PingContext]. + * For server requests, the URL is parsed from the URI + * supplied on the Request-Line as stored in RequestURI. For + * most requests, fields other than Path and RawQuery will be + * empty. (See RFC 7230, Section 5.3) + * + * For client requests, the URL's Host specifies the server to + * connect to, while the Request's Host field optionally + * specifies the Host header value to send in the HTTP + * request. */ - ping(): void - } - interface DB { + url?: url.URL /** - * Close closes the database and prevents new queries from starting. - * Close then waits for all queries that have started processing on the server - * to finish. + * The protocol version for incoming server requests. * - * It is rare to Close a [DB], as the [DB] handle is meant to be - * long-lived and shared between many goroutines. + * For client requests, these fields are ignored. The HTTP + * client code always uses either HTTP/1.1 or HTTP/2. + * See the docs on Transport for details. */ - close(): void - } - interface DB { + proto: string // "HTTP/1.0" + protoMajor: number // 1 + protoMinor: number // 0 /** - * SetMaxIdleConns sets the maximum number of connections in the idle - * connection pool. + * Header contains the request header fields either received + * by the server or to be sent by the client. * - * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, - * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. + * If a server received a request with header lines, * - * If n <= 0, no idle connections are retained. + * ``` + * Host: example.com + * accept-encoding: gzip, deflate + * Accept-Language: en-us + * fOO: Bar + * foo: two + * ``` * - * The default max idle connections is currently 2. This may change in - * a future release. - */ - setMaxIdleConns(n: number): void - } - interface DB { - /** - * SetMaxOpenConns sets the maximum number of open connections to the database. + * then * - * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than - * MaxIdleConns, then MaxIdleConns will be reduced to match the new - * MaxOpenConns limit. + * ``` + * Header = map[string][]string{ + * "Accept-Encoding": {"gzip, deflate"}, + * "Accept-Language": {"en-us"}, + * "Foo": {"Bar", "two"}, + * } + * ``` * - * If n <= 0, then there is no limit on the number of open connections. - * The default is 0 (unlimited). - */ - setMaxOpenConns(n: number): void - } - interface DB { - /** - * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. + * For incoming requests, the Host header is promoted to the + * Request.Host field and removed from the Header map. * - * Expired connections may be closed lazily before reuse. + * HTTP defines that header names are case-insensitive. The + * request parser implements this by using CanonicalHeaderKey, + * making the first character and any characters following a + * hyphen uppercase and the rest lowercase. * - * If d <= 0, connections are not closed due to a connection's age. + * For client requests, certain headers such as Content-Length + * and Connection are automatically written when needed and + * values in Header may be ignored. See the documentation + * for the Request.Write method. */ - setConnMaxLifetime(d: time.Duration): void - } - interface DB { + header: Header /** - * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. + * Body is the request's body. * - * Expired connections may be closed lazily before reuse. + * For client requests, a nil body means the request has no + * body, such as a GET request. The HTTP Client's Transport + * is responsible for calling the Close method. * - * If d <= 0, connections are not closed due to a connection's idle time. + * For server requests, the Request Body is always non-nil + * but will return EOF immediately when no body is present. + * The Server will close the request body. The ServeHTTP + * Handler does not need to. + * + * Body must allow Read to be called concurrently with Close. + * In particular, calling Close should unblock a Read waiting + * for input. */ - setConnMaxIdleTime(d: time.Duration): void - } - interface DB { + body: io.ReadCloser /** - * Stats returns database statistics. + * GetBody defines an optional func to return a new copy of + * Body. It is used for client requests when a redirect requires + * reading the body more than once. Use of GetBody still + * requires setting Body. + * + * For server requests, it is unused. */ - stats(): DBStats - } - interface DB { + getBody: () => io.ReadCloser /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. + * ContentLength records the length of the associated content. + * The value -1 indicates that the length is unknown. + * Values >= 0 indicate that the given number of bytes may + * be read from Body. * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. + * For client requests, a value of 0 with a non-nil Body is + * also treated as unknown. */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface DB { + contentLength: number /** - * Prepare creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * Prepare uses [context.Background] internally; to specify the context, use - * [DB.PrepareContext]. + * TransferEncoding lists the transfer encodings from outermost to + * innermost. An empty list denotes the "identity" encoding. + * TransferEncoding can usually be ignored; chunked encoding is + * automatically added and removed as necessary when sending and + * receiving requests. */ - prepare(query: string): (Stmt) - } - interface DB { + transferEncoding: Array /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. + * Close indicates whether to close the connection after + * replying to this request (for servers) or after sending this + * request and reading its response (for clients). + * + * For server requests, the HTTP server handles this automatically + * and this field is not needed by Handlers. + * + * For client requests, setting this field prevents re-use of + * TCP connections between requests to the same hosts, as if + * Transport.DisableKeepAlives were set. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface DB { + close: boolean /** - * Exec executes a query without returning any rows. - * The args are for any placeholder parameters in the query. + * For server requests, Host specifies the host on which the + * URL is sought. For HTTP/1 (per RFC 7230, section 5.4), this + * is either the value of the "Host" header or the host name + * given in the URL itself. For HTTP/2, it is the value of the + * ":authority" pseudo-header field. + * It may be of the form "host:port". For international domain + * names, Host may be in Punycode or Unicode form. Use + * golang.org/x/net/idna to convert it to either format if + * needed. + * To prevent DNS rebinding attacks, server Handlers should + * validate that the Host header has a value for which the + * Handler considers itself authoritative. The included + * ServeMux supports patterns registered to particular host + * names and thus protects its registered Handlers. * - * Exec uses [context.Background] internally; to specify the context, use - * [DB.ExecContext]. + * For client requests, Host optionally overrides the Host + * header to send. If empty, the Request.Write method uses + * the value of URL.Host. Host may contain an international + * domain name. */ - exec(query: string, ...args: any[]): Result - } - interface DB { + host: string /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. + * Form contains the parsed form data, including both the URL + * field's query parameters and the PATCH, POST, or PUT form data. + * This field is only available after ParseForm is called. + * The HTTP client ignores Form and uses Body instead. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface DB { + form: url.Values /** - * Query executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. + * PostForm contains the parsed form data from PATCH, POST + * or PUT body parameters. * - * Query uses [context.Background] internally; to specify the context, use - * [DB.QueryContext]. + * This field is only available after ParseForm is called. + * The HTTP client ignores PostForm and uses Body instead. */ - query(query: string, ...args: any[]): (Rows) - } - interface DB { + postForm: url.Values /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. + * MultipartForm is the parsed multipart form, including file uploads. + * This field is only available after ParseMultipartForm is called. + * The HTTP client ignores MultipartForm and uses Body instead. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface DB { + multipartForm?: multipart.Form /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. + * Trailer specifies additional headers that are sent after the request + * body. * - * QueryRow uses [context.Background] internally; to specify the context, use - * [DB.QueryRowContext]. - */ - queryRow(query: string, ...args: any[]): (Row) - } - interface DB { - /** - * BeginTx starts a transaction. + * For server requests, the Trailer map initially contains only the + * trailer keys, with nil values. (The client declares which trailers it + * will later send.) While the handler is reading from Body, it must + * not reference Trailer. After reading from Body returns EOF, Trailer + * can be read again and will contain non-nil values, if they were sent + * by the client. * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. + * For client requests, Trailer must be initialized to a map containing + * the trailer keys to later send. The values may be nil or their final + * values. The ContentLength must be 0 or -1, to send a chunked request. + * After the HTTP request is sent the map values can be updated while + * the request body is read. Once the body returns EOF, the caller must + * not mutate Trailer. * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. + * Few HTTP clients, servers, or proxies support HTTP trailers. */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) - } - interface DB { + trailer: Header /** - * Begin starts a transaction. The default isolation level is dependent on - * the driver. - * - * Begin uses [context.Background] internally; to specify the context, use - * [DB.BeginTx]. + * RemoteAddr allows HTTP servers and other software to record + * the network address that sent the request, usually for + * logging. This field is not filled in by ReadRequest and + * has no defined format. The HTTP server in this package + * sets RemoteAddr to an "IP:port" address before invoking a + * handler. + * This field is ignored by the HTTP client. */ - begin(): (Tx) - } - interface DB { + remoteAddr: string /** - * Driver returns the database's underlying driver. + * RequestURI is the unmodified request-target of the + * Request-Line (RFC 7230, Section 3.1.1) as sent by the client + * to a server. Usually the URL field should be used instead. + * It is an error to set this field in an HTTP client request. */ - driver(): any - } - interface DB { + requestURI: string /** - * Conn returns a single connection by either opening a new connection - * or returning an existing connection from the connection pool. Conn will - * block until either a connection is returned or ctx is canceled. - * Queries run on the same Conn will be run in the same database session. + * TLS allows HTTP servers and other software to record + * information about the TLS connection on which the request + * was received. This field is not filled in by ReadRequest. + * The HTTP server in this package sets the field for + * TLS-enabled connections before invoking a handler; + * otherwise it leaves the field nil. + * This field is ignored by the HTTP client. + */ + tls?: any + /** + * Cancel is an optional channel whose closure indicates that the client + * request should be regarded as canceled. Not all implementations of + * RoundTripper may support Cancel. * - * Every Conn must be returned to the database pool after use by - * calling [Conn.Close]. + * For server requests, this field is not applicable. + * + * Deprecated: Set the Request's context with NewRequestWithContext + * instead. If a Request's Cancel field and context are both + * set, it is undefined whether Cancel is respected. */ - conn(ctx: context.Context): (Conn) - } - /** - * Tx is an in-progress database transaction. - * - * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. - * - * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the - * transaction fail with [ErrTxDone]. - * - * The statements prepared for a transaction by calling - * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed - * by the call to [Tx.Commit] or [Tx.Rollback]. - */ - interface Tx { - } - interface Tx { + cancel: undefined /** - * Commit commits the transaction. + * Response is the redirect response which caused this request + * to be created. This field is only populated during client + * redirects. */ - commit(): void - } - interface Tx { + response?: Response /** - * Rollback aborts the transaction. + * Pattern is the [ServeMux] pattern that matched the request. + * It is empty if the request was not matched against a pattern. */ - rollback(): void + pattern: string } - interface Tx { + interface Request { /** - * PrepareContext creates a prepared statement for use within a transaction. + * Context returns the request's context. To change the context, use + * [Request.Clone] or [Request.WithContext]. * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. + * The returned context is always non-nil; it defaults to the + * background context. * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * For outgoing client requests, the context controls cancellation. * - * The provided context will be used for the preparation of the context, not - * for the execution of the returned statement. The returned statement - * will run in the transaction context. + * For incoming server requests, the context is canceled when the + * client's connection closes, the request is canceled (with HTTP/2), + * or when the ServeHTTP method returns. */ - prepareContext(ctx: context.Context, query: string): (Stmt) + context(): context.Context } - interface Tx { + interface Request { /** - * Prepare creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. + * WithContext returns a shallow copy of r with its context changed + * to ctx. The provided ctx must be non-nil. * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * For outgoing client request, the context controls the entire + * lifetime of a request and its response: obtaining a connection, + * sending the request, and reading the response headers and body. * - * Prepare uses [context.Background] internally; to specify the context, use - * [Tx.PrepareContext]. + * To create a new request with a context, use [NewRequestWithContext]. + * To make a deep copy of a request with a new context, use [Request.Clone]. */ - prepare(query: string): (Stmt) + withContext(ctx: context.Context): (Request) } - interface Tx { + interface Request { /** - * StmtContext returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) - * ``` + * Clone returns a deep copy of r with its context changed to ctx. + * The provided ctx must be non-nil. * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. + * Clone only makes a shallow copy of the Body field. * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. + * For an outgoing client request, the context controls the entire + * lifetime of a request and its response: obtaining a connection, + * sending the request, and reading the response headers and body. */ - stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) + clone(ctx: context.Context): (Request) } - interface Tx { + interface Request { /** - * Stmt returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) - * ``` - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * Stmt uses [context.Background] internally; to specify the context, use - * [Tx.StmtContext]. + * ProtoAtLeast reports whether the HTTP protocol used + * in the request is at least major.minor. */ - stmt(stmt: Stmt): (Stmt) + protoAtLeast(major: number, minor: number): boolean } - interface Tx { + interface Request { /** - * ExecContext executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. + * UserAgent returns the client's User-Agent, if sent in the request. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result + userAgent(): string } - interface Tx { + interface Request { /** - * Exec executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Tx.ExecContext]. + * Cookies parses and returns the HTTP cookies sent with the request. */ - exec(query: string, ...args: any[]): Result + cookies(): Array<(Cookie | undefined)> } - interface Tx { + interface Request { /** - * QueryContext executes a query that returns rows, typically a SELECT. + * CookiesNamed parses and returns the named HTTP cookies sent with the request + * or an empty slice if none matched. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + cookiesNamed(name: string): Array<(Cookie | undefined)> } - interface Tx { + interface Request { /** - * Query executes a query that returns rows, typically a SELECT. - * - * Query uses [context.Background] internally; to specify the context, use - * [Tx.QueryContext]. + * Cookie returns the named cookie provided in the request or + * [ErrNoCookie] if not found. + * If multiple cookies match the given name, only one cookie will + * be returned. */ - query(query: string, ...args: any[]): (Rows) + cookie(name: string): (Cookie) } - interface Tx { + interface Request { /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, + * AddCookie does not attach more than one [Cookie] header field. That + * means all cookies, if any, are written into the same line, + * separated by semicolon. + * AddCookie only sanitizes c's name and value, and does not sanitize + * a Cookie header already present in the request. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + addCookie(c: Cookie): void } - interface Tx { + interface Request { /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * Referer returns the referring URL, if sent in the request. * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Tx.QueryRowContext]. + * Referer is misspelled as in the request itself, a mistake from the + * earliest days of HTTP. This value can also be fetched from the + * [Header] map as Header["Referer"]; the benefit of making it available + * as a method is that the compiler can diagnose programs that use the + * alternate (correct English) spelling req.Referrer() but cannot + * diagnose programs that use Header["Referrer"]. */ - queryRow(query: string, ...args: any[]): (Row) - } - /** - * Stmt is a prepared statement. - * A Stmt is safe for concurrent use by multiple goroutines. - * - * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single - * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will - * become unusable and all operations will return an error. - * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the - * [DB]. When the Stmt needs to execute on a new underlying connection, it will - * prepare itself on the new connection automatically. - */ - interface Stmt { + referer(): string } - interface Stmt { + interface Request { /** - * ExecContext executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. + * MultipartReader returns a MIME multipart reader if this is a + * multipart/form-data or a multipart/mixed POST request, else returns nil and an error. + * Use this function instead of [Request.ParseMultipartForm] to + * process the request body as a stream. */ - execContext(ctx: context.Context, ...args: any[]): Result + multipartReader(): (multipart.Reader) } - interface Stmt { + interface Request { /** - * Exec executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. + * Write writes an HTTP/1.1 request, which is the header and body, in wire format. + * This method consults the following fields of the request: * - * Exec uses [context.Background] internally; to specify the context, use - * [Stmt.ExecContext]. + * ``` + * Host + * URL + * Method (defaults to "GET") + * Header + * ContentLength + * TransferEncoding + * Body + * ``` + * + * If Body is present, Content-Length is <= 0 and [Request.TransferEncoding] + * hasn't been set to "identity", Write adds "Transfer-Encoding: + * chunked" to the header. Body is closed after it is sent. */ - exec(...args: any[]): Result + write(w: io.Writer): void } - interface Stmt { + interface Request { /** - * QueryContext executes a prepared query statement with the given arguments - * and returns the query results as a [*Rows]. + * WriteProxy is like [Request.Write] but writes the request in the form + * expected by an HTTP proxy. In particular, [Request.WriteProxy] writes the + * initial Request-URI line of the request with an absolute URI, per + * section 5.3 of RFC 7230, including the scheme and host. + * In either case, WriteProxy also writes a Host header, using + * either r.Host or r.URL.Host. */ - queryContext(ctx: context.Context, ...args: any[]): (Rows) + writeProxy(w: io.Writer): void } - interface Stmt { + interface Request { /** - * Query executes a prepared query statement with the given arguments - * and returns the query results as a *Rows. - * - * Query uses [context.Background] internally; to specify the context, use - * [Stmt.QueryContext]. + * BasicAuth returns the username and password provided in the request's + * Authorization header, if the request uses HTTP Basic Authentication. + * See RFC 2617, Section 2. */ - query(...args: any[]): (Rows) + basicAuth(): [string, string, boolean] } - interface Stmt { + interface Request { /** - * QueryRowContext executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * SetBasicAuth sets the request's Authorization header to use HTTP + * Basic Authentication with the provided username and password. + * + * With HTTP Basic Authentication the provided username and password + * are not encrypted. It should generally only be used in an HTTPS + * request. + * + * The username may not contain a colon. Some protocols may impose + * additional requirements on pre-escaping the username and + * password. For instance, when used with OAuth2, both arguments must + * be URL encoded first with [url.QueryEscape]. */ - queryRowContext(ctx: context.Context, ...args: any[]): (Row) + setBasicAuth(username: string, password: string): void } - interface Stmt { + interface Request { /** - * QueryRow executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * ParseForm populates r.Form and r.PostForm. * - * Example usage: + * For all requests, ParseForm parses the raw query from the URL and updates + * r.Form. * - * ``` - * var name string - * err := nameByUseridStmt.QueryRow(id).Scan(&name) - * ``` + * For POST, PUT, and PATCH requests, it also reads the request body, parses it + * as a form and puts the results into both r.PostForm and r.Form. Request body + * parameters take precedence over URL query string values in r.Form. * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Stmt.QueryRowContext]. + * If the request Body's size has not already been limited by [MaxBytesReader], + * the size is capped at 10MB. + * + * For other HTTP methods, or when the Content-Type is not + * application/x-www-form-urlencoded, the request Body is not read, and + * r.PostForm is initialized to a non-nil, empty value. + * + * [Request.ParseMultipartForm] calls ParseForm automatically. + * ParseForm is idempotent. */ - queryRow(...args: any[]): (Row) + parseForm(): void } - interface Stmt { + interface Request { /** - * Close closes the statement. - */ - close(): void - } - /** - * Rows is the result of a query. Its cursor starts before the first row - * of the result set. Use [Rows.Next] to advance from row to row. - */ - interface Rows { + * ParseMultipartForm parses a request body as multipart/form-data. + * The whole request body is parsed and up to a total of maxMemory bytes of + * its file parts are stored in memory, with the remainder stored on + * disk in temporary files. + * ParseMultipartForm calls [Request.ParseForm] if necessary. + * If ParseForm returns an error, ParseMultipartForm returns it but also + * continues parsing the request body. + * After one call to ParseMultipartForm, subsequent calls have no effect. + */ + parseMultipartForm(maxMemory: number): void } - interface Rows { + interface Request { /** - * Next prepares the next result row for reading with the [Rows.Scan] method. It - * returns true on success, or false if there is no next result row or an error - * happened while preparing it. [Rows.Err] should be consulted to distinguish between - * the two cases. + * FormValue returns the first value for the named component of the query. + * The precedence order: + * 1. application/x-www-form-urlencoded form body (POST, PUT, PATCH only) + * 2. query parameters (always) + * 3. multipart/form-data form body (always) * - * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. + * FormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] + * if necessary and ignores any errors returned by these functions. + * If key is not present, FormValue returns the empty string. + * To access multiple values of the same key, call ParseForm and + * then inspect [Request.Form] directly. */ - next(): boolean + formValue(key: string): string } - interface Rows { + interface Request { /** - * NextResultSet prepares the next result set for reading. It reports whether - * there is further result sets, or false if there is no further result set - * or if there is an error advancing to it. The [Rows.Err] method should be consulted - * to distinguish between the two cases. - * - * After calling NextResultSet, the [Rows.Next] method should always be called before - * scanning. If there are further result sets they may not have rows in the result - * set. + * PostFormValue returns the first value for the named component of the POST, + * PUT, or PATCH request body. URL query parameters are ignored. + * PostFormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary and ignores + * any errors returned by these functions. + * If key is not present, PostFormValue returns the empty string. */ - nextResultSet(): boolean + postFormValue(key: string): string } - interface Rows { + interface Request { /** - * Err returns the error, if any, that was encountered during iteration. - * Err may be called after an explicit or implicit [Rows.Close]. + * FormFile returns the first file for the provided form key. + * FormFile calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary. */ - err(): void + formFile(key: string): [multipart.File, (multipart.FileHeader)] } - interface Rows { + interface Request { /** - * Columns returns the column names. - * Columns returns an error if the rows are closed. + * PathValue returns the value for the named path wildcard in the [ServeMux] pattern + * that matched the request. + * It returns the empty string if the request was not matched against a pattern + * or there is no such wildcard in the pattern. */ - columns(): Array + pathValue(name: string): string } - interface Rows { + interface Request { /** - * ColumnTypes returns column information such as column type, length, - * and nullable. Some information may not be available from some drivers. + * SetPathValue sets name to value, so that subsequent calls to r.PathValue(name) + * return value. */ - columnTypes(): Array<(ColumnType | undefined)> + setPathValue(name: string, value: string): void } - interface Rows { + /** + * A ResponseWriter interface is used by an HTTP handler to + * construct an HTTP response. + * + * A ResponseWriter may not be used after [Handler.ServeHTTP] has returned. + */ + interface ResponseWriter { + [key:string]: any; /** - * Scan copies the columns in the current row into the values pointed - * at by dest. The number of values in dest must be the same as the - * number of columns in [Rows]. + * Header returns the header map that will be sent by + * [ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which + * [Handler] implementations can set HTTP trailers. * - * Scan converts columns read from the database into the following - * common Go types and special types provided by the sql package: + * Changing the header map after a call to [ResponseWriter.WriteHeader] (or + * [ResponseWriter.Write]) has no effect unless the HTTP status code was of the + * 1xx class or the modified headers are trailers. * - * ``` - * *string - * *[]byte - * *int, *int8, *int16, *int32, *int64 - * *uint, *uint8, *uint16, *uint32, *uint64 - * *bool - * *float32, *float64 - * *interface{} - * *RawBytes - * *Rows (cursor value) - * any type implementing Scanner (see Scanner docs) - * ``` + * There are two ways to set Trailers. The preferred way is to + * predeclare in the headers which trailers you will later + * send by setting the "Trailer" header to the names of the + * trailer keys which will come later. In this case, those + * keys of the Header map are treated as if they were + * trailers. See the example. The second way, for trailer + * keys not known to the [Handler] until after the first [ResponseWriter.Write], + * is to prefix the [Header] map keys with the [TrailerPrefix] + * constant value. * - * In the most simple case, if the type of the value from the source - * column is an integer, bool or string type T and dest is of type *T, - * Scan simply assigns the value through the pointer. + * To suppress automatic response headers (such as "Date"), set + * their value to nil. + */ + header(): Header + /** + * Write writes the data to the connection as part of an HTTP reply. * - * Scan also converts between string and numeric types, as long as no - * information would be lost. While Scan stringifies all numbers - * scanned from numeric database columns into *string, scans into - * numeric types are checked for overflow. For example, a float64 with - * value 300 or a string with value "300" can scan into a uint16, but - * not into a uint8, though float64(255) or "255" can scan into a - * uint8. One exception is that scans of some float64 numbers to - * strings may lose information when stringifying. In general, scan - * floating point columns into *float64. + * If [ResponseWriter.WriteHeader] has not yet been called, Write calls + * WriteHeader(http.StatusOK) before writing the data. If the Header + * does not contain a Content-Type line, Write adds a Content-Type set + * to the result of passing the initial 512 bytes of written data to + * [DetectContentType]. Additionally, if the total size of all written + * data is under a few KB and there are no Flush calls, the + * Content-Length header is added automatically. * - * If a dest argument has type *[]byte, Scan saves in that argument a - * copy of the corresponding data. The copy is owned by the caller and - * can be modified and held indefinitely. The copy can be avoided by - * using an argument of type [*RawBytes] instead; see the documentation - * for [RawBytes] for restrictions on its use. + * Depending on the HTTP protocol version and the client, calling + * Write or WriteHeader may prevent future reads on the + * Request.Body. For HTTP/1.x requests, handlers should read any + * needed request body data before writing the response. Once the + * headers have been flushed (due to either an explicit Flusher.Flush + * call or writing enough data to trigger a flush), the request body + * may be unavailable. For HTTP/2 requests, the Go HTTP server permits + * handlers to continue to read the request body while concurrently + * writing the response. However, such behavior may not be supported + * by all HTTP/2 clients. Handlers should read before writing if + * possible to maximize compatibility. + */ + write(_arg0: string|Array): number + /** + * WriteHeader sends an HTTP response header with the provided + * status code. * - * If an argument has type *interface{}, Scan copies the value - * provided by the underlying driver without conversion. When scanning - * from a source value of type []byte to *interface{}, a copy of the - * slice is made and the caller owns the result. + * If WriteHeader is not called explicitly, the first call to Write + * will trigger an implicit WriteHeader(http.StatusOK). + * Thus explicit calls to WriteHeader are mainly used to + * send error codes or 1xx informational responses. * - * Source values of type [time.Time] may be scanned into values of type - * *time.Time, *interface{}, *string, or *[]byte. When converting to - * the latter two, [time.RFC3339Nano] is used. + * The provided code must be a valid HTTP 1xx-5xx status code. + * Any number of 1xx headers may be written, followed by at most + * one 2xx-5xx header. 1xx headers are sent immediately, but 2xx-5xx + * headers may be buffered. Use the Flusher interface to send + * buffered data. The header map is cleared when 2xx-5xx headers are + * sent, but not with 1xx headers. * - * Source values of type bool may be scanned into types *bool, - * *interface{}, *string, *[]byte, or [*RawBytes]. + * The server will automatically send a 100 (Continue) header + * on the first read from the request body if the request has + * an "Expect: 100-continue" header. + */ + writeHeader(statusCode: number): void + } + /** + * A Server defines parameters for running an HTTP server. + * The zero value for Server is a valid configuration. + */ + interface Server { + /** + * Addr optionally specifies the TCP address for the server to listen on, + * in the form "host:port". If empty, ":http" (port 80) is used. + * The service names are defined in RFC 6335 and assigned by IANA. + * See net.Dial for details of the address format. + */ + addr: string + handler: Handler // handler to invoke, http.DefaultServeMux if nil + /** + * DisableGeneralOptionsHandler, if true, passes "OPTIONS *" requests to the Handler, + * otherwise responds with 200 OK and Content-Length: 0. + */ + disableGeneralOptionsHandler: boolean + /** + * TLSConfig optionally provides a TLS configuration for use + * by ServeTLS and ListenAndServeTLS. Note that this value is + * cloned by ServeTLS and ListenAndServeTLS, so it's not + * possible to modify the configuration with methods like + * tls.Config.SetSessionTicketKeys. To use + * SetSessionTicketKeys, use Server.Serve with a TLS Listener + * instead. + */ + tlsConfig?: any + /** + * ReadTimeout is the maximum duration for reading the entire + * request, including the body. A zero or negative value means + * there will be no timeout. * - * For scanning into *bool, the source may be true, false, 1, 0, or - * string inputs parseable by [strconv.ParseBool]. + * Because ReadTimeout does not let Handlers make per-request + * decisions on each request body's acceptable deadline or + * upload rate, most users will prefer to use + * ReadHeaderTimeout. It is valid to use them both. + */ + readTimeout: time.Duration + /** + * ReadHeaderTimeout is the amount of time allowed to read + * request headers. The connection's read deadline is reset + * after reading the headers and the Handler can decide what + * is considered too slow for the body. If zero, the value of + * ReadTimeout is used. If negative, or if zero and ReadTimeout + * is zero or negative, there is no timeout. + */ + readHeaderTimeout: time.Duration + /** + * WriteTimeout is the maximum duration before timing out + * writes of the response. It is reset whenever a new + * request's header is read. Like ReadTimeout, it does not + * let Handlers make decisions on a per-request basis. + * A zero or negative value means there will be no timeout. + */ + writeTimeout: time.Duration + /** + * IdleTimeout is the maximum amount of time to wait for the + * next request when keep-alives are enabled. If zero, the value + * of ReadTimeout is used. If negative, or if zero and ReadTimeout + * is zero or negative, there is no timeout. + */ + idleTimeout: time.Duration + /** + * MaxHeaderBytes controls the maximum number of bytes the + * server will read parsing the request header's keys and + * values, including the request line. It does not limit the + * size of the request body. + * If zero, DefaultMaxHeaderBytes is used. + */ + maxHeaderBytes: number + /** + * TLSNextProto optionally specifies a function to take over + * ownership of the provided TLS connection when an ALPN + * protocol upgrade has occurred. The map key is the protocol + * name negotiated. The Handler argument should be used to + * handle HTTP requests and will initialize the Request's TLS + * and RemoteAddr if not already set. The connection is + * automatically closed when the function returns. + * If TLSNextProto is not nil, HTTP/2 support is not enabled + * automatically. + */ + tlsNextProto: _TygojaDict + /** + * ConnState specifies an optional callback function that is + * called when a client connection changes state. See the + * ConnState type and associated constants for details. + */ + connState: (_arg0: net.Conn, _arg1: ConnState) => void + /** + * ErrorLog specifies an optional logger for errors accepting + * connections, unexpected behavior from handlers, and + * underlying FileSystem errors. + * If nil, logging is done via the log package's standard logger. + */ + errorLog?: any + /** + * BaseContext optionally specifies a function that returns + * the base context for incoming requests on this server. + * The provided Listener is the specific Listener that's + * about to start accepting requests. + * If BaseContext is nil, the default is context.Background(). + * If non-nil, it must return a non-nil context. + */ + baseContext: (_arg0: net.Listener) => context.Context + /** + * ConnContext optionally specifies a function that modifies + * the context used for a new connection c. The provided ctx + * is derived from the base context and has a ServerContextKey + * value. + */ + connContext: (ctx: context.Context, c: net.Conn) => context.Context + } + interface Server { + /** + * Close immediately closes all active net.Listeners and any + * connections in state [StateNew], [StateActive], or [StateIdle]. For a + * graceful shutdown, use [Server.Shutdown]. * - * Scan can also convert a cursor returned from a query, such as - * "select cursor(select * from my_table) from dual", into a - * [*Rows] value that can itself be scanned from. The parent - * select query will close any cursor [*Rows] if the parent [*Rows] is closed. + * Close does not attempt to close (and does not even know about) + * any hijacked connections, such as WebSockets. * - * If any of the first arguments implementing [Scanner] returns an error, - * that error will be wrapped in the returned error. + * Close returns any error returned from closing the [Server]'s + * underlying Listener(s). */ - scan(...dest: any[]): void + close(): void } - interface Rows { + interface Server { /** - * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called - * and returns false and there are no further result sets, - * the [Rows] are closed automatically and it will suffice to check the - * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. + * Shutdown gracefully shuts down the server without interrupting any + * active connections. Shutdown works by first closing all open + * listeners, then closing all idle connections, and then waiting + * indefinitely for connections to return to idle and then shut down. + * If the provided context expires before the shutdown is complete, + * Shutdown returns the context's error, otherwise it returns any + * error returned from closing the [Server]'s underlying Listener(s). + * + * When Shutdown is called, [Serve], [ListenAndServe], and + * [ListenAndServeTLS] immediately return [ErrServerClosed]. Make sure the + * program doesn't exit and waits instead for Shutdown to return. + * + * Shutdown does not attempt to close nor wait for hijacked + * connections such as WebSockets. The caller of Shutdown should + * separately notify such long-lived connections of shutdown and wait + * for them to close, if desired. See [Server.RegisterOnShutdown] for a way to + * register shutdown notification functions. + * + * Once Shutdown has been called on a server, it may not be reused; + * future calls to methods such as Serve will return ErrServerClosed. */ - close(): void + shutdown(ctx: context.Context): void } - /** - * A Result summarizes an executed SQL command. - */ - interface Result { - [key:string]: any; + interface Server { /** - * LastInsertId returns the integer generated by the database - * in response to a command. Typically this will be from an - * "auto increment" column when inserting a new row. Not all - * databases support this feature, and the syntax of such - * statements varies. + * RegisterOnShutdown registers a function to call on [Server.Shutdown]. + * This can be used to gracefully shutdown connections that have + * undergone ALPN protocol upgrade or that have been hijacked. + * This function should start protocol-specific graceful shutdown, + * but should not wait for shutdown to complete. */ - lastInsertId(): number + registerOnShutdown(f: () => void): void + } + interface Server { /** - * RowsAffected returns the number of rows affected by an - * update, insert, or delete. Not every database or database - * driver may support this. + * ListenAndServe listens on the TCP network address srv.Addr and then + * calls [Serve] to handle requests on incoming connections. + * Accepted connections are configured to enable TCP keep-alives. + * + * If srv.Addr is blank, ":http" is used. + * + * ListenAndServe always returns a non-nil error. After [Server.Shutdown] or [Server.Close], + * the returned error is [ErrServerClosed]. */ - rowsAffected(): number + listenAndServe(): void + } + interface Server { + /** + * Serve accepts incoming connections on the Listener l, creating a + * new service goroutine for each. The service goroutines read requests and + * then call srv.Handler to reply to them. + * + * HTTP/2 support is only enabled if the Listener returns [*tls.Conn] + * connections and they were configured with "h2" in the TLS + * Config.NextProtos. + * + * Serve always returns a non-nil error and closes l. + * After [Server.Shutdown] or [Server.Close], the returned error is [ErrServerClosed]. + */ + serve(l: net.Listener): void + } + interface Server { + /** + * ServeTLS accepts incoming connections on the Listener l, creating a + * new service goroutine for each. The service goroutines perform TLS + * setup and then read requests, calling srv.Handler to reply to them. + * + * Files containing a certificate and matching private key for the + * server must be provided if neither the [Server]'s + * TLSConfig.Certificates, TLSConfig.GetCertificate nor + * config.GetConfigForClient are populated. + * If the certificate is signed by a certificate authority, the + * certFile should be the concatenation of the server's certificate, + * any intermediates, and the CA's certificate. + * + * ServeTLS always returns a non-nil error. After [Server.Shutdown] or [Server.Close], the + * returned error is [ErrServerClosed]. + */ + serveTLS(l: net.Listener, certFile: string, keyFile: string): void + } + interface Server { + /** + * SetKeepAlivesEnabled controls whether HTTP keep-alives are enabled. + * By default, keep-alives are always enabled. Only very + * resource-constrained environments or servers in the process of + * shutting down should disable them. + */ + setKeepAlivesEnabled(v: boolean): void + } + interface Server { + /** + * ListenAndServeTLS listens on the TCP network address srv.Addr and + * then calls [ServeTLS] to handle requests on incoming TLS connections. + * Accepted connections are configured to enable TCP keep-alives. + * + * Filenames containing a certificate and matching private key for the + * server must be provided if neither the [Server]'s TLSConfig.Certificates + * nor TLSConfig.GetCertificate are populated. If the certificate is + * signed by a certificate authority, the certFile should be the + * concatenation of the server's certificate, any intermediates, and + * the CA's certificate. + * + * If srv.Addr is blank, ":https" is used. + * + * ListenAndServeTLS always returns a non-nil error. After [Server.Shutdown] or + * [Server.Close], the returned error is [ErrServerClosed]. + */ + listenAndServeTLS(certFile: string, keyFile: string): void } } /** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. + * Drivers that do not support context cancellation will not return until + * after the query is completed. * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. */ -namespace multipart { +namespace sql { /** - * A FileHeader describes a file part of a multipart request. + * TxOptions holds the transaction options to be used in [DB.BeginTx]. */ - interface FileHeader { - filename: string - header: textproto.MIMEHeader - size: number + interface TxOptions { + /** + * Isolation is the transaction isolation level. + * If zero, the driver or database's default level is used. + */ + isolation: IsolationLevel + readOnly: boolean } - interface FileHeader { + /** + * DB is a database handle representing a pool of zero or more + * underlying connections. It's safe for concurrent use by multiple + * goroutines. + * + * The sql package creates and frees connections automatically; it + * also maintains a free pool of idle connections. If the database has + * a concept of per-connection state, such state can be reliably observed + * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the + * returned [Tx] is bound to a single connection. Once [Tx.Commit] or + * [Tx.Rollback] is called on the transaction, that transaction's + * connection is returned to [DB]'s idle connection pool. The pool size + * can be controlled with [DB.SetMaxIdleConns]. + */ + interface DB { + } + interface DB { /** - * Open opens and returns the [FileHeader]'s associated File. + * PingContext verifies a connection to the database is still alive, + * establishing a connection if necessary. */ - open(): File + pingContext(ctx: context.Context): void } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url - /** - * A Request represents an HTTP request received by a server - * or to be sent by a client. - * - * The field semantics differ slightly between client and server - * usage. In addition to the notes on the fields below, see the - * documentation for [Request.Write] and [RoundTripper]. - */ - interface Request { - /** - * Method specifies the HTTP method (GET, POST, PUT, etc.). - * For client requests, an empty string means GET. - */ - method: string + interface DB { /** - * URL specifies either the URI being requested (for server - * requests) or the URL to access (for client requests). - * - * For server requests, the URL is parsed from the URI - * supplied on the Request-Line as stored in RequestURI. For - * most requests, fields other than Path and RawQuery will be - * empty. (See RFC 7230, Section 5.3) + * Ping verifies a connection to the database is still alive, + * establishing a connection if necessary. * - * For client requests, the URL's Host specifies the server to - * connect to, while the Request's Host field optionally - * specifies the Host header value to send in the HTTP - * request. + * Ping uses [context.Background] internally; to specify the context, use + * [DB.PingContext]. */ - url?: url.URL + ping(): void + } + interface DB { /** - * The protocol version for incoming server requests. + * Close closes the database and prevents new queries from starting. + * Close then waits for all queries that have started processing on the server + * to finish. * - * For client requests, these fields are ignored. The HTTP - * client code always uses either HTTP/1.1 or HTTP/2. - * See the docs on Transport for details. + * It is rare to Close a [DB], as the [DB] handle is meant to be + * long-lived and shared between many goroutines. */ - proto: string // "HTTP/1.0" - protoMajor: number // 1 - protoMinor: number // 0 + close(): void + } + interface DB { /** - * Header contains the request header fields either received - * by the server or to be sent by the client. - * - * If a server received a request with header lines, - * - * ``` - * Host: example.com - * accept-encoding: gzip, deflate - * Accept-Language: en-us - * fOO: Bar - * foo: two - * ``` - * - * then - * - * ``` - * Header = map[string][]string{ - * "Accept-Encoding": {"gzip, deflate"}, - * "Accept-Language": {"en-us"}, - * "Foo": {"Bar", "two"}, - * } - * ``` + * SetMaxIdleConns sets the maximum number of connections in the idle + * connection pool. * - * For incoming requests, the Host header is promoted to the - * Request.Host field and removed from the Header map. + * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, + * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. * - * HTTP defines that header names are case-insensitive. The - * request parser implements this by using CanonicalHeaderKey, - * making the first character and any characters following a - * hyphen uppercase and the rest lowercase. + * If n <= 0, no idle connections are retained. * - * For client requests, certain headers such as Content-Length - * and Connection are automatically written when needed and - * values in Header may be ignored. See the documentation - * for the Request.Write method. + * The default max idle connections is currently 2. This may change in + * a future release. */ - header: Header + setMaxIdleConns(n: number): void + } + interface DB { /** - * Body is the request's body. - * - * For client requests, a nil body means the request has no - * body, such as a GET request. The HTTP Client's Transport - * is responsible for calling the Close method. + * SetMaxOpenConns sets the maximum number of open connections to the database. * - * For server requests, the Request Body is always non-nil - * but will return EOF immediately when no body is present. - * The Server will close the request body. The ServeHTTP - * Handler does not need to. + * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than + * MaxIdleConns, then MaxIdleConns will be reduced to match the new + * MaxOpenConns limit. * - * Body must allow Read to be called concurrently with Close. - * In particular, calling Close should unblock a Read waiting - * for input. + * If n <= 0, then there is no limit on the number of open connections. + * The default is 0 (unlimited). */ - body: io.ReadCloser + setMaxOpenConns(n: number): void + } + interface DB { /** - * GetBody defines an optional func to return a new copy of - * Body. It is used for client requests when a redirect requires - * reading the body more than once. Use of GetBody still - * requires setting Body. + * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. * - * For server requests, it is unused. - */ - getBody: () => io.ReadCloser - /** - * ContentLength records the length of the associated content. - * The value -1 indicates that the length is unknown. - * Values >= 0 indicate that the given number of bytes may - * be read from Body. + * Expired connections may be closed lazily before reuse. * - * For client requests, a value of 0 with a non-nil Body is - * also treated as unknown. - */ - contentLength: number - /** - * TransferEncoding lists the transfer encodings from outermost to - * innermost. An empty list denotes the "identity" encoding. - * TransferEncoding can usually be ignored; chunked encoding is - * automatically added and removed as necessary when sending and - * receiving requests. + * If d <= 0, connections are not closed due to a connection's age. */ - transferEncoding: Array + setConnMaxLifetime(d: time.Duration): void + } + interface DB { /** - * Close indicates whether to close the connection after - * replying to this request (for servers) or after sending this - * request and reading its response (for clients). - * - * For server requests, the HTTP server handles this automatically - * and this field is not needed by Handlers. + * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. * - * For client requests, setting this field prevents re-use of - * TCP connections between requests to the same hosts, as if - * Transport.DisableKeepAlives were set. - */ - close: boolean - /** - * For server requests, Host specifies the host on which the - * URL is sought. For HTTP/1 (per RFC 7230, section 5.4), this - * is either the value of the "Host" header or the host name - * given in the URL itself. For HTTP/2, it is the value of the - * ":authority" pseudo-header field. - * It may be of the form "host:port". For international domain - * names, Host may be in Punycode or Unicode form. Use - * golang.org/x/net/idna to convert it to either format if - * needed. - * To prevent DNS rebinding attacks, server Handlers should - * validate that the Host header has a value for which the - * Handler considers itself authoritative. The included - * ServeMux supports patterns registered to particular host - * names and thus protects its registered Handlers. + * Expired connections may be closed lazily before reuse. * - * For client requests, Host optionally overrides the Host - * header to send. If empty, the Request.Write method uses - * the value of URL.Host. Host may contain an international - * domain name. + * If d <= 0, connections are not closed due to a connection's idle time. */ - host: string + setConnMaxIdleTime(d: time.Duration): void + } + interface DB { /** - * Form contains the parsed form data, including both the URL - * field's query parameters and the PATCH, POST, or PUT form data. - * This field is only available after ParseForm is called. - * The HTTP client ignores Form and uses Body instead. + * Stats returns database statistics. */ - form: url.Values + stats(): DBStats + } + interface DB { /** - * PostForm contains the parsed form data from PATCH, POST - * or PUT body parameters. + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. * - * This field is only available after ParseForm is called. - * The HTTP client ignores PostForm and uses Body instead. - */ - postForm: url.Values - /** - * MultipartForm is the parsed multipart form, including file uploads. - * This field is only available after ParseMultipartForm is called. - * The HTTP client ignores MultipartForm and uses Body instead. + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. */ - multipartForm?: multipart.Form + prepareContext(ctx: context.Context, query: string): (Stmt) + } + interface DB { /** - * Trailer specifies additional headers that are sent after the request - * body. - * - * For server requests, the Trailer map initially contains only the - * trailer keys, with nil values. (The client declares which trailers it - * will later send.) While the handler is reading from Body, it must - * not reference Trailer. After reading from Body returns EOF, Trailer - * can be read again and will contain non-nil values, if they were sent - * by the client. - * - * For client requests, Trailer must be initialized to a map containing - * the trailer keys to later send. The values may be nil or their final - * values. The ContentLength must be 0 or -1, to send a chunked request. - * After the HTTP request is sent the map values can be updated while - * the request body is read. Once the body returns EOF, the caller must - * not mutate Trailer. + * Prepare creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. * - * Few HTTP clients, servers, or proxies support HTTP trailers. - */ - trailer: Header - /** - * RemoteAddr allows HTTP servers and other software to record - * the network address that sent the request, usually for - * logging. This field is not filled in by ReadRequest and - * has no defined format. The HTTP server in this package - * sets RemoteAddr to an "IP:port" address before invoking a - * handler. - * This field is ignored by the HTTP client. - */ - remoteAddr: string - /** - * RequestURI is the unmodified request-target of the - * Request-Line (RFC 7230, Section 3.1.1) as sent by the client - * to a server. Usually the URL field should be used instead. - * It is an error to set this field in an HTTP client request. + * Prepare uses [context.Background] internally; to specify the context, use + * [DB.PrepareContext]. */ - requestURI: string + prepare(query: string): (Stmt) + } + interface DB { /** - * TLS allows HTTP servers and other software to record - * information about the TLS connection on which the request - * was received. This field is not filled in by ReadRequest. - * The HTTP server in this package sets the field for - * TLS-enabled connections before invoking a handler; - * otherwise it leaves the field nil. - * This field is ignored by the HTTP client. + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. */ - tls?: any + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface DB { /** - * Cancel is an optional channel whose closure indicates that the client - * request should be regarded as canceled. Not all implementations of - * RoundTripper may support Cancel. - * - * For server requests, this field is not applicable. + * Exec executes a query without returning any rows. + * The args are for any placeholder parameters in the query. * - * Deprecated: Set the Request's context with NewRequestWithContext - * instead. If a Request's Cancel field and context are both - * set, it is undefined whether Cancel is respected. + * Exec uses [context.Background] internally; to specify the context, use + * [DB.ExecContext]. */ - cancel: undefined + exec(query: string, ...args: any[]): Result + } + interface DB { /** - * Response is the redirect response which caused this request - * to be created. This field is only populated during client - * redirects. + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. */ - response?: Response + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface DB { /** - * Pattern is the [ServeMux] pattern that matched the request. - * It is empty if the request was not matched against a pattern. + * Query executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + * + * Query uses [context.Background] internally; to specify the context, use + * [DB.QueryContext]. */ - pattern: string + query(query: string, ...args: any[]): (Rows) } - interface Request { + interface DB { /** - * Context returns the request's context. To change the context, use - * [Request.Clone] or [Request.WithContext]. - * - * The returned context is always non-nil; it defaults to the - * background context. - * - * For outgoing client requests, the context controls cancellation. - * - * For incoming server requests, the context is canceled when the - * client's connection closes, the request is canceled (with HTTP/2), - * or when the ServeHTTP method returns. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. */ - context(): context.Context + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) } - interface Request { + interface DB { /** - * WithContext returns a shallow copy of r with its context changed - * to ctx. The provided ctx must be non-nil. - * - * For outgoing client request, the context controls the entire - * lifetime of a request and its response: obtaining a connection, - * sending the request, and reading the response headers and body. + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. * - * To create a new request with a context, use [NewRequestWithContext]. - * To make a deep copy of a request with a new context, use [Request.Clone]. + * QueryRow uses [context.Background] internally; to specify the context, use + * [DB.QueryRowContext]. */ - withContext(ctx: context.Context): (Request) + queryRow(query: string, ...args: any[]): (Row) } - interface Request { + interface DB { /** - * Clone returns a deep copy of r with its context changed to ctx. - * The provided ctx must be non-nil. + * BeginTx starts a transaction. * - * Clone only makes a shallow copy of the Body field. + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. * - * For an outgoing client request, the context controls the entire - * lifetime of a request and its response: obtaining a connection, - * sending the request, and reading the response headers and body. + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. */ - clone(ctx: context.Context): (Request) + beginTx(ctx: context.Context, opts: TxOptions): (Tx) } - interface Request { + interface DB { /** - * ProtoAtLeast reports whether the HTTP protocol used - * in the request is at least major.minor. + * Begin starts a transaction. The default isolation level is dependent on + * the driver. + * + * Begin uses [context.Background] internally; to specify the context, use + * [DB.BeginTx]. */ - protoAtLeast(major: number, minor: number): boolean + begin(): (Tx) } - interface Request { + interface DB { /** - * UserAgent returns the client's User-Agent, if sent in the request. + * Driver returns the database's underlying driver. */ - userAgent(): string + driver(): any } - interface Request { + interface DB { /** - * Cookies parses and returns the HTTP cookies sent with the request. + * Conn returns a single connection by either opening a new connection + * or returning an existing connection from the connection pool. Conn will + * block until either a connection is returned or ctx is canceled. + * Queries run on the same Conn will be run in the same database session. + * + * Every Conn must be returned to the database pool after use by + * calling [Conn.Close]. */ - cookies(): Array<(Cookie | undefined)> + conn(ctx: context.Context): (Conn) } - interface Request { - /** - * CookiesNamed parses and returns the named HTTP cookies sent with the request - * or an empty slice if none matched. - */ - cookiesNamed(name: string): Array<(Cookie | undefined)> + /** + * Tx is an in-progress database transaction. + * + * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. + * + * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the + * transaction fail with [ErrTxDone]. + * + * The statements prepared for a transaction by calling + * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed + * by the call to [Tx.Commit] or [Tx.Rollback]. + */ + interface Tx { } - interface Request { + interface Tx { /** - * Cookie returns the named cookie provided in the request or - * [ErrNoCookie] if not found. - * If multiple cookies match the given name, only one cookie will - * be returned. + * Commit commits the transaction. */ - cookie(name: string): (Cookie) + commit(): void } - interface Request { + interface Tx { /** - * AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, - * AddCookie does not attach more than one [Cookie] header field. That - * means all cookies, if any, are written into the same line, - * separated by semicolon. - * AddCookie only sanitizes c's name and value, and does not sanitize - * a Cookie header already present in the request. + * Rollback aborts the transaction. */ - addCookie(c: Cookie): void + rollback(): void } - interface Request { + interface Tx { /** - * Referer returns the referring URL, if sent in the request. + * PrepareContext creates a prepared statement for use within a transaction. * - * Referer is misspelled as in the request itself, a mistake from the - * earliest days of HTTP. This value can also be fetched from the - * [Header] map as Header["Referer"]; the benefit of making it available - * as a method is that the compiler can diagnose programs that use the - * alternate (correct English) spelling req.Referrer() but cannot - * diagnose programs that use Header["Referrer"]. + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * + * The provided context will be used for the preparation of the context, not + * for the execution of the returned statement. The returned statement + * will run in the transaction context. */ - referer(): string + prepareContext(ctx: context.Context, query: string): (Stmt) } - interface Request { + interface Tx { /** - * MultipartReader returns a MIME multipart reader if this is a - * multipart/form-data or a multipart/mixed POST request, else returns nil and an error. - * Use this function instead of [Request.ParseMultipartForm] to - * process the request body as a stream. + * Prepare creates a prepared statement for use within a transaction. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * + * Prepare uses [context.Background] internally; to specify the context, use + * [Tx.PrepareContext]. */ - multipartReader(): (multipart.Reader) + prepare(query: string): (Stmt) } - interface Request { + interface Tx { /** - * Write writes an HTTP/1.1 request, which is the header and body, in wire format. - * This method consults the following fields of the request: + * StmtContext returns a transaction-specific prepared statement from + * an existing statement. + * + * Example: * * ``` - * Host - * URL - * Method (defaults to "GET") - * Header - * ContentLength - * TransferEncoding - * Body + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) * ``` * - * If Body is present, Content-Length is <= 0 and [Request.TransferEncoding] - * hasn't been set to "identity", Write adds "Transfer-Encoding: - * chunked" to the header. Body is closed after it is sent. - */ - write(w: io.Writer): void - } - interface Request { - /** - * WriteProxy is like [Request.Write] but writes the request in the form - * expected by an HTTP proxy. In particular, [Request.WriteProxy] writes the - * initial Request-URI line of the request with an absolute URI, per - * section 5.3 of RFC 7230, including the scheme and host. - * In either case, WriteProxy also writes a Host header, using - * either r.Host or r.URL.Host. - */ - writeProxy(w: io.Writer): void - } - interface Request { - /** - * BasicAuth returns the username and password provided in the request's - * Authorization header, if the request uses HTTP Basic Authentication. - * See RFC 2617, Section 2. - */ - basicAuth(): [string, string, boolean] - } - interface Request { - /** - * SetBasicAuth sets the request's Authorization header to use HTTP - * Basic Authentication with the provided username and password. - * - * With HTTP Basic Authentication the provided username and password - * are not encrypted. It should generally only be used in an HTTPS - * request. + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. * - * The username may not contain a colon. Some protocols may impose - * additional requirements on pre-escaping the username and - * password. For instance, when used with OAuth2, both arguments must - * be URL encoded first with [url.QueryEscape]. + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. */ - setBasicAuth(username: string, password: string): void + stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) } - interface Request { + interface Tx { /** - * ParseForm populates r.Form and r.PostForm. - * - * For all requests, ParseForm parses the raw query from the URL and updates - * r.Form. + * Stmt returns a transaction-specific prepared statement from + * an existing statement. * - * For POST, PUT, and PATCH requests, it also reads the request body, parses it - * as a form and puts the results into both r.PostForm and r.Form. Request body - * parameters take precedence over URL query string values in r.Form. + * Example: * - * If the request Body's size has not already been limited by [MaxBytesReader], - * the size is capped at 10MB. + * ``` + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) + * ``` * - * For other HTTP methods, or when the Content-Type is not - * application/x-www-form-urlencoded, the request Body is not read, and - * r.PostForm is initialized to a non-nil, empty value. + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. * - * [Request.ParseMultipartForm] calls ParseForm automatically. - * ParseForm is idempotent. + * Stmt uses [context.Background] internally; to specify the context, use + * [Tx.StmtContext]. */ - parseForm(): void + stmt(stmt: Stmt): (Stmt) } - interface Request { + interface Tx { /** - * ParseMultipartForm parses a request body as multipart/form-data. - * The whole request body is parsed and up to a total of maxMemory bytes of - * its file parts are stored in memory, with the remainder stored on - * disk in temporary files. - * ParseMultipartForm calls [Request.ParseForm] if necessary. - * If ParseForm returns an error, ParseMultipartForm returns it but also - * continues parsing the request body. - * After one call to ParseMultipartForm, subsequent calls have no effect. + * ExecContext executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. */ - parseMultipartForm(maxMemory: number): void + execContext(ctx: context.Context, query: string, ...args: any[]): Result } - interface Request { + interface Tx { /** - * FormValue returns the first value for the named component of the query. - * The precedence order: - * 1. application/x-www-form-urlencoded form body (POST, PUT, PATCH only) - * 2. query parameters (always) - * 3. multipart/form-data form body (always) + * Exec executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. * - * FormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] - * if necessary and ignores any errors returned by these functions. - * If key is not present, FormValue returns the empty string. - * To access multiple values of the same key, call ParseForm and - * then inspect [Request.Form] directly. + * Exec uses [context.Background] internally; to specify the context, use + * [Tx.ExecContext]. */ - formValue(key: string): string + exec(query: string, ...args: any[]): Result } - interface Request { + interface Tx { /** - * PostFormValue returns the first value for the named component of the POST, - * PUT, or PATCH request body. URL query parameters are ignored. - * PostFormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary and ignores - * any errors returned by these functions. - * If key is not present, PostFormValue returns the empty string. + * QueryContext executes a query that returns rows, typically a SELECT. */ - postFormValue(key: string): string + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) } - interface Request { + interface Tx { /** - * FormFile returns the first file for the provided form key. - * FormFile calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary. + * Query executes a query that returns rows, typically a SELECT. + * + * Query uses [context.Background] internally; to specify the context, use + * [Tx.QueryContext]. */ - formFile(key: string): [multipart.File, (multipart.FileHeader)] + query(query: string, ...args: any[]): (Rows) } - interface Request { + interface Tx { /** - * PathValue returns the value for the named path wildcard in the [ServeMux] pattern - * that matched the request. - * It returns the empty string if the request was not matched against a pattern - * or there is no such wildcard in the pattern. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - pathValue(name: string): string + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) } - interface Request { + interface Tx { /** - * SetPathValue sets name to value, so that subsequent calls to r.PathValue(name) - * return value. + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [Tx.QueryRowContext]. */ - setPathValue(name: string, value: string): void + queryRow(query: string, ...args: any[]): (Row) } /** - * A ResponseWriter interface is used by an HTTP handler to - * construct an HTTP response. + * Stmt is a prepared statement. + * A Stmt is safe for concurrent use by multiple goroutines. * - * A ResponseWriter may not be used after [Handler.ServeHTTP] has returned. + * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single + * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will + * become unusable and all operations will return an error. + * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the + * [DB]. When the Stmt needs to execute on a new underlying connection, it will + * prepare itself on the new connection automatically. */ - interface ResponseWriter { - [key:string]: any; - /** - * Header returns the header map that will be sent by - * [ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which - * [Handler] implementations can set HTTP trailers. - * - * Changing the header map after a call to [ResponseWriter.WriteHeader] (or - * [ResponseWriter.Write]) has no effect unless the HTTP status code was of the - * 1xx class or the modified headers are trailers. - * - * There are two ways to set Trailers. The preferred way is to - * predeclare in the headers which trailers you will later - * send by setting the "Trailer" header to the names of the - * trailer keys which will come later. In this case, those - * keys of the Header map are treated as if they were - * trailers. See the example. The second way, for trailer - * keys not known to the [Handler] until after the first [ResponseWriter.Write], - * is to prefix the [Header] map keys with the [TrailerPrefix] - * constant value. - * - * To suppress automatic response headers (such as "Date"), set - * their value to nil. - */ - header(): Header + interface Stmt { + } + interface Stmt { /** - * Write writes the data to the connection as part of an HTTP reply. - * - * If [ResponseWriter.WriteHeader] has not yet been called, Write calls - * WriteHeader(http.StatusOK) before writing the data. If the Header - * does not contain a Content-Type line, Write adds a Content-Type set - * to the result of passing the initial 512 bytes of written data to - * [DetectContentType]. Additionally, if the total size of all written - * data is under a few KB and there are no Flush calls, the - * Content-Length header is added automatically. - * - * Depending on the HTTP protocol version and the client, calling - * Write or WriteHeader may prevent future reads on the - * Request.Body. For HTTP/1.x requests, handlers should read any - * needed request body data before writing the response. Once the - * headers have been flushed (due to either an explicit Flusher.Flush - * call or writing enough data to trigger a flush), the request body - * may be unavailable. For HTTP/2 requests, the Go HTTP server permits - * handlers to continue to read the request body while concurrently - * writing the response. However, such behavior may not be supported - * by all HTTP/2 clients. Handlers should read before writing if - * possible to maximize compatibility. + * ExecContext executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. */ - write(_arg0: string|Array): number + execContext(ctx: context.Context, ...args: any[]): Result + } + interface Stmt { /** - * WriteHeader sends an HTTP response header with the provided - * status code. - * - * If WriteHeader is not called explicitly, the first call to Write - * will trigger an implicit WriteHeader(http.StatusOK). - * Thus explicit calls to WriteHeader are mainly used to - * send error codes or 1xx informational responses. - * - * The provided code must be a valid HTTP 1xx-5xx status code. - * Any number of 1xx headers may be written, followed by at most - * one 2xx-5xx header. 1xx headers are sent immediately, but 2xx-5xx - * headers may be buffered. Use the Flusher interface to send - * buffered data. The header map is cleared when 2xx-5xx headers are - * sent, but not with 1xx headers. + * Exec executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. * - * The server will automatically send a 100 (Continue) header - * on the first read from the request body if the request has - * an "Expect: 100-continue" header. + * Exec uses [context.Background] internally; to specify the context, use + * [Stmt.ExecContext]. */ - writeHeader(statusCode: number): void + exec(...args: any[]): Result } - /** - * A Server defines parameters for running an HTTP server. - * The zero value for Server is a valid configuration. - */ - interface Server { - /** - * Addr optionally specifies the TCP address for the server to listen on, - * in the form "host:port". If empty, ":http" (port 80) is used. - * The service names are defined in RFC 6335 and assigned by IANA. - * See net.Dial for details of the address format. - */ - addr: string - handler: Handler // handler to invoke, http.DefaultServeMux if nil - /** - * DisableGeneralOptionsHandler, if true, passes "OPTIONS *" requests to the Handler, - * otherwise responds with 200 OK and Content-Length: 0. - */ - disableGeneralOptionsHandler: boolean + interface Stmt { /** - * TLSConfig optionally provides a TLS configuration for use - * by ServeTLS and ListenAndServeTLS. Note that this value is - * cloned by ServeTLS and ListenAndServeTLS, so it's not - * possible to modify the configuration with methods like - * tls.Config.SetSessionTicketKeys. To use - * SetSessionTicketKeys, use Server.Serve with a TLS Listener - * instead. + * QueryContext executes a prepared query statement with the given arguments + * and returns the query results as a [*Rows]. */ - tlsConfig?: any + queryContext(ctx: context.Context, ...args: any[]): (Rows) + } + interface Stmt { /** - * ReadTimeout is the maximum duration for reading the entire - * request, including the body. A zero or negative value means - * there will be no timeout. + * Query executes a prepared query statement with the given arguments + * and returns the query results as a *Rows. * - * Because ReadTimeout does not let Handlers make per-request - * decisions on each request body's acceptable deadline or - * upload rate, most users will prefer to use - * ReadHeaderTimeout. It is valid to use them both. + * Query uses [context.Background] internally; to specify the context, use + * [Stmt.QueryContext]. */ - readTimeout: time.Duration + query(...args: any[]): (Rows) + } + interface Stmt { /** - * ReadHeaderTimeout is the amount of time allowed to read - * request headers. The connection's read deadline is reset - * after reading the headers and the Handler can decide what - * is considered too slow for the body. If zero, the value of - * ReadTimeout is used. If negative, or if zero and ReadTimeout - * is zero or negative, there is no timeout. + * QueryRowContext executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - readHeaderTimeout: time.Duration + queryRowContext(ctx: context.Context, ...args: any[]): (Row) + } + interface Stmt { /** - * WriteTimeout is the maximum duration before timing out - * writes of the response. It is reset whenever a new - * request's header is read. Like ReadTimeout, it does not - * let Handlers make decisions on a per-request basis. - * A zero or negative value means there will be no timeout. + * QueryRow executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + * + * Example usage: + * + * ``` + * var name string + * err := nameByUseridStmt.QueryRow(id).Scan(&name) + * ``` + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [Stmt.QueryRowContext]. */ - writeTimeout: time.Duration + queryRow(...args: any[]): (Row) + } + interface Stmt { /** - * IdleTimeout is the maximum amount of time to wait for the - * next request when keep-alives are enabled. If zero, the value - * of ReadTimeout is used. If negative, or if zero and ReadTimeout - * is zero or negative, there is no timeout. + * Close closes the statement. */ - idleTimeout: time.Duration + close(): void + } + /** + * Rows is the result of a query. Its cursor starts before the first row + * of the result set. Use [Rows.Next] to advance from row to row. + */ + interface Rows { + } + interface Rows { /** - * MaxHeaderBytes controls the maximum number of bytes the - * server will read parsing the request header's keys and - * values, including the request line. It does not limit the - * size of the request body. - * If zero, DefaultMaxHeaderBytes is used. + * Next prepares the next result row for reading with the [Rows.Scan] method. It + * returns true on success, or false if there is no next result row or an error + * happened while preparing it. [Rows.Err] should be consulted to distinguish between + * the two cases. + * + * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. */ - maxHeaderBytes: number + next(): boolean + } + interface Rows { /** - * TLSNextProto optionally specifies a function to take over - * ownership of the provided TLS connection when an ALPN - * protocol upgrade has occurred. The map key is the protocol - * name negotiated. The Handler argument should be used to - * handle HTTP requests and will initialize the Request's TLS - * and RemoteAddr if not already set. The connection is - * automatically closed when the function returns. - * If TLSNextProto is not nil, HTTP/2 support is not enabled - * automatically. + * NextResultSet prepares the next result set for reading. It reports whether + * there is further result sets, or false if there is no further result set + * or if there is an error advancing to it. The [Rows.Err] method should be consulted + * to distinguish between the two cases. + * + * After calling NextResultSet, the [Rows.Next] method should always be called before + * scanning. If there are further result sets they may not have rows in the result + * set. */ - tlsNextProto: _TygojaDict + nextResultSet(): boolean + } + interface Rows { /** - * ConnState specifies an optional callback function that is - * called when a client connection changes state. See the - * ConnState type and associated constants for details. + * Err returns the error, if any, that was encountered during iteration. + * Err may be called after an explicit or implicit [Rows.Close]. */ - connState: (_arg0: net.Conn, _arg1: ConnState) => void + err(): void + } + interface Rows { /** - * ErrorLog specifies an optional logger for errors accepting - * connections, unexpected behavior from handlers, and - * underlying FileSystem errors. - * If nil, logging is done via the log package's standard logger. + * Columns returns the column names. + * Columns returns an error if the rows are closed. */ - errorLog?: any + columns(): Array + } + interface Rows { /** - * BaseContext optionally specifies a function that returns - * the base context for incoming requests on this server. - * The provided Listener is the specific Listener that's - * about to start accepting requests. - * If BaseContext is nil, the default is context.Background(). - * If non-nil, it must return a non-nil context. + * ColumnTypes returns column information such as column type, length, + * and nullable. Some information may not be available from some drivers. */ - baseContext: (_arg0: net.Listener) => context.Context + columnTypes(): Array<(ColumnType | undefined)> + } + interface Rows { /** - * ConnContext optionally specifies a function that modifies - * the context used for a new connection c. The provided ctx - * is derived from the base context and has a ServerContextKey - * value. - */ - connContext: (ctx: context.Context, c: net.Conn) => context.Context - } - interface Server { - /** - * Close immediately closes all active net.Listeners and any - * connections in state [StateNew], [StateActive], or [StateIdle]. For a - * graceful shutdown, use [Server.Shutdown]. + * Scan copies the columns in the current row into the values pointed + * at by dest. The number of values in dest must be the same as the + * number of columns in [Rows]. * - * Close does not attempt to close (and does not even know about) - * any hijacked connections, such as WebSockets. + * Scan converts columns read from the database into the following + * common Go types and special types provided by the sql package: * - * Close returns any error returned from closing the [Server]'s - * underlying Listener(s). - */ - close(): void - } - interface Server { - /** - * Shutdown gracefully shuts down the server without interrupting any - * active connections. Shutdown works by first closing all open - * listeners, then closing all idle connections, and then waiting - * indefinitely for connections to return to idle and then shut down. - * If the provided context expires before the shutdown is complete, - * Shutdown returns the context's error, otherwise it returns any - * error returned from closing the [Server]'s underlying Listener(s). + * ``` + * *string + * *[]byte + * *int, *int8, *int16, *int32, *int64 + * *uint, *uint8, *uint16, *uint32, *uint64 + * *bool + * *float32, *float64 + * *interface{} + * *RawBytes + * *Rows (cursor value) + * any type implementing Scanner (see Scanner docs) + * ``` * - * When Shutdown is called, [Serve], [ListenAndServe], and - * [ListenAndServeTLS] immediately return [ErrServerClosed]. Make sure the - * program doesn't exit and waits instead for Shutdown to return. + * In the most simple case, if the type of the value from the source + * column is an integer, bool or string type T and dest is of type *T, + * Scan simply assigns the value through the pointer. * - * Shutdown does not attempt to close nor wait for hijacked - * connections such as WebSockets. The caller of Shutdown should - * separately notify such long-lived connections of shutdown and wait - * for them to close, if desired. See [Server.RegisterOnShutdown] for a way to - * register shutdown notification functions. + * Scan also converts between string and numeric types, as long as no + * information would be lost. While Scan stringifies all numbers + * scanned from numeric database columns into *string, scans into + * numeric types are checked for overflow. For example, a float64 with + * value 300 or a string with value "300" can scan into a uint16, but + * not into a uint8, though float64(255) or "255" can scan into a + * uint8. One exception is that scans of some float64 numbers to + * strings may lose information when stringifying. In general, scan + * floating point columns into *float64. * - * Once Shutdown has been called on a server, it may not be reused; - * future calls to methods such as Serve will return ErrServerClosed. - */ - shutdown(ctx: context.Context): void - } - interface Server { - /** - * RegisterOnShutdown registers a function to call on [Server.Shutdown]. - * This can be used to gracefully shutdown connections that have - * undergone ALPN protocol upgrade or that have been hijacked. - * This function should start protocol-specific graceful shutdown, - * but should not wait for shutdown to complete. - */ - registerOnShutdown(f: () => void): void - } - interface Server { - /** - * ListenAndServe listens on the TCP network address srv.Addr and then - * calls [Serve] to handle requests on incoming connections. - * Accepted connections are configured to enable TCP keep-alives. + * If a dest argument has type *[]byte, Scan saves in that argument a + * copy of the corresponding data. The copy is owned by the caller and + * can be modified and held indefinitely. The copy can be avoided by + * using an argument of type [*RawBytes] instead; see the documentation + * for [RawBytes] for restrictions on its use. * - * If srv.Addr is blank, ":http" is used. + * If an argument has type *interface{}, Scan copies the value + * provided by the underlying driver without conversion. When scanning + * from a source value of type []byte to *interface{}, a copy of the + * slice is made and the caller owns the result. * - * ListenAndServe always returns a non-nil error. After [Server.Shutdown] or [Server.Close], - * the returned error is [ErrServerClosed]. - */ - listenAndServe(): void - } - interface Server { - /** - * Serve accepts incoming connections on the Listener l, creating a - * new service goroutine for each. The service goroutines read requests and - * then call srv.Handler to reply to them. + * Source values of type [time.Time] may be scanned into values of type + * *time.Time, *interface{}, *string, or *[]byte. When converting to + * the latter two, [time.RFC3339Nano] is used. * - * HTTP/2 support is only enabled if the Listener returns [*tls.Conn] - * connections and they were configured with "h2" in the TLS - * Config.NextProtos. + * Source values of type bool may be scanned into types *bool, + * *interface{}, *string, *[]byte, or [*RawBytes]. * - * Serve always returns a non-nil error and closes l. - * After [Server.Shutdown] or [Server.Close], the returned error is [ErrServerClosed]. - */ - serve(l: net.Listener): void - } - interface Server { - /** - * ServeTLS accepts incoming connections on the Listener l, creating a - * new service goroutine for each. The service goroutines perform TLS - * setup and then read requests, calling srv.Handler to reply to them. + * For scanning into *bool, the source may be true, false, 1, 0, or + * string inputs parseable by [strconv.ParseBool]. * - * Files containing a certificate and matching private key for the - * server must be provided if neither the [Server]'s - * TLSConfig.Certificates, TLSConfig.GetCertificate nor - * config.GetConfigForClient are populated. - * If the certificate is signed by a certificate authority, the - * certFile should be the concatenation of the server's certificate, - * any intermediates, and the CA's certificate. + * Scan can also convert a cursor returned from a query, such as + * "select cursor(select * from my_table) from dual", into a + * [*Rows] value that can itself be scanned from. The parent + * select query will close any cursor [*Rows] if the parent [*Rows] is closed. * - * ServeTLS always returns a non-nil error. After [Server.Shutdown] or [Server.Close], the - * returned error is [ErrServerClosed]. + * If any of the first arguments implementing [Scanner] returns an error, + * that error will be wrapped in the returned error. */ - serveTLS(l: net.Listener, certFile: string, keyFile: string): void + scan(...dest: any[]): void } - interface Server { + interface Rows { /** - * SetKeepAlivesEnabled controls whether HTTP keep-alives are enabled. - * By default, keep-alives are always enabled. Only very - * resource-constrained environments or servers in the process of - * shutting down should disable them. + * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called + * and returns false and there are no further result sets, + * the [Rows] are closed automatically and it will suffice to check the + * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. */ - setKeepAlivesEnabled(v: boolean): void + close(): void } - interface Server { + /** + * A Result summarizes an executed SQL command. + */ + interface Result { + [key:string]: any; /** - * ListenAndServeTLS listens on the TCP network address srv.Addr and - * then calls [ServeTLS] to handle requests on incoming TLS connections. - * Accepted connections are configured to enable TCP keep-alives. - * - * Filenames containing a certificate and matching private key for the - * server must be provided if neither the [Server]'s TLSConfig.Certificates - * nor TLSConfig.GetCertificate are populated. If the certificate is - * signed by a certificate authority, the certFile should be the - * concatenation of the server's certificate, any intermediates, and - * the CA's certificate. - * - * If srv.Addr is blank, ":https" is used. - * - * ListenAndServeTLS always returns a non-nil error. After [Server.Shutdown] or - * [Server.Close], the returned error is [ErrServerClosed]. + * LastInsertId returns the integer generated by the database + * in response to a command. Typically this will be from an + * "auto increment" column when inserting a new row. Not all + * databases support this feature, and the syntax of such + * statements varies. */ - listenAndServeTLS(certFile: string, keyFile: string): void + lastInsertId(): number + /** + * RowsAffected returns the number of rows affected by an + * update, insert, or delete. Not every database or database + * driver may support this. + */ + rowsAffected(): number } } @@ -17574,8 +17586,8 @@ namespace schema { * Package models implements all PocketBase DB models and DTOs. */ namespace models { - type _subTPaAx = BaseModel - interface Admin extends _subTPaAx { + type _subqleDw = BaseModel + interface Admin extends _subqleDw { avatar: number email: string tokenKey: string @@ -17610,8 +17622,8 @@ namespace models { } // @ts-ignore import validation = ozzo_validation - type _subxVwLG = BaseModel - interface Collection extends _subxVwLG { + type _subEjuzK = BaseModel + interface Collection extends _subEjuzK { name: string type: string system: boolean @@ -17704,8 +17716,8 @@ namespace models { */ setOptions(typedOptions: any): void } - type _subnirpX = BaseModel - interface ExternalAuth extends _subnirpX { + type _subbugzZ = BaseModel + interface ExternalAuth extends _subbugzZ { collectionId: string recordId: string provider: string @@ -17714,8 +17726,8 @@ namespace models { interface ExternalAuth { tableName(): string } - type _subbYdTV = BaseModel - interface Record extends _subbYdTV { + type _subZiwqQ = BaseModel + interface Record extends _subZiwqQ { } interface Record { /** @@ -18128,6 +18140,134 @@ namespace models { } } +namespace auth { + /** + * AuthUser defines a standardized oauth2 user data structure. + */ + interface AuthUser { + id: string + name: string + username: string + email: string + avatarUrl: string + accessToken: string + refreshToken: string + expiry: types.DateTime + rawUser: _TygojaDict + } + /** + * Provider defines a common interface for an OAuth2 client. + */ + interface Provider { + [key:string]: any; + /** + * Context returns the context associated with the provider (if any). + */ + context(): context.Context + /** + * SetContext assigns the specified context to the current provider. + */ + setContext(ctx: context.Context): void + /** + * PKCE indicates whether the provider can use the PKCE flow. + */ + pkce(): boolean + /** + * SetPKCE toggles the state whether the provider can use the PKCE flow or not. + */ + setPKCE(enable: boolean): void + /** + * DisplayName usually returns provider name as it is officially written + * and it could be used directly in the UI. + */ + displayName(): string + /** + * SetDisplayName sets the provider's display name. + */ + setDisplayName(displayName: string): void + /** + * Scopes returns the provider access permissions that will be requested. + */ + scopes(): Array + /** + * SetScopes sets the provider access permissions that will be requested later. + */ + setScopes(scopes: Array): void + /** + * ClientId returns the provider client's app ID. + */ + clientId(): string + /** + * SetClientId sets the provider client's ID. + */ + setClientId(clientId: string): void + /** + * ClientSecret returns the provider client's app secret. + */ + clientSecret(): string + /** + * SetClientSecret sets the provider client's app secret. + */ + setClientSecret(secret: string): void + /** + * RedirectUrl returns the end address to redirect the user + * going through the OAuth flow. + */ + redirectUrl(): string + /** + * SetRedirectUrl sets the provider's RedirectUrl. + */ + setRedirectUrl(url: string): void + /** + * AuthUrl returns the provider's authorization service url. + */ + authUrl(): string + /** + * SetAuthUrl sets the provider's AuthUrl. + */ + setAuthUrl(url: string): void + /** + * TokenUrl returns the provider's token exchange service url. + */ + tokenUrl(): string + /** + * SetTokenUrl sets the provider's TokenUrl. + */ + setTokenUrl(url: string): void + /** + * UserApiUrl returns the provider's user info api url. + */ + userApiUrl(): string + /** + * SetUserApiUrl sets the provider's UserApiUrl. + */ + setUserApiUrl(url: string): void + /** + * Client returns an http client using the provided token. + */ + client(token: oauth2.Token): (any) + /** + * BuildAuthUrl returns a URL to the provider's consent page + * that asks for permissions for the required scopes explicitly. + */ + buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string + /** + * FetchToken converts an authorization code to token. + */ + fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) + /** + * FetchRawUserData requests and marshalizes into `result` the + * the OAuth user api response. + */ + fetchRawUserData(token: oauth2.Token): string|Array + /** + * FetchAuthUser is similar to FetchRawUserData, but normalizes and + * marshalizes the user api response into a standardized AuthUser struct. + */ + fetchAuthUser(token: oauth2.Token): (AuthUser) + } +} + /** * Package echo implements high performance, minimalist Go web framework. * @@ -18704,134 +18844,6 @@ namespace echo { } } -namespace auth { - /** - * AuthUser defines a standardized oauth2 user data structure. - */ - interface AuthUser { - id: string - name: string - username: string - email: string - avatarUrl: string - accessToken: string - refreshToken: string - expiry: types.DateTime - rawUser: _TygojaDict - } - /** - * Provider defines a common interface for an OAuth2 client. - */ - interface Provider { - [key:string]: any; - /** - * Context returns the context associated with the provider (if any). - */ - context(): context.Context - /** - * SetContext assigns the specified context to the current provider. - */ - setContext(ctx: context.Context): void - /** - * PKCE indicates whether the provider can use the PKCE flow. - */ - pkce(): boolean - /** - * SetPKCE toggles the state whether the provider can use the PKCE flow or not. - */ - setPKCE(enable: boolean): void - /** - * DisplayName usually returns provider name as it is officially written - * and it could be used directly in the UI. - */ - displayName(): string - /** - * SetDisplayName sets the provider's display name. - */ - setDisplayName(displayName: string): void - /** - * Scopes returns the provider access permissions that will be requested. - */ - scopes(): Array - /** - * SetScopes sets the provider access permissions that will be requested later. - */ - setScopes(scopes: Array): void - /** - * ClientId returns the provider client's app ID. - */ - clientId(): string - /** - * SetClientId sets the provider client's ID. - */ - setClientId(clientId: string): void - /** - * ClientSecret returns the provider client's app secret. - */ - clientSecret(): string - /** - * SetClientSecret sets the provider client's app secret. - */ - setClientSecret(secret: string): void - /** - * RedirectUrl returns the end address to redirect the user - * going through the OAuth flow. - */ - redirectUrl(): string - /** - * SetRedirectUrl sets the provider's RedirectUrl. - */ - setRedirectUrl(url: string): void - /** - * AuthUrl returns the provider's authorization service url. - */ - authUrl(): string - /** - * SetAuthUrl sets the provider's AuthUrl. - */ - setAuthUrl(url: string): void - /** - * TokenUrl returns the provider's token exchange service url. - */ - tokenUrl(): string - /** - * SetTokenUrl sets the provider's TokenUrl. - */ - setTokenUrl(url: string): void - /** - * UserApiUrl returns the provider's user info api url. - */ - userApiUrl(): string - /** - * SetUserApiUrl sets the provider's UserApiUrl. - */ - setUserApiUrl(url: string): void - /** - * Client returns an http client using the provided token. - */ - client(token: oauth2.Token): (any) - /** - * BuildAuthUrl returns a URL to the provider's consent page - * that asks for permissions for the required scopes explicitly. - */ - buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string - /** - * FetchToken converts an authorization code to token. - */ - fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) - /** - * FetchRawUserData requests and marshalizes into `result` the - * the OAuth user api response. - */ - fetchRawUserData(token: oauth2.Token): string|Array - /** - * FetchAuthUser is similar to FetchRawUserData, but normalizes and - * marshalizes the user api response into a standardized AuthUser struct. - */ - fetchAuthUser(token: oauth2.Token): (AuthUser) - } -} - namespace settings { // @ts-ignore import validation = ozzo_validation @@ -20444,36 +20456,6 @@ namespace core { } } -namespace migrate { - /** - * MigrationsList defines a list with migration definitions - */ - interface MigrationsList { - } - interface MigrationsList { - /** - * Item returns a single migration from the list by its index. - */ - item(index: number): (Migration) - } - interface MigrationsList { - /** - * Items returns the internal migrations list slice. - */ - items(): Array<(Migration | undefined)> - } - interface MigrationsList { - /** - * Register adds new migration definition to the list. - * - * If `optFilename` is not provided, it will try to get the name from its .go file. - * - * The list will be sorted automatically based on the migrations file name. - */ - register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void - } -} - /** * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. @@ -21542,6 +21524,61 @@ namespace cobra { } } +namespace migrate { + /** + * MigrationsList defines a list with migration definitions + */ + interface MigrationsList { + } + interface MigrationsList { + /** + * Item returns a single migration from the list by its index. + */ + item(index: number): (Migration) + } + interface MigrationsList { + /** + * Items returns the internal migrations list slice. + */ + items(): Array<(Migration | undefined)> + } + interface MigrationsList { + /** + * Register adds new migration definition to the list. + * + * If `optFilename` is not provided, it will try to get the name from its .go file. + * + * The list will be sorted automatically based on the migrations file name. + */ + register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void + } +} + +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * ReadCloser is the interface that groups the basic Read and Close methods. + */ + interface ReadCloser { + [key:string]: any; + } + /** + * WriteCloser is the interface that groups the basic Write and Close methods. + */ + interface WriteCloser { + [key:string]: any; + } +} + /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -21738,6 +21775,17 @@ namespace time { } } +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + * + * See the [testing/fstest] package for support with testing + * implementations of file systems. + */ +namespace fs { +} + /** * Package context defines the Context type, which carries deadlines, * cancellation signals, and other request-scoped values across API boundaries @@ -21794,42 +21842,6 @@ namespace time { namespace context { } -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { - /** - * ReadCloser is the interface that groups the basic Read and Close methods. - */ - interface ReadCloser { - [key:string]: any; - } - /** - * WriteCloser is the interface that groups the basic Write and Close methods. - */ - interface WriteCloser { - [key:string]: any; - } -} - -/** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. - * - * See the [testing/fstest] package for support with testing - * implementations of file systems. - */ -namespace fs { -} - /** * Package url parses URLs and implements query escaping. */ @@ -21863,136 +21875,6 @@ namespace url { } } -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * DateTime represents a [time.Time] instance in UTC that is wrapped - * and serialized using the app default date layout. - */ - interface DateTime { - } - interface DateTime { - /** - * Time returns the internal [time.Time] instance. - */ - time(): time.Time - } - interface DateTime { - /** - * IsZero checks whether the current DateTime instance has zero time value. - */ - isZero(): boolean - } - interface DateTime { - /** - * String serializes the current DateTime instance into a formatted - * UTC date string. - * - * The zero value is serialized to an empty string. - */ - string(): string - } - interface DateTime { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface DateTime { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string|Array): void - } - interface DateTime { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface DateTime { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current DateTime instance. - */ - scan(value: any): void - } -} - -namespace store { - /** - * Store defines a concurrent safe in memory key-value data store. - */ - interface Store { - } - interface Store { - /** - * Reset clears the store and replaces the store data with a - * shallow copy of the provided newData. - */ - reset(newData: _TygojaDict): void - } - interface Store { - /** - * Length returns the current number of elements in the store. - */ - length(): number - } - interface Store { - /** - * RemoveAll removes all the existing store entries. - */ - removeAll(): void - } - interface Store { - /** - * Remove removes a single entry from the store. - * - * Remove does nothing if key doesn't exist in the store. - */ - remove(key: string): void - } - interface Store { - /** - * Has checks if element with the specified key exist or not. - */ - has(key: string): boolean - } - interface Store { - /** - * Get returns a single element value from the store. - * - * If key is not set, the zero T value is returned. - */ - get(key: string): T - } - interface Store { - /** - * GetAll returns a shallow copy of the current store data. - */ - getAll(): _TygojaDict - } - interface Store { - /** - * Set sets (or overwrite if already exist) a new value for key. - */ - set(key: string, value: T): void - } - interface Store { - /** - * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. - * - * This method is similar to Set() but **it will skip adding new elements** - * to the store if the store length has reached the specified limit. - * false is returned if maxAllowedElements limit is reached. - */ - setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean - } -} - /** * Package net provides a portable interface for network I/O, including * TCP/IP, UDP, domain name resolution, and Unix domain sockets. @@ -22181,98 +22063,62 @@ namespace net { } } -namespace hook { +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { /** - * Hook defines a concurrent safe structure for handling event hooks - * (aka. callbacks propagation). + * DateTime represents a [time.Time] instance in UTC that is wrapped + * and serialized using the app default date layout. */ - interface Hook { - } - interface Hook { - /** - * PreAdd registers a new handler to the hook by prepending it to the existing queue. - * - * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). - */ - preAdd(fn: Handler): string - } - interface Hook { - /** - * Add registers a new handler to the hook by appending it to the existing queue. - * - * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). - */ - add(fn: Handler): string + interface DateTime { } - interface Hook { + interface DateTime { /** - * Remove removes a single hook handler by its id. + * Time returns the internal [time.Time] instance. */ - remove(id: string): void + time(): time.Time } - interface Hook { + interface DateTime { /** - * RemoveAll removes all registered handlers. + * IsZero checks whether the current DateTime instance has zero time value. */ - removeAll(): void + isZero(): boolean } - interface Hook { + interface DateTime { /** - * Trigger executes all registered hook handlers one by one - * with the specified `data` as an argument. - * - * Optionally, this method allows also to register additional one off - * handlers that will be temporary appended to the handlers queue. + * String serializes the current DateTime instance into a formatted + * UTC date string. * - * The execution stops when: - * - hook.StopPropagation is returned in one of the handlers - * - any non-nil error is returned in one of the handlers + * The zero value is serialized to an empty string. */ - trigger(data: T, ...oneOffHandlers: Handler[]): void - } - /** - * TaggedHook defines a proxy hook which register handlers that are triggered only - * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). - */ - type _subbFzXR = mainHook - interface TaggedHook extends _subbFzXR { + string(): string } - interface TaggedHook { + interface DateTime { /** - * CanTriggerOn checks if the current TaggedHook can be triggered with - * the provided event data tags. + * MarshalJSON implements the [json.Marshaler] interface. */ - canTriggerOn(tags: Array): boolean + marshalJSON(): string|Array } - interface TaggedHook { + interface DateTime { /** - * PreAdd registers a new handler to the hook by prepending it to the existing queue. - * - * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. + * UnmarshalJSON implements the [json.Unmarshaler] interface. */ - preAdd(fn: Handler): string + unmarshalJSON(b: string|Array): void } - interface TaggedHook { + interface DateTime { /** - * Add registers a new handler to the hook by appending it to the existing queue. - * - * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. + * Value implements the [driver.Valuer] interface. */ - add(fn: Handler): string + value(): any } -} - -namespace logging { - /** - * Logger is an interface for logging entries at certain classifications. - */ - interface Logger { - [key:string]: any; + interface DateTime { /** - * Logf is expected to support the standard fmt package "verbs". + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current DateTime instance. */ - logf(classification: Classification, format: string, ...v: { - }[]): void + scan(value: any): void } } @@ -22868,548 +22714,659 @@ namespace http { } /** - * Package gcerr provides an error type for Go CDK APIs. + * Package oauth2 provides support for making + * OAuth2 authorized and authenticated HTTP requests, + * as specified in RFC 6749. + * It can additionally grant authorization with Bearer JWT. */ -namespace gcerr { - interface ErrorCode { - string(): string - } - /** - * An ErrorCode describes the error's category. - */ - interface ErrorCode extends Number{} -} - /** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. + * Copyright 2023 The Go Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. */ -namespace blob { +namespace oauth2 { /** - * Writer writes bytes to a blob. - * - * It implements io.WriteCloser (https://golang.org/pkg/io/#Closer), and must be - * closed after all writes are done. + * An AuthCodeOption is passed to Config.AuthCodeURL. */ - interface Writer { + interface AuthCodeOption { + [key:string]: any; } - interface Writer { + /** + * Token represents the credentials used to authorize + * the requests to access protected resources on the OAuth 2.0 + * provider's backend. + * + * Most users of this package should not access fields of Token + * directly. They're exported mostly for use by related packages + * implementing derivative OAuth2 flows. + */ + interface Token { /** - * Write implements the io.Writer interface (https://golang.org/pkg/io/#Writer). + * AccessToken is the token that authorizes and authenticates + * the requests. + */ + accessToken: string + /** + * TokenType is the type of token. + * The Type method returns either this or "Bearer", the default. + */ + tokenType: string + /** + * RefreshToken is a token that's used by the application + * (as opposed to the user) to refresh the access token + * if it expires. + */ + refreshToken: string + /** + * Expiry is the optional expiration time of the access token. * - * Writes may happen asynchronously, so the returned error can be nil - * even if the actual write eventually fails. The write is only guaranteed to - * have succeeded if Close returns no error. + * If zero, TokenSource implementations will reuse the same + * token forever and RefreshToken or equivalent + * mechanisms for that TokenSource will not be used. */ - write(p: string|Array): number + expiry: time.Time + /** + * ExpiresIn is the OAuth2 wire format "expires_in" field, + * which specifies how many seconds later the token expires, + * relative to an unknown time base approximately around "now". + * It is the application's responsibility to populate + * `Expiry` from `ExpiresIn` when required. + */ + expiresIn: number } - interface Writer { + interface Token { /** - * Close closes the blob writer. The write operation is not guaranteed to have succeeded until - * Close returns with no error. - * Close may return an error if the context provided to create the Writer is - * canceled or reaches its deadline. + * Type returns t.TokenType if non-empty, else "Bearer". */ - close(): void + type(): string } - interface Writer { + interface Token { /** - * ReadFrom reads from r and writes to w until EOF or error. - * The return value is the number of bytes read from r. + * SetAuthHeader sets the Authorization header to r using the access + * token in t. * - * It implements the io.ReaderFrom interface. + * This method is unnecessary when using Transport or an HTTP Client + * returned by this package. */ - readFrom(r: io.Reader): number + setAuthHeader(r: http.Request): void } - /** - * ListOptions sets options for listing blobs via Bucket.List. - */ - interface ListOptions { + interface Token { /** - * Prefix indicates that only blobs with a key starting with this prefix - * should be returned. + * WithExtra returns a new Token that's a clone of t, but using the + * provided raw extra map. This is only intended for use by packages + * implementing derivative OAuth2 flows. */ - prefix: string + withExtra(extra: { + }): (Token) + } + interface Token { /** - * Delimiter sets the delimiter used to define a hierarchical namespace, - * like a filesystem with "directories". It is highly recommended that you - * use "" or "/" as the Delimiter. Other values should work through this API, - * but service UIs generally assume "/". - * - * An empty delimiter means that the bucket is treated as a single flat - * namespace. - * - * A non-empty delimiter means that any result with the delimiter in its key - * after Prefix is stripped will be returned with ListObject.IsDir = true, - * ListObject.Key truncated after the delimiter, and zero values for other - * ListObject fields. These results represent "directories". Multiple results - * in a "directory" are returned as a single result. + * Extra returns an extra field. + * Extra fields are key-value pairs returned by the server as a + * part of the token retrieval response. */ - delimiter: string + extra(key: string): { + } + } + interface Token { /** - * BeforeList is a callback that will be called before each call to the - * the underlying service's list functionality. - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. + * Valid reports whether t is non-nil, has an AccessToken, and is not expired. */ - beforeList: (asFunc: (_arg0: { - }) => boolean) => void + valid(): boolean } +} + +namespace store { /** - * ListIterator iterates over List results. + * Store defines a concurrent safe in memory key-value data store. */ - interface ListIterator { + interface Store { } - interface ListIterator { + interface Store { /** - * Next returns a *ListObject for the next blob. It returns (nil, io.EOF) if - * there are no more. + * Reset clears the store and replaces the store data with a + * shallow copy of the provided newData. */ - next(ctx: context.Context): (ListObject) + reset(newData: _TygojaDict): void } - /** - * SignedURLOptions sets options for SignedURL. - */ - interface SignedURLOptions { + interface Store { /** - * Expiry sets how long the returned URL is valid for. - * Defaults to DefaultSignedURLExpiry. + * Length returns the current number of elements in the store. */ - expiry: time.Duration + length(): number + } + interface Store { /** - * Method is the HTTP method that can be used on the URL; one of "GET", "PUT", - * or "DELETE". Defaults to "GET". + * RemoveAll removes all the existing store entries. */ - method: string + removeAll(): void + } + interface Store { /** - * ContentType specifies the Content-Type HTTP header the user agent is - * permitted to use in the PUT request. It must match exactly. See - * EnforceAbsentContentType for behavior when ContentType is the empty string. - * If a bucket does not implement this verification, then it returns an - * Unimplemented error. + * Remove removes a single entry from the store. * - * Must be empty for non-PUT requests. + * Remove does nothing if key doesn't exist in the store. */ - contentType: string + remove(key: string): void + } + interface Store { /** - * If EnforceAbsentContentType is true and ContentType is the empty string, - * then PUTing to the signed URL will fail if the Content-Type header is - * present. Not all buckets support this: ones that do not will return an - * Unimplemented error. - * - * If EnforceAbsentContentType is false and ContentType is the empty string, - * then PUTing without a Content-Type header will succeed, but it is - * implementation-specific whether providing a Content-Type header will fail. - * - * Must be false for non-PUT requests. + * Has checks if element with the specified key exist or not. */ - enforceAbsentContentType: boolean + has(key: string): boolean + } + interface Store { /** - * BeforeSign is a callback that will be called before each call to the - * the underlying service's sign functionality. - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. + * Get returns a single element value from the store. + * + * If key is not set, the zero T value is returned. */ - beforeSign: (asFunc: (_arg0: { - }) => boolean) => void + get(key: string): T } - /** - * ReaderOptions sets options for NewReader and NewRangeReader. - */ - interface ReaderOptions { + interface Store { /** - * BeforeRead is a callback that will be called before - * any data is read (unless NewReader returns an error before then, in which - * case it may not be called at all). - * - * Calling Seek may reset the underlying reader, and result in BeforeRead - * getting called again with a different underlying provider-specific reader.. - * - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. + * GetAll returns a shallow copy of the current store data. */ - beforeRead: (asFunc: (_arg0: { - }) => boolean) => void + getAll(): _TygojaDict } - /** - * WriterOptions sets options for NewWriter. - */ - interface WriterOptions { + interface Store { /** - * BufferSize changes the default size in bytes of the chunks that - * Writer will upload in a single request; larger blobs will be split into - * multiple requests. - * - * This option may be ignored by some drivers. - * - * If 0, the driver will choose a reasonable default. - * - * If the Writer is used to do many small writes concurrently, using a - * smaller BufferSize may reduce memory usage. + * Set sets (or overwrite if already exist) a new value for key. */ - bufferSize: number + set(key: string, value: T): void + } + interface Store { /** - * MaxConcurrency changes the default concurrency for parts of an upload. - * - * This option may be ignored by some drivers. + * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. * - * If 0, the driver will choose a reasonable default. + * This method is similar to Set() but **it will skip adding new elements** + * to the store if the store length has reached the specified limit. + * false is returned if maxAllowedElements limit is reached. */ - maxConcurrency: number + setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean + } +} + +namespace mailer { + /** + * Mailer defines a base mail client interface. + */ + interface Mailer { + [key:string]: any; /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + * Send sends an email with the provided Message. */ - cacheControl: string + send(message: Message): void + } +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + /** + * Binder is the interface that wraps the Bind method. + */ + interface Binder { + [key:string]: any; + bind(c: Context, i: { + }): void + } + /** + * ServableContext is interface that Echo context implementation must implement to be usable in middleware/handlers and + * be able to be routed by Router. + */ + interface ServableContext { + [key:string]: any; /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + * Reset resets the context after request completes. It must be called along + * with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. + * See `Echo#ServeHTTP()` */ - contentDisposition: string + reset(r: http.Request, w: http.ResponseWriter): void + } + // @ts-ignore + import stdContext = context + /** + * JSONSerializer is the interface that encodes and decodes JSON to and from interfaces. + */ + interface JSONSerializer { + [key:string]: any; + serialize(c: Context, i: { + }, indent: string): void + deserialize(c: Context, i: { + }): void + } + /** + * HTTPErrorHandler is a centralized HTTP error handler. + */ + interface HTTPErrorHandler {(c: Context, err: Error): void } + /** + * Validator is the interface that wraps the Validate function. + */ + interface Validator { + [key:string]: any; + validate(i: { + }): void + } + /** + * Renderer is the interface that wraps the Render function. + */ + interface Renderer { + [key:string]: any; + render(_arg0: io.Writer, _arg1: string, _arg2: { + }, _arg3: Context): void + } + /** + * Group is a set of sub-routes for a specified route. It can be used for inner + * routes that share a common middleware or functionality that should be separate + * from the parent echo instance while still inheriting from it. + */ + interface Group { + } + interface Group { /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + * Use implements `Echo#Use()` for sub-routes within the Group. + * Group middlewares are not executed on request when there is no matching route found. */ - contentEncoding: string + use(...middleware: MiddlewareFunc[]): void + } + interface Group { /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language + * CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. Panics on error. */ - contentLanguage: string + connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { /** - * ContentType specifies the MIME type of the blob being written. If not set, - * it will be inferred from the content using the algorithm described at - * http://mimesniff.spec.whatwg.org/. - * Set DisableContentTypeDetection to true to disable the above and force - * the ContentType to stay empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type + * DELETE implements `Echo#DELETE()` for sub-routes within the Group. Panics on error. */ - contentType: string + delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { /** - * When true, if ContentType is the empty string, it will stay the empty - * string rather than being inferred from the content. - * Note that while the blob will be written with an empty string ContentType, - * most providers will fill one in during reads, so don't expect an empty - * ContentType if you read the blob back. + * GET implements `Echo#GET()` for sub-routes within the Group. Panics on error. */ - disableContentTypeDetection: boolean + get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { /** - * ContentMD5 is used as a message integrity check. - * If len(ContentMD5) > 0, the MD5 hash of the bytes written must match - * ContentMD5, or Close will return an error without completing the write. - * https://tools.ietf.org/html/rfc1864 + * HEAD implements `Echo#HEAD()` for sub-routes within the Group. Panics on error. */ - contentMD5: string|Array + head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { /** - * Metadata holds key/value strings to be associated with the blob, or nil. - * Keys may not be empty, and are lowercased before being written. - * Duplicate case-insensitive keys (e.g., "foo" and "FOO") will result in - * an error. + * OPTIONS implements `Echo#OPTIONS()` for sub-routes within the Group. Panics on error. */ - metadata: _TygojaDict + options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { /** - * BeforeWrite is a callback that will be called exactly once, before - * any data is written (unless NewWriter returns an error, in which case - * it will not be called at all). Note that this is not necessarily during - * or after the first Write call, as drivers may buffer bytes before - * sending an upload request. - * - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. + * PATCH implements `Echo#PATCH()` for sub-routes within the Group. Panics on error. */ - beforeWrite: (asFunc: (_arg0: { - }) => boolean) => void + patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - /** - * CopyOptions sets options for Copy. - */ - interface CopyOptions { + interface Group { /** - * BeforeCopy is a callback that will be called before the copy is - * initiated. - * - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. + * POST implements `Echo#POST()` for sub-routes within the Group. Panics on error. */ - beforeCopy: (asFunc: (_arg0: { - }) => boolean) => void + post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } -} - -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * IsolationLevel is the transaction isolation level used in [TxOptions]. - */ - interface IsolationLevel extends Number{} - interface IsolationLevel { + interface Group { /** - * String returns the name of the transaction isolation level. + * PUT implements `Echo#PUT()` for sub-routes within the Group. Panics on error. */ - string(): string + put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - /** - * DBStats contains database statistics. - */ - interface DBStats { - maxOpenConnections: number // Maximum number of open connections to the database. + interface Group { /** - * Pool Status + * TRACE implements `Echo#TRACE()` for sub-routes within the Group. Panics on error. */ - openConnections: number // The number of established connections both in use and idle. - inUse: number // The number of connections currently in use. - idle: number // The number of idle connections. + trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Group { /** - * Counters + * Any implements `Echo#Any()` for sub-routes within the Group. Panics on error. */ - waitCount: number // The total number of connections waited for. - waitDuration: time.Duration // The total time blocked waiting for a new connection. - maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. - maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. - maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. + any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - /** - * Conn represents a single database connection rather than a pool of database - * connections. Prefer running queries from [DB] unless there is a specific - * need for a continuous single database connection. - * - * A Conn must call [Conn.Close] to return the connection to the database pool - * and may do so concurrently with a running query. - * - * After a call to [Conn.Close], all operations on the - * connection fail with [ErrConnDone]. - */ - interface Conn { + interface Group { + /** + * Match implements `Echo#Match()` for sub-routes within the Group. Panics on error. + */ + match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Conn { + interface Group { /** - * PingContext verifies the connection to the database is still alive. + * Group creates a new sub-group with prefix and optional sub-group-level middleware. + * Important! Group middlewares are only executed in case there was exact route match and not + * for 404 (not found) or 405 (method not allowed) cases. If this kind of behaviour is needed then add + * a catch-all route `/*` for the group which handler returns always 404 */ - pingContext(ctx: context.Context): void + group(prefix: string, ...middleware: MiddlewareFunc[]): (Group) } - interface Conn { + interface Group { /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. + * Static implements `Echo#Static()` for sub-routes within the Group. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result + static(pathPrefix: string, fsRoot: string): RouteInfo } - interface Conn { + interface Group { /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. + * StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. + * + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo } - interface Conn { + interface Group { /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * the [*Row.Scan] method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * FileFS implements `Echo#FileFS()` for sub-routes within the Group. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo } - interface Conn { + interface Group { /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. + * File implements `Echo#File()` for sub-routes within the Group. Panics on error. */ - prepareContext(ctx: context.Context, query: string): (Stmt) + file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Conn { + interface Group { /** - * Raw executes f exposing the underlying driver connection for the - * duration of f. The driverConn must not be used outside of f. + * RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group. * - * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable - * until [Conn.Close] is called. + * Example: `g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` */ - raw(f: (driverConn: any) => void): void + routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Conn { + interface Group { /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. + * Add implements `Echo#Add()` for sub-routes within the Group. Panics on error. */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) + add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Conn { + interface Group { /** - * Close returns the connection to the connection pool. - * All operations after a Close will return with [ErrConnDone]. - * Close is safe to call concurrently with other operations and will - * block until all other operations finish. It may be useful to first - * cancel any used context and then call close directly after. + * AddRoute registers a new Routable with Router */ - close(): void + addRoute(route: Routable): RouteInfo } /** - * ColumnType contains the name and type of a column. + * IPExtractor is a function to extract IP addr from http.Request. + * Set appropriate one to Echo#IPExtractor. + * See https://echo.labstack.com/guide/ip-address for more details. */ - interface ColumnType { + interface IPExtractor {(_arg0: http.Request): string } + /** + * Logger defines the logging interface that Echo uses internally in few places. + * For logging in handlers use your own logger instance (dependency injected or package/public variable) from logging framework of your choice. + */ + interface Logger { + [key:string]: any; + /** + * Write provides writer interface for http.Server `ErrorLog` and for logging startup messages. + * `http.Server.ErrorLog` logs errors from accepting connections, unexpected behavior from handlers, + * and underlying FileSystem errors. + * `logger` middleware will use this method to write its JSON payload. + */ + write(p: string|Array): number + /** + * Error logs the error + */ + error(err: Error): void } - interface ColumnType { + /** + * Response wraps an http.ResponseWriter and implements its interface to be used + * by an HTTP handler to construct an HTTP response. + * See: https://golang.org/pkg/net/http/#ResponseWriter + */ + interface Response { + writer: http.ResponseWriter + status: number + size: number + committed: boolean + } + interface Response { /** - * Name returns the name or alias of the column. + * Header returns the header map for the writer that will be sent by + * WriteHeader. Changing the header after a call to WriteHeader (or Write) has + * no effect unless the modified headers were declared as trailers by setting + * the "Trailer" header before the call to WriteHeader (see example) + * To suppress implicit response headers, set their value to nil. + * Example: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers */ - name(): string + header(): http.Header } - interface ColumnType { + interface Response { /** - * Length returns the column type length for variable length column types such - * as text and binary field types. If the type length is unbounded the value will - * be [math.MaxInt64] (any database limits will still apply). - * If the column type is not variable length, such as an int, or if not supported - * by the driver ok is false. + * Before registers a function which is called just before the response is written. */ - length(): [number, boolean] + before(fn: () => void): void } - interface ColumnType { + interface Response { /** - * DecimalSize returns the scale and precision of a decimal type. - * If not applicable or if not supported ok is false. + * After registers a function which is called just after the response is written. + * If the `Content-Length` is unknown, none of the after function is executed. */ - decimalSize(): [number, number, boolean] + after(fn: () => void): void } - interface ColumnType { + interface Response { /** - * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. - * If a driver does not support this property ScanType will return - * the type of an empty interface. + * WriteHeader sends an HTTP response header with status code. If WriteHeader is + * not called explicitly, the first call to Write will trigger an implicit + * WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly + * used to send error codes. */ - scanType(): any + writeHeader(code: number): void } - interface ColumnType { + interface Response { /** - * Nullable reports whether the column may be null. - * If a driver does not support this property ok will be false. + * Write writes the data to the connection as part of an HTTP reply. */ - nullable(): [boolean, boolean] + write(b: string|Array): number } - interface ColumnType { + interface Response { /** - * DatabaseTypeName returns the database system name of the column type. If an empty - * string is returned, then the driver type name is not supported. - * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers - * are not included. - * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - * "INT", and "BIGINT". + * Flush implements the http.Flusher interface to allow an HTTP handler to flush + * buffered data to the client. + * See [http.Flusher](https://golang.org/pkg/net/http/#Flusher) */ - databaseTypeName(): string + flush(): void } - /** - * Row is the result of calling [DB.QueryRow] to select a single row. - */ - interface Row { + interface Response { + /** + * Hijack implements the http.Hijacker interface to allow an HTTP handler to + * take over the connection. + * See [http.Hijacker](https://golang.org/pkg/net/http/#Hijacker) + */ + hijack(): [net.Conn, (bufio.ReadWriter)] } - interface Row { + interface Response { /** - * Scan copies the columns from the matched row into the values - * pointed at by dest. See the documentation on [Rows.Scan] for details. - * If more than one row matches the query, - * Scan uses the first row and discards the rest. If no row matches - * the query, Scan returns [ErrNoRows]. + * Unwrap returns the original http.ResponseWriter. + * ResponseController can be used to access the original http.ResponseWriter. + * See [https://go.dev/blog/go1.20] */ - scan(...dest: any[]): void + unwrap(): http.ResponseWriter } - interface Row { + interface Routes { /** - * Err provides a way for wrapping packages to check for - * query errors without calling [Row.Scan]. - * Err returns the error, if any, that was encountered while running the query. - * If this error is not nil, this error will also be returned from [Row.Scan]. + * Reverse reverses route to URL string by replacing path parameters with given params values. */ - err(): void + reverse(name: string, ...params: { + }[]): string } -} - -namespace migrate { - interface Migration { - file: string - up: (db: dbx.Builder) => void - down: (db: dbx.Builder) => void + interface Routes { + /** + * FindByMethodPath searched for matching route info by method and path + */ + findByMethodPath(method: string, path: string): RouteInfo + } + interface Routes { + /** + * FilterByMethod searched for matching route info by method + */ + filterByMethod(method: string): Routes + } + interface Routes { + /** + * FilterByPath searched for matching route info by path + */ + filterByPath(path: string): Routes + } + interface Routes { + /** + * FilterByName searched for matching route info by name + */ + filterByName(name: string): Routes + } + /** + * Router is interface for routing request contexts to registered routes. + * + * Contract between Echo/Context instance and the router: + * ``` + * - all routes must be added through methods on echo.Echo instance. + * Reason: Echo instance uses RouteInfo.Params() length to allocate slice for paths parameters (see `Echo.contextPathParamAllocSize`). + * - Router must populate Context during Router.Route call with: + * - RoutableContext.SetPath + * - RoutableContext.SetRawPathParams (IMPORTANT! with same slice pointer that c.RawPathParams() returns) + * - RoutableContext.SetRouteInfo + * And optionally can set additional information to Context with RoutableContext.Set + * ``` + */ + interface Router { + [key:string]: any; + /** + * Add registers Routable with the Router and returns registered RouteInfo + */ + add(routable: Routable): RouteInfo + /** + * Remove removes route from the Router + */ + remove(method: string, path: string): void + /** + * Routes returns information about all registered routes + */ + routes(): Routes + /** + * Route searches Router for matching route and applies it to the given context. In case when no matching method + * was not found (405) or no matching route exists for path (404), router will return its implementation of 405/404 + * handler function. + */ + route(c: RoutableContext): HandlerFunc + } + /** + * Routable is interface for registering Route with Router. During route registration process the Router will + * convert Routable to RouteInfo with ToRouteInfo method. By creating custom implementation of Routable additional + * information about registered route can be stored in Routes (i.e. privileges used with route etc.) + */ + interface Routable { + [key:string]: any; + /** + * ToRouteInfo converts Routable to RouteInfo + * + * This method is meant to be used by Router after it parses url for path parameters, to store information about + * route just added. + */ + toRouteInfo(params: Array): RouteInfo + /** + * ToRoute converts Routable to Route which Router uses to register the method handler for path. + * + * This method is meant to be used by Router to get fields (including handler and middleware functions) needed to + * add Route to Router. + */ + toRoute(): Route + /** + * ForGroup recreates routable with added group prefix and group middlewares it is grouped to. + * + * Is necessary for Echo.Group to be able to add/register Routable with Router and having group prefix and group + * middlewares included in actually registered Route. + */ + forGroup(pathPrefix: string, middlewares: Array): Routable + } + /** + * Routes is collection of RouteInfo instances with various helper methods. + */ + interface Routes extends Array{} + /** + * RouteInfo describes registered route base fields. + * Method+Path pair uniquely identifies the Route. Name can have duplicates. + */ + interface RouteInfo { + [key:string]: any; + method(): string + path(): string + name(): string + params(): Array + /** + * Reverse reverses route to URL string by replacing path parameters with given params values. + */ + reverse(...params: { + }[]): string + } + /** + * PathParams is collections of PathParam instances with various helper methods + */ + interface PathParams extends Array{} + interface PathParams { + /** + * Get returns path parameter value for given name or default value. + */ + get(name: string, defaultValue: string): string + } +} + +namespace logging { + /** + * Logger is an interface for logging entries at certain classifications. + */ + interface Logger { + [key:string]: any; + /** + * Logf is expected to support the standard fmt package "verbs". + */ + logf(classification: Classification, format: string, ...v: { + }[]): void } } @@ -23976,8 +23933,8 @@ namespace s3 { import smithydocument = document // @ts-ignore import smithyhttp = http - type _subdoBVF = noSmithyDocumentSerde - interface AbortMultipartUploadInput extends _subdoBVF { + type _subQQXwh = noSmithyDocumentSerde + interface AbortMultipartUploadInput extends _subQQXwh { /** * The bucket name to which the upload was taking place. * @@ -24048,8 +24005,8 @@ namespace s3 { */ requestPayer: types.RequestPayer } - type _subAhzcd = noSmithyDocumentSerde - interface AbortMultipartUploadOutput extends _subAhzcd { + type _subsLqIT = noSmithyDocumentSerde + interface AbortMultipartUploadOutput extends _subsLqIT { /** * If present, indicates that the requester was successfully charged for the * request. @@ -24062,8 +24019,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subRygdJ = noSmithyDocumentSerde - interface CompleteMultipartUploadInput extends _subRygdJ { + type _subiloAc = noSmithyDocumentSerde + interface CompleteMultipartUploadInput extends _subiloAc { /** * Name of the bucket to which the multipart upload was initiated. * @@ -24222,8 +24179,8 @@ namespace s3 { */ sseCustomerKeyMD5?: string } - type _subopwgM = noSmithyDocumentSerde - interface CompleteMultipartUploadOutput extends _subopwgM { + type _subllseS = noSmithyDocumentSerde + interface CompleteMultipartUploadOutput extends _subllseS { /** * The name of the bucket that contains the newly created object. Does not return * the access point ARN or access point alias if used. @@ -24339,8 +24296,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subzVCbd = noSmithyDocumentSerde - interface CopyObjectInput extends _subzVCbd { + type _subysoCn = noSmithyDocumentSerde + interface CopyObjectInput extends _subysoCn { /** * The name of the destination bucket. * @@ -25042,8 +24999,8 @@ namespace s3 { */ websiteRedirectLocation?: string } - type _subMUDlx = noSmithyDocumentSerde - interface CopyObjectOutput extends _subMUDlx { + type _subWpKZz = noSmithyDocumentSerde + interface CopyObjectOutput extends _subWpKZz { /** * Indicates whether the copied object uses an S3 Bucket Key for server-side * encryption with Key Management Service (KMS) keys (SSE-KMS). @@ -25115,8 +25072,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subFvUAF = noSmithyDocumentSerde - interface CreateBucketInput extends _subFvUAF { + type _subrFiLm = noSmithyDocumentSerde + interface CreateBucketInput extends _subrFiLm { /** * The name of the bucket to create. * @@ -25217,8 +25174,8 @@ namespace s3 { */ objectOwnership: types.ObjectOwnership } - type _subVPZab = noSmithyDocumentSerde - interface CreateBucketOutput extends _subVPZab { + type _subMLVEG = noSmithyDocumentSerde + interface CreateBucketOutput extends _subMLVEG { /** * A forward slash followed by the name of the bucket. */ @@ -25228,8 +25185,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subcEoRi = noSmithyDocumentSerde - interface CreateMultipartUploadInput extends _subcEoRi { + type _subMkBpH = noSmithyDocumentSerde + interface CreateMultipartUploadInput extends _subMkBpH { /** * The name of the bucket where the multipart upload is initiated and where the * object is uploaded. @@ -25791,8 +25748,8 @@ namespace s3 { */ websiteRedirectLocation?: string } - type _subHZuFd = noSmithyDocumentSerde - interface CreateMultipartUploadOutput extends _subHZuFd { + type _subIspSp = noSmithyDocumentSerde + interface CreateMultipartUploadOutput extends _subIspSp { /** * If the bucket has a lifecycle rule configured with an action to abort * incomplete multipart uploads and the prefix in the lifecycle rule matches the @@ -25883,8 +25840,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subNnMiF = noSmithyDocumentSerde - interface CreateSessionInput extends _subNnMiF { + type _subsHwVy = noSmithyDocumentSerde + interface CreateSessionInput extends _subsHwVy { /** * The name of the bucket that you create a session for. * @@ -25966,8 +25923,8 @@ namespace s3 { */ sessionMode: types.SessionMode } - type _subKUQZg = noSmithyDocumentSerde - interface CreateSessionOutput extends _subKUQZg { + type _subZmyqj = noSmithyDocumentSerde + interface CreateSessionOutput extends _subZmyqj { /** * The established temporary security credentials for the created session. * @@ -26003,8 +25960,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subWWBVW = noSmithyDocumentSerde - interface DeleteBucketInput extends _subWWBVW { + type _subMzCGg = noSmithyDocumentSerde + interface DeleteBucketInput extends _subMzCGg { /** * Specifies the bucket being deleted. * @@ -26033,15 +25990,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subKOrqE = noSmithyDocumentSerde - interface DeleteBucketOutput extends _subKOrqE { + type _subhCCMG = noSmithyDocumentSerde + interface DeleteBucketOutput extends _subhCCMG { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subPauEn = noSmithyDocumentSerde - interface DeleteBucketAnalyticsConfigurationInput extends _subPauEn { + type _subrMhZl = noSmithyDocumentSerde + interface DeleteBucketAnalyticsConfigurationInput extends _subrMhZl { /** * The name of the bucket from which an analytics configuration is deleted. * @@ -26061,15 +26018,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subyOGOJ = noSmithyDocumentSerde - interface DeleteBucketAnalyticsConfigurationOutput extends _subyOGOJ { + type _subLRBxi = noSmithyDocumentSerde + interface DeleteBucketAnalyticsConfigurationOutput extends _subLRBxi { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subKrJPX = noSmithyDocumentSerde - interface DeleteBucketCorsInput extends _subKrJPX { + type _subMlAuW = noSmithyDocumentSerde + interface DeleteBucketCorsInput extends _subMlAuW { /** * Specifies the bucket whose cors configuration is being deleted. * @@ -26083,15 +26040,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subUJnEh = noSmithyDocumentSerde - interface DeleteBucketCorsOutput extends _subUJnEh { + type _subOiuSW = noSmithyDocumentSerde + interface DeleteBucketCorsOutput extends _subOiuSW { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subSOoKo = noSmithyDocumentSerde - interface DeleteBucketEncryptionInput extends _subSOoKo { + type _subZwZga = noSmithyDocumentSerde + interface DeleteBucketEncryptionInput extends _subZwZga { /** * The name of the bucket containing the server-side encryption configuration to * delete. @@ -26121,15 +26078,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subfyfpN = noSmithyDocumentSerde - interface DeleteBucketEncryptionOutput extends _subfyfpN { + type _subObZOa = noSmithyDocumentSerde + interface DeleteBucketEncryptionOutput extends _subObZOa { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _submCnCq = noSmithyDocumentSerde - interface DeleteBucketIntelligentTieringConfigurationInput extends _submCnCq { + type _subZcJsr = noSmithyDocumentSerde + interface DeleteBucketIntelligentTieringConfigurationInput extends _subZcJsr { /** * The name of the Amazon S3 bucket whose configuration you want to modify or * retrieve. @@ -26144,15 +26101,15 @@ namespace s3 { */ id?: string } - type _subKbBci = noSmithyDocumentSerde - interface DeleteBucketIntelligentTieringConfigurationOutput extends _subKbBci { + type _subxQKpF = noSmithyDocumentSerde + interface DeleteBucketIntelligentTieringConfigurationOutput extends _subxQKpF { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subJcILg = noSmithyDocumentSerde - interface DeleteBucketInventoryConfigurationInput extends _subJcILg { + type _subpDwgQ = noSmithyDocumentSerde + interface DeleteBucketInventoryConfigurationInput extends _subpDwgQ { /** * The name of the bucket containing the inventory configuration to delete. * @@ -26172,15 +26129,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subUovMy = noSmithyDocumentSerde - interface DeleteBucketInventoryConfigurationOutput extends _subUovMy { + type _subKYyoo = noSmithyDocumentSerde + interface DeleteBucketInventoryConfigurationOutput extends _subKYyoo { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subNuiWc = noSmithyDocumentSerde - interface DeleteBucketLifecycleInput extends _subNuiWc { + type _suboMivD = noSmithyDocumentSerde + interface DeleteBucketLifecycleInput extends _suboMivD { /** * The bucket name of the lifecycle to delete. * @@ -26194,15 +26151,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subacBoP = noSmithyDocumentSerde - interface DeleteBucketLifecycleOutput extends _subacBoP { + type _subOAFze = noSmithyDocumentSerde + interface DeleteBucketLifecycleOutput extends _subOAFze { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subBqDnL = noSmithyDocumentSerde - interface DeleteBucketMetricsConfigurationInput extends _subBqDnL { + type _submHPbK = noSmithyDocumentSerde + interface DeleteBucketMetricsConfigurationInput extends _submHPbK { /** * The name of the bucket containing the metrics configuration to delete. * @@ -26223,15 +26180,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subRTqPc = noSmithyDocumentSerde - interface DeleteBucketMetricsConfigurationOutput extends _subRTqPc { + type _subrBtWw = noSmithyDocumentSerde + interface DeleteBucketMetricsConfigurationOutput extends _subrBtWw { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subpReTa = noSmithyDocumentSerde - interface DeleteBucketOwnershipControlsInput extends _subpReTa { + type _subQLiKn = noSmithyDocumentSerde + interface DeleteBucketOwnershipControlsInput extends _subQLiKn { /** * The Amazon S3 bucket whose OwnershipControls you want to delete. * @@ -26245,15 +26202,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subomweP = noSmithyDocumentSerde - interface DeleteBucketOwnershipControlsOutput extends _subomweP { + type _subarfSr = noSmithyDocumentSerde + interface DeleteBucketOwnershipControlsOutput extends _subarfSr { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subYpTYR = noSmithyDocumentSerde - interface DeleteBucketPolicyInput extends _subYpTYR { + type _subSdVFp = noSmithyDocumentSerde + interface DeleteBucketPolicyInput extends _subSdVFp { /** * The bucket name. * @@ -26282,15 +26239,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subSarex = noSmithyDocumentSerde - interface DeleteBucketPolicyOutput extends _subSarex { + type _subQIzev = noSmithyDocumentSerde + interface DeleteBucketPolicyOutput extends _subQIzev { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subyoKUU = noSmithyDocumentSerde - interface DeleteBucketReplicationInput extends _subyoKUU { + type _subbHFLQ = noSmithyDocumentSerde + interface DeleteBucketReplicationInput extends _subbHFLQ { /** * The bucket name. * @@ -26304,15 +26261,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subcFLBG = noSmithyDocumentSerde - interface DeleteBucketReplicationOutput extends _subcFLBG { + type _subDVhHx = noSmithyDocumentSerde + interface DeleteBucketReplicationOutput extends _subDVhHx { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subFkuCR = noSmithyDocumentSerde - interface DeleteBucketTaggingInput extends _subFkuCR { + type _subeSpxr = noSmithyDocumentSerde + interface DeleteBucketTaggingInput extends _subeSpxr { /** * The bucket that has the tag set to be removed. * @@ -26326,15 +26283,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subXaBzc = noSmithyDocumentSerde - interface DeleteBucketTaggingOutput extends _subXaBzc { + type _subdiYxH = noSmithyDocumentSerde + interface DeleteBucketTaggingOutput extends _subdiYxH { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subfMerk = noSmithyDocumentSerde - interface DeleteBucketWebsiteInput extends _subfMerk { + type _subPaZot = noSmithyDocumentSerde + interface DeleteBucketWebsiteInput extends _subPaZot { /** * The bucket name for which you want to remove the website configuration. * @@ -26348,15 +26305,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subGWwIc = noSmithyDocumentSerde - interface DeleteBucketWebsiteOutput extends _subGWwIc { + type _subUVfOt = noSmithyDocumentSerde + interface DeleteBucketWebsiteOutput extends _subUVfOt { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subkIyTL = noSmithyDocumentSerde - interface DeleteObjectInput extends _subkIyTL { + type _subIJNwZ = noSmithyDocumentSerde + interface DeleteObjectInput extends _subIJNwZ { /** * The bucket name of the bucket containing the object. * @@ -26445,8 +26402,8 @@ namespace s3 { */ versionId?: string } - type _subynbWF = noSmithyDocumentSerde - interface DeleteObjectOutput extends _subynbWF { + type _subfOOIN = noSmithyDocumentSerde + interface DeleteObjectOutput extends _subfOOIN { /** * Indicates whether the specified object version that was permanently deleted was * (true) or was not (false) a delete marker before deletion. In a simple DELETE, @@ -26475,8 +26432,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subUIqMT = noSmithyDocumentSerde - interface DeleteObjectTaggingInput extends _subUIqMT { + type _subAuQXB = noSmithyDocumentSerde + interface DeleteObjectTaggingInput extends _subAuQXB { /** * The bucket name containing the objects from which to remove the tags. * @@ -26520,8 +26477,8 @@ namespace s3 { */ versionId?: string } - type _subhfXHb = noSmithyDocumentSerde - interface DeleteObjectTaggingOutput extends _subhfXHb { + type _subZcXxD = noSmithyDocumentSerde + interface DeleteObjectTaggingOutput extends _subZcXxD { /** * The versionId of the object the tag-set was removed from. */ @@ -26531,8 +26488,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subUILFI = noSmithyDocumentSerde - interface DeleteObjectsInput extends _subUILFI { + type _subFyijG = noSmithyDocumentSerde + interface DeleteObjectsInput extends _subFyijG { /** * The bucket name containing the objects to delete. * @@ -26658,8 +26615,8 @@ namespace s3 { */ requestPayer: types.RequestPayer } - type _subDrSEi = noSmithyDocumentSerde - interface DeleteObjectsOutput extends _subDrSEi { + type _subkBpHA = noSmithyDocumentSerde + interface DeleteObjectsOutput extends _subkBpHA { /** * Container element for a successful delete. It identifies the object that was * successfully deleted. @@ -26682,8 +26639,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subdkKfs = noSmithyDocumentSerde - interface DeletePublicAccessBlockInput extends _subdkKfs { + type _subRaypk = noSmithyDocumentSerde + interface DeletePublicAccessBlockInput extends _subRaypk { /** * The Amazon S3 bucket whose PublicAccessBlock configuration you want to delete. * @@ -26697,15 +26654,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subbnEep = noSmithyDocumentSerde - interface DeletePublicAccessBlockOutput extends _subbnEep { + type _subYJcGi = noSmithyDocumentSerde + interface DeletePublicAccessBlockOutput extends _subYJcGi { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subxadmv = noSmithyDocumentSerde - interface GetBucketAccelerateConfigurationInput extends _subxadmv { + type _subpwmKr = noSmithyDocumentSerde + interface GetBucketAccelerateConfigurationInput extends _subpwmKr { /** * The name of the bucket for which the accelerate configuration is retrieved. * @@ -26732,8 +26689,8 @@ namespace s3 { */ requestPayer: types.RequestPayer } - type _subMJXUk = noSmithyDocumentSerde - interface GetBucketAccelerateConfigurationOutput extends _subMJXUk { + type _subTsvha = noSmithyDocumentSerde + interface GetBucketAccelerateConfigurationOutput extends _subTsvha { /** * If present, indicates that the requester was successfully charged for the * request. @@ -26750,8 +26707,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subymWaB = noSmithyDocumentSerde - interface GetBucketAclInput extends _subymWaB { + type _subqWjbv = noSmithyDocumentSerde + interface GetBucketAclInput extends _subqWjbv { /** * Specifies the S3 bucket whose ACL is being requested. * @@ -26776,8 +26733,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subZjWFl = noSmithyDocumentSerde - interface GetBucketAclOutput extends _subZjWFl { + type _subuvftD = noSmithyDocumentSerde + interface GetBucketAclOutput extends _subuvftD { /** * A list of grants. */ @@ -26791,8 +26748,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subSTUzj = noSmithyDocumentSerde - interface GetBucketAnalyticsConfigurationInput extends _subSTUzj { + type _subCGWlj = noSmithyDocumentSerde + interface GetBucketAnalyticsConfigurationInput extends _subCGWlj { /** * The name of the bucket from which an analytics configuration is retrieved. * @@ -26812,8 +26769,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subGjmkO = noSmithyDocumentSerde - interface GetBucketAnalyticsConfigurationOutput extends _subGjmkO { + type _subOLpbm = noSmithyDocumentSerde + interface GetBucketAnalyticsConfigurationOutput extends _subOLpbm { /** * The configuration and any analyses for the analytics filter. */ @@ -26823,8 +26780,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subBAguP = noSmithyDocumentSerde - interface GetBucketCorsInput extends _subBAguP { + type _subsnxdu = noSmithyDocumentSerde + interface GetBucketCorsInput extends _subsnxdu { /** * The bucket name for which to get the cors configuration. * @@ -26849,8 +26806,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subaoqvd = noSmithyDocumentSerde - interface GetBucketCorsOutput extends _subaoqvd { + type _subpeDCa = noSmithyDocumentSerde + interface GetBucketCorsOutput extends _subpeDCa { /** * A set of origins and methods (cross-origin access that you want to allow). You * can add up to 100 rules to the configuration. @@ -26861,8 +26818,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subGSqbe = noSmithyDocumentSerde - interface GetBucketEncryptionInput extends _subGSqbe { + type _subHQfZu = noSmithyDocumentSerde + interface GetBucketEncryptionInput extends _subHQfZu { /** * The name of the bucket from which the server-side encryption configuration is * retrieved. @@ -26892,8 +26849,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subWdusS = noSmithyDocumentSerde - interface GetBucketEncryptionOutput extends _subWdusS { + type _subcUJIz = noSmithyDocumentSerde + interface GetBucketEncryptionOutput extends _subcUJIz { /** * Specifies the default server-side-encryption configuration. */ @@ -26903,8 +26860,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subZxizZ = noSmithyDocumentSerde - interface GetBucketIntelligentTieringConfigurationInput extends _subZxizZ { + type _subhJfTf = noSmithyDocumentSerde + interface GetBucketIntelligentTieringConfigurationInput extends _subhJfTf { /** * The name of the Amazon S3 bucket whose configuration you want to modify or * retrieve. @@ -26919,8 +26876,8 @@ namespace s3 { */ id?: string } - type _subeeKSR = noSmithyDocumentSerde - interface GetBucketIntelligentTieringConfigurationOutput extends _subeeKSR { + type _subqAeZc = noSmithyDocumentSerde + interface GetBucketIntelligentTieringConfigurationOutput extends _subqAeZc { /** * Container for S3 Intelligent-Tiering configuration. */ @@ -26930,8 +26887,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _submQByk = noSmithyDocumentSerde - interface GetBucketInventoryConfigurationInput extends _submQByk { + type _subkwWWN = noSmithyDocumentSerde + interface GetBucketInventoryConfigurationInput extends _subkwWWN { /** * The name of the bucket containing the inventory configuration to retrieve. * @@ -26951,8 +26908,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _sublBZFv = noSmithyDocumentSerde - interface GetBucketInventoryConfigurationOutput extends _sublBZFv { + type _subWHLLo = noSmithyDocumentSerde + interface GetBucketInventoryConfigurationOutput extends _subWHLLo { /** * Specifies the inventory configuration. */ @@ -26962,8 +26919,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _sublFvsi = noSmithyDocumentSerde - interface GetBucketLifecycleConfigurationInput extends _sublFvsi { + type _subnArOC = noSmithyDocumentSerde + interface GetBucketLifecycleConfigurationInput extends _subnArOC { /** * The name of the bucket for which to get the lifecycle information. * @@ -26977,8 +26934,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subkQQAq = noSmithyDocumentSerde - interface GetBucketLifecycleConfigurationOutput extends _subkQQAq { + type _subXUZyS = noSmithyDocumentSerde + interface GetBucketLifecycleConfigurationOutput extends _subXUZyS { /** * Container for a lifecycle rule. */ @@ -27011,8 +26968,8 @@ namespace s3 { import smithyxml = xml // @ts-ignore import smithyio = io - type _subtPYNo = noSmithyDocumentSerde - interface GetBucketLocationInput extends _subtPYNo { + type _subAUxmS = noSmithyDocumentSerde + interface GetBucketLocationInput extends _subAUxmS { /** * The name of the bucket for which to get the location. * @@ -27037,8 +26994,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subYSLff = noSmithyDocumentSerde - interface GetBucketLocationOutput extends _subYSLff { + type _subJGlUu = noSmithyDocumentSerde + interface GetBucketLocationOutput extends _subJGlUu { /** * Specifies the Region where the bucket resides. For a list of all the Amazon S3 * supported location constraints by Region, see [Regions and Endpoints]. Buckets in Region us-east-1 @@ -27052,8 +27009,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subffqWS = noSmithyDocumentSerde - interface GetBucketLoggingInput extends _subffqWS { + type _subtfoeZ = noSmithyDocumentSerde + interface GetBucketLoggingInput extends _subtfoeZ { /** * The bucket name for which to get the logging information. * @@ -27067,8 +27024,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subLKFCe = noSmithyDocumentSerde - interface GetBucketLoggingOutput extends _subLKFCe { + type _subbusuo = noSmithyDocumentSerde + interface GetBucketLoggingOutput extends _subbusuo { /** * Describes where logs are stored and the prefix that Amazon S3 assigns to all * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API @@ -27082,8 +27039,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subXnQXI = noSmithyDocumentSerde - interface GetBucketMetricsConfigurationInput extends _subXnQXI { + type _subdtlCW = noSmithyDocumentSerde + interface GetBucketMetricsConfigurationInput extends _subdtlCW { /** * The name of the bucket containing the metrics configuration to retrieve. * @@ -27104,8 +27061,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subPlbFZ = noSmithyDocumentSerde - interface GetBucketMetricsConfigurationOutput extends _subPlbFZ { + type _subDLNIq = noSmithyDocumentSerde + interface GetBucketMetricsConfigurationOutput extends _subDLNIq { /** * Specifies the metrics configuration. */ @@ -27115,8 +27072,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subtoemD = noSmithyDocumentSerde - interface GetBucketNotificationConfigurationInput extends _subtoemD { + type _subIuYNe = noSmithyDocumentSerde + interface GetBucketNotificationConfigurationInput extends _subIuYNe { /** * The name of the bucket for which to get the notification configuration. * @@ -27145,8 +27102,8 @@ namespace s3 { * A container for specifying the notification configuration of the bucket. If * this element is empty, notifications are turned off for the bucket. */ - type _subMPMnb = noSmithyDocumentSerde - interface GetBucketNotificationConfigurationOutput extends _subMPMnb { + type _subBVyDh = noSmithyDocumentSerde + interface GetBucketNotificationConfigurationOutput extends _subBVyDh { /** * Enables delivery of events to Amazon EventBridge. */ @@ -27171,8 +27128,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subuEFGJ = noSmithyDocumentSerde - interface GetBucketOwnershipControlsInput extends _subuEFGJ { + type _subpwbTf = noSmithyDocumentSerde + interface GetBucketOwnershipControlsInput extends _subpwbTf { /** * The name of the Amazon S3 bucket whose OwnershipControls you want to retrieve. * @@ -27186,8 +27143,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subgMVIl = noSmithyDocumentSerde - interface GetBucketOwnershipControlsOutput extends _subgMVIl { + type _subFQhUc = noSmithyDocumentSerde + interface GetBucketOwnershipControlsOutput extends _subFQhUc { /** * The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or * ObjectWriter) currently in effect for this Amazon S3 bucket. @@ -27198,8 +27155,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subJDaPJ = noSmithyDocumentSerde - interface GetBucketPolicyInput extends _subJDaPJ { + type _subYRXXj = noSmithyDocumentSerde + interface GetBucketPolicyInput extends _subYRXXj { /** * The bucket name to get the bucket policy for. * @@ -27241,8 +27198,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subtdLaI = noSmithyDocumentSerde - interface GetBucketPolicyOutput extends _subtdLaI { + type _subkZmkL = noSmithyDocumentSerde + interface GetBucketPolicyOutput extends _subkZmkL { /** * The bucket policy as a JSON document. */ @@ -27252,8 +27209,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subbnuMF = noSmithyDocumentSerde - interface GetBucketPolicyStatusInput extends _subbnuMF { + type _subOvbfe = noSmithyDocumentSerde + interface GetBucketPolicyStatusInput extends _subOvbfe { /** * The name of the Amazon S3 bucket whose policy status you want to retrieve. * @@ -27267,8 +27224,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subBRLkC = noSmithyDocumentSerde - interface GetBucketPolicyStatusOutput extends _subBRLkC { + type _subcEEzY = noSmithyDocumentSerde + interface GetBucketPolicyStatusOutput extends _subcEEzY { /** * The policy status for the specified bucket. */ @@ -27278,8 +27235,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subUECqT = noSmithyDocumentSerde - interface GetBucketReplicationInput extends _subUECqT { + type _subfJyle = noSmithyDocumentSerde + interface GetBucketReplicationInput extends _subfJyle { /** * The bucket name for which to get the replication information. * @@ -27293,8 +27250,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subirNjO = noSmithyDocumentSerde - interface GetBucketReplicationOutput extends _subirNjO { + type _subemVJG = noSmithyDocumentSerde + interface GetBucketReplicationOutput extends _subemVJG { /** * A container for replication rules. You can add up to 1,000 rules. The maximum * size of a replication configuration is 2 MB. @@ -27305,8 +27262,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subItMYt = noSmithyDocumentSerde - interface GetBucketRequestPaymentInput extends _subItMYt { + type _subPHmQJ = noSmithyDocumentSerde + interface GetBucketRequestPaymentInput extends _subPHmQJ { /** * The name of the bucket for which to get the payment request configuration * @@ -27320,8 +27277,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subvFcwV = noSmithyDocumentSerde - interface GetBucketRequestPaymentOutput extends _subvFcwV { + type _subobmEb = noSmithyDocumentSerde + interface GetBucketRequestPaymentOutput extends _subobmEb { /** * Specifies who pays for the download and request fees. */ @@ -27331,8 +27288,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subpdzhk = noSmithyDocumentSerde - interface GetBucketTaggingInput extends _subpdzhk { + type _subbPTIW = noSmithyDocumentSerde + interface GetBucketTaggingInput extends _subbPTIW { /** * The name of the bucket for which to get the tagging information. * @@ -27346,8 +27303,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subcxgba = noSmithyDocumentSerde - interface GetBucketTaggingOutput extends _subcxgba { + type _subRiRIO = noSmithyDocumentSerde + interface GetBucketTaggingOutput extends _subRiRIO { /** * Contains the tag set. * @@ -27359,8 +27316,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subckrrF = noSmithyDocumentSerde - interface GetBucketVersioningInput extends _subckrrF { + type _subjaJnG = noSmithyDocumentSerde + interface GetBucketVersioningInput extends _subjaJnG { /** * The name of the bucket for which to get the versioning information. * @@ -27374,8 +27331,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subZmfqn = noSmithyDocumentSerde - interface GetBucketVersioningOutput extends _subZmfqn { + type _subJFesj = noSmithyDocumentSerde + interface GetBucketVersioningOutput extends _subJFesj { /** * Specifies whether MFA delete is enabled in the bucket versioning configuration. * This element is only returned if the bucket has been configured with MFA delete. @@ -27391,8 +27348,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subpcLqO = noSmithyDocumentSerde - interface GetBucketWebsiteInput extends _subpcLqO { + type _subirskq = noSmithyDocumentSerde + interface GetBucketWebsiteInput extends _subirskq { /** * The bucket name for which to get the website configuration. * @@ -27406,8 +27363,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subpWjbK = noSmithyDocumentSerde - interface GetBucketWebsiteOutput extends _subpWjbK { + type _subiABkf = noSmithyDocumentSerde + interface GetBucketWebsiteOutput extends _subiABkf { /** * The object key name of the website error document to use for 4XX class errors. */ @@ -27430,8 +27387,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subrfljy = noSmithyDocumentSerde - interface GetObjectInput extends _subrfljy { + type _subyxkEG = noSmithyDocumentSerde + interface GetObjectInput extends _subyxkEG { /** * The bucket name containing the object. * @@ -27705,8 +27662,8 @@ namespace s3 { */ versionId?: string } - type _subaoaMd = noSmithyDocumentSerde - interface GetObjectOutput extends _subaoaMd { + type _subpBNvB = noSmithyDocumentSerde + interface GetObjectOutput extends _subpBNvB { /** * Indicates that a range of bytes was specified in the request. */ @@ -27960,8 +27917,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subcSmrI = noSmithyDocumentSerde - interface GetObjectAclInput extends _subcSmrI { + type _subEUnnZ = noSmithyDocumentSerde + interface GetObjectAclInput extends _subEUnnZ { /** * The bucket name that contains the object for which to get the ACL information. * @@ -28011,8 +27968,8 @@ namespace s3 { */ versionId?: string } - type _subAcamt = noSmithyDocumentSerde - interface GetObjectAclOutput extends _subAcamt { + type _subagcvo = noSmithyDocumentSerde + interface GetObjectAclOutput extends _subagcvo { /** * A list of grants. */ @@ -28033,8 +27990,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subxCSXH = noSmithyDocumentSerde - interface GetObjectAttributesInput extends _subxCSXH { + type _subSSgpw = noSmithyDocumentSerde + interface GetObjectAttributesInput extends _subSSgpw { /** * The name of the bucket that contains the object. * @@ -28148,8 +28105,8 @@ namespace s3 { */ versionId?: string } - type _subtJwoC = noSmithyDocumentSerde - interface GetObjectAttributesOutput extends _subtJwoC { + type _subYfQeA = noSmithyDocumentSerde + interface GetObjectAttributesOutput extends _subYfQeA { /** * The checksum or digest of the object. */ @@ -28208,8 +28165,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subyrFaW = noSmithyDocumentSerde - interface GetObjectLegalHoldInput extends _subyrFaW { + type _subCrIAi = noSmithyDocumentSerde + interface GetObjectLegalHoldInput extends _subCrIAi { /** * The bucket name containing the object whose legal hold status you want to * retrieve. @@ -28258,8 +28215,8 @@ namespace s3 { */ versionId?: string } - type _subYTMHo = noSmithyDocumentSerde - interface GetObjectLegalHoldOutput extends _subYTMHo { + type _subgtndl = noSmithyDocumentSerde + interface GetObjectLegalHoldOutput extends _subgtndl { /** * The current legal hold status for the specified object. */ @@ -28269,8 +28226,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _suboPiwy = noSmithyDocumentSerde - interface GetObjectLockConfigurationInput extends _suboPiwy { + type _subwElMD = noSmithyDocumentSerde + interface GetObjectLockConfigurationInput extends _subwElMD { /** * The bucket whose Object Lock configuration you want to retrieve. * @@ -28295,8 +28252,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subGRZzR = noSmithyDocumentSerde - interface GetObjectLockConfigurationOutput extends _subGRZzR { + type _subrkmid = noSmithyDocumentSerde + interface GetObjectLockConfigurationOutput extends _subrkmid { /** * The specified bucket's Object Lock configuration. */ @@ -28306,8 +28263,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subBxtRy = noSmithyDocumentSerde - interface GetObjectRetentionInput extends _subBxtRy { + type _subBTEov = noSmithyDocumentSerde + interface GetObjectRetentionInput extends _subBTEov { /** * The bucket name containing the object whose retention settings you want to * retrieve. @@ -28356,8 +28313,8 @@ namespace s3 { */ versionId?: string } - type _subdWwqE = noSmithyDocumentSerde - interface GetObjectRetentionOutput extends _subdWwqE { + type _subFNcgn = noSmithyDocumentSerde + interface GetObjectRetentionOutput extends _subFNcgn { /** * The container element for an object's retention settings. */ @@ -28367,8 +28324,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subMZCpC = noSmithyDocumentSerde - interface GetObjectTaggingInput extends _subMZCpC { + type _subxvHff = noSmithyDocumentSerde + interface GetObjectTaggingInput extends _subxvHff { /** * The bucket name containing the object for which to get the tagging information. * @@ -28425,8 +28382,8 @@ namespace s3 { */ versionId?: string } - type _subZcjmo = noSmithyDocumentSerde - interface GetObjectTaggingOutput extends _subZcjmo { + type _subuqYCt = noSmithyDocumentSerde + interface GetObjectTaggingOutput extends _subuqYCt { /** * Contains the tag set. * @@ -28442,8 +28399,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subpvHHG = noSmithyDocumentSerde - interface GetObjectTorrentInput extends _subpvHHG { + type _subkOzNf = noSmithyDocumentSerde + interface GetObjectTorrentInput extends _subkOzNf { /** * The name of the bucket containing the object for which to get the torrent files. * @@ -28476,8 +28433,8 @@ namespace s3 { */ requestPayer: types.RequestPayer } - type _subDeCIU = noSmithyDocumentSerde - interface GetObjectTorrentOutput extends _subDeCIU { + type _subkuRvp = noSmithyDocumentSerde + interface GetObjectTorrentOutput extends _subkuRvp { /** * A Bencoded dictionary as defined by the BitTorrent specification */ @@ -28494,8 +28451,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subwDirT = noSmithyDocumentSerde - interface GetPublicAccessBlockInput extends _subwDirT { + type _subRuXex = noSmithyDocumentSerde + interface GetPublicAccessBlockInput extends _subRuXex { /** * The name of the Amazon S3 bucket whose PublicAccessBlock configuration you want * to retrieve. @@ -28510,8 +28467,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subLleHs = noSmithyDocumentSerde - interface GetPublicAccessBlockOutput extends _subLleHs { + type _subGopXJ = noSmithyDocumentSerde + interface GetPublicAccessBlockOutput extends _subGopXJ { /** * The PublicAccessBlock configuration currently in effect for this Amazon S3 * bucket. @@ -28526,8 +28483,8 @@ namespace s3 { import smithytime = time // @ts-ignore import smithywaiter = waiter - type _subTJcNB = noSmithyDocumentSerde - interface HeadBucketInput extends _subTJcNB { + type _subBOqiz = noSmithyDocumentSerde + interface HeadBucketInput extends _subBOqiz { /** * The bucket name. * @@ -28580,8 +28537,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _submwZVR = noSmithyDocumentSerde - interface HeadBucketOutput extends _submwZVR { + type _suboEBLa = noSmithyDocumentSerde + interface HeadBucketOutput extends _suboEBLa { /** * Indicates whether the bucket name used in the request is an access point alias. * @@ -28612,8 +28569,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subaRmfR = noSmithyDocumentSerde - interface HeadObjectInput extends _subaRmfR { + type _subOUwOk = noSmithyDocumentSerde + interface HeadObjectInput extends _subOUwOk { /** * The name of the bucket that contains the object. * @@ -28842,8 +28799,8 @@ namespace s3 { */ versionId?: string } - type _subFwlXE = noSmithyDocumentSerde - interface HeadObjectOutput extends _subFwlXE { + type _subhWMmV = noSmithyDocumentSerde + interface HeadObjectOutput extends _subhWMmV { /** * Indicates that a range of bytes was specified. */ @@ -29154,8 +29111,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subdNWQa = noSmithyDocumentSerde - interface ListBucketAnalyticsConfigurationsInput extends _subdNWQa { + type _subgVQvH = noSmithyDocumentSerde + interface ListBucketAnalyticsConfigurationsInput extends _subgVQvH { /** * The name of the bucket from which analytics configurations are retrieved. * @@ -29174,8 +29131,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subaBiJF = noSmithyDocumentSerde - interface ListBucketAnalyticsConfigurationsOutput extends _subaBiJF { + type _subSyBid = noSmithyDocumentSerde + interface ListBucketAnalyticsConfigurationsOutput extends _subSyBid { /** * The list of analytics configurations for a bucket. */ @@ -29202,8 +29159,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subdKGaA = noSmithyDocumentSerde - interface ListBucketIntelligentTieringConfigurationsInput extends _subdKGaA { + type _subKEOAP = noSmithyDocumentSerde + interface ListBucketIntelligentTieringConfigurationsInput extends _subKEOAP { /** * The name of the Amazon S3 bucket whose configuration you want to modify or * retrieve. @@ -29217,8 +29174,8 @@ namespace s3 { */ continuationToken?: string } - type _subnzypp = noSmithyDocumentSerde - interface ListBucketIntelligentTieringConfigurationsOutput extends _subnzypp { + type _subNsryO = noSmithyDocumentSerde + interface ListBucketIntelligentTieringConfigurationsOutput extends _subNsryO { /** * The ContinuationToken that represents a placeholder from where this request * should begin. @@ -29245,8 +29202,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subBEkvG = noSmithyDocumentSerde - interface ListBucketInventoryConfigurationsInput extends _subBEkvG { + type _subJIdrm = noSmithyDocumentSerde + interface ListBucketInventoryConfigurationsInput extends _subJIdrm { /** * The name of the bucket containing the inventory configurations to retrieve. * @@ -29267,8 +29224,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subNlUiN = noSmithyDocumentSerde - interface ListBucketInventoryConfigurationsOutput extends _subNlUiN { + type _subzajyU = noSmithyDocumentSerde + interface ListBucketInventoryConfigurationsOutput extends _subzajyU { /** * If sent in the request, the marker that is used as a starting point for this * inventory configuration list response. @@ -29295,8 +29252,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subuBMnM = noSmithyDocumentSerde - interface ListBucketMetricsConfigurationsInput extends _subuBMnM { + type _subxcLXa = noSmithyDocumentSerde + interface ListBucketMetricsConfigurationsInput extends _subxcLXa { /** * The name of the bucket containing the metrics configurations to retrieve. * @@ -29317,8 +29274,8 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subWAvdQ = noSmithyDocumentSerde - interface ListBucketMetricsConfigurationsOutput extends _subWAvdQ { + type _subMszAf = noSmithyDocumentSerde + interface ListBucketMetricsConfigurationsOutput extends _subMszAf { /** * The marker that is used as a starting point for this metrics configuration list * response. This value is present if it was sent in the request. @@ -29346,8 +29303,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subDHJJR = noSmithyDocumentSerde - interface ListBucketsInput extends _subDHJJR { + type _subTphwv = noSmithyDocumentSerde + interface ListBucketsInput extends _subTphwv { /** * ContinuationToken indicates to Amazon S3 that the list is being continued on * this bucket with a token. ContinuationToken is obfuscated and is not a real @@ -29365,8 +29322,8 @@ namespace s3 { */ maxBuckets?: number } - type _subZmNtO = noSmithyDocumentSerde - interface ListBucketsOutput extends _subZmNtO { + type _subHwIvk = noSmithyDocumentSerde + interface ListBucketsOutput extends _subHwIvk { /** * The list of buckets owned by the requester. */ @@ -29387,8 +29344,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subymSpX = noSmithyDocumentSerde - interface ListDirectoryBucketsInput extends _subymSpX { + type _subQszFC = noSmithyDocumentSerde + interface ListDirectoryBucketsInput extends _subQszFC { /** * ContinuationToken indicates to Amazon S3 that the list is being continued on * buckets in this account with a token. ContinuationToken is obfuscated and is @@ -29403,8 +29360,8 @@ namespace s3 { */ maxDirectoryBuckets?: number } - type _subHVtMn = noSmithyDocumentSerde - interface ListDirectoryBucketsOutput extends _subHVtMn { + type _subPQBWD = noSmithyDocumentSerde + interface ListDirectoryBucketsOutput extends _subPQBWD { /** * The list of buckets owned by the requester. */ @@ -29419,8 +29376,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subZXicn = noSmithyDocumentSerde - interface ListMultipartUploadsInput extends _subZXicn { + type _subsUpLq = noSmithyDocumentSerde + interface ListMultipartUploadsInput extends _subsUpLq { /** * The name of the bucket to which the multipart upload was initiated. * @@ -29566,8 +29523,8 @@ namespace s3 { */ uploadIdMarker?: string } - type _subopNEP = noSmithyDocumentSerde - interface ListMultipartUploadsOutput extends _subopNEP { + type _subESnvi = noSmithyDocumentSerde + interface ListMultipartUploadsOutput extends _subESnvi { /** * The name of the bucket to which the multipart upload was initiated. Does not * return the access point ARN or access point alias if used. @@ -29662,8 +29619,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subYLZDQ = noSmithyDocumentSerde - interface ListObjectVersionsInput extends _subYLZDQ { + type _submRLUM = noSmithyDocumentSerde + interface ListObjectVersionsInput extends _submRLUM { /** * The bucket name that contains the objects. * @@ -29744,8 +29701,8 @@ namespace s3 { */ versionIdMarker?: string } - type _subHQVKY = noSmithyDocumentSerde - interface ListObjectVersionsOutput extends _subHQVKY { + type _subIJpmm = noSmithyDocumentSerde + interface ListObjectVersionsOutput extends _subIJpmm { /** * All of the keys rolled up into a common prefix count as a single return when * calculating the number of returns. @@ -29830,8 +29787,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subpZPkc = noSmithyDocumentSerde - interface ListObjectsInput extends _subpZPkc { + type _subzfSDR = noSmithyDocumentSerde + interface ListObjectsInput extends _subzfSDR { /** * The name of the bucket containing the objects. * @@ -29924,8 +29881,8 @@ namespace s3 { */ requestPayer: types.RequestPayer } - type _subOSJeO = noSmithyDocumentSerde - interface ListObjectsOutput extends _subOSJeO { + type _subiNexF = noSmithyDocumentSerde + interface ListObjectsOutput extends _subiNexF { /** * All of the keys (up to 1,000) rolled up in a common prefix count as a single * return when calculating the number of returns. @@ -30019,8 +29976,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subYNZGG = noSmithyDocumentSerde - interface ListObjectsV2Input extends _subYNZGG { + type _subjIzNE = noSmithyDocumentSerde + interface ListObjectsV2Input extends _subjIzNE { /** * Directory buckets - When you use this operation with a directory bucket, you * must use virtual-hosted-style requests in the format @@ -30146,8 +30103,8 @@ namespace s3 { */ startAfter?: string } - type _subMMqpa = noSmithyDocumentSerde - interface ListObjectsV2Output extends _subMMqpa { + type _subwzDqH = noSmithyDocumentSerde + interface ListObjectsV2Output extends _subwzDqH { /** * All of the keys (up to 1,000) that share the same prefix are grouped together. * When counting the total numbers of returns by this API operation, this group of @@ -30264,8 +30221,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subLIeSp = noSmithyDocumentSerde - interface ListPartsInput extends _subLIeSp { + type _subyXYCR = noSmithyDocumentSerde + interface ListPartsInput extends _subyXYCR { /** * The name of the bucket to which the parts are being uploaded. * @@ -30375,8 +30332,8 @@ namespace s3 { */ sseCustomerKeyMD5?: string } - type _subVoJFh = noSmithyDocumentSerde - interface ListPartsOutput extends _subVoJFh { + type _subflroF = noSmithyDocumentSerde + interface ListPartsOutput extends _subflroF { /** * If the bucket has a lifecycle rule configured with an action to abort * incomplete multipart uploads and the prefix in the lifecycle rule matches the @@ -30478,8 +30435,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subdvmub = noSmithyDocumentSerde - interface PutBucketAccelerateConfigurationInput extends _subdvmub { + type _subtigAb = noSmithyDocumentSerde + interface PutBucketAccelerateConfigurationInput extends _subtigAb { /** * Container for setting the transfer acceleration state. * @@ -30513,15 +30470,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subIvJxE = noSmithyDocumentSerde - interface PutBucketAccelerateConfigurationOutput extends _subIvJxE { + type _subQbWOK = noSmithyDocumentSerde + interface PutBucketAccelerateConfigurationOutput extends _subQbWOK { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subYpAFl = noSmithyDocumentSerde - interface PutBucketAclInput extends _subYpAFl { + type _subSjgdG = noSmithyDocumentSerde + interface PutBucketAclInput extends _subSjgdG { /** * The bucket to which to apply the ACL. * @@ -30592,15 +30549,15 @@ namespace s3 { */ grantWriteACP?: string } - type _sublhrtH = noSmithyDocumentSerde - interface PutBucketAclOutput extends _sublhrtH { + type _subcbxne = noSmithyDocumentSerde + interface PutBucketAclOutput extends _subcbxne { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subZSIfw = noSmithyDocumentSerde - interface PutBucketAnalyticsConfigurationInput extends _subZSIfw { + type _subsMlet = noSmithyDocumentSerde + interface PutBucketAnalyticsConfigurationInput extends _subsMlet { /** * The configuration and any analyses for the analytics filter. * @@ -30626,15 +30583,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subRNcDs = noSmithyDocumentSerde - interface PutBucketAnalyticsConfigurationOutput extends _subRNcDs { + type _subHOpFQ = noSmithyDocumentSerde + interface PutBucketAnalyticsConfigurationOutput extends _subHOpFQ { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subMrBSr = noSmithyDocumentSerde - interface PutBucketCorsInput extends _subMrBSr { + type _subSWBAD = noSmithyDocumentSerde + interface PutBucketCorsInput extends _subSWBAD { /** * Specifies the bucket impacted by the cors configuration. * @@ -30682,15 +30639,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subGcPQY = noSmithyDocumentSerde - interface PutBucketCorsOutput extends _subGcPQY { + type _subjWSXi = noSmithyDocumentSerde + interface PutBucketCorsOutput extends _subjWSXi { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subWpkys = noSmithyDocumentSerde - interface PutBucketEncryptionInput extends _subWpkys { + type _subZrxRN = noSmithyDocumentSerde + interface PutBucketEncryptionInput extends _subZrxRN { /** * Specifies default encryption for a bucket using server-side encryption with * different key options. @@ -30753,15 +30710,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subQzgEL = noSmithyDocumentSerde - interface PutBucketEncryptionOutput extends _subQzgEL { + type _submGsGB = noSmithyDocumentSerde + interface PutBucketEncryptionOutput extends _submGsGB { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subusqpL = noSmithyDocumentSerde - interface PutBucketIntelligentTieringConfigurationInput extends _subusqpL { + type _subJmtZy = noSmithyDocumentSerde + interface PutBucketIntelligentTieringConfigurationInput extends _subJmtZy { /** * The name of the Amazon S3 bucket whose configuration you want to modify or * retrieve. @@ -30782,15 +30739,15 @@ namespace s3 { */ intelligentTieringConfiguration?: types.IntelligentTieringConfiguration } - type _subCYkED = noSmithyDocumentSerde - interface PutBucketIntelligentTieringConfigurationOutput extends _subCYkED { + type _subzegRn = noSmithyDocumentSerde + interface PutBucketIntelligentTieringConfigurationOutput extends _subzegRn { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subEDQDU = noSmithyDocumentSerde - interface PutBucketInventoryConfigurationInput extends _subEDQDU { + type _subFOyUH = noSmithyDocumentSerde + interface PutBucketInventoryConfigurationInput extends _subFOyUH { /** * The name of the bucket where the inventory configuration will be stored. * @@ -30816,15 +30773,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subrBuEk = noSmithyDocumentSerde - interface PutBucketInventoryConfigurationOutput extends _subrBuEk { + type _subFUOFd = noSmithyDocumentSerde + interface PutBucketInventoryConfigurationOutput extends _subFUOFd { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subNvNOa = noSmithyDocumentSerde - interface PutBucketLifecycleConfigurationInput extends _subNvNOa { + type _subILaTt = noSmithyDocumentSerde + interface PutBucketLifecycleConfigurationInput extends _subILaTt { /** * The name of the bucket for which to set the configuration. * @@ -30875,8 +30832,8 @@ namespace s3 { */ transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize } - type _subGWwQT = noSmithyDocumentSerde - interface PutBucketLifecycleConfigurationOutput extends _subGWwQT { + type _subwdllN = noSmithyDocumentSerde + interface PutBucketLifecycleConfigurationOutput extends _subwdllN { /** * Indicates which default minimum object size behavior is applied to the * lifecycle configuration. @@ -30901,8 +30858,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subuRdDU = noSmithyDocumentSerde - interface PutBucketLoggingInput extends _subuRdDU { + type _subMirfx = noSmithyDocumentSerde + interface PutBucketLoggingInput extends _subMirfx { /** * The name of the bucket for which to set the logging parameters. * @@ -30943,15 +30900,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subVqzPz = noSmithyDocumentSerde - interface PutBucketLoggingOutput extends _subVqzPz { + type _subIGUPl = noSmithyDocumentSerde + interface PutBucketLoggingOutput extends _subIGUPl { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subAuGIi = noSmithyDocumentSerde - interface PutBucketMetricsConfigurationInput extends _subAuGIi { + type _subqnExZ = noSmithyDocumentSerde + interface PutBucketMetricsConfigurationInput extends _subqnExZ { /** * The name of the bucket for which the metrics configuration is set. * @@ -30978,15 +30935,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subZZnAv = noSmithyDocumentSerde - interface PutBucketMetricsConfigurationOutput extends _subZZnAv { + type _subkJTeS = noSmithyDocumentSerde + interface PutBucketMetricsConfigurationOutput extends _subkJTeS { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subVChPt = noSmithyDocumentSerde - interface PutBucketNotificationConfigurationInput extends _subVChPt { + type _subZxDVa = noSmithyDocumentSerde + interface PutBucketNotificationConfigurationInput extends _subZxDVa { /** * The name of the bucket. * @@ -31012,15 +30969,15 @@ namespace s3 { */ skipDestinationValidation?: boolean } - type _subzhWTS = noSmithyDocumentSerde - interface PutBucketNotificationConfigurationOutput extends _subzhWTS { + type _subyIqiK = noSmithyDocumentSerde + interface PutBucketNotificationConfigurationOutput extends _subyIqiK { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subUkynR = noSmithyDocumentSerde - interface PutBucketOwnershipControlsInput extends _subUkynR { + type _subKxghv = noSmithyDocumentSerde + interface PutBucketOwnershipControlsInput extends _subKxghv { /** * The name of the Amazon S3 bucket whose OwnershipControls you want to set. * @@ -31048,15 +31005,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subgncqn = noSmithyDocumentSerde - interface PutBucketOwnershipControlsOutput extends _subgncqn { + type _subNDidY = noSmithyDocumentSerde + interface PutBucketOwnershipControlsOutput extends _subNDidY { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subfjRvj = noSmithyDocumentSerde - interface PutBucketPolicyInput extends _subfjRvj { + type _subkSYiw = noSmithyDocumentSerde + interface PutBucketPolicyInput extends _subkSYiw { /** * The name of the bucket. * @@ -31144,15 +31101,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subJNMQZ = noSmithyDocumentSerde - interface PutBucketPolicyOutput extends _subJNMQZ { + type _subiLJek = noSmithyDocumentSerde + interface PutBucketPolicyOutput extends _subiLJek { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subhBUWh = noSmithyDocumentSerde - interface PutBucketReplicationInput extends _subhBUWh { + type _subOPvAT = noSmithyDocumentSerde + interface PutBucketReplicationInput extends _subOPvAT { /** * The name of the bucket * @@ -31202,15 +31159,15 @@ namespace s3 { */ token?: string } - type _subhwzAr = noSmithyDocumentSerde - interface PutBucketReplicationOutput extends _subhwzAr { + type _subxOphO = noSmithyDocumentSerde + interface PutBucketReplicationOutput extends _subxOphO { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subyrzSF = noSmithyDocumentSerde - interface PutBucketRequestPaymentInput extends _subyrzSF { + type _subGtezW = noSmithyDocumentSerde + interface PutBucketRequestPaymentInput extends _subGtezW { /** * The bucket name. * @@ -31255,15 +31212,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _sublqlWX = noSmithyDocumentSerde - interface PutBucketRequestPaymentOutput extends _sublqlWX { + type _subgDjyR = noSmithyDocumentSerde + interface PutBucketRequestPaymentOutput extends _subgDjyR { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subsIsNs = noSmithyDocumentSerde - interface PutBucketTaggingInput extends _subsIsNs { + type _subyNhEL = noSmithyDocumentSerde + interface PutBucketTaggingInput extends _subyNhEL { /** * The bucket name. * @@ -31308,15 +31265,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subJklpP = noSmithyDocumentSerde - interface PutBucketTaggingOutput extends _subJklpP { + type _subgDkcm = noSmithyDocumentSerde + interface PutBucketTaggingOutput extends _subgDkcm { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subZTOJl = noSmithyDocumentSerde - interface PutBucketVersioningInput extends _subZTOJl { + type _subLQukt = noSmithyDocumentSerde + interface PutBucketVersioningInput extends _subLQukt { /** * The bucket name. * @@ -31366,15 +31323,15 @@ namespace s3 { */ mfa?: string } - type _subGTuLM = noSmithyDocumentSerde - interface PutBucketVersioningOutput extends _subGTuLM { + type _subpbotJ = noSmithyDocumentSerde + interface PutBucketVersioningOutput extends _subpbotJ { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subnRJwE = noSmithyDocumentSerde - interface PutBucketWebsiteInput extends _subnRJwE { + type _subNROnV = noSmithyDocumentSerde + interface PutBucketWebsiteInput extends _subNROnV { /** * The bucket name. * @@ -31419,15 +31376,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _submkdXl = noSmithyDocumentSerde - interface PutBucketWebsiteOutput extends _submkdXl { + type _subVBInS = noSmithyDocumentSerde + interface PutBucketWebsiteOutput extends _subVBInS { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subeJRpI = noSmithyDocumentSerde - interface PutObjectInput extends _subeJRpI { + type _subIjPul = noSmithyDocumentSerde + interface PutObjectInput extends _subIjPul { /** * The bucket name to which the PUT action was initiated. * @@ -31944,8 +31901,8 @@ namespace s3 { */ websiteRedirectLocation?: string } - type _subPlEPr = noSmithyDocumentSerde - interface PutObjectOutput extends _subPlEPr { + type _subjaEwo = noSmithyDocumentSerde + interface PutObjectOutput extends _subjaEwo { /** * Indicates whether the uploaded object uses an S3 Bucket Key for server-side * encryption with Key Management Service (KMS) keys (SSE-KMS). @@ -32083,8 +32040,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subGFZDA = noSmithyDocumentSerde - interface PutObjectAclInput extends _subGFZDA { + type _subVpPqA = noSmithyDocumentSerde + interface PutObjectAclInput extends _subVpPqA { /** * The bucket name that contains the object to which you want to attach the ACL. * @@ -32210,8 +32167,8 @@ namespace s3 { */ versionId?: string } - type _subhYLJz = noSmithyDocumentSerde - interface PutObjectAclOutput extends _subhYLJz { + type _subVxRKD = noSmithyDocumentSerde + interface PutObjectAclOutput extends _subVxRKD { /** * If present, indicates that the requester was successfully charged for the * request. @@ -32224,8 +32181,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subyfpPe = noSmithyDocumentSerde - interface PutObjectLegalHoldInput extends _subyfpPe { + type _subbvBPU = noSmithyDocumentSerde + interface PutObjectLegalHoldInput extends _subbvBPU { /** * The bucket name containing the object that you want to place a legal hold on. * @@ -32299,8 +32256,8 @@ namespace s3 { */ versionId?: string } - type _subPWMsH = noSmithyDocumentSerde - interface PutObjectLegalHoldOutput extends _subPWMsH { + type _subDzyOS = noSmithyDocumentSerde + interface PutObjectLegalHoldOutput extends _subDzyOS { /** * If present, indicates that the requester was successfully charged for the * request. @@ -32313,8 +32270,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subpFViB = noSmithyDocumentSerde - interface PutObjectLockConfigurationInput extends _subpFViB { + type _subWezci = noSmithyDocumentSerde + interface PutObjectLockConfigurationInput extends _subWezci { /** * The bucket whose Object Lock configuration you want to create or replace. * @@ -32370,8 +32327,8 @@ namespace s3 { */ token?: string } - type _subCfBIC = noSmithyDocumentSerde - interface PutObjectLockConfigurationOutput extends _subCfBIC { + type _subarufO = noSmithyDocumentSerde + interface PutObjectLockConfigurationOutput extends _subarufO { /** * If present, indicates that the requester was successfully charged for the * request. @@ -32384,8 +32341,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subQDqpO = noSmithyDocumentSerde - interface PutObjectRetentionInput extends _subQDqpO { + type _subGRszz = noSmithyDocumentSerde + interface PutObjectRetentionInput extends _subGRszz { /** * The bucket name that contains the object you want to apply this Object * Retention configuration to. @@ -32465,8 +32422,8 @@ namespace s3 { */ versionId?: string } - type _subditGI = noSmithyDocumentSerde - interface PutObjectRetentionOutput extends _subditGI { + type _subrNawZ = noSmithyDocumentSerde + interface PutObjectRetentionOutput extends _subrNawZ { /** * If present, indicates that the requester was successfully charged for the * request. @@ -32479,8 +32436,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _suboiOeh = noSmithyDocumentSerde - interface PutObjectTaggingInput extends _suboiOeh { + type _subMqnHb = noSmithyDocumentSerde + interface PutObjectTaggingInput extends _subMqnHb { /** * The bucket name containing the object. * @@ -32564,8 +32521,8 @@ namespace s3 { */ versionId?: string } - type _subuVSga = noSmithyDocumentSerde - interface PutObjectTaggingOutput extends _subuVSga { + type _subTwuto = noSmithyDocumentSerde + interface PutObjectTaggingOutput extends _subTwuto { /** * The versionId of the object the tag-set was added to. */ @@ -32575,8 +32532,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subwMCvj = noSmithyDocumentSerde - interface PutPublicAccessBlockInput extends _subwMCvj { + type _subkucAm = noSmithyDocumentSerde + interface PutPublicAccessBlockInput extends _subkucAm { /** * The name of the Amazon S3 bucket whose PublicAccessBlock configuration you want * to set. @@ -32623,15 +32580,15 @@ namespace s3 { */ expectedBucketOwner?: string } - type _subKeqew = noSmithyDocumentSerde - interface PutPublicAccessBlockOutput extends _subKeqew { + type _subTHBGk = noSmithyDocumentSerde + interface PutPublicAccessBlockOutput extends _subTHBGk { /** * Metadata pertaining to the operation's result. */ resultMetadata: middleware.Metadata } - type _subkObCn = noSmithyDocumentSerde - interface RestoreObjectInput extends _subkObCn { + type _subBLDTT = noSmithyDocumentSerde + interface RestoreObjectInput extends _subBLDTT { /** * The bucket name containing the object to restore. * @@ -32706,8 +32663,8 @@ namespace s3 { */ versionId?: string } - type _subHBstk = noSmithyDocumentSerde - interface RestoreObjectOutput extends _subHBstk { + type _submerZr = noSmithyDocumentSerde + interface RestoreObjectOutput extends _submerZr { /** * If present, indicates that the requester was successfully charged for the * request. @@ -32741,8 +32698,8 @@ namespace s3 { * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ * [S3Select API Documentation]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html */ - type _subjzKEZ = noSmithyDocumentSerde - interface SelectObjectContentInput extends _subjzKEZ { + type _subSsfuY = noSmithyDocumentSerde + interface SelectObjectContentInput extends _subSsfuY { /** * The S3 bucket. * @@ -32832,8 +32789,8 @@ namespace s3 { */ scanRange?: types.ScanRange } - type _subGliMM = noSmithyDocumentSerde - interface SelectObjectContentOutput extends _subGliMM { + type _subWVucK = noSmithyDocumentSerde + interface SelectObjectContentOutput extends _subWVucK { /** * Metadata pertaining to the operation's result. */ @@ -32845,8 +32802,8 @@ namespace s3 { */ getStream(): (SelectObjectContentEventStream) } - type _subXWhvG = noSmithyDocumentSerde - interface UploadPartInput extends _subXWhvG { + type _subFirAv = noSmithyDocumentSerde + interface UploadPartInput extends _subFirAv { /** * The name of the bucket to which the multipart upload was initiated. * @@ -33019,8 +32976,8 @@ namespace s3 { */ sseCustomerKeyMD5?: string } - type _subuZGom = noSmithyDocumentSerde - interface UploadPartOutput extends _subuZGom { + type _subcuUYr = noSmithyDocumentSerde + interface UploadPartOutput extends _subcuUYr { /** * Indicates whether the multipart upload uses an S3 Bucket Key for server-side * encryption with Key Management Service (KMS) keys (SSE-KMS). @@ -33115,8 +33072,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subIrsiu = noSmithyDocumentSerde - interface UploadPartCopyInput extends _subIrsiu { + type _subdnmpc = noSmithyDocumentSerde + interface UploadPartCopyInput extends _subdnmpc { /** * The bucket name. * @@ -33377,8 +33334,8 @@ namespace s3 { */ sseCustomerKeyMD5?: string } - type _subCjJBx = noSmithyDocumentSerde - interface UploadPartCopyOutput extends _subCjJBx { + type _subCujVN = noSmithyDocumentSerde + interface UploadPartCopyOutput extends _subCujVN { /** * Indicates whether the multipart upload uses an S3 Bucket Key for server-side * encryption with Key Management Service (KMS) keys (SSE-KMS). @@ -33433,8 +33390,8 @@ namespace s3 { */ resultMetadata: middleware.Metadata } - type _subPezLW = noSmithyDocumentSerde - interface WriteGetObjectResponseInput extends _subPezLW { + type _subzKJfa = noSmithyDocumentSerde + interface WriteGetObjectResponseInput extends _subzKJfa { /** * Route prefix to the HTTP URL generated. * @@ -33716,8 +33673,8 @@ namespace s3 { */ versionId?: string } - type _subqFpGs = noSmithyDocumentSerde - interface WriteGetObjectResponseOutput extends _subqFpGs { + type _subVwCeO = noSmithyDocumentSerde + interface WriteGetObjectResponseOutput extends _subVwCeO { /** * Metadata pertaining to the operation's result. */ @@ -33912,926 +33869,626 @@ namespace s3 { } /** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. + * Package gcerr provides an error type for Go CDK APIs. */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation +namespace gcerr { + interface ErrorCode { + string(): string + } /** - * SchemaField defines a single schema field structure. + * An ErrorCode describes the error's category. */ - interface SchemaField { - system: boolean - id: string - name: string - type: string - required: boolean - /** - * Presentable indicates whether the field is suitable for - * visualization purposes (eg. in the Admin UI relation views). - */ - presentable: boolean + interface ErrorCode extends Number{} +} + +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { + /** + * Writer writes bytes to a blob. + * + * It implements io.WriteCloser (https://golang.org/pkg/io/#Closer), and must be + * closed after all writes are done. + */ + interface Writer { + } + interface Writer { /** - * Deprecated: This field is no-op and will be removed in future versions. - * Please use the collection.Indexes field to define a unique constraint. + * Write implements the io.Writer interface (https://golang.org/pkg/io/#Writer). + * + * Writes may happen asynchronously, so the returned error can be nil + * even if the actual write eventually fails. The write is only guaranteed to + * have succeeded if Close returns no error. */ - unique: boolean - options: any + write(p: string|Array): number } - interface SchemaField { + interface Writer { /** - * ColDefinition returns the field db column type definition as string. + * Close closes the blob writer. The write operation is not guaranteed to have succeeded until + * Close returns with no error. + * Close may return an error if the context provided to create the Writer is + * canceled or reaches its deadline. */ - colDefinition(): string + close(): void } - interface SchemaField { + interface Writer { /** - * String serializes and returns the current field as string. + * ReadFrom reads from r and writes to w until EOF or error. + * The return value is the number of bytes read from r. + * + * It implements the io.ReaderFrom interface. */ - string(): string + readFrom(r: io.Reader): number } - interface SchemaField { + /** + * ListOptions sets options for listing blobs via Bucket.List. + */ + interface ListOptions { /** - * MarshalJSON implements the [json.Marshaler] interface. + * Prefix indicates that only blobs with a key starting with this prefix + * should be returned. */ - marshalJSON(): string|Array - } - interface SchemaField { + prefix: string /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * Delimiter sets the delimiter used to define a hierarchical namespace, + * like a filesystem with "directories". It is highly recommended that you + * use "" or "/" as the Delimiter. Other values should work through this API, + * but service UIs generally assume "/". * - * The schema field options are auto initialized on success. + * An empty delimiter means that the bucket is treated as a single flat + * namespace. + * + * A non-empty delimiter means that any result with the delimiter in its key + * after Prefix is stripped will be returned with ListObject.IsDir = true, + * ListObject.Key truncated after the delimiter, and zero values for other + * ListObject fields. These results represent "directories". Multiple results + * in a "directory" are returned as a single result. */ - unmarshalJSON(data: string|Array): void + delimiter: string + /** + * BeforeList is a callback that will be called before each call to the + * the underlying service's list functionality. + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. + */ + beforeList: (asFunc: (_arg0: { + }) => boolean) => void } - interface SchemaField { + /** + * ListIterator iterates over List results. + */ + interface ListIterator { + } + interface ListIterator { /** - * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. + * Next returns a *ListObject for the next blob. It returns (nil, io.EOF) if + * there are no more. */ - validate(): void + next(ctx: context.Context): (ListObject) } - interface SchemaField { + /** + * SignedURLOptions sets options for SignedURL. + */ + interface SignedURLOptions { /** - * InitOptions initializes the current field options based on its type. + * Expiry sets how long the returned URL is valid for. + * Defaults to DefaultSignedURLExpiry. + */ + expiry: time.Duration + /** + * Method is the HTTP method that can be used on the URL; one of "GET", "PUT", + * or "DELETE". Defaults to "GET". + */ + method: string + /** + * ContentType specifies the Content-Type HTTP header the user agent is + * permitted to use in the PUT request. It must match exactly. See + * EnforceAbsentContentType for behavior when ContentType is the empty string. + * If a bucket does not implement this verification, then it returns an + * Unimplemented error. * - * Returns error on unknown field type. + * Must be empty for non-PUT requests. */ - initOptions(): void - } - interface SchemaField { + contentType: string /** - * PrepareValue returns normalized and properly formatted field value. + * If EnforceAbsentContentType is true and ContentType is the empty string, + * then PUTing to the signed URL will fail if the Content-Type header is + * present. Not all buckets support this: ones that do not will return an + * Unimplemented error. + * + * If EnforceAbsentContentType is false and ContentType is the empty string, + * then PUTing without a Content-Type header will succeed, but it is + * implementation-specific whether providing a Content-Type header will fail. + * + * Must be false for non-PUT requests. */ - prepareValue(value: any): any - } - interface SchemaField { + enforceAbsentContentType: boolean /** - * PrepareValueWithModifier returns normalized and properly formatted field value - * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). + * BeforeSign is a callback that will be called before each call to the + * the underlying service's sign functionality. + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. */ - prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any - } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - /** - * Model defines an interface with common methods that all db models should have. - */ - interface Model { - [key:string]: any; - tableName(): string - isNew(): boolean - markAsNew(): void - markAsNotNew(): void - hasId(): boolean - getId(): string - setId(id: string): void - getCreated(): types.DateTime - getUpdated(): types.DateTime - refreshId(): void - refreshCreated(): void - refreshUpdated(): void + beforeSign: (asFunc: (_arg0: { + }) => boolean) => void } /** - * BaseModel defines common fields and methods used by all other models. + * ReaderOptions sets options for NewReader and NewRangeReader. */ - interface BaseModel { - id: string - created: types.DateTime - updated: types.DateTime - } - interface BaseModel { + interface ReaderOptions { /** - * HasId returns whether the model has a nonzero id. + * BeforeRead is a callback that will be called before + * any data is read (unless NewReader returns an error before then, in which + * case it may not be called at all). + * + * Calling Seek may reset the underlying reader, and result in BeforeRead + * getting called again with a different underlying provider-specific reader.. + * + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. */ - hasId(): boolean + beforeRead: (asFunc: (_arg0: { + }) => boolean) => void } - interface BaseModel { + /** + * WriterOptions sets options for NewWriter. + */ + interface WriterOptions { /** - * GetId returns the model id. + * BufferSize changes the default size in bytes of the chunks that + * Writer will upload in a single request; larger blobs will be split into + * multiple requests. + * + * This option may be ignored by some drivers. + * + * If 0, the driver will choose a reasonable default. + * + * If the Writer is used to do many small writes concurrently, using a + * smaller BufferSize may reduce memory usage. */ - getId(): string - } - interface BaseModel { + bufferSize: number /** - * SetId sets the model id to the provided string value. + * MaxConcurrency changes the default concurrency for parts of an upload. + * + * This option may be ignored by some drivers. + * + * If 0, the driver will choose a reasonable default. */ - setId(id: string): void - } - interface BaseModel { + maxConcurrency: number /** - * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control */ - markAsNew(): void - } - interface BaseModel { + cacheControl: string /** - * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition */ - markAsNotNew(): void - } - interface BaseModel { + contentDisposition: string /** - * IsNew indicates what type of db query (insert or update) - * should be used with the model instance. + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding */ - isNew(): boolean - } - interface BaseModel { + contentEncoding: string /** - * GetCreated returns the model Created datetime. + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language */ - getCreated(): types.DateTime - } - interface BaseModel { + contentLanguage: string /** - * GetUpdated returns the model Updated datetime. + * ContentType specifies the MIME type of the blob being written. If not set, + * it will be inferred from the content using the algorithm described at + * http://mimesniff.spec.whatwg.org/. + * Set DisableContentTypeDetection to true to disable the above and force + * the ContentType to stay empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type */ - getUpdated(): types.DateTime - } - interface BaseModel { + contentType: string /** - * RefreshId generates and sets a new model id. - * - * The generated id is a cryptographically random 15 characters length string. + * When true, if ContentType is the empty string, it will stay the empty + * string rather than being inferred from the content. + * Note that while the blob will be written with an empty string ContentType, + * most providers will fill one in during reads, so don't expect an empty + * ContentType if you read the blob back. */ - refreshId(): void - } - interface BaseModel { + disableContentTypeDetection: boolean /** - * RefreshCreated updates the model Created field with the current datetime. + * ContentMD5 is used as a message integrity check. + * If len(ContentMD5) > 0, the MD5 hash of the bytes written must match + * ContentMD5, or Close will return an error without completing the write. + * https://tools.ietf.org/html/rfc1864 */ - refreshCreated(): void - } - interface BaseModel { + contentMD5: string|Array /** - * RefreshUpdated updates the model Updated field with the current datetime. + * Metadata holds key/value strings to be associated with the blob, or nil. + * Keys may not be empty, and are lowercased before being written. + * Duplicate case-insensitive keys (e.g., "foo" and "FOO") will result in + * an error. */ - refreshUpdated(): void - } - interface BaseModel { + metadata: _TygojaDict /** - * PostScan implements the [dbx.PostScanner] interface. + * BeforeWrite is a callback that will be called exactly once, before + * any data is written (unless NewWriter returns an error, in which case + * it will not be called at all). Note that this is not necessarily during + * or after the first Write call, as drivers may buffer bytes before + * sending an upload request. * - * It is executed right after the model was populated with the db row values. + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. */ - postScan(): void + beforeWrite: (asFunc: (_arg0: { + }) => boolean) => void } - // @ts-ignore - import validation = ozzo_validation /** - * CollectionBaseOptions defines the "base" Collection.Options fields. - */ - interface CollectionBaseOptions { - } - interface CollectionBaseOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - /** - * CollectionAuthOptions defines the "auth" Collection.Options fields. - */ - interface CollectionAuthOptions { - manageRule?: string - allowOAuth2Auth: boolean - allowUsernameAuth: boolean - allowEmailAuth: boolean - requireEmail: boolean - exceptEmailDomains: Array - onlyVerified: boolean - onlyEmailDomains: Array - minPasswordLength: number - } - interface CollectionAuthOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - /** - * CollectionViewOptions defines the "view" Collection.Options fields. + * CopyOptions sets options for Copy. */ - interface CollectionViewOptions { - query: string - } - interface CollectionViewOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - type _subOHEED = BaseModel - interface Log extends _subOHEED { - data: types.JsonMap - message: string - level: number - } - interface Log { - tableName(): string - } - type _subpuOmJ = BaseModel - interface Param extends _subpuOmJ { - key: string - value: types.JsonRaw - } - interface Param { - tableName(): string - } - interface TableInfoRow { + interface CopyOptions { /** - * the `db:"pk"` tag has special semantic so we cannot rename - * the original field without specifying a custom mapper + * BeforeCopy is a callback that will be called before the copy is + * initiated. + * + * asFunc converts its argument to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information. */ - pk: number - index: number - name: string - type: string - notNull: boolean - defaultValue: types.JsonRaw + beforeCopy: (asFunc: (_arg0: { + }) => boolean) => void } } /** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: - * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. * - * // Routes - * e.GET("/", hello) + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` + * Drivers that do not support context cancellation will not return until + * after the query is completed. * - * Learn more at https://echo.labstack.com + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. */ -namespace echo { - /** - * Binder is the interface that wraps the Bind method. - */ - interface Binder { - [key:string]: any; - bind(c: Context, i: { - }): void - } +namespace sql { /** - * ServableContext is interface that Echo context implementation must implement to be usable in middleware/handlers and - * be able to be routed by Router. + * IsolationLevel is the transaction isolation level used in [TxOptions]. */ - interface ServableContext { - [key:string]: any; + interface IsolationLevel extends Number{} + interface IsolationLevel { /** - * Reset resets the context after request completes. It must be called along - * with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. - * See `Echo#ServeHTTP()` + * String returns the name of the transaction isolation level. */ - reset(r: http.Request, w: http.ResponseWriter): void - } - // @ts-ignore - import stdContext = context - /** - * JSONSerializer is the interface that encodes and decodes JSON to and from interfaces. - */ - interface JSONSerializer { - [key:string]: any; - serialize(c: Context, i: { - }, indent: string): void - deserialize(c: Context, i: { - }): void - } - /** - * HTTPErrorHandler is a centralized HTTP error handler. - */ - interface HTTPErrorHandler {(c: Context, err: Error): void } - /** - * Validator is the interface that wraps the Validate function. - */ - interface Validator { - [key:string]: any; - validate(i: { - }): void + string(): string } /** - * Renderer is the interface that wraps the Render function. + * DBStats contains database statistics. */ - interface Renderer { - [key:string]: any; - render(_arg0: io.Writer, _arg1: string, _arg2: { - }, _arg3: Context): void + interface DBStats { + maxOpenConnections: number // Maximum number of open connections to the database. + /** + * Pool Status + */ + openConnections: number // The number of established connections both in use and idle. + inUse: number // The number of connections currently in use. + idle: number // The number of idle connections. + /** + * Counters + */ + waitCount: number // The total number of connections waited for. + waitDuration: time.Duration // The total time blocked waiting for a new connection. + maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. + maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. + maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. } /** - * Group is a set of sub-routes for a specified route. It can be used for inner - * routes that share a common middleware or functionality that should be separate - * from the parent echo instance while still inheriting from it. + * Conn represents a single database connection rather than a pool of database + * connections. Prefer running queries from [DB] unless there is a specific + * need for a continuous single database connection. + * + * A Conn must call [Conn.Close] to return the connection to the database pool + * and may do so concurrently with a running query. + * + * After a call to [Conn.Close], all operations on the + * connection fail with [ErrConnDone]. */ - interface Group { + interface Conn { } - interface Group { + interface Conn { /** - * Use implements `Echo#Use()` for sub-routes within the Group. - * Group middlewares are not executed on request when there is no matching route found. + * PingContext verifies the connection to the database is still alive. */ - use(...middleware: MiddlewareFunc[]): void + pingContext(ctx: context.Context): void } - interface Group { + interface Conn { /** - * CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. Panics on error. + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. */ - connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + execContext(ctx: context.Context, query: string, ...args: any[]): Result } - interface Group { + interface Conn { /** - * DELETE implements `Echo#DELETE()` for sub-routes within the Group. Panics on error. + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. */ - delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) } - interface Group { + interface Conn { /** - * GET implements `Echo#GET()` for sub-routes within the Group. Panics on error. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * the [*Row.Scan] method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) } - interface Group { + interface Conn { /** - * HEAD implements `Echo#HEAD()` for sub-routes within the Group. Panics on error. + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. */ - head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + prepareContext(ctx: context.Context, query: string): (Stmt) } - interface Group { + interface Conn { /** - * OPTIONS implements `Echo#OPTIONS()` for sub-routes within the Group. Panics on error. + * Raw executes f exposing the underlying driver connection for the + * duration of f. The driverConn must not be used outside of f. + * + * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable + * until [Conn.Close] is called. */ - options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + raw(f: (driverConn: any) => void): void } - interface Group { + interface Conn { /** - * PATCH implements `Echo#PATCH()` for sub-routes within the Group. Panics on error. + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. + * + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. */ - patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + beginTx(ctx: context.Context, opts: TxOptions): (Tx) } - interface Group { + interface Conn { /** - * POST implements `Echo#POST()` for sub-routes within the Group. Panics on error. + * Close returns the connection to the connection pool. + * All operations after a Close will return with [ErrConnDone]. + * Close is safe to call concurrently with other operations and will + * block until all other operations finish. It may be useful to first + * cancel any used context and then call close directly after. */ - post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + close(): void } - interface Group { - /** - * PUT implements `Echo#PUT()` for sub-routes within the Group. Panics on error. - */ - put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + /** + * ColumnType contains the name and type of a column. + */ + interface ColumnType { } - interface Group { + interface ColumnType { /** - * TRACE implements `Echo#TRACE()` for sub-routes within the Group. Panics on error. + * Name returns the name or alias of the column. */ - trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + name(): string } - interface Group { + interface ColumnType { /** - * Any implements `Echo#Any()` for sub-routes within the Group. Panics on error. + * Length returns the column type length for variable length column types such + * as text and binary field types. If the type length is unbounded the value will + * be [math.MaxInt64] (any database limits will still apply). + * If the column type is not variable length, such as an int, or if not supported + * by the driver ok is false. */ - any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + length(): [number, boolean] } - interface Group { + interface ColumnType { /** - * Match implements `Echo#Match()` for sub-routes within the Group. Panics on error. + * DecimalSize returns the scale and precision of a decimal type. + * If not applicable or if not supported ok is false. */ - match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + decimalSize(): [number, number, boolean] } - interface Group { + interface ColumnType { /** - * Group creates a new sub-group with prefix and optional sub-group-level middleware. - * Important! Group middlewares are only executed in case there was exact route match and not - * for 404 (not found) or 405 (method not allowed) cases. If this kind of behaviour is needed then add - * a catch-all route `/*` for the group which handler returns always 404 + * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. + * If a driver does not support this property ScanType will return + * the type of an empty interface. */ - group(prefix: string, ...middleware: MiddlewareFunc[]): (Group) + scanType(): any } - interface Group { + interface ColumnType { /** - * Static implements `Echo#Static()` for sub-routes within the Group. + * Nullable reports whether the column may be null. + * If a driver does not support this property ok will be false. */ - static(pathPrefix: string, fsRoot: string): RouteInfo + nullable(): [boolean, boolean] } - interface Group { + interface ColumnType { /** - * StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. + * DatabaseTypeName returns the database system name of the column type. If an empty + * string is returned, then the driver type name is not supported. + * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers + * are not included. + * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". */ - staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo + databaseTypeName(): string } - interface Group { - /** - * FileFS implements `Echo#FileFS()` for sub-routes within the Group. - */ - fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo + /** + * Row is the result of calling [DB.QueryRow] to select a single row. + */ + interface Row { } - interface Group { + interface Row { /** - * File implements `Echo#File()` for sub-routes within the Group. Panics on error. + * Scan copies the columns from the matched row into the values + * pointed at by dest. See the documentation on [Rows.Scan] for details. + * If more than one row matches the query, + * Scan uses the first row and discards the rest. If no row matches + * the query, Scan returns [ErrNoRows]. */ - file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo + scan(...dest: any[]): void } - interface Group { + interface Row { /** - * RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group. - * - * Example: `g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` + * Err provides a way for wrapping packages to check for + * query errors without calling [Row.Scan]. + * Err returns the error, if any, that was encountered while running the query. + * If this error is not nil, this error will also be returned from [Row.Scan]. */ - routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + err(): void } - interface Group { - /** - * Add implements `Echo#Add()` for sub-routes within the Group. Panics on error. - */ - add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + interface TokenConfig { + secret: string + duration: number } - interface Group { + interface TokenConfig { /** - * AddRoute registers a new Routable with Router + * Validate makes TokenConfig validatable by implementing [validation.Validatable] interface. */ - addRoute(route: Routable): RouteInfo + validate(): void } - /** - * IPExtractor is a function to extract IP addr from http.Request. - * Set appropriate one to Echo#IPExtractor. - * See https://echo.labstack.com/guide/ip-address for more details. - */ - interface IPExtractor {(_arg0: http.Request): string } - /** - * Logger defines the logging interface that Echo uses internally in few places. - * For logging in handlers use your own logger instance (dependency injected or package/public variable) from logging framework of your choice. - */ - interface Logger { - [key:string]: any; + interface SmtpConfig { + enabled: boolean + host: string + port: number + username: string + password: string /** - * Write provides writer interface for http.Server `ErrorLog` and for logging startup messages. - * `http.Server.ErrorLog` logs errors from accepting connections, unexpected behavior from handlers, - * and underlying FileSystem errors. - * `logger` middleware will use this method to write its JSON payload. + * SMTP AUTH - PLAIN (default) or LOGIN */ - write(p: string|Array): number + authMethod: string /** - * Error logs the error + * Whether to enforce TLS encryption for the mail server connection. + * + * When set to false StartTLS command is send, leaving the server + * to decide whether to upgrade the connection or not. */ - error(err: Error): void - } - /** - * Response wraps an http.ResponseWriter and implements its interface to be used - * by an HTTP handler to construct an HTTP response. - * See: https://golang.org/pkg/net/http/#ResponseWriter - */ - interface Response { - writer: http.ResponseWriter - status: number - size: number - committed: boolean - } - interface Response { + tls: boolean /** - * Header returns the header map for the writer that will be sent by - * WriteHeader. Changing the header after a call to WriteHeader (or Write) has - * no effect unless the modified headers were declared as trailers by setting - * the "Trailer" header before the call to WriteHeader (see example) - * To suppress implicit response headers, set their value to nil. - * Example: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers + * LocalName is optional domain name or IP address used for the + * EHLO/HELO exchange (if not explicitly set, defaults to "localhost"). + * + * This is required only by some SMTP servers, such as Gmail SMTP-relay. */ - header(): http.Header + localName: string } - interface Response { + interface SmtpConfig { /** - * Before registers a function which is called just before the response is written. + * Validate makes SmtpConfig validatable by implementing [validation.Validatable] interface. */ - before(fn: () => void): void + validate(): void } - interface Response { - /** - * After registers a function which is called just after the response is written. - * If the `Content-Length` is unknown, none of the after function is executed. - */ - after(fn: () => void): void + interface S3Config { + enabled: boolean + bucket: string + region: string + endpoint: string + accessKey: string + secret: string + forcePathStyle: boolean } - interface Response { + interface S3Config { /** - * WriteHeader sends an HTTP response header with status code. If WriteHeader is - * not called explicitly, the first call to Write will trigger an implicit - * WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly - * used to send error codes. + * Validate makes S3Config validatable by implementing [validation.Validatable] interface. */ - writeHeader(code: number): void + validate(): void } - interface Response { + interface BackupsConfig { /** - * Write writes the data to the connection as part of an HTTP reply. + * Cron is a cron expression to schedule auto backups, eg. "* * * * *". + * + * Leave it empty to disable the auto backups functionality. */ - write(b: string|Array): number - } - interface Response { + cron: string /** - * Flush implements the http.Flusher interface to allow an HTTP handler to flush - * buffered data to the client. - * See [http.Flusher](https://golang.org/pkg/net/http/#Flusher) + * CronMaxKeep is the max number of cron generated backups to + * keep before removing older entries. + * + * This field works only when the cron config has valid cron expression. */ - flush(): void - } - interface Response { + cronMaxKeep: number /** - * Hijack implements the http.Hijacker interface to allow an HTTP handler to - * take over the connection. - * See [http.Hijacker](https://golang.org/pkg/net/http/#Hijacker) + * S3 is an optional S3 storage config specifying where to store the app backups. */ - hijack(): [net.Conn, (bufio.ReadWriter)] + s3: S3Config } - interface Response { + interface BackupsConfig { /** - * Unwrap returns the original http.ResponseWriter. - * ResponseController can be used to access the original http.ResponseWriter. - * See [https://go.dev/blog/go1.20] + * Validate makes BackupsConfig validatable by implementing [validation.Validatable] interface. */ - unwrap(): http.ResponseWriter - } - interface Routes { - /** - * Reverse reverses route to URL string by replacing path parameters with given params values. - */ - reverse(name: string, ...params: { - }[]): string - } - interface Routes { - /** - * FindByMethodPath searched for matching route info by method and path - */ - findByMethodPath(method: string, path: string): RouteInfo - } - interface Routes { - /** - * FilterByMethod searched for matching route info by method - */ - filterByMethod(method: string): Routes - } - interface Routes { - /** - * FilterByPath searched for matching route info by path - */ - filterByPath(path: string): Routes - } - interface Routes { - /** - * FilterByName searched for matching route info by name - */ - filterByName(name: string): Routes - } - /** - * Router is interface for routing request contexts to registered routes. - * - * Contract between Echo/Context instance and the router: - * ``` - * - all routes must be added through methods on echo.Echo instance. - * Reason: Echo instance uses RouteInfo.Params() length to allocate slice for paths parameters (see `Echo.contextPathParamAllocSize`). - * - Router must populate Context during Router.Route call with: - * - RoutableContext.SetPath - * - RoutableContext.SetRawPathParams (IMPORTANT! with same slice pointer that c.RawPathParams() returns) - * - RoutableContext.SetRouteInfo - * And optionally can set additional information to Context with RoutableContext.Set - * ``` - */ - interface Router { - [key:string]: any; - /** - * Add registers Routable with the Router and returns registered RouteInfo - */ - add(routable: Routable): RouteInfo - /** - * Remove removes route from the Router - */ - remove(method: string, path: string): void - /** - * Routes returns information about all registered routes - */ - routes(): Routes - /** - * Route searches Router for matching route and applies it to the given context. In case when no matching method - * was not found (405) or no matching route exists for path (404), router will return its implementation of 405/404 - * handler function. - */ - route(c: RoutableContext): HandlerFunc - } - /** - * Routable is interface for registering Route with Router. During route registration process the Router will - * convert Routable to RouteInfo with ToRouteInfo method. By creating custom implementation of Routable additional - * information about registered route can be stored in Routes (i.e. privileges used with route etc.) - */ - interface Routable { - [key:string]: any; - /** - * ToRouteInfo converts Routable to RouteInfo - * - * This method is meant to be used by Router after it parses url for path parameters, to store information about - * route just added. - */ - toRouteInfo(params: Array): RouteInfo - /** - * ToRoute converts Routable to Route which Router uses to register the method handler for path. - * - * This method is meant to be used by Router to get fields (including handler and middleware functions) needed to - * add Route to Router. - */ - toRoute(): Route - /** - * ForGroup recreates routable with added group prefix and group middlewares it is grouped to. - * - * Is necessary for Echo.Group to be able to add/register Routable with Router and having group prefix and group - * middlewares included in actually registered Route. - */ - forGroup(pathPrefix: string, middlewares: Array): Routable - } - /** - * Routes is collection of RouteInfo instances with various helper methods. - */ - interface Routes extends Array{} - /** - * RouteInfo describes registered route base fields. - * Method+Path pair uniquely identifies the Route. Name can have duplicates. - */ - interface RouteInfo { - [key:string]: any; - method(): string - path(): string - name(): string - params(): Array - /** - * Reverse reverses route to URL string by replacing path parameters with given params values. - */ - reverse(...params: { - }[]): string - } - /** - * PathParams is collections of PathParam instances with various helper methods - */ - interface PathParams extends Array{} - interface PathParams { - /** - * Get returns path parameter value for given name or default value. - */ - get(name: string, defaultValue: string): string - } -} - -/** - * Package oauth2 provides support for making - * OAuth2 authorized and authenticated HTTP requests, - * as specified in RFC 6749. - * It can additionally grant authorization with Bearer JWT. - */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. - */ -namespace oauth2 { - /** - * An AuthCodeOption is passed to Config.AuthCodeURL. - */ - interface AuthCodeOption { - [key:string]: any; - } - /** - * Token represents the credentials used to authorize - * the requests to access protected resources on the OAuth 2.0 - * provider's backend. - * - * Most users of this package should not access fields of Token - * directly. They're exported mostly for use by related packages - * implementing derivative OAuth2 flows. - */ - interface Token { - /** - * AccessToken is the token that authorizes and authenticates - * the requests. - */ - accessToken: string - /** - * TokenType is the type of token. - * The Type method returns either this or "Bearer", the default. - */ - tokenType: string - /** - * RefreshToken is a token that's used by the application - * (as opposed to the user) to refresh the access token - * if it expires. - */ - refreshToken: string - /** - * Expiry is the optional expiration time of the access token. - * - * If zero, TokenSource implementations will reuse the same - * token forever and RefreshToken or equivalent - * mechanisms for that TokenSource will not be used. - */ - expiry: time.Time - /** - * ExpiresIn is the OAuth2 wire format "expires_in" field, - * which specifies how many seconds later the token expires, - * relative to an unknown time base approximately around "now". - * It is the application's responsibility to populate - * `Expiry` from `ExpiresIn` when required. - */ - expiresIn: number - } - interface Token { - /** - * Type returns t.TokenType if non-empty, else "Bearer". - */ - type(): string - } - interface Token { - /** - * SetAuthHeader sets the Authorization header to r using the access - * token in t. - * - * This method is unnecessary when using Transport or an HTTP Client - * returned by this package. - */ - setAuthHeader(r: http.Request): void - } - interface Token { - /** - * WithExtra returns a new Token that's a clone of t, but using the - * provided raw extra map. This is only intended for use by packages - * implementing derivative OAuth2 flows. - */ - withExtra(extra: { - }): (Token) - } - interface Token { - /** - * Extra returns an extra field. - * Extra fields are key-value pairs returned by the server as a - * part of the token retrieval response. - */ - extra(key: string): { - } - } - interface Token { - /** - * Valid reports whether t is non-nil, has an AccessToken, and is not expired. - */ - valid(): boolean - } -} - -namespace mailer { - /** - * Mailer defines a base mail client interface. - */ - interface Mailer { - [key:string]: any; - /** - * Send sends an email with the provided Message. - */ - send(message: Message): void - } -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - interface TokenConfig { - secret: string - duration: number - } - interface TokenConfig { - /** - * Validate makes TokenConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface SmtpConfig { - enabled: boolean - host: string - port: number - username: string - password: string - /** - * SMTP AUTH - PLAIN (default) or LOGIN - */ - authMethod: string - /** - * Whether to enforce TLS encryption for the mail server connection. - * - * When set to false StartTLS command is send, leaving the server - * to decide whether to upgrade the connection or not. - */ - tls: boolean - /** - * LocalName is optional domain name or IP address used for the - * EHLO/HELO exchange (if not explicitly set, defaults to "localhost"). - * - * This is required only by some SMTP servers, such as Gmail SMTP-relay. - */ - localName: string - } - interface SmtpConfig { - /** - * Validate makes SmtpConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface S3Config { - enabled: boolean - bucket: string - region: string - endpoint: string - accessKey: string - secret: string - forcePathStyle: boolean - } - interface S3Config { - /** - * Validate makes S3Config validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface BackupsConfig { - /** - * Cron is a cron expression to schedule auto backups, eg. "* * * * *". - * - * Leave it empty to disable the auto backups functionality. - */ - cron: string - /** - * CronMaxKeep is the max number of cron generated backups to - * keep before removing older entries. - * - * This field works only when the cron config has valid cron expression. - */ - cronMaxKeep: number - /** - * S3 is an optional S3 storage config specifying where to store the app backups. - */ - s3: S3Config - } - interface BackupsConfig { - /** - * Validate makes BackupsConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void + validate(): void } interface MetaConfig { appName: string @@ -34899,22 +34556,41 @@ namespace settings { } } -/** - * Package daos handles common PocketBase DB model manipulations. - * - * Think of daos as DB repository and service layer in one. - */ -namespace daos { - interface LogsStatsItem { - total: number - date: types.DateTime - } +namespace subscriptions { /** - * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. + * Broker defines a struct for managing subscriptions clients. */ - interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } - // @ts-ignore - import validation = ozzo_validation + interface Broker { + } + interface Broker { + /** + * Clients returns a shallow copy of all registered clients indexed + * with their connection id. + */ + clients(): _TygojaDict + } + interface Broker { + /** + * ClientById finds a registered client by its id. + * + * Returns non-nil error when client with clientId is not registered. + */ + clientById(clientId: string): Client + } + interface Broker { + /** + * Register adds a new client to the broker instance. + */ + register(client: Client): void + } + interface Broker { + /** + * Unregister removes a single client by its id. + * + * If client with clientId doesn't exist, this method does nothing. + */ + unregister(clientId: string): void + } } /** @@ -35407,73 +35083,458 @@ namespace slog { } } -namespace subscriptions { +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation /** - * Broker defines a struct for managing subscriptions clients. + * SchemaField defines a single schema field structure. */ - interface Broker { + interface SchemaField { + system: boolean + id: string + name: string + type: string + required: boolean + /** + * Presentable indicates whether the field is suitable for + * visualization purposes (eg. in the Admin UI relation views). + */ + presentable: boolean + /** + * Deprecated: This field is no-op and will be removed in future versions. + * Please use the collection.Indexes field to define a unique constraint. + */ + unique: boolean + options: any } - interface Broker { + interface SchemaField { /** - * Clients returns a shallow copy of all registered clients indexed - * with their connection id. + * ColDefinition returns the field db column type definition as string. */ - clients(): _TygojaDict + colDefinition(): string } - interface Broker { + interface SchemaField { /** - * ClientById finds a registered client by its id. + * String serializes and returns the current field as string. + */ + string(): string + } + interface SchemaField { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface SchemaField { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. * - * Returns non-nil error when client with clientId is not registered. + * The schema field options are auto initialized on success. */ - clientById(clientId: string): Client + unmarshalJSON(data: string|Array): void } - interface Broker { + interface SchemaField { /** - * Register adds a new client to the broker instance. + * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. */ - register(client: Client): void + validate(): void } - interface Broker { + interface SchemaField { /** - * Unregister removes a single client by its id. + * InitOptions initializes the current field options based on its type. * - * If client with clientId doesn't exist, this method does nothing. + * Returns error on unknown field type. */ - unregister(clientId: string): void + initOptions(): void + } + interface SchemaField { + /** + * PrepareValue returns normalized and properly formatted field value. + */ + prepareValue(value: any): any + } + interface SchemaField { + /** + * PrepareValueWithModifier returns normalized and properly formatted field value + * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). + */ + prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any } } /** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. + * Package models implements all PocketBase DB models and DTOs. */ -namespace core { - interface BootstrapEvent { - app: App - } - interface TerminateEvent { - app: App - isRestart: boolean +namespace models { + /** + * Model defines an interface with common methods that all db models should have. + */ + interface Model { + [key:string]: any; + tableName(): string + isNew(): boolean + markAsNew(): void + markAsNotNew(): void + hasId(): boolean + getId(): string + setId(id: string): void + getCreated(): types.DateTime + getUpdated(): types.DateTime + refreshId(): void + refreshCreated(): void + refreshUpdated(): void } - interface ServeEvent { - app: App - router?: echo.Echo - server?: http.Server - certManager?: any + /** + * BaseModel defines common fields and methods used by all other models. + */ + interface BaseModel { + id: string + created: types.DateTime + updated: types.DateTime } - interface ApiErrorEvent { - httpContext: echo.Context - error: Error + interface BaseModel { + /** + * HasId returns whether the model has a nonzero id. + */ + hasId(): boolean } - type _subyaEim = BaseModelEvent - interface ModelEvent extends _subyaEim { - dao?: daos.Dao + interface BaseModel { + /** + * GetId returns the model id. + */ + getId(): string } - type _subskeUa = BaseCollectionEvent - interface MailerRecordEvent extends _subskeUa { - mailClient: mailer.Mailer + interface BaseModel { + /** + * SetId sets the model id to the provided string value. + */ + setId(id: string): void + } + interface BaseModel { + /** + * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). + */ + markAsNew(): void + } + interface BaseModel { + /** + * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) + */ + markAsNotNew(): void + } + interface BaseModel { + /** + * IsNew indicates what type of db query (insert or update) + * should be used with the model instance. + */ + isNew(): boolean + } + interface BaseModel { + /** + * GetCreated returns the model Created datetime. + */ + getCreated(): types.DateTime + } + interface BaseModel { + /** + * GetUpdated returns the model Updated datetime. + */ + getUpdated(): types.DateTime + } + interface BaseModel { + /** + * RefreshId generates and sets a new model id. + * + * The generated id is a cryptographically random 15 characters length string. + */ + refreshId(): void + } + interface BaseModel { + /** + * RefreshCreated updates the model Created field with the current datetime. + */ + refreshCreated(): void + } + interface BaseModel { + /** + * RefreshUpdated updates the model Updated field with the current datetime. + */ + refreshUpdated(): void + } + interface BaseModel { + /** + * PostScan implements the [dbx.PostScanner] interface. + * + * It is executed right after the model was populated with the db row values. + */ + postScan(): void + } + // @ts-ignore + import validation = ozzo_validation + /** + * CollectionBaseOptions defines the "base" Collection.Options fields. + */ + interface CollectionBaseOptions { + } + interface CollectionBaseOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + /** + * CollectionAuthOptions defines the "auth" Collection.Options fields. + */ + interface CollectionAuthOptions { + manageRule?: string + allowOAuth2Auth: boolean + allowUsernameAuth: boolean + allowEmailAuth: boolean + requireEmail: boolean + exceptEmailDomains: Array + onlyVerified: boolean + onlyEmailDomains: Array + minPasswordLength: number + } + interface CollectionAuthOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + /** + * CollectionViewOptions defines the "view" Collection.Options fields. + */ + interface CollectionViewOptions { + query: string + } + interface CollectionViewOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + type _subfMtQV = BaseModel + interface Log extends _subfMtQV { + data: types.JsonMap + message: string + level: number + } + interface Log { + tableName(): string + } + type _subFKVHZ = BaseModel + interface Param extends _subFKVHZ { + key: string + value: types.JsonRaw + } + interface Param { + tableName(): string + } + interface TableInfoRow { + /** + * the `db:"pk"` tag has special semantic so we cannot rename + * the original field without specifying a custom mapper + */ + pk: number + index: number + name: string + type: string + notNull: boolean + defaultValue: types.JsonRaw + } +} + +/** + * Package daos handles common PocketBase DB model manipulations. + * + * Think of daos as DB repository and service layer in one. + */ +namespace daos { + interface LogsStatsItem { + total: number + date: types.DateTime + } + /** + * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. + */ + interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } + // @ts-ignore + import validation = ozzo_validation +} + +namespace migrate { + interface Migration { + file: string + up: (db: dbx.Builder) => void + down: (db: dbx.Builder) => void + } +} + +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } + // @ts-ignore + import flag = pflag + /** + * FParseErrWhitelist configures Flag parse errors to be ignored + */ + interface FParseErrWhitelist extends _TygojaAny{} + /** + * Group Structure to manage groups for commands + */ + interface Group { + id: string + title: string + } + /** + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. + */ + interface ShellCompDirective extends Number{} + /** + * CompletionOptions are the options to control shell completion + */ + interface CompletionOptions { + /** + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + */ + disableDefaultCmd: boolean + /** + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions + */ + disableNoDescFlag: boolean + /** + * DisableDescriptions turns off all completion descriptions for shells + * that support them + */ + disableDescriptions: boolean + /** + * HiddenDefaultCmd makes the default 'completion' command hidden + */ + hiddenDefaultCmd: boolean + } +} + +namespace hook { + /** + * Hook defines a concurrent safe structure for handling event hooks + * (aka. callbacks propagation). + */ + interface Hook { + } + interface Hook { + /** + * PreAdd registers a new handler to the hook by prepending it to the existing queue. + * + * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). + */ + preAdd(fn: Handler): string + } + interface Hook { + /** + * Add registers a new handler to the hook by appending it to the existing queue. + * + * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). + */ + add(fn: Handler): string + } + interface Hook { + /** + * Remove removes a single hook handler by its id. + */ + remove(id: string): void + } + interface Hook { + /** + * RemoveAll removes all registered handlers. + */ + removeAll(): void + } + interface Hook { + /** + * Trigger executes all registered hook handlers one by one + * with the specified `data` as an argument. + * + * Optionally, this method allows also to register additional one off + * handlers that will be temporary appended to the handlers queue. + * + * The execution stops when: + * - hook.StopPropagation is returned in one of the handlers + * - any non-nil error is returned in one of the handlers + */ + trigger(data: T, ...oneOffHandlers: Handler[]): void + } + /** + * TaggedHook defines a proxy hook which register handlers that are triggered only + * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). + */ + type _subODnSY = mainHook + interface TaggedHook extends _subODnSY { + } + interface TaggedHook { + /** + * CanTriggerOn checks if the current TaggedHook can be triggered with + * the provided event data tags. + */ + canTriggerOn(tags: Array): boolean + } + interface TaggedHook { + /** + * PreAdd registers a new handler to the hook by prepending it to the existing queue. + * + * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. + */ + preAdd(fn: Handler): string + } + interface TaggedHook { + /** + * Add registers a new handler to the hook by appending it to the existing queue. + * + * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. + */ + add(fn: Handler): string + } +} + +/** + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. + */ +namespace core { + interface BootstrapEvent { + app: App + } + interface TerminateEvent { + app: App + isRestart: boolean + } + interface ServeEvent { + app: App + router?: echo.Echo + server?: http.Server + certManager?: any + } + interface ApiErrorEvent { + httpContext: echo.Context + error: Error + } + type _subStmDG = BaseModelEvent + interface ModelEvent extends _subStmDG { + dao?: daos.Dao + } + type _subQpmjZ = BaseCollectionEvent + interface MailerRecordEvent extends _subQpmjZ { + mailClient: mailer.Mailer message?: mailer.Message record?: models.Record meta: _TygojaDict @@ -35512,50 +35573,50 @@ namespace core { oldSettings?: settings.Settings newSettings?: settings.Settings } - type _subwpEYD = BaseCollectionEvent - interface RecordsListEvent extends _subwpEYD { + type _subelpWh = BaseCollectionEvent + interface RecordsListEvent extends _subelpWh { httpContext: echo.Context records: Array<(models.Record | undefined)> result?: search.Result } - type _subtaOqT = BaseCollectionEvent - interface RecordViewEvent extends _subtaOqT { + type _subLvPKS = BaseCollectionEvent + interface RecordViewEvent extends _subLvPKS { httpContext: echo.Context record?: models.Record } - type _subxKFWr = BaseCollectionEvent - interface RecordCreateEvent extends _subxKFWr { + type _subZtOqS = BaseCollectionEvent + interface RecordCreateEvent extends _subZtOqS { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subciQwE = BaseCollectionEvent - interface RecordUpdateEvent extends _subciQwE { + type _subAjkWJ = BaseCollectionEvent + interface RecordUpdateEvent extends _subAjkWJ { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _sublAvhJ = BaseCollectionEvent - interface RecordDeleteEvent extends _sublAvhJ { + type _subkZlEQ = BaseCollectionEvent + interface RecordDeleteEvent extends _subkZlEQ { httpContext: echo.Context record?: models.Record } - type _subxEibi = BaseCollectionEvent - interface RecordAuthEvent extends _subxEibi { + type _subeuCow = BaseCollectionEvent + interface RecordAuthEvent extends _subeuCow { httpContext: echo.Context record?: models.Record token: string meta: any } - type _subVKrAt = BaseCollectionEvent - interface RecordAuthWithPasswordEvent extends _subVKrAt { + type _subviYXC = BaseCollectionEvent + interface RecordAuthWithPasswordEvent extends _subviYXC { httpContext: echo.Context record?: models.Record identity: string password: string } - type _subZBmyR = BaseCollectionEvent - interface RecordAuthWithOAuth2Event extends _subZBmyR { + type _subFmeZh = BaseCollectionEvent + interface RecordAuthWithOAuth2Event extends _subFmeZh { httpContext: echo.Context providerName: string providerClient: auth.Provider @@ -35563,49 +35624,49 @@ namespace core { oAuth2User?: auth.AuthUser isNewRecord: boolean } - type _subhzcxC = BaseCollectionEvent - interface RecordAuthRefreshEvent extends _subhzcxC { + type _subpoJmu = BaseCollectionEvent + interface RecordAuthRefreshEvent extends _subpoJmu { httpContext: echo.Context record?: models.Record } - type _subiLmJt = BaseCollectionEvent - interface RecordRequestPasswordResetEvent extends _subiLmJt { + type _subHkEeE = BaseCollectionEvent + interface RecordRequestPasswordResetEvent extends _subHkEeE { httpContext: echo.Context record?: models.Record } - type _subGFxjK = BaseCollectionEvent - interface RecordConfirmPasswordResetEvent extends _subGFxjK { + type _subYEJqc = BaseCollectionEvent + interface RecordConfirmPasswordResetEvent extends _subYEJqc { httpContext: echo.Context record?: models.Record } - type _subzficU = BaseCollectionEvent - interface RecordRequestVerificationEvent extends _subzficU { + type _subbBUmy = BaseCollectionEvent + interface RecordRequestVerificationEvent extends _subbBUmy { httpContext: echo.Context record?: models.Record } - type _subohIST = BaseCollectionEvent - interface RecordConfirmVerificationEvent extends _subohIST { + type _subtMtnn = BaseCollectionEvent + interface RecordConfirmVerificationEvent extends _subtMtnn { httpContext: echo.Context record?: models.Record } - type _subCykoA = BaseCollectionEvent - interface RecordRequestEmailChangeEvent extends _subCykoA { + type _subnkOlf = BaseCollectionEvent + interface RecordRequestEmailChangeEvent extends _subnkOlf { httpContext: echo.Context record?: models.Record } - type _subnopwl = BaseCollectionEvent - interface RecordConfirmEmailChangeEvent extends _subnopwl { + type _subUjcfa = BaseCollectionEvent + interface RecordConfirmEmailChangeEvent extends _subUjcfa { httpContext: echo.Context record?: models.Record } - type _subFAnbA = BaseCollectionEvent - interface RecordListExternalAuthsEvent extends _subFAnbA { + type _subYEmXT = BaseCollectionEvent + interface RecordListExternalAuthsEvent extends _subYEmXT { httpContext: echo.Context record?: models.Record externalAuths: Array<(models.ExternalAuth | undefined)> } - type _subfYBlb = BaseCollectionEvent - interface RecordUnlinkExternalAuthEvent extends _subfYBlb { + type _subqoOQW = BaseCollectionEvent + interface RecordUnlinkExternalAuthEvent extends _subqoOQW { httpContext: echo.Context record?: models.Record externalAuth?: models.ExternalAuth @@ -35659,33 +35720,33 @@ namespace core { collections: Array<(models.Collection | undefined)> result?: search.Result } - type _subjPeMq = BaseCollectionEvent - interface CollectionViewEvent extends _subjPeMq { + type _subeGmmK = BaseCollectionEvent + interface CollectionViewEvent extends _subeGmmK { httpContext: echo.Context } - type _subXjljn = BaseCollectionEvent - interface CollectionCreateEvent extends _subXjljn { + type _subIzYYM = BaseCollectionEvent + interface CollectionCreateEvent extends _subIzYYM { httpContext: echo.Context } - type _subnVfEX = BaseCollectionEvent - interface CollectionUpdateEvent extends _subnVfEX { + type _subkgZTc = BaseCollectionEvent + interface CollectionUpdateEvent extends _subkgZTc { httpContext: echo.Context } - type _subMtvMx = BaseCollectionEvent - interface CollectionDeleteEvent extends _subMtvMx { + type _subLSHMR = BaseCollectionEvent + interface CollectionDeleteEvent extends _subLSHMR { httpContext: echo.Context } interface CollectionsImportEvent { httpContext: echo.Context collections: Array<(models.Collection | undefined)> } - type _subzChAu = BaseModelEvent - interface FileTokenEvent extends _subzChAu { + type _subwfGve = BaseModelEvent + interface FileTokenEvent extends _subwfGve { httpContext: echo.Context token: string } - type _subKnVrU = BaseCollectionEvent - interface FileDownloadEvent extends _subKnVrU { + type _subENXIg = BaseCollectionEvent + interface FileDownloadEvent extends _subENXIg { httpContext: echo.Context record?: models.Record fileField?: schema.SchemaField @@ -35694,68 +35755,7 @@ namespace core { } } -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} - /** - * Group Structure to manage groups for commands - */ - interface Group { - id: string - title: string - } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} - /** - * CompletionOptions are the options to control shell completion - */ - interface CompletionOptions { - /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command - */ - disableDefaultCmd: boolean - /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions - */ - disableNoDescFlag: boolean - /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them - */ - disableDescriptions: boolean - /** - * HiddenDefaultCmd makes the default 'completion' command hidden - */ - hiddenDefaultCmd: boolean - } -} - -/** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. - */ -namespace bufio { - /** - * ReadWriter stores pointers to a [Reader] and a [Writer]. - * It implements [io.ReadWriter]. - */ - type _subNCmDN = Reader&Writer - interface ReadWriter extends _subNCmDN { - } +namespace store { } /** @@ -35866,439 +35866,127 @@ namespace net { } } +namespace hook { + /** + * Handler defines a hook handler function. + */ + interface Handler {(e: T): void } + /** + * wrapped local Hook embedded struct to limit the public API surface. + */ + type _subFoqDt = Hook + interface mainHook extends _subFoqDt { + } +} + +namespace logging { + /** + * Classification is the type of the log entry's classification name. + */ + interface Classification extends String{} +} + /** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. + * Package middleware provides transport agnostic middleware for decorating SDK + * handlers. * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. + * The Smithy middleware stack provides ordered behavior to be invoked on an + * underlying handler. The stack is separated into steps that are invoked in a + * static order. A step is a collection of middleware that are injected into a + * ordered list defined by the user. The user may add, insert, swap, and remove a + * step's middleware. When the stack is invoked the step middleware become static, + * and their order cannot be modified. * - * # Limits + * A stack and its step middleware are **not** safe to modify concurrently. * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. + * A stack will use the ordered list of middleware to decorate a underlying + * handler. A handler could be something like an HTTP Client that round trips an + * API operation over HTTP. * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. + * Smithy Middleware Stack * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. + * A Stack is a collection of middleware that wrap a handler. The stack can be + * broken down into discreet steps. Each step may contain zero or more middleware + * specific to that stack's step. + * + * A Stack Step is a predefined set of middleware that are invoked in a static + * order by the Stack. These steps represent fixed points in the middleware stack + * for organizing specific behavior, such as serialize and build. A Stack Step is + * composed of zero or more middleware that are specific to that step. A step may + * define its own set of input/output parameters the generic input/output + * parameters are cast from. A step calls its middleware recursively, before + * calling the next step in the stack returning the result or error of the step + * middleware decorating the underlying handler. + * + * * Initialize: Prepares the input, and sets any default parameters as needed, + * (e.g. idempotency token, and presigned URLs). + * + * * Serialize: Serializes the prepared input into a data structure that can be + * consumed by the target transport's message, (e.g. REST-JSON serialization). + * + * * Build: Adds additional metadata to the serialized transport message, (e.g. + * HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. + * + * * Finalize: Performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated to + * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request + * signing). + * + * * Deserialize: Reacts to the handler's response returned by the recipient of + * the request message. Deserializes the response into a structured type or + * error above stacks can react to. + * + * Adding Middleware to a Stack Step + * + * Middleware can be added to a step front or back, or relative, by name, to an + * existing middleware in that stack. If a middleware does not have a name, a + * unique name will be generated at the middleware and be added to the step. + * + * ``` + * // Create middleware stack + * stack := middleware.NewStack() + * + * // Add middleware to stack steps + * stack.Initialize.Add(paramValidationMiddleware, middleware.After) + * stack.Serialize.Add(marshalOperationFoo, middleware.After) + * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) + * + * // Invoke middleware on handler. + * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) + * ``` */ -namespace multipart { +namespace middleware { /** - * A Part represents a single part in a multipart body. + * Metadata provides storing and reading metadata values. Keys may be any + * comparable value type. Get and set will panic if key is not a comparable + * value type. + * + * Metadata uses lazy initialization, and Set method must be called as an + * addressable value, or pointer. Not doing so may cause key/value pair to not + * be set. */ - interface Part { + interface Metadata { + } + interface Metadata { /** - * The headers of the body, if any, with the keys canonicalized - * in the same fashion that the Go http.Request headers are. - * For example, "foo-bar" changes case to "Foo-Bar" + * Get attempts to retrieve the value the key points to. Returns nil if the + * key was not found. + * + * Panics if key type is not comparable. */ - header: textproto.MIMEHeader + get(key: { + }): { } - interface Part { + } + interface Metadata { /** - * FormName returns the name parameter if p has a Content-Disposition - * of type "form-data". Otherwise it returns the empty string. + * Clone creates a shallow copy of Metadata entries, returning a new Metadata + * value with the original entries copied into it. */ - formName(): string + clone(): Metadata } - interface Part { - /** - * FileName returns the filename parameter of the [Part]'s Content-Disposition - * header. If not empty, the filename is passed through filepath.Base (which is - * platform dependent) before being returned. - */ - fileName(): string - } - interface Part { - /** - * Read reads the body of a part, after its headers and before the - * next part (if any) begins. - */ - read(d: string|Array): number - } - interface Part { - close(): void - } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - /** - * SameSite allows a server to define a cookie attribute making it impossible for - * the browser to send this cookie along with cross-site requests. The main - * goal is to mitigate the risk of cross-origin information leakage, and provide - * some protection against cross-site request forgery attacks. - * - * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. - */ - interface SameSite extends Number{} - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url -} - -namespace store { -} - -namespace mailer { - /** - * Message defines a generic email message struct. - */ - interface Message { - from: mail.Address - to: Array - bcc: Array - cc: Array - subject: string - html: string - text: string - headers: _TygojaDict - attachments: _TygojaDict - } -} - -namespace logging { - /** - * Classification is the type of the log entry's classification name. - */ - interface Classification extends String{} -} - -/** - * Package tracing defines tracing APIs to be used by Smithy clients. - */ -namespace tracing { - /** - * TracerProvider is the entry point for creating client traces. - */ - interface TracerProvider { - [key:string]: any; - tracer(scope: string, ...opts: TracerOption[]): Tracer - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonRaw defines a json value type that is safe for db read/write. - */ - interface JsonRaw extends Array{} - interface JsonRaw { - /** - * String returns the current JsonRaw instance as a json encoded string. - */ - string(): string - } - interface JsonRaw { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonRaw { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string|Array): void - } - interface JsonRaw { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonRaw { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonRaw instance. - */ - scan(value: any): void - } -} - -namespace search { - /** - * Result defines the returned search result structure. - */ - interface Result { - page: number - perPage: number - totalItems: number - totalPages: number - items: any - } -} - -namespace hook { - /** - * Handler defines a hook handler function. - */ - interface Handler {(e: T): void } - /** - * wrapped local Hook embedded struct to limit the public API surface. - */ - type _suboKSlp = Hook - interface mainHook extends _suboKSlp { - } -} - -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { - /** - * MeterProvider is the entry point for creating a Meter. - */ - interface MeterProvider { - [key:string]: any; - meter(scope: string, ...opts: MeterOption[]): Meter - } -} - -/** - * Package auth defines protocol-agnostic authentication types for smithy - * clients. - */ -namespace auth { - /** - * IdentityResolver defines the interface through which an Identity is - * retrieved. - */ - interface IdentityResolver { - [key:string]: any; - getIdentity(_arg0: context.Context, _arg1: smithy.Properties): Identity - } -} - -/** - * Package middleware provides transport agnostic middleware for decorating SDK - * handlers. - * - * The Smithy middleware stack provides ordered behavior to be invoked on an - * underlying handler. The stack is separated into steps that are invoked in a - * static order. A step is a collection of middleware that are injected into a - * ordered list defined by the user. The user may add, insert, swap, and remove a - * step's middleware. When the stack is invoked the step middleware become static, - * and their order cannot be modified. - * - * A stack and its step middleware are **not** safe to modify concurrently. - * - * A stack will use the ordered list of middleware to decorate a underlying - * handler. A handler could be something like an HTTP Client that round trips an - * API operation over HTTP. - * - * Smithy Middleware Stack - * - * A Stack is a collection of middleware that wrap a handler. The stack can be - * broken down into discreet steps. Each step may contain zero or more middleware - * specific to that stack's step. - * - * A Stack Step is a predefined set of middleware that are invoked in a static - * order by the Stack. These steps represent fixed points in the middleware stack - * for organizing specific behavior, such as serialize and build. A Stack Step is - * composed of zero or more middleware that are specific to that step. A step may - * define its own set of input/output parameters the generic input/output - * parameters are cast from. A step calls its middleware recursively, before - * calling the next step in the stack returning the result or error of the step - * middleware decorating the underlying handler. - * - * * Initialize: Prepares the input, and sets any default parameters as needed, - * (e.g. idempotency token, and presigned URLs). - * - * * Serialize: Serializes the prepared input into a data structure that can be - * consumed by the target transport's message, (e.g. REST-JSON serialization). - * - * * Build: Adds additional metadata to the serialized transport message, (e.g. - * HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. - * - * * Finalize: Performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated to - * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request - * signing). - * - * * Deserialize: Reacts to the handler's response returned by the recipient of - * the request message. Deserializes the response into a structured type or - * error above stacks can react to. - * - * Adding Middleware to a Stack Step - * - * Middleware can be added to a step front or back, or relative, by name, to an - * existing middleware in that stack. If a middleware does not have a name, a - * unique name will be generated at the middleware and be added to the step. - * - * ``` - * // Create middleware stack - * stack := middleware.NewStack() - * - * // Add middleware to stack steps - * stack.Initialize.Add(paramValidationMiddleware, middleware.After) - * stack.Serialize.Add(marshalOperationFoo, middleware.After) - * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) - * - * // Invoke middleware on handler. - * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) - * ``` - */ -namespace middleware { - /** - * Metadata provides storing and reading metadata values. Keys may be any - * comparable value type. Get and set will panic if key is not a comparable - * value type. - * - * Metadata uses lazy initialization, and Set method must be called as an - * addressable value, or pointer. Not doing so may cause key/value pair to not - * be set. - */ - interface Metadata { - } - interface Metadata { - /** - * Get attempts to retrieve the value the key points to. Returns nil if the - * key was not found. - * - * Panics if key type is not comparable. - */ - get(key: { - }): { - } - } - interface Metadata { - /** - * Clone creates a shallow copy of Metadata entries, returning a new Metadata - * value with the original entries copied into it. - */ - clone(): Metadata - } - interface Metadata { + interface Metadata { /** * Set stores the value pointed to by the key. If a value already exists at * that key it will be replaced with the new value. @@ -36694,105 +36382,1222 @@ namespace middleware { } /** - * Package http provides the HTTP transport client and request/response types - * needed to round trip API operation calls with an service. + * Package auth defines protocol-agnostic authentication types for smithy + * clients. */ -namespace http { - // @ts-ignore - import smithy = smithy_go +namespace auth { /** - * AuthScheme defines an HTTP authentication scheme. + * IdentityResolver defines the interface through which an Identity is + * retrieved. */ - interface AuthScheme { + interface IdentityResolver { [key:string]: any; - schemeID(): string - identityResolver(_arg0: auth.IdentityResolverOptions): auth.IdentityResolver - signer(): Signer + getIdentity(_arg0: context.Context, _arg1: smithy.Properties): Identity } - // @ts-ignore - import iointernal = io - // @ts-ignore - import smithytime = time } -namespace subscriptions { +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { /** - * Message defines a client's channel data. + * MeterProvider is the entry point for creating a Meter. */ - interface Message { - name: string - data: string|Array + interface MeterProvider { + [key:string]: any; + meter(scope: string, ...opts: MeterOption[]): Meter } +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { /** - * Client is an interface for a generic subscription client. + * TracerProvider is the entry point for creating client traces. */ - interface Client { + interface TracerProvider { [key:string]: any; + tracer(scope: string, ...opts: TracerOption[]): Tracer + } +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { + /** + * ReadWriter stores pointers to a [Reader] and a [Writer]. + * It implements [io.ReadWriter]. + */ + type _sububutk = Reader&Writer + interface ReadWriter extends _sububutk { + } +} + +/** + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. + */ +namespace multipart { + /** + * A Part represents a single part in a multipart body. + */ + interface Part { /** - * Id Returns the unique id of the client. + * The headers of the body, if any, with the keys canonicalized + * in the same fashion that the Go http.Request headers are. + * For example, "foo-bar" changes case to "Foo-Bar" */ - id(): string + header: textproto.MIMEHeader + } + interface Part { /** - * Channel returns the client's communication channel. + * FormName returns the name parameter if p has a Content-Disposition + * of type "form-data". Otherwise it returns the empty string. */ - channel(): undefined + formName(): string + } + interface Part { /** - * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. - * If no prefix is specified, returns all subscriptions. + * FileName returns the filename parameter of the [Part]'s Content-Disposition + * header. If not empty, the filename is passed through filepath.Base (which is + * platform dependent) before being returned. */ - subscriptions(...prefixes: string[]): _TygojaDict + fileName(): string + } + interface Part { /** - * Subscribe subscribes the client to the provided subscriptions list. - * - * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. - * - * Example: - * - * ``` - * Subscribe( - * "subscriptionA", - * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, - * ) - * ``` + * Read reads the body of a part, after its headers and before the + * next part (if any) begins. */ - subscribe(...subs: string[]): void + read(d: string|Array): number + } + interface Part { + close(): void + } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + /** + * SameSite allows a server to define a cookie attribute making it impossible for + * the browser to send this cookie along with cross-site requests. The main + * goal is to mitigate the risk of cross-origin information leakage, and provide + * some protection against cross-site request forgery attacks. + * + * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. + */ + interface SameSite extends Number{} + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url +} + +/** + * Package http provides the HTTP transport client and request/response types + * needed to round trip API operation calls with an service. + */ +namespace http { + // @ts-ignore + import smithy = smithy_go + /** + * AuthScheme defines an HTTP authentication scheme. + */ + interface AuthScheme { + [key:string]: any; + schemeID(): string + identityResolver(_arg0: auth.IdentityResolverOptions): auth.IdentityResolver + signer(): Signer + } + // @ts-ignore + import iointernal = io + // @ts-ignore + import smithytime = time +} + +/** + * Package bearer provides middleware and utilities for authenticating API + * operation calls with a Bearer Token. + */ +namespace bearer { + // @ts-ignore + import smithyhttp = http + /** + * Token provides a type wrapping a bearer token and expiration metadata. + */ + interface Token { + value: string + canExpire: boolean + expires: time.Time + } + interface Token { + /** + * Expired returns if the token's Expires time is before or equal to the time + * provided. If CanExpires is false, Expired will always return false. + */ + expired(now: time.Time): boolean + } + // @ts-ignore + import smithycontext = context +} + +namespace mailer { + /** + * Message defines a generic email message struct. + */ + interface Message { + from: mail.Address + to: Array + bcc: Array + cc: Array + subject: string + html: string + text: string + headers: _TygojaDict + attachments: _TygojaDict + } +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + /** + * An Attr is a key-value pair. + */ + interface Attr { + key: string + value: Value + } + interface Attr { + /** + * Equal reports whether a and b have equal keys and values. + */ + equal(b: Attr): boolean + } + interface Attr { + string(): string + } + /** + * A Handler handles log records produced by a Logger. + * + * A typical handler may print log records to standard error, + * or write them to a file or database, or perhaps augment them + * with additional attributes and pass them on to another handler. + * + * Any of the Handler's methods may be called concurrently with itself + * or with other methods. It is the responsibility of the Handler to + * manage this concurrency. + * + * Users of the slog package should not invoke Handler methods directly. + * They should use the methods of [Logger] instead. + */ + interface Handler { + [key:string]: any; /** - * Unsubscribe unsubscribes the client from the provided subscriptions list. + * Enabled reports whether the handler handles records at the given level. + * The handler ignores records whose level is lower. + * It is called early, before any arguments are processed, + * to save effort if the log event should be discarded. + * If called from a Logger method, the first argument is the context + * passed to that method, or context.Background() if nil was passed + * or the method does not take a context. + * The context is passed so Enabled can use its values + * to make a decision. */ - unsubscribe(...subs: string[]): void + enabled(_arg0: context.Context, _arg1: Level): boolean /** - * HasSubscription checks if the client is subscribed to `sub`. + * Handle handles the Record. + * It will only be called when Enabled returns true. + * The Context argument is as for Enabled. + * It is present solely to provide Handlers access to the context's values. + * Canceling the context should not affect record processing. + * (Among other things, log messages may be necessary to debug a + * cancellation-related problem.) + * + * Handle methods that produce output should observe the following rules: + * ``` + * - If r.Time is the zero time, ignore the time. + * - If r.PC is zero, ignore it. + * - Attr's values should be resolved. + * - If an Attr's key and value are both the zero value, ignore the Attr. + * This can be tested with attr.Equal(Attr{}). + * - If a group's key is empty, inline the group's Attrs. + * - If a group has no Attrs (even if it has a non-empty key), + * ignore it. + * ``` */ - hasSubscription(sub: string): boolean + handle(_arg0: context.Context, _arg1: Record): void /** - * Set stores any value to the client's context. + * WithAttrs returns a new Handler whose attributes consist of + * both the receiver's attributes and the arguments. + * The Handler owns the slice: it may retain, modify or discard it. */ - set(key: string, value: any): void + withAttrs(attrs: Array): Handler /** - * Unset removes a single value from the client's context. + * WithGroup returns a new Handler with the given group appended to + * the receiver's existing groups. + * The keys of all subsequent attributes, whether added by With or in a + * Record, should be qualified by the sequence of group names. + * + * How this qualification happens is up to the Handler, so long as + * this Handler's attribute keys differ from those of another Handler + * with a different sequence of group names. + * + * A Handler should treat WithGroup as starting a Group of Attrs that ends + * at the end of the log event. That is, + * + * ``` + * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) + * ``` + * + * should behave like + * + * ``` + * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) + * ``` + * + * If the name is empty, WithGroup returns the receiver. */ - unset(key: string): void + withGroup(name: string): Handler + } + /** + * A Level is the importance or severity of a log event. + * The higher the level, the more important or severe the event. + */ + interface Level extends Number{} + interface Level { /** - * Get retrieves the key value from the client's context. + * String returns a name for the level. + * If the level has a name, then that name + * in uppercase is returned. + * If the level is between named values, then + * an integer is appended to the uppercased name. + * Examples: + * + * ``` + * LevelWarn.String() => "WARN" + * (LevelInfo+2).String() => "INFO+2" + * ``` */ - get(key: string): any + string(): string + } + interface Level { /** - * Discard marks the client as "discarded", meaning that it - * shouldn't be used anymore for sending new messages. + * MarshalJSON implements [encoding/json.Marshaler] + * by quoting the output of [Level.String]. + */ + marshalJSON(): string|Array + } + interface Level { + /** + * UnmarshalJSON implements [encoding/json.Unmarshaler] + * It accepts any string produced by [Level.MarshalJSON], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". + */ + unmarshalJSON(data: string|Array): void + } + interface Level { + /** + * MarshalText implements [encoding.TextMarshaler] + * by calling [Level.String]. + */ + marshalText(): string|Array + } + interface Level { + /** + * UnmarshalText implements [encoding.TextUnmarshaler]. + * It accepts any string produced by [Level.MarshalText], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". + */ + unmarshalText(data: string|Array): void + } + interface Level { + /** + * Level returns the receiver. + * It implements [Leveler]. + */ + level(): Level + } + // @ts-ignore + import loginternal = internal +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonRaw defines a json value type that is safe for db read/write. + */ + interface JsonRaw extends Array{} + interface JsonRaw { + /** + * String returns the current JsonRaw instance as a json encoded string. + */ + string(): string + } + interface JsonRaw { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JsonRaw { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string|Array): void + } + interface JsonRaw { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonRaw { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonRaw instance. + */ + scan(value: any): void + } +} + +namespace search { + /** + * Result defines the returned search result structure. + */ + interface Result { + page: number + perPage: number + totalItems: number + totalPages: number + items: any + } +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + // @ts-ignore + import stdContext = context + /** + * Route contains information to adding/registering new route with the router. + * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. + */ + interface Route { + method: string + path: string + handler: HandlerFunc + middlewares: Array + name: string + } + interface Route { + /** + * ToRouteInfo converts Route to RouteInfo + */ + toRouteInfo(params: Array): RouteInfo + } + interface Route { + /** + * ToRoute returns Route which Router uses to register the method handler for path. + */ + toRoute(): Route + } + interface Route { + /** + * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. + */ + forGroup(pathPrefix: string, middlewares: Array): Routable + } + /** + * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this + * interface are meant for request routing purposes and should not be used in middlewares. + */ + interface RoutableContext { + [key:string]: any; + /** + * Request returns `*http.Request`. + */ + request(): (http.Request) + /** + * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. + */ + rawPathParams(): (PathParams) + /** + * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). + * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. + */ + setRawPathParams(params: PathParams): void + /** + * SetPath sets the registered path for the handler. + */ + setPath(p: string): void + /** + * SetRouteInfo sets the route info of this request to the context. + */ + setRouteInfo(ri: RouteInfo): void + /** + * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context + * for later use in middlewares/handler. + */ + set(key: string, val: { + }): void + } + /** + * PathParam is tuple pf path parameter name and its value in request path + */ + interface PathParam { + name: string + value: string + } +} + +/** + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. + * + * # Value and Pointer Conversion Utilities + * + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. + * + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. + * + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. + * + * ``` + * var strPtr *string + * + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str + * + * // With the SDK's conversion functions + * strPtr = aws.String("my string") + * + * // Convert *string to string value + * str = aws.ToString(strPtr) + * ``` + * + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. + * + * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} + * + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) + * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) + * ``` + * + * # SDK Default HTTP Client + * + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. + * + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. + */ +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + // @ts-ignore + import smithybearer = bearer + // @ts-ignore + import sdkrand = rand + /** + * A Credentials is the AWS credentials value for individual credential fields. + */ + interface Credentials { + /** + * AWS Access key ID + */ + accessKeyID: string + /** + * AWS Secret Access Key + */ + secretAccessKey: string + /** + * AWS Session Token + */ + sessionToken: string + /** + * Source of the credentials + */ + source: string + /** + * States if the credentials can expire or not. + */ + canExpire: boolean + /** + * The time the credentials will expire at. Should be ignored if CanExpire + * is false. + */ + expires: time.Time + /** + * The ID of the account for the credentials. + */ + accountID: string + } + interface Credentials { + /** + * Expired returns if the credentials have expired. + */ + expired(): boolean + } + interface Credentials { + /** + * HasKeys returns if the credentials keys are set. + */ + hasKeys(): boolean + } + /** + * Endpoint represents the endpoint a service client should make API operation + * calls to. + * + * The SDK will automatically resolve these endpoints per API client using an + * internal endpoint resolvers. If you'd like to provide custom endpoint + * resolving behavior you can implement the EndpointResolver interface. + * + * Deprecated: This structure was used with the global [EndpointResolver] + * interface, which has been deprecated in favor of service-specific endpoint + * resolution. See the deprecation docs on that interface for more information. + */ + interface Endpoint { + /** + * The base URL endpoint the SDK API clients will use to make API calls to. + * The SDK will suffix URI path and query elements to this endpoint. + */ + url: string + /** + * Specifies if the endpoint's hostname can be modified by the SDK's API + * client. * - * It is safe to call Discard() multiple times. + * If the hostname is mutable the SDK API clients may modify any part of + * the hostname based on the requirements of the API, (e.g. adding, or + * removing content in the hostname). Such as, Amazon S3 API client + * prefixing "bucketname" to the hostname, or changing the + * hostname service name component from "s3." to "s3-accesspoint.dualstack." + * for the dualstack endpoint of an S3 Accesspoint resource. + * + * Care should be taken when providing a custom endpoint for an API. If the + * endpoint hostname is mutable, and the client cannot modify the endpoint + * correctly, the operation call will most likely fail, or have undefined + * behavior. + * + * If hostname is immutable, the SDK API clients will not modify the + * hostname of the URL. This may cause the API client not to function + * correctly if the API requires the operation specific hostname values + * to be used by the client. + * + * This flag does not modify the API client's behavior if this endpoint + * will be used instead of Endpoint Discovery, or if the endpoint will be + * used to perform Endpoint Discovery. That behavior is configured via the + * API Client's Options. */ - discard(): void + hostnameImmutable: boolean /** - * IsDiscarded indicates whether the client has been "discarded" - * and should no longer be used. + * The AWS partition the endpoint belongs to. */ - isDiscarded(): boolean + partitionID: string /** - * Send sends the specified message to the client's channel (if not discarded). + * The service name that should be used for signing the requests to the + * endpoint. */ - send(m: Message): void + signingName: string + /** + * The region that should be used for signing the request to the endpoint. + */ + signingRegion: string + /** + * The signing method that should be used for signing the requests to the + * endpoint. + */ + signingMethod: string + /** + * The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata. + * When providing a custom endpoint, you should set the source as EndpointSourceCustom. + * If source is not provided when providing a custom endpoint, the SDK may not + * perform required host mutations correctly. Source should be used along with + * HostnameImmutable property as per the usage requirement. + */ + source: EndpointSource } + /** + * ExecutionEnvironmentID is the AWS execution environment runtime identifier. + */ + interface ExecutionEnvironmentID extends String{} } namespace types { @@ -37077,8 +37882,8 @@ namespace types { * * [Amazon S3 Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html */ - type _subAdQMO = noSmithyDocumentSerde - interface AccelerateConfiguration extends _subAdQMO { + type _suboupbj = noSmithyDocumentSerde + interface AccelerateConfiguration extends _suboupbj { /** * Specifies the transfer acceleration status of the bucket. */ @@ -37087,8 +37892,8 @@ namespace types { /** * Contains the elements that set the ACL permissions for an object per grantee. */ - type _subvBLGU = noSmithyDocumentSerde - interface AccessControlPolicy extends _subvBLGU { + type _subSPxyB = noSmithyDocumentSerde + interface AccessControlPolicy extends _subSPxyB { /** * A list of grants. */ @@ -37102,8 +37907,8 @@ namespace types { * Specifies the configuration and any analyses for the analytics filter of an * Amazon S3 bucket. */ - type _subgdymU = noSmithyDocumentSerde - interface AnalyticsConfiguration extends _subgdymU { + type _subtcBQi = noSmithyDocumentSerde + interface AnalyticsConfiguration extends _subtcBQi { /** * The ID that identifies the analytics configuration. * @@ -37127,8 +37932,8 @@ namespace types { /** * In terms of implementation, a Bucket is a resource. */ - type _subnVWkk = noSmithyDocumentSerde - interface Bucket extends _subnVWkk { + type _subnHRrx = noSmithyDocumentSerde + interface Bucket extends _subnHRrx { /** * Date the bucket was created. This date can change when making changes to your * bucket, such as editing its bucket policy. @@ -37145,8 +37950,8 @@ namespace types { * * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html */ - type _subJAxMi = noSmithyDocumentSerde - interface BucketLifecycleConfiguration extends _subJAxMi { + type _subYkJsN = noSmithyDocumentSerde + interface BucketLifecycleConfiguration extends _subYkJsN { /** * A lifecycle rule for individual objects in an Amazon S3 bucket. * @@ -37157,8 +37962,8 @@ namespace types { /** * Container for logging status information. */ - type _subednLl = noSmithyDocumentSerde - interface BucketLoggingStatus extends _subednLl { + type _subBBxuR = noSmithyDocumentSerde + interface BucketLoggingStatus extends _subBBxuR { /** * Describes where logs are stored and the prefix that Amazon S3 assigns to all * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API @@ -37171,8 +37976,8 @@ namespace types { /** * Contains all the possible checksum or digest values for an object. */ - type _subwHZAb = noSmithyDocumentSerde - interface Checksum extends _subwHZAb { + type _subIqiaI = noSmithyDocumentSerde + interface Checksum extends _subIqiaI { /** * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be * present if it was uploaded with the object. When you use an API operation on an @@ -37229,8 +38034,8 @@ namespace types { * if the prefix is notes/ and the delimiter is a slash (/) as in * notes/summer/july, the common prefix is notes/summer/. */ - type _subatVOG = noSmithyDocumentSerde - interface CommonPrefix extends _subatVOG { + type _subnfYXQ = noSmithyDocumentSerde + interface CommonPrefix extends _subnfYXQ { /** * Container for the specified common prefix. */ @@ -37239,8 +38044,8 @@ namespace types { /** * The container for the completed multipart upload details. */ - type _subSccUS = noSmithyDocumentSerde - interface CompletedMultipartUpload extends _subSccUS { + type _sublPvcF = noSmithyDocumentSerde + interface CompletedMultipartUpload extends _sublPvcF { /** * Array of CompletedPart data types. * @@ -37252,8 +38057,8 @@ namespace types { /** * Container for all response elements. */ - type _subIajoo = noSmithyDocumentSerde - interface CopyObjectResult extends _subIajoo { + type _subHUIMd = noSmithyDocumentSerde + interface CopyObjectResult extends _subHUIMd { /** * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be * present if it was uploaded with the object. For more information, see [Checking object integrity]in the @@ -37299,8 +38104,8 @@ namespace types { /** * Container for all response elements. */ - type _subOurrh = noSmithyDocumentSerde - interface CopyPartResult extends _subOurrh { + type _subVgsnT = noSmithyDocumentSerde + interface CopyPartResult extends _subVgsnT { /** * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be * present if it was uploaded with the object. When you use an API operation on an @@ -37364,8 +38169,8 @@ namespace types { * * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html */ - type _submJiRs = noSmithyDocumentSerde - interface CORSConfiguration extends _submJiRs { + type _subxlNzL = noSmithyDocumentSerde + interface CORSConfiguration extends _subxlNzL { /** * A set of origins and methods (cross-origin access that you want to allow). You * can add up to 100 rules to the configuration. @@ -37377,8 +38182,8 @@ namespace types { /** * Specifies a cross-origin access rule for an Amazon S3 bucket. */ - type _subXkLgD = noSmithyDocumentSerde - interface CORSRule extends _subXkLgD { + type _subvJddm = noSmithyDocumentSerde + interface CORSRule extends _subvJddm { /** * An HTTP method that you allow the origin to execute. Valid values are GET , PUT * , HEAD , POST , and DELETE . @@ -37417,8 +38222,8 @@ namespace types { /** * The configuration information for the bucket. */ - type _subUJNvK = noSmithyDocumentSerde - interface CreateBucketConfiguration extends _subUJNvK { + type _subDqXck = noSmithyDocumentSerde + interface CreateBucketConfiguration extends _subDqXck { /** * Specifies the information about the bucket that will be created. * @@ -37452,8 +38257,8 @@ namespace types { /** * Container for the objects to delete. */ - type _subTMlPO = noSmithyDocumentSerde - interface Delete extends _subTMlPO { + type _subVsMDX = noSmithyDocumentSerde + interface Delete extends _subVsMDX { /** * The object to delete. * @@ -37474,8 +38279,8 @@ namespace types { /** * Information about the deleted object. */ - type _submlJyi = noSmithyDocumentSerde - interface DeletedObject extends _submlJyi { + type _subdPtrS = noSmithyDocumentSerde + interface DeletedObject extends _subdPtrS { /** * Indicates whether the specified object version that was permanently deleted was * (true) or was not (false) a delete marker before deletion. In a simple DELETE, @@ -37507,8 +38312,8 @@ namespace types { /** * Information about the delete marker. */ - type _submPJJq = noSmithyDocumentSerde - interface DeleteMarkerEntry extends _submPJJq { + type _subPAfKs = noSmithyDocumentSerde + interface DeleteMarkerEntry extends _subPAfKs { /** * Specifies whether the object is (true) or is not (false) the latest version of * an object. @@ -37534,8 +38339,8 @@ namespace types { /** * Container for all error elements. */ - type _subIGHMu = noSmithyDocumentSerde - interface Error extends _subIGHMu { + type _subHZsof = noSmithyDocumentSerde + interface Error extends _subHZsof { /** * The error code is a string that uniquely identifies an error condition. It is * meant to be read and understood by programs that detect and handle errors by @@ -38327,8 +39132,8 @@ namespace types { /** * The error information. */ - type _subQUEOW = noSmithyDocumentSerde - interface ErrorDocument extends _subQUEOW { + type _subqXSdr = noSmithyDocumentSerde + interface ErrorDocument extends _subqXSdr { /** * The object key name to use when a 4XX class error occurs. * @@ -38344,14 +39149,14 @@ namespace types { /** * A container for specifying the configuration for Amazon EventBridge. */ - type _subUGNlL = noSmithyDocumentSerde - interface EventBridgeConfiguration extends _subUGNlL { + type _subOMMVt = noSmithyDocumentSerde + interface EventBridgeConfiguration extends _subOMMVt { } /** * A collection of parts associated with a multipart upload. */ - type _subblghU = noSmithyDocumentSerde - interface GetObjectAttributesParts extends _subblghU { + type _subZajtR = noSmithyDocumentSerde + interface GetObjectAttributesParts extends _subZajtR { /** * Indicates whether the returned list of parts is truncated. A value of true * indicates that the list was truncated. A list can be truncated if the number of @@ -38396,8 +39201,8 @@ namespace types { /** * Container for grant information. */ - type _subwnudN = noSmithyDocumentSerde - interface Grant extends _subwnudN { + type _subIsxyk = noSmithyDocumentSerde + interface Grant extends _subIsxyk { /** * The person being granted permissions. */ @@ -38410,8 +39215,8 @@ namespace types { /** * Container for the Suffix element. */ - type _subEyvCu = noSmithyDocumentSerde - interface IndexDocument extends _subEyvCu { + type _subWouSZ = noSmithyDocumentSerde + interface IndexDocument extends _subWouSZ { /** * A suffix that is appended to a request that is for a directory on the website * endpoint. (For example, if the suffix is index.html and you make a request to @@ -38431,8 +39236,8 @@ namespace types { /** * Container element that identifies who initiated the multipart upload. */ - type _sublRNgr = noSmithyDocumentSerde - interface Initiator extends _sublRNgr { + type _subhONmI = noSmithyDocumentSerde + interface Initiator extends _subhONmI { /** * Name of the Principal. * @@ -38452,8 +39257,8 @@ namespace types { /** * Describes the serialization format of the object. */ - type _subfCWeH = noSmithyDocumentSerde - interface InputSerialization extends _subfCWeH { + type _subzrXpB = noSmithyDocumentSerde + interface InputSerialization extends _subzrXpB { /** * Describes the serialization of a CSV-encoded object. */ @@ -38479,8 +39284,8 @@ namespace types { * * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access */ - type _subtWzGE = noSmithyDocumentSerde - interface IntelligentTieringConfiguration extends _subtWzGE { + type _subICxld = noSmithyDocumentSerde + interface IntelligentTieringConfiguration extends _subICxld { /** * The ID used to identify the S3 Intelligent-Tiering configuration. * @@ -38511,8 +39316,8 @@ namespace types { * * [GET Bucket inventory]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html */ - type _subrcUOK = noSmithyDocumentSerde - interface InventoryConfiguration extends _subrcUOK { + type _subYZjch = noSmithyDocumentSerde + interface InventoryConfiguration extends _subYZjch { /** * Contains information about where to publish the inventory results. * @@ -38560,8 +39365,8 @@ namespace types { /** * A container for specifying the configuration for Lambda notifications. */ - type _subyrYtM = noSmithyDocumentSerde - interface LambdaFunctionConfiguration extends _subyrYtM { + type _sublzkaU = noSmithyDocumentSerde + interface LambdaFunctionConfiguration extends _sublzkaU { /** * The Amazon S3 bucket event for which to invoke the Lambda function. For more * information, see [Supported Event Types]in the Amazon S3 User Guide. @@ -38598,8 +39403,8 @@ namespace types { * * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html */ - type _subjZLim = noSmithyDocumentSerde - interface LifecycleRule extends _subjZLim { + type _subAkDst = noSmithyDocumentSerde + interface LifecycleRule extends _subAkDst { /** * If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is * not currently being applied. @@ -38670,8 +39475,8 @@ namespace types { * * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html */ - type _subkbPlf = noSmithyDocumentSerde - interface LoggingEnabled extends _subkbPlf { + type _subcqzdK = noSmithyDocumentSerde + interface LoggingEnabled extends _subcqzdK { /** * Specifies the bucket where you want Amazon S3 to store server access logs. You * can have your logs delivered to any bucket that you own, including the same @@ -38714,8 +39519,8 @@ namespace types { * * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html */ - type _subVyqCh = noSmithyDocumentSerde - interface MetricsConfiguration extends _subVyqCh { + type _subsQNZP = noSmithyDocumentSerde + interface MetricsConfiguration extends _subsQNZP { /** * The ID used to identify the metrics configuration. The ID has a 64 character * limit and can only contain letters, numbers, periods, dashes, and underscores. @@ -38733,8 +39538,8 @@ namespace types { /** * Container for the MultipartUpload for the Amazon S3 object. */ - type _subJfQNT = noSmithyDocumentSerde - interface MultipartUpload extends _subJfQNT { + type _subgrMIB = noSmithyDocumentSerde + interface MultipartUpload extends _subgrMIB { /** * The algorithm that was used to create a checksum of the object. */ @@ -38774,8 +39579,8 @@ namespace types { * A container for specifying the notification configuration of the bucket. If * this element is empty, notifications are turned off for the bucket. */ - type _submfUYx = noSmithyDocumentSerde - interface NotificationConfiguration extends _submfUYx { + type _subORLDi = noSmithyDocumentSerde + interface NotificationConfiguration extends _subORLDi { /** * Enables delivery of events to Amazon EventBridge. */ @@ -38799,8 +39604,8 @@ namespace types { /** * An object consists of data and its descriptive metadata. */ - type _subKzNJK = noSmithyDocumentSerde - interface Object extends _subKzNJK { + type _subygDwi = noSmithyDocumentSerde + interface Object extends _subygDwi { /** * The algorithm that was used to create a checksum of the object. */ @@ -38872,8 +39677,8 @@ namespace types { /** * The container element for Object Lock configuration parameters. */ - type _subslJnE = noSmithyDocumentSerde - interface ObjectLockConfiguration extends _subslJnE { + type _subPmUFU = noSmithyDocumentSerde + interface ObjectLockConfiguration extends _subPmUFU { /** * Indicates whether this bucket has an Object Lock configuration enabled. Enable * ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket. @@ -38890,8 +39695,8 @@ namespace types { /** * A legal hold configuration for an object. */ - type _subQNweC = noSmithyDocumentSerde - interface ObjectLockLegalHold extends _subQNweC { + type _subRuoIU = noSmithyDocumentSerde + interface ObjectLockLegalHold extends _subRuoIU { /** * Indicates whether the specified object has a legal hold in place. */ @@ -38900,8 +39705,8 @@ namespace types { /** * A Retention configuration for an object. */ - type _sublHSUJ = noSmithyDocumentSerde - interface ObjectLockRetention extends _sublHSUJ { + type _subeRKwD = noSmithyDocumentSerde + interface ObjectLockRetention extends _subeRKwD { /** * Indicates the Retention mode for the specified object. */ @@ -38914,8 +39719,8 @@ namespace types { /** * The version of an object. */ - type _subuWjvD = noSmithyDocumentSerde - interface ObjectVersion extends _subuWjvD { + type _subMRzMq = noSmithyDocumentSerde + interface ObjectVersion extends _subMRzMq { /** * The algorithm that was used to create a checksum of the object. */ @@ -38966,8 +39771,8 @@ namespace types { /** * Describes how results of the Select job are serialized. */ - type _subgSPBp = noSmithyDocumentSerde - interface OutputSerialization extends _subgSPBp { + type _submqdFf = noSmithyDocumentSerde + interface OutputSerialization extends _submqdFf { /** * Describes the serialization of CSV-encoded Select results. */ @@ -38980,8 +39785,8 @@ namespace types { /** * Container for the owner's display name and ID. */ - type _subEdbjx = noSmithyDocumentSerde - interface Owner extends _subEdbjx { + type _subbNdPB = noSmithyDocumentSerde + interface Owner extends _subbNdPB { /** * Container for the display name of the owner. This value is only supported in * the following Amazon Web Services Regions: @@ -39015,8 +39820,8 @@ namespace types { /** * The container element for a bucket's ownership controls. */ - type _subpHgpP = noSmithyDocumentSerde - interface OwnershipControls extends _subpHgpP { + type _subaEOKu = noSmithyDocumentSerde + interface OwnershipControls extends _subaEOKu { /** * The container element for an ownership control rule. * @@ -39027,8 +39832,8 @@ namespace types { /** * Container for elements related to a part. */ - type _subhxloO = noSmithyDocumentSerde - interface Part extends _subhxloO { + type _subboIgG = noSmithyDocumentSerde + interface Part extends _subboIgG { /** * This header can be used as a data integrity check to verify that the data * received is the same data that was originally sent. This header specifies the @@ -39047,1804 +39852,738 @@ namespace types { * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User * Guide. * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Entity tag returned when the part was uploaded. - */ - eTag?: string - /** - * Date and time at which the part was uploaded. - */ - lastModified?: time.Time - /** - * Part number identifying the part. This is a positive integer between 1 and - * 10,000. - */ - partNumber?: number - /** - * Size in bytes of the uploaded part data. - */ - size?: number - } - /** - * The container element for a bucket's policy status. - */ - type _subodOuo = noSmithyDocumentSerde - interface PolicyStatus extends _subodOuo { - /** - * The policy status for this bucket. TRUE indicates that this bucket is public. - * FALSE indicates that the bucket is not public. - */ - isPublic?: boolean - } - /** - * The PublicAccessBlock configuration that you want to apply to this Amazon S3 - * bucket. You can enable the configuration options in any combination. For more - * information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in - * the Amazon S3 User Guide. - * - * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status - */ - type _subabDMY = noSmithyDocumentSerde - interface PublicAccessBlockConfiguration extends _subabDMY { - /** - * Specifies whether Amazon S3 should block public access control lists (ACLs) for - * this bucket and objects in this bucket. Setting this element to TRUE causes the - * following behavior: - * - * ``` - * - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. - * - * - PUT Object calls fail if the request includes a public ACL. - * - * - PUT Bucket calls fail if the request includes a public ACL. - * ``` - * - * Enabling this setting doesn't affect existing policies or ACLs. - */ - blockPublicAcls?: boolean - /** - * Specifies whether Amazon S3 should block public bucket policies for this - * bucket. Setting this element to TRUE causes Amazon S3 to reject calls to PUT - * Bucket policy if the specified bucket policy allows public access. - * - * Enabling this setting doesn't affect existing bucket policies. - */ - blockPublicPolicy?: boolean - /** - * Specifies whether Amazon S3 should ignore public ACLs for this bucket and - * objects in this bucket. Setting this element to TRUE causes Amazon S3 to ignore - * all public ACLs on this bucket and objects in this bucket. - * - * Enabling this setting doesn't affect the persistence of any existing ACLs and - * doesn't prevent new public ACLs from being set. - */ - ignorePublicAcls?: boolean - /** - * Specifies whether Amazon S3 should restrict public bucket policies for this - * bucket. Setting this element to TRUE restricts access to this bucket to only - * Amazon Web Servicesservice principals and authorized users within this account - * if the bucket has a public policy. - * - * Enabling this setting doesn't affect previously stored bucket policies, except - * that public and cross-account access within any public bucket policy, including - * non-public delegation to specific accounts, is blocked. - */ - restrictPublicBuckets?: boolean - } - /** - * Specifies the configuration for publishing messages to an Amazon Simple Queue - * Service (Amazon SQS) queue when Amazon S3 detects specified events. - */ - type _subtAqlQ = noSmithyDocumentSerde - interface QueueConfiguration extends _subtAqlQ { - /** - * A collection of bucket events for which to send notifications - * - * This member is required. - */ - events: Array - /** - * The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 - * publishes a message when it detects events of the specified type. - * - * This member is required. - */ - queueArn?: string - /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html - */ - filter?: NotificationConfigurationFilter - /** - * An optional unique identifier for configurations in a notification - * configuration. If you don't provide one, Amazon S3 will assign an ID. - */ - id?: string - } - /** - * Specifies the redirect behavior of all requests to a website endpoint of an - * Amazon S3 bucket. - */ - type _subTXThv = noSmithyDocumentSerde - interface RedirectAllRequestsTo extends _subTXThv { - /** - * Name of the host where requests are redirected. - * - * This member is required. - */ - hostName?: string - /** - * Protocol to use when redirecting requests. The default is the protocol that is - * used in the original request. - */ - protocol: Protocol - } - /** - * A container for replication rules. You can add up to 1,000 rules. The maximum - * size of a replication configuration is 2 MB. - */ - type _subiVRed = noSmithyDocumentSerde - interface ReplicationConfiguration extends _subiVRed { - /** - * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role - * that Amazon S3 assumes when replicating objects. For more information, see [How to Set Up Replication]in - * the Amazon S3 User Guide. - * - * [How to Set Up Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html - * - * This member is required. - */ - role?: string - /** - * A container for one or more replication rules. A replication configuration must - * have at least one rule and can contain a maximum of 1,000 rules. - * - * This member is required. - */ - rules: Array - } - /** - * Container for Payer. - */ - type _subsnwVf = noSmithyDocumentSerde - interface RequestPaymentConfiguration extends _subsnwVf { - /** - * Specifies who pays for the download and request fees. - * - * This member is required. - */ - payer: Payer - } - /** - * Container for specifying if periodic QueryProgress messages should be sent. - */ - type _subefJEa = noSmithyDocumentSerde - interface RequestProgress extends _subefJEa { - /** - * Specifies whether periodic QueryProgress frames should be sent. Valid values: - * TRUE, FALSE. Default value: FALSE. - */ - enabled?: boolean - } - /** - * Container for restore job parameters. - */ - type _subiBseV = noSmithyDocumentSerde - interface RestoreRequest extends _subiBseV { - /** - * Lifetime of the active copy in days. Do not use with restores that specify - * OutputLocation . - * - * The Days element is required for regular restores, and must not be provided for - * select requests. - */ - days?: number - /** - * The optional description for the job. - */ - description?: string - /** - * S3 Glacier related parameters pertaining to this job. Do not use with restores - * that specify OutputLocation . - */ - glacierJobParameters?: GlacierJobParameters - /** - * Describes the location where the restore job's output is stored. - */ - outputLocation?: OutputLocation - /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Describes the parameters for Select job types. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - */ - selectParameters?: SelectParameters - /** - * Retrieval tier at which the restore will be processed. - */ - tier: Tier - /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Type of restore request. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - */ - type: RestoreRequestType - } - /** - * Specifies the redirect behavior and when a redirect is applied. For more - * information about routing rules, see [Configuring advanced conditional redirects]in the Amazon S3 User Guide. - * - * [Configuring advanced conditional redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects - */ - type _submoxtI = noSmithyDocumentSerde - interface RoutingRule extends _submoxtI { - /** - * Container for redirect information. You can redirect requests to another host, - * to another page, or with another protocol. In the event of an error, you can - * specify a different error code to return. - * - * This member is required. - */ - redirect?: Redirect - /** - * A container for describing a condition that must be met for the specified - * redirect to apply. For example, 1. If request is for pages in the /docs folder, - * redirect to the /documents folder. 2. If request results in HTTP error 4xx, - * redirect request to another host where you might process the error. - */ - condition?: Condition - } - /** - * Specifies the byte range of the object to get the records from. A record is - * processed when its first byte is contained by the range. This parameter is - * optional, but when specified, it must not be empty. See RFC 2616, Section - * 14.35.1 about how to specify the start and end of the range. - */ - type _subRivjC = noSmithyDocumentSerde - interface ScanRange extends _subRivjC { - /** - * Specifies the end of the byte range. This parameter is optional. Valid values: - * non-negative integers. The default value is one less than the size of the object - * being queried. If only the End parameter is supplied, it is interpreted to mean - * scan the last N bytes of the file. For example, 50 means scan the last 50 bytes. - */ - end?: number - /** - * Specifies the start of the byte range. This parameter is optional. Valid - * values: non-negative integers. The default value is 0. If only start is - * supplied, it means scan from that point to the end of the file. For example, 50 - * means scan from byte 50 until the end of the file. - */ - start?: number - } - /** - * Specifies the default server-side-encryption configuration. - */ - type _subVPqsj = noSmithyDocumentSerde - interface ServerSideEncryptionConfiguration extends _subVPqsj { - /** - * Container for information about a particular server-side encryption - * configuration rule. - * - * This member is required. - */ - rules: Array - } - /** - * The established temporary security credentials of the session. - * - * Directory buckets - These session credentials are only supported for the - * authentication and authorization of Zonal endpoint API operations on directory - * buckets. - */ - type _subCZMxI = noSmithyDocumentSerde - interface SessionCredentials extends _subCZMxI { - /** - * A unique identifier that's associated with a secret access key. The access key - * ID and the secret access key are used together to sign programmatic Amazon Web - * Services requests cryptographically. - * - * This member is required. - */ - accessKeyId?: string - /** - * Temporary security credentials expire after a specified interval. After - * temporary credentials expire, any calls that you make with those credentials - * will fail. So you must generate a new set of temporary credentials. Temporary - * credentials cannot be extended or refreshed beyond the original specified - * interval. - * - * This member is required. - */ - expiration?: time.Time - /** - * A key that's used with the access key ID to cryptographically sign programmatic - * Amazon Web Services requests. Signing a request identifies the sender and - * prevents the request from being altered. - * - * This member is required. - */ - secretAccessKey?: string - /** - * A part of the temporary security credentials. The session token is used to - * validate the temporary security credentials. - * - * This member is required. - */ - sessionToken?: string - } - /** - * A container of a key value name pair. - */ - type _sublEKMb = noSmithyDocumentSerde - interface Tag extends _sublEKMb { - /** - * Name of the object key. - * - * This member is required. - */ - key?: string - /** - * Value of the tag. - * - * This member is required. - */ - value?: string - } - /** - * Container for TagSet elements. - */ - type _subDFXKG = noSmithyDocumentSerde - interface Tagging extends _subDFXKG { - /** - * A collection for a set of tags - * - * This member is required. - */ - tagSet: Array - } - /** - * A container for specifying the configuration for publication of messages to an - * Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects - * specified events. - */ - type _subBtArW = noSmithyDocumentSerde - interface TopicConfiguration extends _subBtArW { - /** - * The Amazon S3 bucket event about which to send notifications. For more - * information, see [Supported Event Types]in the Amazon S3 User Guide. - * - * [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - * - * This member is required. - */ - events: Array - /** - * The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 - * publishes a message when it detects events of the specified type. - * - * This member is required. - */ - topicArn?: string - /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html - */ - filter?: NotificationConfigurationFilter - /** - * An optional unique identifier for configurations in a notification - * configuration. If you don't provide one, Amazon S3 will assign an ID. - */ - id?: string - } - /** - * Describes the versioning state of an Amazon S3 bucket. For more information, - * see [PUT Bucket versioning]in the Amazon S3 API Reference. - * - * [PUT Bucket versioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html - */ - type _subVyFBK = noSmithyDocumentSerde - interface VersioningConfiguration extends _subVyFBK { - /** - * Specifies whether MFA delete is enabled in the bucket versioning configuration. - * This element is only returned if the bucket has been configured with MFA delete. - * If the bucket has never been so configured, this element is not returned. - */ - mfaDelete: MFADelete - /** - * The versioning state of the bucket. - */ - status: BucketVersioningStatus - } - /** - * Specifies website configuration parameters for an Amazon S3 bucket. - */ - type _submmRKx = noSmithyDocumentSerde - interface WebsiteConfiguration extends _submmRKx { - /** - * The name of the error document for the website. - */ - errorDocument?: ErrorDocument - /** - * The name of the index document for the website. - */ - indexDocument?: IndexDocument - /** - * The redirect behavior for every request to this bucket's website endpoint. - * - * If you specify this property, you can't specify any other property. - */ - redirectAllRequestsTo?: RedirectAllRequestsTo - /** - * Rules that define when a redirect is applied and the redirect behavior. - */ - routingRules: Array - } -} - -/** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: - * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) - * - * // Routes - * e.GET("/", hello) - * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` - * - * Learn more at https://echo.labstack.com - */ -namespace echo { - // @ts-ignore - import stdContext = context - /** - * Route contains information to adding/registering new route with the router. - * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. - */ - interface Route { - method: string - path: string - handler: HandlerFunc - middlewares: Array - name: string - } - interface Route { - /** - * ToRouteInfo converts Route to RouteInfo - */ - toRouteInfo(params: Array): RouteInfo - } - interface Route { - /** - * ToRoute returns Route which Router uses to register the method handler for path. - */ - toRoute(): Route - } - interface Route { - /** - * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums */ - forGroup(pathPrefix: string, middlewares: Array): Routable - } - /** - * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this - * interface are meant for request routing purposes and should not be used in middlewares. - */ - interface RoutableContext { - [key:string]: any; + checksumCRC32C?: string /** - * Request returns `*http.Request`. + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums */ - request(): (http.Request) + checksumSHA1?: string /** - * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html */ - rawPathParams(): (PathParams) + checksumSHA256?: string /** - * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). - * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. + * Entity tag returned when the part was uploaded. */ - setRawPathParams(params: PathParams): void + eTag?: string /** - * SetPath sets the registered path for the handler. + * Date and time at which the part was uploaded. */ - setPath(p: string): void + lastModified?: time.Time /** - * SetRouteInfo sets the route info of this request to the context. + * Part number identifying the part. This is a positive integer between 1 and + * 10,000. */ - setRouteInfo(ri: RouteInfo): void + partNumber?: number /** - * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context - * for later use in middlewares/handler. + * Size in bytes of the uploaded part data. */ - set(key: string, val: { - }): void + size?: number } /** - * PathParam is tuple pf path parameter name and its value in request path + * The container element for a bucket's policy status. */ - interface PathParam { - name: string - value: string + type _subSlORQ = noSmithyDocumentSerde + interface PolicyStatus extends _subSlORQ { + /** + * The policy status for this bucket. TRUE indicates that this bucket is public. + * FALSE indicates that the bucket is not public. + */ + isPublic?: boolean } -} - -/** - * Package bearer provides middleware and utilities for authenticating API - * operation calls with a Bearer Token. - */ -namespace bearer { - // @ts-ignore - import smithyhttp = http /** - * Token provides a type wrapping a bearer token and expiration metadata. + * The PublicAccessBlock configuration that you want to apply to this Amazon S3 + * bucket. You can enable the configuration options in any combination. For more + * information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in + * the Amazon S3 User Guide. + * + * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status */ - interface Token { - value: string - canExpire: boolean - expires: time.Time - } - interface Token { + type _subfBNiK = noSmithyDocumentSerde + interface PublicAccessBlockConfiguration extends _subfBNiK { /** - * Expired returns if the token's Expires time is before or equal to the time - * provided. If CanExpires is false, Expired will always return false. + * Specifies whether Amazon S3 should block public access control lists (ACLs) for + * this bucket and objects in this bucket. Setting this element to TRUE causes the + * following behavior: + * + * ``` + * - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + * + * - PUT Object calls fail if the request includes a public ACL. + * + * - PUT Bucket calls fail if the request includes a public ACL. + * ``` + * + * Enabling this setting doesn't affect existing policies or ACLs. */ - expired(now: time.Time): boolean + blockPublicAcls?: boolean + /** + * Specifies whether Amazon S3 should block public bucket policies for this + * bucket. Setting this element to TRUE causes Amazon S3 to reject calls to PUT + * Bucket policy if the specified bucket policy allows public access. + * + * Enabling this setting doesn't affect existing bucket policies. + */ + blockPublicPolicy?: boolean + /** + * Specifies whether Amazon S3 should ignore public ACLs for this bucket and + * objects in this bucket. Setting this element to TRUE causes Amazon S3 to ignore + * all public ACLs on this bucket and objects in this bucket. + * + * Enabling this setting doesn't affect the persistence of any existing ACLs and + * doesn't prevent new public ACLs from being set. + */ + ignorePublicAcls?: boolean + /** + * Specifies whether Amazon S3 should restrict public bucket policies for this + * bucket. Setting this element to TRUE restricts access to this bucket to only + * Amazon Web Servicesservice principals and authorized users within this account + * if the bucket has a public policy. + * + * Enabling this setting doesn't affect previously stored bucket policies, except + * that public and cross-account access within any public bucket policy, including + * non-public delegation to specific accounts, is blocked. + */ + restrictPublicBuckets?: boolean } - // @ts-ignore - import smithycontext = context -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - // @ts-ignore - import sdkrand = rand /** - * A Credentials is the AWS credentials value for individual credential fields. + * Specifies the configuration for publishing messages to an Amazon Simple Queue + * Service (Amazon SQS) queue when Amazon S3 detects specified events. */ - interface Credentials { + type _subYmItT = noSmithyDocumentSerde + interface QueueConfiguration extends _subYmItT { /** - * AWS Access key ID + * A collection of bucket events for which to send notifications + * + * This member is required. */ - accessKeyID: string + events: Array /** - * AWS Secret Access Key + * The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 + * publishes a message when it detects events of the specified type. + * + * This member is required. */ - secretAccessKey: string + queueArn?: string /** - * AWS Session Token + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + * + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html */ - sessionToken: string + filter?: NotificationConfigurationFilter /** - * Source of the credentials + * An optional unique identifier for configurations in a notification + * configuration. If you don't provide one, Amazon S3 will assign an ID. */ - source: string + id?: string + } + /** + * Specifies the redirect behavior of all requests to a website endpoint of an + * Amazon S3 bucket. + */ + type _subrdDeP = noSmithyDocumentSerde + interface RedirectAllRequestsTo extends _subrdDeP { /** - * States if the credentials can expire or not. + * Name of the host where requests are redirected. + * + * This member is required. */ - canExpire: boolean + hostName?: string /** - * The time the credentials will expire at. Should be ignored if CanExpire - * is false. + * Protocol to use when redirecting requests. The default is the protocol that is + * used in the original request. */ - expires: time.Time + protocol: Protocol + } + /** + * A container for replication rules. You can add up to 1,000 rules. The maximum + * size of a replication configuration is 2 MB. + */ + type _subhluIr = noSmithyDocumentSerde + interface ReplicationConfiguration extends _subhluIr { /** - * The ID of the account for the credentials. + * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role + * that Amazon S3 assumes when replicating objects. For more information, see [How to Set Up Replication]in + * the Amazon S3 User Guide. + * + * [How to Set Up Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html + * + * This member is required. */ - accountID: string - } - interface Credentials { + role?: string /** - * Expired returns if the credentials have expired. + * A container for one or more replication rules. A replication configuration must + * have at least one rule and can contain a maximum of 1,000 rules. + * + * This member is required. */ - expired(): boolean + rules: Array } - interface Credentials { + /** + * Container for Payer. + */ + type _subAbWTq = noSmithyDocumentSerde + interface RequestPaymentConfiguration extends _subAbWTq { /** - * HasKeys returns if the credentials keys are set. + * Specifies who pays for the download and request fees. + * + * This member is required. */ - hasKeys(): boolean + payer: Payer } /** - * Endpoint represents the endpoint a service client should make API operation - * calls to. - * - * The SDK will automatically resolve these endpoints per API client using an - * internal endpoint resolvers. If you'd like to provide custom endpoint - * resolving behavior you can implement the EndpointResolver interface. - * - * Deprecated: This structure was used with the global [EndpointResolver] - * interface, which has been deprecated in favor of service-specific endpoint - * resolution. See the deprecation docs on that interface for more information. + * Container for specifying if periodic QueryProgress messages should be sent. */ - interface Endpoint { + type _subfVUrc = noSmithyDocumentSerde + interface RequestProgress extends _subfVUrc { /** - * The base URL endpoint the SDK API clients will use to make API calls to. - * The SDK will suffix URI path and query elements to this endpoint. + * Specifies whether periodic QueryProgress frames should be sent. Valid values: + * TRUE, FALSE. Default value: FALSE. */ - url: string + enabled?: boolean + } + /** + * Container for restore job parameters. + */ + type _subpgvbW = noSmithyDocumentSerde + interface RestoreRequest extends _subpgvbW { /** - * Specifies if the endpoint's hostname can be modified by the SDK's API - * client. - * - * If the hostname is mutable the SDK API clients may modify any part of - * the hostname based on the requirements of the API, (e.g. adding, or - * removing content in the hostname). Such as, Amazon S3 API client - * prefixing "bucketname" to the hostname, or changing the - * hostname service name component from "s3." to "s3-accesspoint.dualstack." - * for the dualstack endpoint of an S3 Accesspoint resource. - * - * Care should be taken when providing a custom endpoint for an API. If the - * endpoint hostname is mutable, and the client cannot modify the endpoint - * correctly, the operation call will most likely fail, or have undefined - * behavior. - * - * If hostname is immutable, the SDK API clients will not modify the - * hostname of the URL. This may cause the API client not to function - * correctly if the API requires the operation specific hostname values - * to be used by the client. + * Lifetime of the active copy in days. Do not use with restores that specify + * OutputLocation . * - * This flag does not modify the API client's behavior if this endpoint - * will be used instead of Endpoint Discovery, or if the endpoint will be - * used to perform Endpoint Discovery. That behavior is configured via the - * API Client's Options. + * The Days element is required for regular restores, and must not be provided for + * select requests. */ - hostnameImmutable: boolean + days?: number /** - * The AWS partition the endpoint belongs to. + * The optional description for the job. */ - partitionID: string + description?: string /** - * The service name that should be used for signing the requests to the - * endpoint. + * S3 Glacier related parameters pertaining to this job. Do not use with restores + * that specify OutputLocation . */ - signingName: string + glacierJobParameters?: GlacierJobParameters /** - * The region that should be used for signing the request to the endpoint. + * Describes the location where the restore job's output is stored. */ - signingRegion: string + outputLocation?: OutputLocation /** - * The signing method that should be used for signing the requests to the - * endpoint. + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Describes the parameters for Select job types. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ */ - signingMethod: string + selectParameters?: SelectParameters /** - * The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata. - * When providing a custom endpoint, you should set the source as EndpointSourceCustom. - * If source is not provided when providing a custom endpoint, the SDK may not - * perform required host mutations correctly. Source should be used along with - * HostnameImmutable property as per the usage requirement. + * Retrieval tier at which the restore will be processed. */ - source: EndpointSource - } - /** - * ExecutionEnvironmentID is the AWS execution environment runtime identifier. - */ - interface ExecutionEnvironmentID extends String{} -} - -/** - * Package s3 provides the API client, operations, and parameter types for Amazon - * Simple Storage Service. - */ -namespace s3 { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import awshttp = http - // @ts-ignore - import internalauth = auth - // @ts-ignore - import internalauthsmithy = smithy - // @ts-ignore - import internalConfig = configsources - // @ts-ignore - import internalmiddleware = middleware - // @ts-ignore - import acceptencodingcust = accept_encoding - // @ts-ignore - import internalChecksum = checksum - // @ts-ignore - import presignedurlcust = presigned_url - // @ts-ignore - import s3sharedconfig = config - // @ts-ignore - import s3cust = customizations - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithyauth = auth - // @ts-ignore - import smithydocument = document - // @ts-ignore - import smithyhttp = http - interface noSmithyDocumentSerde extends smithydocument.NoSerde{} - interface HTTPSignerV4 { - [key:string]: any; - signHTTP(ctx: context.Context, credentials: aws.Credentials, r: http.Request, payloadHash: string, service: string, region: string, signingTime: time.Time, ...optFns: ((_arg0: v4.SignerOptions) => void)[]): void + tier: Tier + /** + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Type of restore request. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + */ + type: RestoreRequestType } - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import smithyio = io - // @ts-ignore - import smithytime = time - // @ts-ignore - import smithywaiter = waiter - // @ts-ignore - import smithysync = sync /** - * SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent operation. + * Specifies the redirect behavior and when a redirect is applied. For more + * information about routing rules, see [Configuring advanced conditional redirects]in the Amazon S3 User Guide. * - * For testing and mocking the event stream this type should be initialized via - * the NewSelectObjectContentEventStream constructor function. Using the functional options - * to pass in nested mock behavior. + * [Configuring advanced conditional redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects */ - interface SelectObjectContentEventStream { + type _subgmBiz = noSmithyDocumentSerde + interface RoutingRule extends _subgmBiz { /** - * SelectObjectContentEventStreamReader is the EventStream reader for the - * SelectObjectContentEventStream events. This value is automatically set by the - * SDK when the API call is made Use this member when unit testing your code with - * the SDK to mock out the EventStream Reader. + * Container for redirect information. You can redirect requests to another host, + * to another page, or with another protocol. In the event of an error, you can + * specify a different error code to return. * - * Must not be nil. + * This member is required. */ - reader: SelectObjectContentEventStreamReader - } - interface SelectObjectContentEventStream { + redirect?: Redirect /** - * Events returns a channel to read events from. + * A container for describing a condition that must be met for the specified + * redirect to apply. For example, 1. If request is for pages in the /docs folder, + * redirect to the /documents folder. 2. If request results in HTTP error 4xx, + * redirect request to another host where you might process the error. */ - events(): undefined + condition?: Condition } - interface SelectObjectContentEventStream { + /** + * Specifies the byte range of the object to get the records from. A record is + * processed when its first byte is contained by the range. This parameter is + * optional, but when specified, it must not be empty. See RFC 2616, Section + * 14.35.1 about how to specify the start and end of the range. + */ + type _subkqDeR = noSmithyDocumentSerde + interface ScanRange extends _subkqDeR { /** - * Close closes the stream. This will also cause the stream to be closed. - * Close must be called when done using the stream API. Not calling Close - * may result in resource leaks. - * - * Will close the underlying EventStream writer and reader, and no more events can be - * sent or received. + * Specifies the end of the byte range. This parameter is optional. Valid values: + * non-negative integers. The default value is one less than the size of the object + * being queried. If only the End parameter is supplied, it is interpreted to mean + * scan the last N bytes of the file. For example, 50 means scan the last 50 bytes. */ - close(): void - } - interface SelectObjectContentEventStream { + end?: number /** - * Err returns any error that occurred while reading or writing EventStream Events - * from the service API's response. Returns nil if there were no errors. - */ - err(): void - } - /** - * AuthSchemeResolver returns a set of possible authentication options for an - * operation. - */ - interface AuthSchemeResolver { - [key:string]: any; - resolveAuthSchemes(_arg0: context.Context, _arg1: AuthResolverParameters): Array<(smithyauth.Option | undefined)> - } - // @ts-ignore - import internalcontext = context - // @ts-ignore - import awsxml = xml - // @ts-ignore - import internalendpoints = endpoints - // @ts-ignore - import smithyendpoints = endpoints - /** - * EndpointResolverOptions is the service endpoint resolver options - */ - interface EndpointResolverOptions extends internalendpoints.Options{} - /** - * EndpointResolver interface for resolving service endpoints. - */ - interface EndpointResolver { - [key:string]: any; - resolveEndpoint(region: string, options: EndpointResolverOptions): aws.Endpoint + * Specifies the start of the byte range. This parameter is optional. Valid + * values: non-negative integers. The default value is 0. If only start is + * supplied, it means scan from that point to the end of the file. For example, 50 + * means scan from byte 50 until the end of the file. + */ + start?: number } /** - * EndpointResolverV2 provides the interface for resolving service endpoints. + * Specifies the default server-side-encryption configuration. */ - interface EndpointResolverV2 { - [key:string]: any; + type _subULGqH = noSmithyDocumentSerde + interface ServerSideEncryptionConfiguration extends _subULGqH { /** - * ResolveEndpoint attempts to resolve the endpoint with the provided options, - * returning the endpoint if found. Otherwise an error is returned. + * Container for information about a particular server-side encryption + * configuration rule. + * + * This member is required. */ - resolveEndpoint(ctx: context.Context, params: EndpointParameters): smithyendpoints.Endpoint + rules: Array } /** - * ExpressCredentialsProvider retrieves credentials for operations against the - * S3Express storage class. + * The established temporary security credentials of the session. + * + * Directory buckets - These session credentials are only supported for the + * authentication and authorization of Zonal endpoint API operations on directory + * buckets. */ - interface ExpressCredentialsProvider extends customizations.S3ExpressCredentialsProvider{} - interface HTTPClient { - [key:string]: any; - do(_arg0: http.Request): (http.Response) - } - // @ts-ignore - import v4 = signer -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - interface EmailTemplate { - body: string - subject: string - actionUrl: string - hidden: boolean - } - interface EmailTemplate { + type _subBNDTI = noSmithyDocumentSerde + interface SessionCredentials extends _subBNDTI { /** - * Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. + * A unique identifier that's associated with a secret access key. The access key + * ID and the secret access key are used together to sign programmatic Amazon Web + * Services requests cryptographically. + * + * This member is required. */ - validate(): void - } - interface EmailTemplate { + accessKeyId?: string /** - * Resolve replaces the placeholder parameters in the current email - * template and returns its components as ready-to-use strings. + * Temporary security credentials expire after a specified interval. After + * temporary credentials expire, any calls that you make with those credentials + * will fail. So you must generate a new set of temporary credentials. Temporary + * credentials cannot be extended or refreshed beyond the original specified + * interval. + * + * This member is required. */ - resolve(appName: string, appUrl: string, token: string): [string, string, string] - } -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` - * slog.SetDefault(logger) - * ``` - * - * will cause the top-level functions like [Info] to use it. - * [SetDefault] also updates the default logger used by the [log] package, - * so that existing applications that use [log.Printf] and related functions - * will send log records to the logger's handler without needing to be rewritten. - * - * Some attributes are common to many log calls. - * For example, you may wish to include the URL or trace identifier of a server request - * with all log events arising from the request. - * Rather than repeat the attribute with every log call, you can use [Logger.With] - * to construct a new Logger containing the attributes: - * - * ``` - * logger2 := logger.With("url", r.URL) - * ``` - * - * The arguments to With are the same key-value pairs used in [Logger.Info]. - * The result is a new Logger with the same handler as the original, but additional - * attributes that will appear in the output of every call. - * - * # Levels - * - * A [Level] is an integer representing the importance or severity of a log event. - * The higher the level, the more severe the event. - * This package defines constants for the most common levels, - * but any int can be used as a level. - * - * In an application, you may wish to log messages only at a certain level or greater. - * One common configuration is to log messages at Info or higher levels, - * suppressing debug logging until it is needed. - * The built-in handlers can be configured with the minimum level to output by - * setting [HandlerOptions.Level]. - * The program's `main` function typically does this. - * The default value is LevelInfo. - * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: - * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: - * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` - * - * Now the program can change its logging level with a single statement: - * - * ``` - * programLevel.Set(slog.LevelDebug) - * ``` - * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. - * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: - * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` - * - * TextHandler would display this group as - * - * ``` - * request.method=GET request.url=http://example.com - * ``` - * - * JSONHandler would display it as - * - * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. - * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: - * - * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. - * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, - * - * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement - * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` - * - * behaves the same as - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` - * - * is the most efficient way to achieve the same output as - * - * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call - * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` - * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: - * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` - * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: - * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: - * - * ``` - * type expensive struct { arg int } - * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } - * ``` - * - * Then use a value of that type in log calls: - * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - /** - * An Attr is a key-value pair. - */ - interface Attr { - key: string - value: Value - } - interface Attr { + expiration?: time.Time /** - * Equal reports whether a and b have equal keys and values. + * A key that's used with the access key ID to cryptographically sign programmatic + * Amazon Web Services requests. Signing a request identifies the sender and + * prevents the request from being altered. + * + * This member is required. */ - equal(b: Attr): boolean - } - interface Attr { - string(): string + secretAccessKey?: string + /** + * A part of the temporary security credentials. The session token is used to + * validate the temporary security credentials. + * + * This member is required. + */ + sessionToken?: string } /** - * A Handler handles log records produced by a Logger. - * - * A typical handler may print log records to standard error, - * or write them to a file or database, or perhaps augment them - * with additional attributes and pass them on to another handler. - * - * Any of the Handler's methods may be called concurrently with itself - * or with other methods. It is the responsibility of the Handler to - * manage this concurrency. - * - * Users of the slog package should not invoke Handler methods directly. - * They should use the methods of [Logger] instead. + * A container of a key value name pair. */ - interface Handler { - [key:string]: any; + type _subcoyTd = noSmithyDocumentSerde + interface Tag extends _subcoyTd { /** - * Enabled reports whether the handler handles records at the given level. - * The handler ignores records whose level is lower. - * It is called early, before any arguments are processed, - * to save effort if the log event should be discarded. - * If called from a Logger method, the first argument is the context - * passed to that method, or context.Background() if nil was passed - * or the method does not take a context. - * The context is passed so Enabled can use its values - * to make a decision. - */ - enabled(_arg0: context.Context, _arg1: Level): boolean - /** - * Handle handles the Record. - * It will only be called when Enabled returns true. - * The Context argument is as for Enabled. - * It is present solely to provide Handlers access to the context's values. - * Canceling the context should not affect record processing. - * (Among other things, log messages may be necessary to debug a - * cancellation-related problem.) + * Name of the object key. * - * Handle methods that produce output should observe the following rules: - * ``` - * - If r.Time is the zero time, ignore the time. - * - If r.PC is zero, ignore it. - * - Attr's values should be resolved. - * - If an Attr's key and value are both the zero value, ignore the Attr. - * This can be tested with attr.Equal(Attr{}). - * - If a group's key is empty, inline the group's Attrs. - * - If a group has no Attrs (even if it has a non-empty key), - * ignore it. - * ``` + * This member is required. */ - handle(_arg0: context.Context, _arg1: Record): void + key?: string /** - * WithAttrs returns a new Handler whose attributes consist of - * both the receiver's attributes and the arguments. - * The Handler owns the slice: it may retain, modify or discard it. + * Value of the tag. + * + * This member is required. */ - withAttrs(attrs: Array): Handler + value?: string + } + /** + * Container for TagSet elements. + */ + type _subTATMo = noSmithyDocumentSerde + interface Tagging extends _subTATMo { /** - * WithGroup returns a new Handler with the given group appended to - * the receiver's existing groups. - * The keys of all subsequent attributes, whether added by With or in a - * Record, should be qualified by the sequence of group names. - * - * How this qualification happens is up to the Handler, so long as - * this Handler's attribute keys differ from those of another Handler - * with a different sequence of group names. + * A collection for a set of tags * - * A Handler should treat WithGroup as starting a Group of Attrs that ends - * at the end of the log event. That is, + * This member is required. + */ + tagSet: Array + } + /** + * A container for specifying the configuration for publication of messages to an + * Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects + * specified events. + */ + type _subHWkEl = noSmithyDocumentSerde + interface TopicConfiguration extends _subHWkEl { + /** + * The Amazon S3 bucket event about which to send notifications. For more + * information, see [Supported Event Types]in the Amazon S3 User Guide. * - * ``` - * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) - * ``` + * [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html * - * should behave like + * This member is required. + */ + events: Array + /** + * The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 + * publishes a message when it detects events of the specified type. * - * ``` - * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) - * ``` + * This member is required. + */ + topicArn?: string + /** + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. * - * If the name is empty, WithGroup returns the receiver. + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html */ - withGroup(name: string): Handler + filter?: NotificationConfigurationFilter + /** + * An optional unique identifier for configurations in a notification + * configuration. If you don't provide one, Amazon S3 will assign an ID. + */ + id?: string } /** - * A Level is the importance or severity of a log event. - * The higher the level, the more important or severe the event. + * Describes the versioning state of an Amazon S3 bucket. For more information, + * see [PUT Bucket versioning]in the Amazon S3 API Reference. + * + * [PUT Bucket versioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html */ - interface Level extends Number{} - interface Level { + type _subIcZDf = noSmithyDocumentSerde + interface VersioningConfiguration extends _subIcZDf { /** - * String returns a name for the level. - * If the level has a name, then that name - * in uppercase is returned. - * If the level is between named values, then - * an integer is appended to the uppercased name. - * Examples: - * - * ``` - * LevelWarn.String() => "WARN" - * (LevelInfo+2).String() => "INFO+2" - * ``` + * Specifies whether MFA delete is enabled in the bucket versioning configuration. + * This element is only returned if the bucket has been configured with MFA delete. + * If the bucket has never been so configured, this element is not returned. */ - string(): string - } - interface Level { + mfaDelete: MFADelete /** - * MarshalJSON implements [encoding/json.Marshaler] - * by quoting the output of [Level.String]. + * The versioning state of the bucket. */ - marshalJSON(): string|Array + status: BucketVersioningStatus } - interface Level { + /** + * Specifies website configuration parameters for an Amazon S3 bucket. + */ + type _subtLumZ = noSmithyDocumentSerde + interface WebsiteConfiguration extends _subtLumZ { /** - * UnmarshalJSON implements [encoding/json.Unmarshaler] - * It accepts any string produced by [Level.MarshalJSON], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". + * The name of the error document for the website. */ - unmarshalJSON(data: string|Array): void - } - interface Level { + errorDocument?: ErrorDocument /** - * MarshalText implements [encoding.TextMarshaler] - * by calling [Level.String]. + * The name of the index document for the website. */ - marshalText(): string|Array - } - interface Level { + indexDocument?: IndexDocument /** - * UnmarshalText implements [encoding.TextUnmarshaler]. - * It accepts any string produced by [Level.MarshalText], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". + * The redirect behavior for every request to this bucket's website endpoint. + * + * If you specify this property, you can't specify any other property. */ - unmarshalText(data: string|Array): void - } - interface Level { + redirectAllRequestsTo?: RedirectAllRequestsTo /** - * Level returns the receiver. - * It implements [Leveler]. + * Rules that define when a redirect is applied and the redirect behavior. */ - level(): Level + routingRules: Array } - // @ts-ignore - import loginternal = internal } /** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. + * Package s3 provides the API client, operations, and parameter types for Amazon + * Simple Storage Service. */ -namespace core { - interface BaseModelEvent { - model: models.Model - } - interface BaseModelEvent { - tags(): Array - } - interface BaseCollectionEvent { - collection?: models.Collection - } - interface BaseCollectionEvent { - tags(): Array +namespace s3 { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import awshttp = http + // @ts-ignore + import internalauth = auth + // @ts-ignore + import internalauthsmithy = smithy + // @ts-ignore + import internalConfig = configsources + // @ts-ignore + import internalmiddleware = middleware + // @ts-ignore + import acceptencodingcust = accept_encoding + // @ts-ignore + import internalChecksum = checksum + // @ts-ignore + import presignedurlcust = presigned_url + // @ts-ignore + import s3sharedconfig = config + // @ts-ignore + import s3cust = customizations + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithyauth = auth + // @ts-ignore + import smithydocument = document + // @ts-ignore + import smithyhttp = http + interface noSmithyDocumentSerde extends smithydocument.NoSerde{} + interface HTTPSignerV4 { + [key:string]: any; + signHTTP(ctx: context.Context, credentials: aws.Credentials, r: http.Request, payloadHash: string, service: string, region: string, signingTime: time.Time, ...optFns: ((_arg0: v4.SignerOptions) => void)[]): void } -} - -namespace subscriptions { -} - -/** - * Package middleware provides transport agnostic middleware for decorating SDK - * handlers. - * - * The Smithy middleware stack provides ordered behavior to be invoked on an - * underlying handler. The stack is separated into steps that are invoked in a - * static order. A step is a collection of middleware that are injected into a - * ordered list defined by the user. The user may add, insert, swap, and remove a - * step's middleware. When the stack is invoked the step middleware become static, - * and their order cannot be modified. - * - * A stack and its step middleware are **not** safe to modify concurrently. - * - * A stack will use the ordered list of middleware to decorate a underlying - * handler. A handler could be something like an HTTP Client that round trips an - * API operation over HTTP. - * - * Smithy Middleware Stack - * - * A Stack is a collection of middleware that wrap a handler. The stack can be - * broken down into discreet steps. Each step may contain zero or more middleware - * specific to that stack's step. - * - * A Stack Step is a predefined set of middleware that are invoked in a static - * order by the Stack. These steps represent fixed points in the middleware stack - * for organizing specific behavior, such as serialize and build. A Stack Step is - * composed of zero or more middleware that are specific to that step. A step may - * define its own set of input/output parameters the generic input/output - * parameters are cast from. A step calls its middleware recursively, before - * calling the next step in the stack returning the result or error of the step - * middleware decorating the underlying handler. - * - * * Initialize: Prepares the input, and sets any default parameters as needed, - * (e.g. idempotency token, and presigned URLs). - * - * * Serialize: Serializes the prepared input into a data structure that can be - * consumed by the target transport's message, (e.g. REST-JSON serialization). - * - * * Build: Adds additional metadata to the serialized transport message, (e.g. - * HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. - * - * * Finalize: Performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated to - * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request - * signing). - * - * * Deserialize: Reacts to the handler's response returned by the recipient of - * the request message. Deserializes the response into a structured type or - * error above stacks can react to. - * - * Adding Middleware to a Stack Step - * - * Middleware can be added to a step front or back, or relative, by name, to an - * existing middleware in that stack. If a middleware does not have a name, a - * unique name will be generated at the middleware and be added to the step. - * - * ``` - * // Create middleware stack - * stack := middleware.NewStack() - * - * // Add middleware to stack steps - * stack.Initialize.Add(paramValidationMiddleware, middleware.After) - * stack.Serialize.Add(marshalOperationFoo, middleware.After) - * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) - * - * // Invoke middleware on handler. - * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) - * ``` - */ -namespace middleware { - /** - * RelativePosition provides specifying the relative position of a middleware - * in an ordered group. - */ - interface RelativePosition extends Number{} + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import smithyio = io + // @ts-ignore + import smithytime = time + // @ts-ignore + import smithywaiter = waiter + // @ts-ignore + import smithysync = sync /** - * BuildMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next BuildHandler for further - * processing. + * SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent operation. + * + * For testing and mocking the event stream this type should be initialized via + * the NewSelectObjectContentEventStream constructor function. Using the functional options + * to pass in nested mock behavior. */ - interface BuildMiddleware { - [key:string]: any; + interface SelectObjectContentEventStream { /** - * Unique ID for the middleware in theBuildStep. The step does not allow - * duplicate IDs. + * SelectObjectContentEventStreamReader is the EventStream reader for the + * SelectObjectContentEventStream events. This value is automatically set by the + * SDK when the API call is made Use this member when unit testing your code with + * the SDK to mock out the EventStream Reader. + * + * Must not be nil. */ - id(): string + reader: SelectObjectContentEventStreamReader + } + interface SelectObjectContentEventStream { /** - * Invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. + * Events returns a channel to read events from. */ - handleBuild(ctx: context.Context, _arg10: BuildInput, next: BuildHandler): [BuildOutput, Metadata] + events(): undefined } - /** - * DeserializeMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next DeserializeHandler for further - * processing. - */ - interface DeserializeMiddleware { - [key:string]: any; + interface SelectObjectContentEventStream { /** - * ID returns a unique ID for the middleware in the DeserializeStep. The step does not - * allow duplicate IDs. + * Close closes the stream. This will also cause the stream to be closed. + * Close must be called when done using the stream API. Not calling Close + * may result in resource leaks. + * + * Will close the underlying EventStream writer and reader, and no more events can be + * sent or received. */ - id(): string + close(): void + } + interface SelectObjectContentEventStream { /** - * HandleDeserialize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. + * Err returns any error that occurred while reading or writing EventStream Events + * from the service API's response. Returns nil if there were no errors. */ - handleDeserialize(ctx: context.Context, _arg10: DeserializeInput, next: DeserializeHandler): [DeserializeOutput, Metadata] + err(): void } /** - * FinalizeMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next FinalizeHandler for further - * processing. + * AuthSchemeResolver returns a set of possible authentication options for an + * operation. */ - interface FinalizeMiddleware { + interface AuthSchemeResolver { [key:string]: any; - /** - * ID returns a unique ID for the middleware in the FinalizeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleFinalize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleFinalize(ctx: context.Context, _arg10: FinalizeInput, next: FinalizeHandler): [FinalizeOutput, Metadata] + resolveAuthSchemes(_arg0: context.Context, _arg1: AuthResolverParameters): Array<(smithyauth.Option | undefined)> } + // @ts-ignore + import internalcontext = context + // @ts-ignore + import awsxml = xml + // @ts-ignore + import internalendpoints = endpoints + // @ts-ignore + import smithyendpoints = endpoints /** - * InitializeMiddleware provides the interface for middleware specific to the - * initialize step. Delegates to the next InitializeHandler for further - * processing. + * EndpointResolverOptions is the service endpoint resolver options */ - interface InitializeMiddleware { + interface EndpointResolverOptions extends internalendpoints.Options{} + /** + * EndpointResolver interface for resolving service endpoints. + */ + interface EndpointResolver { [key:string]: any; - /** - * ID returns a unique ID for the middleware in the InitializeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleInitialize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleInitialize(ctx: context.Context, _arg10: InitializeInput, next: InitializeHandler): [InitializeOutput, Metadata] + resolveEndpoint(region: string, options: EndpointResolverOptions): aws.Endpoint } /** - * SerializeMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next SerializeHandler for further - * processing. + * EndpointResolverV2 provides the interface for resolving service endpoints. */ - interface SerializeMiddleware { + interface EndpointResolverV2 { [key:string]: any; /** - * ID returns a unique ID for the middleware in the SerializeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleSerialize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. + * ResolveEndpoint attempts to resolve the endpoint with the provided options, + * returning the endpoint if found. Otherwise an error is returned. */ - handleSerialize(ctx: context.Context, _arg10: SerializeInput, next: SerializeHandler): [SerializeOutput, Metadata] + resolveEndpoint(ctx: context.Context, params: EndpointParameters): smithyendpoints.Endpoint } -} - -/** - * Package auth defines protocol-agnostic authentication types for smithy - * clients. - */ -namespace auth { /** - * Identity contains information that identifies who the user making the - * request is. + * ExpressCredentialsProvider retrieves credentials for operations against the + * S3Express storage class. */ - interface Identity { + interface ExpressCredentialsProvider extends customizations.S3ExpressCredentialsProvider{} + interface HTTPClient { [key:string]: any; - expiration(): time.Time + do(_arg0: http.Request): (http.Response) } - /** - * IdentityResolverOptions defines the interface through which an entity can be - * queried to retrieve an IdentityResolver for a given auth scheme. - */ - interface IdentityResolverOptions { - [key:string]: any; - getIdentityResolver(schemeID: string): IdentityResolver + // @ts-ignore + import v4 = signer +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + interface EmailTemplate { + body: string + subject: string + actionUrl: string + hidden: boolean } - /** - * Option represents a possible authentication method for an operation. - */ - interface Option { - schemeID: string - identityProperties: smithy.Properties - signerProperties: smithy.Properties + interface EmailTemplate { + /** + * Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface EmailTemplate { + /** + * Resolve replaces the placeholder parameters in the current email + * template and returns its components as ready-to-use strings. + */ + resolve(appName: string, appUrl: string, token: string): [string, string, string] } } -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { +namespace subscriptions { /** - * MeterOption applies configuration to a Meter. + * Message defines a client's channel data. */ - interface MeterOption {(o: MeterOptions): void } + interface Message { + name: string + data: string|Array + } /** - * Meter is the entry point for creation of measurement instruments. + * Client is an interface for a generic subscription client. */ - interface Meter { + interface Client { [key:string]: any; /** - * integer/synchronous + * Id Returns the unique id of the client. + */ + id(): string + /** + * Channel returns the client's communication channel. + */ + channel(): undefined + /** + * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. + * If no prefix is specified, returns all subscriptions. + */ + subscriptions(...prefixes: string[]): _TygojaDict + /** + * Subscribe subscribes the client to the provided subscriptions list. + * + * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. + * + * Example: + * + * ``` + * Subscribe( + * "subscriptionA", + * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, + * ) + * ``` + */ + subscribe(...subs: string[]): void + /** + * Unsubscribe unsubscribes the client from the provided subscriptions list. + */ + unsubscribe(...subs: string[]): void + /** + * HasSubscription checks if the client is subscribed to `sub`. + */ + hasSubscription(sub: string): boolean + /** + * Set stores any value to the client's context. + */ + set(key: string, value: any): void + /** + * Unset removes a single value from the client's context. */ - int64Counter(name: string, ...opts: InstrumentOption[]): Int64Counter - int64UpDownCounter(name: string, ...opts: InstrumentOption[]): Int64UpDownCounter - int64Gauge(name: string, ...opts: InstrumentOption[]): Int64Gauge - int64Histogram(name: string, ...opts: InstrumentOption[]): Int64Histogram + unset(key: string): void /** - * integer/asynchronous + * Get retrieves the key value from the client's context. */ - int64AsyncCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument - int64AsyncUpDownCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument - int64AsyncGauge(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + get(key: string): any /** - * floating-point/synchronous + * Discard marks the client as "discarded", meaning that it + * shouldn't be used anymore for sending new messages. + * + * It is safe to call Discard() multiple times. */ - float64Counter(name: string, ...opts: InstrumentOption[]): Float64Counter - float64UpDownCounter(name: string, ...opts: InstrumentOption[]): Float64UpDownCounter - float64Gauge(name: string, ...opts: InstrumentOption[]): Float64Gauge - float64Histogram(name: string, ...opts: InstrumentOption[]): Float64Histogram + discard(): void /** - * floating-point/asynchronous + * IsDiscarded indicates whether the client has been "discarded" + * and should no longer be used. */ - float64AsyncCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument - float64AsyncUpDownCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument - float64AsyncGauge(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + isDiscarded(): boolean + /** + * Send sends the specified message to the client's channel (if not discarded). + */ + send(m: Message): void } } /** - * Package tracing defines tracing APIs to be used by Smithy clients. + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. */ -namespace tracing { - /** - * TracerOption applies configuration to a tracer. - */ - interface TracerOption {(o: TracerOptions): void } - /** - * Tracer is the entry point for creating observed client Spans. - * - * Spans created by tracers propagate by existing on the Context. Consumers of - * the API can use [GetSpan] to pull the active Span from a Context. - * - * Creation of child Spans is implicit through Context persistence. If - * CreateSpan is called with a Context that holds a Span, the result will be a - * child of that Span. - */ - interface Tracer { - [key:string]: any; - startSpan(ctx: context.Context, name: string, ...opts: SpanOption[]): [context.Context, Span] +namespace core { + interface BaseModelEvent { + model: models.Model + } + interface BaseModelEvent { + tags(): Array + } + interface BaseCollectionEvent { + collection?: models.Collection + } + interface BaseCollectionEvent { + tags(): Array } } @@ -41239,6 +40978,276 @@ namespace http { import urlpkg = url } +/** + * Package middleware provides transport agnostic middleware for decorating SDK + * handlers. + * + * The Smithy middleware stack provides ordered behavior to be invoked on an + * underlying handler. The stack is separated into steps that are invoked in a + * static order. A step is a collection of middleware that are injected into a + * ordered list defined by the user. The user may add, insert, swap, and remove a + * step's middleware. When the stack is invoked the step middleware become static, + * and their order cannot be modified. + * + * A stack and its step middleware are **not** safe to modify concurrently. + * + * A stack will use the ordered list of middleware to decorate a underlying + * handler. A handler could be something like an HTTP Client that round trips an + * API operation over HTTP. + * + * Smithy Middleware Stack + * + * A Stack is a collection of middleware that wrap a handler. The stack can be + * broken down into discreet steps. Each step may contain zero or more middleware + * specific to that stack's step. + * + * A Stack Step is a predefined set of middleware that are invoked in a static + * order by the Stack. These steps represent fixed points in the middleware stack + * for organizing specific behavior, such as serialize and build. A Stack Step is + * composed of zero or more middleware that are specific to that step. A step may + * define its own set of input/output parameters the generic input/output + * parameters are cast from. A step calls its middleware recursively, before + * calling the next step in the stack returning the result or error of the step + * middleware decorating the underlying handler. + * + * * Initialize: Prepares the input, and sets any default parameters as needed, + * (e.g. idempotency token, and presigned URLs). + * + * * Serialize: Serializes the prepared input into a data structure that can be + * consumed by the target transport's message, (e.g. REST-JSON serialization). + * + * * Build: Adds additional metadata to the serialized transport message, (e.g. + * HTTP's Content-Length header, or body checksum). Decorations and + * modifications to the message should be copied to all message attempts. + * + * * Finalize: Performs final preparations needed before sending the message. The + * message should already be complete by this stage, and is only alternated to + * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request + * signing). + * + * * Deserialize: Reacts to the handler's response returned by the recipient of + * the request message. Deserializes the response into a structured type or + * error above stacks can react to. + * + * Adding Middleware to a Stack Step + * + * Middleware can be added to a step front or back, or relative, by name, to an + * existing middleware in that stack. If a middleware does not have a name, a + * unique name will be generated at the middleware and be added to the step. + * + * ``` + * // Create middleware stack + * stack := middleware.NewStack() + * + * // Add middleware to stack steps + * stack.Initialize.Add(paramValidationMiddleware, middleware.After) + * stack.Serialize.Add(marshalOperationFoo, middleware.After) + * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) + * + * // Invoke middleware on handler. + * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) + * ``` + */ +namespace middleware { + /** + * RelativePosition provides specifying the relative position of a middleware + * in an ordered group. + */ + interface RelativePosition extends Number{} + /** + * BuildMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next BuildHandler for further + * processing. + */ + interface BuildMiddleware { + [key:string]: any; + /** + * Unique ID for the middleware in theBuildStep. The step does not allow + * duplicate IDs. + */ + id(): string + /** + * Invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleBuild(ctx: context.Context, _arg10: BuildInput, next: BuildHandler): [BuildOutput, Metadata] + } + /** + * DeserializeMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next DeserializeHandler for further + * processing. + */ + interface DeserializeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the DeserializeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleDeserialize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleDeserialize(ctx: context.Context, _arg10: DeserializeInput, next: DeserializeHandler): [DeserializeOutput, Metadata] + } + /** + * FinalizeMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next FinalizeHandler for further + * processing. + */ + interface FinalizeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the FinalizeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleFinalize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleFinalize(ctx: context.Context, _arg10: FinalizeInput, next: FinalizeHandler): [FinalizeOutput, Metadata] + } + /** + * InitializeMiddleware provides the interface for middleware specific to the + * initialize step. Delegates to the next InitializeHandler for further + * processing. + */ + interface InitializeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the InitializeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleInitialize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleInitialize(ctx: context.Context, _arg10: InitializeInput, next: InitializeHandler): [InitializeOutput, Metadata] + } + /** + * SerializeMiddleware provides the interface for middleware specific to the + * serialize step. Delegates to the next SerializeHandler for further + * processing. + */ + interface SerializeMiddleware { + [key:string]: any; + /** + * ID returns a unique ID for the middleware in the SerializeStep. The step does not + * allow duplicate IDs. + */ + id(): string + /** + * HandleSerialize invokes the middleware behavior which must delegate to the next handler + * for the middleware chain to continue. The method must return a result or + * error to its caller. + */ + handleSerialize(ctx: context.Context, _arg10: SerializeInput, next: SerializeHandler): [SerializeOutput, Metadata] + } +} + +/** + * Package auth defines protocol-agnostic authentication types for smithy + * clients. + */ +namespace auth { + /** + * Identity contains information that identifies who the user making the + * request is. + */ + interface Identity { + [key:string]: any; + expiration(): time.Time + } + /** + * IdentityResolverOptions defines the interface through which an entity can be + * queried to retrieve an IdentityResolver for a given auth scheme. + */ + interface IdentityResolverOptions { + [key:string]: any; + getIdentityResolver(schemeID: string): IdentityResolver + } + /** + * Option represents a possible authentication method for an operation. + */ + interface Option { + schemeID: string + identityProperties: smithy.Properties + signerProperties: smithy.Properties + } +} + +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { + /** + * MeterOption applies configuration to a Meter. + */ + interface MeterOption {(o: MeterOptions): void } + /** + * Meter is the entry point for creation of measurement instruments. + */ + interface Meter { + [key:string]: any; + /** + * integer/synchronous + */ + int64Counter(name: string, ...opts: InstrumentOption[]): Int64Counter + int64UpDownCounter(name: string, ...opts: InstrumentOption[]): Int64UpDownCounter + int64Gauge(name: string, ...opts: InstrumentOption[]): Int64Gauge + int64Histogram(name: string, ...opts: InstrumentOption[]): Int64Histogram + /** + * integer/asynchronous + */ + int64AsyncCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + int64AsyncUpDownCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + int64AsyncGauge(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument + /** + * floating-point/synchronous + */ + float64Counter(name: string, ...opts: InstrumentOption[]): Float64Counter + float64UpDownCounter(name: string, ...opts: InstrumentOption[]): Float64UpDownCounter + float64Gauge(name: string, ...opts: InstrumentOption[]): Float64Gauge + float64Histogram(name: string, ...opts: InstrumentOption[]): Float64Histogram + /** + * floating-point/asynchronous + */ + float64AsyncCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + float64AsyncUpDownCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + float64AsyncGauge(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument + } +} + +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * TracerOption applies configuration to a tracer. + */ + interface TracerOption {(o: TracerOptions): void } + /** + * Tracer is the entry point for creating observed client Spans. + * + * Spans created by tracers propagate by existing on the Context. Consumers of + * the API can use [GetSpan] to pull the active Span from a Context. + * + * Creation of child Spans is implicit through Context persistence. If + * CreateSpan is called with a Context that holds a Span, the result will be a + * child of that Span. + */ + interface Tracer { + [key:string]: any; + startSpan(ctx: context.Context, name: string, ...opts: SpanOption[]): [context.Context, Span] + } +} + /** * Package http provides the HTTP transport client and request/response types * needed to round trip API operation calls with an service. @@ -41260,6 +41269,179 @@ namespace http { import smithytime = time } +/** + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. + * + * # Value and Pointer Conversion Utilities + * + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. + * + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. + * + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. + * + * ``` + * var strPtr *string + * + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str + * + * // With the SDK's conversion functions + * strPtr = aws.String("my string") + * + * // Convert *string to string value + * str = aws.ToString(strPtr) + * ``` + * + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. + * + * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} + * + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) + * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) + * ``` + * + * # SDK Default HTTP Client + * + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. + * + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. + */ +/** + * Package aws provides core functionality for making requests to AWS services. + */ +namespace aws { + // @ts-ignore + import smithybearer = bearer + // @ts-ignore + import sdkrand = rand + /** + * EndpointSource is the endpoint source type. + * + * Deprecated: The global [Endpoint] structure is deprecated. + */ + interface EndpointSource extends Number{} +} + +/** + * Package v4 implements the AWS signature version 4 algorithm (commonly known + * as SigV4). + * + * For more information about SigV4, see [Signing AWS API requests] in the IAM + * user guide. + * + * While this implementation CAN work in an external context, it is developed + * primarily for SDK use and you may encounter fringe behaviors around header + * canonicalization. + * + * # Pre-escaping a request URI + * + * AWS v4 signature validation requires that the canonical string's URI path + * component must be the escaped form of the HTTP request's path. + * + * The Go HTTP client will perform escaping automatically on the HTTP request. + * This may cause signature validation errors because the request differs from + * the URI path or query from which the signature was generated. + * + * Because of this, we recommend that you explicitly escape the request when + * using this signer outside of the SDK to prevent possible signature mismatch. + * This can be done by setting URL.Opaque on the request. The signer will + * prefer that value, falling back to the return of URL.EscapedPath if unset. + * + * When setting URL.Opaque you must do so in the form of: + * + * ``` + * "///" + * + * // e.g. + * "//example.com/some/path" + * ``` + * + * The leading "//" and hostname are required or the escaping will not work + * correctly. + * + * The TestStandaloneSign unit test provides a complete example of using the + * signer outside of the SDK and pre-escaping the URI path. + * + * [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html + */ +namespace signer { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import v4Internal = internal + // @ts-ignore + import internalauth = auth + // @ts-ignore + import smithyhttp = http + // @ts-ignore + import smithyHTTP = http + /** + * SignerOptions is the SigV4 Signer options. + */ + interface SignerOptions { + /** + * Disables the Signer's moving HTTP header key/value pairs from the HTTP + * request header to the request's query string. This is most commonly used + * with pre-signed requests preventing headers from being added to the + * request's query string. + */ + disableHeaderHoisting: boolean + /** + * Disables the automatic escaping of the URI path of the request for the + * siganture's canonical string's path. For services that do not need additional + * escaping then use this to disable the signer escaping the path. + * + * S3 is an example of a service that does not need additional escaping. + * + * http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html + */ + disableURIPathEscaping: boolean + /** + * The logger to send log messages to. + */ + logger: logging.Logger + /** + * Enable logging of signed requests. + * This will enable logging of the canonical request, the string to sign, and for presigning the subsequent + * presigned URL. + */ + logSigning: boolean + /** + * Disables setting the session token on the request as part of signing + * through X-Amz-Security-Token. This is needed for variations of v4 that + * present the token elsewhere. + */ + disableSessionToken: boolean + } +} + +namespace subscriptions { +} + /** * Package slog provides structured logging, * in which log records include a message, @@ -41805,83 +41987,6 @@ namespace slog { } } -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - // @ts-ignore - import sdkrand = rand - /** - * EndpointSource is the endpoint source type. - * - * Deprecated: The global [Endpoint] structure is deprecated. - */ - interface EndpointSource extends Number{} -} - namespace endpoints { // @ts-ignore import endpoints = endpoints @@ -41934,125 +42039,206 @@ namespace endpoints { } /** - * Package v4 implements the AWS signature version 4 algorithm (commonly known - * as SigV4). + * Package document provides interface definitions and error types for document types. * - * For more information about SigV4, see [Signing AWS API requests] in the IAM - * user guide. + * A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send + * UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 + * strings to these values. * - * While this implementation CAN work in an external context, it is developed - * primarily for SDK use and you may encounter fringe behaviors around header - * canonicalization. + * API Clients expose document constructors in their respective client document packages which must be used to + * Marshal and Unmarshal Go types to and from their respective protocol representations. * - * # Pre-escaping a request URI + * See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from + * document types. + */ +namespace document { + /** + * NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled + * into a protocol document. + */ + interface NoSerde { + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { +} + +/** + * Package customizations provides customizations for the Amazon S3 API client. * - * AWS v4 signature validation requires that the canonical string's URI path - * component must be the escaped form of the HTTP request's path. + * This package provides support for following S3 customizations * - * The Go HTTP client will perform escaping automatically on the HTTP request. - * This may cause signature validation errors because the request differs from - * the URI path or query from which the signature was generated. + * ``` + * ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type * - * Because of this, we recommend that you explicitly escape the request when - * using this signer outside of the SDK to prevent possible signature mismatch. - * This can be done by setting URL.Opaque on the request. The signer will - * prefer that value, falling back to the return of URL.EscapedPath if unset. + * UpdateEndpoint Middleware: resolves a custom endpoint as per s3 config options * - * When setting URL.Opaque you must do so in the form of: + * RemoveBucket Middleware: removes a serialized bucket name from request url path * + * processResponseWith200Error Middleware: Deserializing response error with 200 status code * ``` - * "///" * - * // e.g. - * "//example.com/some/path" + * # Virtual Host style url addressing + * + * Since serializers serialize by default as path style url, we use customization + * to modify the endpoint url when `UsePathStyle` option on S3Client is unset or + * false. This flag will be ignored if `UseAccelerate` option is set to true. + * + * If UseAccelerate is not enabled, and the bucket name is not a valid hostname + * label, they SDK will fallback to forcing the request to be made as if + * UsePathStyle was enabled. This behavior is also used if UseDualStackEndpoint is enabled. + * + * https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html#dual-stack-endpoints-description + * + * # Transfer acceleration + * + * By default S3 Transfer acceleration support is disabled. By enabling `UseAccelerate` + * option on S3Client, one can enable s3 transfer acceleration support. Transfer + * acceleration only works with Virtual Host style addressing, and thus `UsePathStyle` + * option if set is ignored. Transfer acceleration is not supported for S3 operations + * DeleteBucket, ListBuckets, and CreateBucket. + * + * # Dualstack support + * + * By default dualstack support for s3 client is disabled. By enabling `UseDualstack` + * option on s3 client, you can enable dualstack endpoint support. + * + * # Endpoint customizations + * + * Customizations to lookup ARN, process ARN needs to happen before request serialization. + * UpdateEndpoint middleware which mutates resources based on Options such as + * UseDualstack, UseAccelerate for modifying resolved endpoint are executed after + * request serialization. Remove bucket middleware is executed after + * an request is serialized, and removes the serialized bucket name from request path + * + * ``` + * Middleware layering: + * + * Initialize : HTTP Request -> ARN Lookup -> Input-Validation -> Serialize step + * + * Serialize : HTTP Request -> Process ARN -> operation serializer -> Update-Endpoint customization -> Remove-Bucket -> next middleware * ``` * - * The leading "//" and hostname are required or the escaping will not work - * correctly. + * Customization options: * - * The TestStandaloneSign unit test provides a complete example of using the - * signer outside of the SDK and pre-escaping the URI path. + * ``` + * UseARNRegion (Disabled by Default) * - * [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html + * UsePathStyle (Disabled by Default) + * + * UseAccelerate (Disabled by Default) + * + * UseDualstack (Disabled by Default) + * ``` + * + * # Handle Error response with 200 status code + * + * S3 operations: CopyObject, CompleteMultipartUpload, UploadPartCopy can have an + * error Response with status code 2xx. The processResponseWith200Error middleware + * customizations enables SDK to check for an error within response body prior to + * deserialization. + * + * As the check for 2xx response containing an error needs to be performed earlier + * than response deserialization. Since the behavior of Deserialization is in + * reverse order to the other stack steps its easier to consider that "after" means + * "before". + * + * ``` + * Middleware layering: + * + * HTTP Response -> handle 200 error customization -> deserialize + * ``` */ -namespace signer { +namespace customizations { // @ts-ignore - import awsmiddleware = middleware + import internalauthsmithy = smithy + /** + * S3ExpressCredentialsProvider retrieves credentials for the S3Express storage + * class. + */ + interface S3ExpressCredentialsProvider { + [key:string]: any; + retrieve(ctx: context.Context, bucket: string): aws.Credentials + } // @ts-ignore - import v4Internal = internal + import ictx = context // @ts-ignore - import internalauth = auth + import v4 = signer // @ts-ignore import smithyhttp = http // @ts-ignore - import smithyHTTP = http - /** - * SignerOptions is the SigV4 Signer options. - */ - interface SignerOptions { - /** - * Disables the Signer's moving HTTP header key/value pairs from the HTTP - * request header to the request's query string. This is most commonly used - * with pre-signed requests preventing headers from being added to the - * request's query string. - */ - disableHeaderHoisting: boolean - /** - * Disables the automatic escaping of the URI path of the request for the - * siganture's canonical string's path. For services that do not need additional - * escaping then use this to disable the signer escaping the path. - * - * S3 is an example of a service that does not need additional escaping. - * - * http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html - */ - disableURIPathEscaping: boolean - /** - * The logger to send log messages to. - */ - logger: logging.Logger - /** - * Enable logging of signed requests. - * This will enable logging of the canonical request, the string to sign, and for presigning the subsequent - * presigned URL. - */ - logSigning: boolean - /** - * Disables setting the session token on the request as part of signing - * through X-Amz-Security-Token. This is needed for variations of v4 that - * present the token elsewhere. - */ - disableSessionToken: boolean - } + import smithyxml = xml + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import s3arn = arn + // @ts-ignore + import internalendpoints = endpoints } /** - * Package document provides interface definitions and error types for document types. - * - * A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send - * UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 - * strings to these values. - * - * API Clients expose document constructors in their respective client document packages which must be used to - * Marshal and Unmarshal Go types to and from their respective protocol representations. + * Package mail implements parsing of mail messages. * - * See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from - * document types. + * For the most part, this package follows the syntax as specified by RFC 5322 and + * extended by RFC 6532. + * Notable divergences: + * ``` + * - Obsolete address formats are not parsed, including addresses with + * embedded route information. + * - The full range of spacing (the CFWS syntax element) is not supported, + * such as breaking addresses across lines. + * - No unicode normalization is performed. + * - A leading From line is permitted, as in mbox format (RFC 4155). + * ``` */ -namespace document { +namespace mail { /** - * NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled - * into a protocol document. + * Address represents a single mail address. + * An address such as "Barry Gibbs " is represented + * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. */ - interface NoSerde { + interface Address { + name: string // Proper name; may be empty. + address: string // user@domain + } + interface Address { + /** + * String formats the address as a valid RFC 5322 address. + * If the address's name contains non-ASCII characters + * the name will be rendered according to RFC 2047. + */ + string(): string } } -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { +namespace search { +} + +namespace endpoints { + /** + * Endpoint is the endpoint object returned by Endpoint resolution V2 + */ + interface Endpoint { + /** + * The complete URL minimally specfiying the scheme and host. + * May optionally specify the port and base path component. + */ + uri: url.URL + /** + * An optional set of headers to be sent using transport layer headers. + */ + headers: http.Header + /** + * A grab-bag property map of endpoint attributes. The + * values present here are subject to change, or being add/removed at any + * time. + */ + properties: smithy.Properties + } } namespace types { @@ -42218,8 +42404,8 @@ namespace types { * * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config */ - type _subTtsCE = noSmithyDocumentSerde - interface AbortIncompleteMultipartUpload extends _subTtsCE { + type _subTGUuf = noSmithyDocumentSerde + interface AbortIncompleteMultipartUpload extends _subTGUuf { /** * Specifies the number of days after which Amazon S3 aborts an incomplete * multipart upload. @@ -42250,8 +42436,8 @@ namespace types { * * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html */ - type _suboDMoj = noSmithyDocumentSerde - interface BucketInfo extends _suboDMoj { + type _subwsyMZ = noSmithyDocumentSerde + interface BucketInfo extends _subwsyMZ { /** * The number of Availability Zone that's used for redundancy for the bucket. */ @@ -42264,8 +42450,8 @@ namespace types { /** * Details of the parts that were uploaded. */ - type _subThMsH = noSmithyDocumentSerde - interface CompletedPart extends _subThMsH { + type _subgUiBN = noSmithyDocumentSerde + interface CompletedPart extends _subgUiBN { /** * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be * present if it was uploaded with the object. When you use an API operation on an @@ -42342,8 +42528,8 @@ namespace types { * redirect to the /documents folder. 2. If request results in HTTP error 4xx, * redirect request to another host where you might process the error. */ - type _subslzCU = noSmithyDocumentSerde - interface Condition extends _subslzCU { + type _subdiwoz = noSmithyDocumentSerde + interface Condition extends _subdiwoz { /** * The HTTP error code when the redirect is applied. In the event of an error, if * the error code equals this value, then the specified redirect is applied. @@ -42372,8 +42558,8 @@ namespace types { * Describes how an uncompressed comma-separated values (CSV)-formatted input * object is formatted. */ - type _subpoDVL = noSmithyDocumentSerde - interface CSVInput extends _subpoDVL { + type _subArRzr = noSmithyDocumentSerde + interface CSVInput extends _subArRzr { /** * Specifies that CSV field values may contain quoted record delimiters and such * records should be allowed. Default value is FALSE. Setting this value to TRUE @@ -42436,8 +42622,8 @@ namespace types { * Describes how uncompressed comma-separated values (CSV)-formatted results are * formatted. */ - type _subADOJI = noSmithyDocumentSerde - interface CSVOutput extends _subADOJI { + type _subtiTxV = noSmithyDocumentSerde + interface CSVOutput extends _subtiTxV { /** * The value used to separate individual fields in a record. You can specify an * arbitrary delimiter. @@ -42473,8 +42659,8 @@ namespace types { /** * Container for S3 Glacier job parameters. */ - type _subdFnGf = noSmithyDocumentSerde - interface GlacierJobParameters extends _subdFnGf { + type _sublYhOb = noSmithyDocumentSerde + interface GlacierJobParameters extends _sublYhOb { /** * Retrieval tier at which the restore will be processed. * @@ -42485,8 +42671,8 @@ namespace types { /** * Container for the person being granted permissions. */ - type _subWGHQu = noSmithyDocumentSerde - interface Grantee extends _subWGHQu { + type _subBVJYu = noSmithyDocumentSerde + interface Grantee extends _subBVJYu { /** * Type of grantee * @@ -42540,8 +42726,8 @@ namespace types { * The Filter is used to identify objects that the S3 Intelligent-Tiering * configuration applies to. */ - type _subjMqFn = noSmithyDocumentSerde - interface IntelligentTieringFilter extends _subjMqFn { + type _subRvWPi = noSmithyDocumentSerde + interface IntelligentTieringFilter extends _subRvWPi { /** * A conjunction (logical AND) of predicates, which is used in evaluating a * metrics filter. The operator must have at least two predicates, and an object @@ -42566,8 +42752,8 @@ namespace types { /** * Specifies the inventory configuration for an Amazon S3 bucket. */ - type _subNhQFG = noSmithyDocumentSerde - interface InventoryDestination extends _subNhQFG { + type _subSNUXZ = noSmithyDocumentSerde + interface InventoryDestination extends _subSNUXZ { /** * Contains the bucket name, file format, bucket owner (optional), and prefix * (optional) where inventory results are published. @@ -42580,8 +42766,8 @@ namespace types { * Specifies an inventory filter. The inventory only includes objects that meet * the filter's criteria. */ - type _subaXFzR = noSmithyDocumentSerde - interface InventoryFilter extends _subaXFzR { + type _subITVSf = noSmithyDocumentSerde + interface InventoryFilter extends _subITVSf { /** * The prefix that an object must have to be included in the inventory results. * @@ -42592,8 +42778,8 @@ namespace types { /** * Specifies the schedule for generating inventory results. */ - type _subApprQ = noSmithyDocumentSerde - interface InventorySchedule extends _subApprQ { + type _subjrnpt = noSmithyDocumentSerde + interface InventorySchedule extends _subjrnpt { /** * Specifies how frequently inventory results are produced. * @@ -42604,8 +42790,8 @@ namespace types { /** * Specifies JSON as object's input serialization format. */ - type _subNlzgt = noSmithyDocumentSerde - interface JSONInput extends _subNlzgt { + type _subSpwfD = noSmithyDocumentSerde + interface JSONInput extends _subSpwfD { /** * The type of JSON. Valid values: Document, Lines. */ @@ -42614,8 +42800,8 @@ namespace types { /** * Specifies JSON as request's output serialization format. */ - type _subQMtYm = noSmithyDocumentSerde - interface JSONOutput extends _subQMtYm { + type _subkIKSy = noSmithyDocumentSerde + interface JSONOutput extends _subkIKSy { /** * The value used to separate individual records in the output. If no value is * specified, Amazon S3 uses a newline character ('\n'). @@ -42629,8 +42815,8 @@ namespace types { * * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html */ - type _subvVmSu = noSmithyDocumentSerde - interface LifecycleExpiration extends _subvVmSu { + type _subIwqVo = noSmithyDocumentSerde + interface LifecycleExpiration extends _subIwqVo { /** * Indicates at what date the object is to be moved or deleted. The date value * must conform to the ISO 8601 format. The time is always midnight UTC. @@ -42665,1071 +42851,1490 @@ namespace types { * LifecycleRuleFilterMemberTag * ``` */ - interface LifecycleRuleFilter { - [key:string]: any; + interface LifecycleRuleFilter { + [key:string]: any; + } + /** + * Specifies the location where the bucket will be created. + * + * For directory buckets, the location type is Availability Zone. For more + * information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. + * + * This functionality is only supported by directory buckets. + * + * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + */ + type _subpgwtx = noSmithyDocumentSerde + interface LocationInfo extends _subpgwtx { + /** + * The name of the location where the bucket will be created. + * + * For directory buckets, the name of the location is the AZ ID of the + * Availability Zone where the bucket will be created. An example AZ ID value is + * usw2-az1 . + */ + name?: string + /** + * The type of location where the bucket will be created. + */ + type: LocationType + } + /** + * Specifies a metrics configuration filter. The metrics configuration only + * includes objects that meet the filter's criteria. A filter must be a prefix, an + * object tag, an access point ARN, or a conjunction (MetricsAndOperator). For more + * information, see [PutBucketMetricsConfiguration]. + * + * The following types satisfy this interface: + * + * ``` + * MetricsFilterMemberAccessPointArn + * MetricsFilterMemberAnd + * MetricsFilterMemberPrefix + * MetricsFilterMemberTag + * ``` + * + * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + */ + interface MetricsFilter { + [key:string]: any; + } + /** + * Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 + * permanently deletes the noncurrent object versions. You set this lifecycle + * configuration action on a bucket that has versioning enabled (or suspended) to + * request that Amazon S3 delete noncurrent object versions at a specific period in + * the object's lifetime. + */ + type _subOkXCM = noSmithyDocumentSerde + interface NoncurrentVersionExpiration extends _subOkXCM { + /** + * Specifies how many noncurrent versions Amazon S3 will retain. You can specify + * up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any + * additional noncurrent versions beyond the specified number to retain. For more + * information about noncurrent versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. + * + * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html + */ + newerNoncurrentVersions?: number + /** + * Specifies the number of days an object is noncurrent before Amazon S3 can + * perform the associated action. The value must be a non-zero positive integer. + * For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent]in the Amazon S3 + * User Guide. + * + * [How Amazon S3 Calculates When an Object Became Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations + */ + noncurrentDays?: number + } + /** + * Container for the transition rule that describes when noncurrent objects + * transition to the STANDARD_IA , ONEZONE_IA , INTELLIGENT_TIERING , GLACIER_IR , + * GLACIER , or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled + * (or versioning is suspended), you can set this action to request that Amazon S3 + * transition noncurrent object versions to the STANDARD_IA , ONEZONE_IA , + * INTELLIGENT_TIERING , GLACIER_IR , GLACIER , or DEEP_ARCHIVE storage class at a + * specific period in the object's lifetime. + */ + type _subxybkO = noSmithyDocumentSerde + interface NoncurrentVersionTransition extends _subxybkO { + /** + * Specifies how many noncurrent versions Amazon S3 will retain in the same + * storage class before transitioning objects. You can specify up to 100 noncurrent + * versions to retain. Amazon S3 will transition any additional noncurrent versions + * beyond the specified number to retain. For more information about noncurrent + * versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. + * + * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html + */ + newerNoncurrentVersions?: number + /** + * Specifies the number of days an object is noncurrent before Amazon S3 can + * perform the associated action. For information about the noncurrent days + * calculations, see [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]in the Amazon S3 User Guide. + * + * [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations + */ + noncurrentDays?: number + /** + * The class of storage used to store the object. + */ + storageClass: TransitionStorageClass + } + /** + * Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + * + * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html + */ + type _subqUNze = noSmithyDocumentSerde + interface NotificationConfigurationFilter extends _subqUNze { + /** + * A container for object key name prefix and suffix filtering rules. + */ + key?: S3KeyFilter + } + /** + * Object Identifier is unique value to identify objects. + */ + type _subwqbXl = noSmithyDocumentSerde + interface ObjectIdentifier extends _subwqbXl { + /** + * Key name of the object. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * This member is required. + */ + key?: string + /** + * Version ID for the specific version of the object to delete. + * + * This functionality is not supported for directory buckets. + */ + versionId?: string + } + /** + * The container element for an Object Lock rule. + */ + type _subsFmDf = noSmithyDocumentSerde + interface ObjectLockRule extends _subsFmDf { + /** + * The default Object Lock retention mode and period that you want to apply to new + * objects placed in the specified bucket. Bucket settings require both a mode and + * a period. The period can be either Days or Years but you must select one. You + * cannot specify Days and Years at the same time. + */ + defaultRetention?: DefaultRetention + } + /** + * A container for elements related to an individual part. + */ + type _subZzZHD = noSmithyDocumentSerde + interface ObjectPart extends _subZzZHD { + /** + * This header can be used as a data integrity check to verify that the data + * received is the same data that was originally sent. This header specifies the + * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] + * in the Amazon S3 User Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + */ + checksumCRC32?: string + /** + * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumCRC32C?: string + /** + * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be + * present if it was uploaded with the object. When you use the API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA1?: string + /** + * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be + * present if it was uploaded with the object. When you use an API operation on an + * object that was uploaded using multipart uploads, this value may not be a direct + * checksum value of the full object. Instead, it's a calculation based on the + * checksum values of each individual part. For more information about how + * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + * Guide. + * + * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + */ + checksumSHA256?: string + /** + * The part number identifying the part. This value is a positive integer between + * 1 and 10,000. + */ + partNumber?: number + /** + * The size of the uploaded part in bytes. + */ + size?: number + } + /** + * Describes the location where the restore job's output is stored. + */ + type _subSpKZD = noSmithyDocumentSerde + interface OutputLocation extends _subSpKZD { + /** + * Describes an S3 location that will receive the results of the restore request. + */ + s3?: S3Location + } + /** + * The container element for an ownership control rule. + */ + type _subDWjeb = noSmithyDocumentSerde + interface OwnershipControlsRule extends _subDWjeb { + /** + * The container element for object ownership for a bucket's ownership controls. + * + * BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the + * bucket owner if the objects are uploaded with the bucket-owner-full-control + * canned ACL. + * + * ObjectWriter - The uploading account will own the object if the object is + * uploaded with the bucket-owner-full-control canned ACL. + * + * BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer + * affect permissions. The bucket owner automatically owns and has full control + * over every object in the bucket. The bucket only accepts PUT requests that don't + * specify an ACL or specify bucket owner full control ACLs (such as the predefined + * bucket-owner-full-control canned ACL or a custom ACL in XML format that grants + * the same permissions). + * + * By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are + * disabled. We recommend keeping ACLs disabled, except in uncommon use cases where + * you must control access for each object individually. For more information about + * S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. Directory buckets + * use the bucket owner enforced setting for S3 Object Ownership. + * + * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * + * This member is required. + */ + objectOwnership: ObjectOwnership + } + /** + * Container for Parquet. + */ + type _subEjLVy = noSmithyDocumentSerde + interface ParquetInput extends _subEjLVy { + } + /** + * Specifies how requests are redirected. In the event of an error, you can + * specify a different error code to return. + */ + type _subtBJpK = noSmithyDocumentSerde + interface Redirect extends _subtBJpK { + /** + * The host name to use in the redirect request. + */ + hostName?: string + /** + * The HTTP redirect code to use on the response. Not required if one of the + * siblings is present. + */ + httpRedirectCode?: string + /** + * Protocol to use when redirecting requests. The default is the protocol that is + * used in the original request. + */ + protocol: Protocol + /** + * The object key prefix to use in the redirect request. For example, to redirect + * requests for all pages with prefix docs/ (objects in the docs/ folder) to + * documents/ , you can set a condition block with KeyPrefixEquals set to docs/ + * and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one + * of the siblings is present. Can be present only if ReplaceKeyWith is not + * provided. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + */ + replaceKeyPrefixWith?: string + /** + * The specific object key to use in the redirect request. For example, redirect + * request to error.html . Not required if one of the siblings is present. Can be + * present only if ReplaceKeyPrefixWith is not provided. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + */ + replaceKeyWith?: string + } + /** + * Specifies which Amazon S3 objects to replicate and where to store the replicas. + */ + type _subpkUOi = noSmithyDocumentSerde + interface ReplicationRule extends _subpkUOi { + /** + * A container for information about the replication destination and its + * configurations including enabling the S3 Replication Time Control (S3 RTC). + * + * This member is required. + */ + destination?: Destination + /** + * Specifies whether the rule is enabled. + * + * This member is required. + */ + status: ReplicationRuleStatus + /** + * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter + * in your replication configuration, you must also include a + * DeleteMarkerReplication element. If your Filter includes a Tag element, the + * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does + * not support replicating delete markers for tag-based rules. For an example + * configuration, see [Basic Rule Configuration]. + * + * For more information about delete marker replication, see [Basic Rule Configuration]. + * + * If you are using an earlier version of the replication configuration, Amazon S3 + * handles replication of delete markers differently. For more information, see [Backward Compatibility]. + * + * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html + * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations + */ + deleteMarkerReplication?: DeleteMarkerReplication + /** + * Optional configuration to replicate existing source bucket objects. + * + * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in + * the Amazon S3 User Guide. + * + * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html + */ + existingObjectReplication?: ExistingObjectReplication + /** + * A filter that identifies the subset of objects to which the replication rule + * applies. A Filter must specify exactly one Prefix , Tag , or an And child + * element. + */ + filter: ReplicationRuleFilter + /** + * A unique identifier for the rule. The maximum value is 255 characters. + */ + id?: string + /** + * An object key name prefix that identifies the object or objects to which the + * rule applies. The maximum prefix length is 1,024 characters. To include all + * objects in a bucket, specify an empty string. + * + * Replacement must be made for object keys containing special characters (such as + * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * + * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * + * Deprecated: This member has been deprecated. + */ + prefix?: string + /** + * The priority indicates which rule has precedence whenever two or more + * replication rules conflict. Amazon S3 will attempt to replicate objects + * according to all replication rules. However, if there are two or more rules with + * the same destination bucket, then objects will be replicated according to the + * rule with the highest priority. The higher the number, the higher the priority. + * + * For more information, see [Replication] in the Amazon S3 User Guide. + * + * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html + */ + priority?: number + /** + * A container that describes additional filters for identifying the source + * objects that you want to replicate. You can choose to enable or disable the + * replication of these objects. Currently, Amazon S3 supports only the filter that + * you can specify for objects created with server-side encryption using a customer + * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). + */ + sourceSelectionCriteria?: SourceSelectionCriteria + } + /** + * Specifies the restoration status of an object. Objects in certain storage + * classes must be restored before they can be retrieved. For more information + * about these storage classes and how to work with archived objects, see [Working with archived objects]in the + * Amazon S3 User Guide. + * + * This functionality is not supported for directory buckets. Only the S3 Express + * One Zone storage class is supported by directory buckets to store objects. + * + * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html + */ + type _suboDeJO = noSmithyDocumentSerde + interface RestoreStatus extends _suboDeJO { + /** + * Specifies whether the object is currently being restored. If the object + * restoration is in progress, the header returns the value TRUE . For example: + * + * ``` + * x-amz-optional-object-attributes: IsRestoreInProgress="true" + * ``` + * + * If the object restoration has completed, the header returns the value FALSE . + * For example: + * + * ``` + * x-amz-optional-object-attributes: IsRestoreInProgress="false", + * RestoreExpiryDate="2012-12-21T00:00:00.000Z" + * ``` + * + * If the object hasn't been restored, there is no header response. + */ + isRestoreInProgress?: boolean + /** + * Indicates when the restored copy will expire. This value is populated only if + * the object has already been restored. For example: + * + * ``` + * x-amz-optional-object-attributes: IsRestoreInProgress="false", + * RestoreExpiryDate="2012-12-21T00:00:00.000Z" + * ``` + */ + restoreExpiryDate?: time.Time + } + /** + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * Describes the parameters for Select job types. + * + * Learn [How to optimize querying your data in Amazon S3] using [Amazon Athena], [S3 Object Lambda], or client-side filtering. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [How to optimize querying your data in Amazon S3]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * [Amazon Athena]: https://docs.aws.amazon.com/athena/latest/ug/what-is.html + * [S3 Object Lambda]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html + */ + type _subLvMOu = noSmithyDocumentSerde + interface SelectParameters extends _subLvMOu { + /** + * Amazon S3 Select is no longer available to new customers. Existing customers of + * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * + * The expression that is used to query the object. + * + * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * + * This member is required. + */ + expression?: string + /** + * The type of the provided expression (for example, SQL). + * + * This member is required. + */ + expressionType: ExpressionType + /** + * Describes the serialization format of the object. + * + * This member is required. + */ + inputSerialization?: InputSerialization + /** + * Describes how the results of the Select job are serialized. + * + * This member is required. + */ + outputSerialization?: OutputSerialization + } + /** + * Specifies the default server-side encryption configuration. + * + * ``` + * - General purpose buckets - If you're specifying a customer managed KMS key, + * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias + * instead, then KMS resolves the key within the requester’s account. This behavior + * can result in data that's encrypted with a KMS key that belongs to the + * requester, and not the bucket owner. + * + * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory + * bucket, only use the key ID or key ARN. The key alias format of the KMS key + * isn't supported. + * ``` + * + * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + */ + type _subsAkJx = noSmithyDocumentSerde + interface ServerSideEncryptionRule extends _subsAkJx { + /** + * Specifies the default server-side encryption to apply to new objects in the + * bucket. If a PUT Object request doesn't specify any server-side encryption, this + * default encryption will be applied. + */ + applyServerSideEncryptionByDefault?: ServerSideEncryptionByDefault + /** + * Specifies whether Amazon S3 should use an S3 Bucket Key with server-side + * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects + * are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 + * to use an S3 Bucket Key. + * + * ``` + * - General purpose buckets - By default, S3 Bucket Key is not enabled. For + * more information, see [Amazon S3 Bucket Keys]in the Amazon S3 User Guide. + * + * - Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + * supported, when you copy SSE-KMS encrypted objects from general purpose buckets + * to directory buckets, from directory buckets to general purpose buckets, or + * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + * call to KMS every time a copy request is made for a KMS-encrypted object. + * ``` + * + * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html + * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + */ + bucketKeyEnabled?: boolean + } + /** + * Specifies data related to access patterns to be collected and made available to + * analyze the tradeoffs between different storage classes for an Amazon S3 bucket. + */ + type _subqvUbE = noSmithyDocumentSerde + interface StorageClassAnalysis extends _subqvUbE { + /** + * Specifies how data related to the storage class analysis for an Amazon S3 + * bucket should be exported. + */ + dataExport?: StorageClassAnalysisDataExport } /** - * Specifies the location where the bucket will be created. - * - * For directory buckets, the location type is Availability Zone. For more - * information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. + * Container for granting information. * - * This functionality is only supported by directory buckets. + * Buckets that use the bucket owner enforced setting for Object Ownership don't + * support target grants. For more information, see [Permissions server access log delivery]in the Amazon S3 User Guide. * - * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + * [Permissions server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general */ - type _subGUAJG = noSmithyDocumentSerde - interface LocationInfo extends _subGUAJG { + type _subUKRbv = noSmithyDocumentSerde + interface TargetGrant extends _subUKRbv { /** - * The name of the location where the bucket will be created. - * - * For directory buckets, the name of the location is the AZ ID of the - * Availability Zone where the bucket will be created. An example AZ ID value is - * usw2-az1 . + * Container for the person being granted permissions. */ - name?: string + grantee?: Grantee /** - * The type of location where the bucket will be created. + * Logging permissions assigned to the grantee for the bucket. */ - type: LocationType + permission: BucketLogsPermission } /** - * Specifies a metrics configuration filter. The metrics configuration only - * includes objects that meet the filter's criteria. A filter must be a prefix, an - * object tag, an access point ARN, or a conjunction (MetricsAndOperator). For more - * information, see [PutBucketMetricsConfiguration]. - * - * The following types satisfy this interface: - * - * ``` - * MetricsFilterMemberAccessPointArn - * MetricsFilterMemberAnd - * MetricsFilterMemberPrefix - * MetricsFilterMemberTag - * ``` - * - * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + * Amazon S3 key format for log objects. Only one format, PartitionedPrefix or + * SimplePrefix, is allowed. */ - interface MetricsFilter { - [key:string]: any; + type _subQKjZL = noSmithyDocumentSerde + interface TargetObjectKeyFormat extends _subQKjZL { + /** + * Partitioned S3 key for log objects. + */ + partitionedPrefix?: PartitionedPrefix + /** + * To use the simple format for S3 keys for log objects. To specify SimplePrefix + * format, set SimplePrefix to {}. + */ + simplePrefix?: SimplePrefix } /** - * Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 - * permanently deletes the noncurrent object versions. You set this lifecycle - * configuration action on a bucket that has versioning enabled (or suspended) to - * request that Amazon S3 delete noncurrent object versions at a specific period in - * the object's lifetime. + * The S3 Intelligent-Tiering storage class is designed to optimize storage costs + * by automatically moving data to the most cost-effective storage access tier, + * without additional operational overhead. */ - type _subPKzco = noSmithyDocumentSerde - interface NoncurrentVersionExpiration extends _subPKzco { + type _subQJvwL = noSmithyDocumentSerde + interface Tiering extends _subQJvwL { /** - * Specifies how many noncurrent versions Amazon S3 will retain. You can specify - * up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any - * additional noncurrent versions beyond the specified number to retain. For more - * information about noncurrent versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. + * S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently accessed objects] for a list of access tiers in the S3 + * Intelligent-Tiering storage class. * - * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html + * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + * + * This member is required. */ - newerNoncurrentVersions?: number + accessTier: IntelligentTieringAccessTier /** - * Specifies the number of days an object is noncurrent before Amazon S3 can - * perform the associated action. The value must be a non-zero positive integer. - * For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent]in the Amazon S3 - * User Guide. + * The number of consecutive days of no access after which an object will be + * eligible to be transitioned to the corresponding tier. The minimum number of + * days specified for Archive Access tier must be at least 90 days and Deep Archive + * Access tier must be at least 180 days. The maximum can be up to 2 years (730 + * days). * - * [How Amazon S3 Calculates When an Object Became Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations + * This member is required. */ - noncurrentDays?: number + days?: number } /** - * Container for the transition rule that describes when noncurrent objects - * transition to the STANDARD_IA , ONEZONE_IA , INTELLIGENT_TIERING , GLACIER_IR , - * GLACIER , or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled - * (or versioning is suspended), you can set this action to request that Amazon S3 - * transition noncurrent object versions to the STANDARD_IA , ONEZONE_IA , - * INTELLIGENT_TIERING , GLACIER_IR , GLACIER , or DEEP_ARCHIVE storage class at a - * specific period in the object's lifetime. + * Specifies when an object transitions to a specified storage class. For more + * information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 Lifecycle]in the Amazon S3 + * User Guide. + * + * [Transitioning Objects Using Amazon S3 Lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html */ - type _subDHdHp = noSmithyDocumentSerde - interface NoncurrentVersionTransition extends _subDHdHp { + type _sublHufA = noSmithyDocumentSerde + interface Transition extends _sublHufA { /** - * Specifies how many noncurrent versions Amazon S3 will retain in the same - * storage class before transitioning objects. You can specify up to 100 noncurrent - * versions to retain. Amazon S3 will transition any additional noncurrent versions - * beyond the specified number to retain. For more information about noncurrent - * versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. - * - * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html + * Indicates when objects are transitioned to the specified storage class. The + * date value must be in ISO 8601 format. The time is always midnight UTC. */ - newerNoncurrentVersions?: number + date?: time.Time /** - * Specifies the number of days an object is noncurrent before Amazon S3 can - * perform the associated action. For information about the noncurrent days - * calculations, see [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]in the Amazon S3 User Guide. - * - * [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations + * Indicates the number of days after creation when objects are transitioned to + * the specified storage class. The value must be a positive integer. */ - noncurrentDays?: number + days?: number /** - * The class of storage used to store the object. + * The storage class to which you want the object to transition. */ storageClass: TransitionStorageClass } + interface noSmithyDocumentSerde extends smithydocument.NoSerde{} +} + +/** + * Package s3 provides the API client, operations, and parameter types for Amazon + * Simple Storage Service. + */ +namespace s3 { + // @ts-ignore + import awsmiddleware = middleware + // @ts-ignore + import awshttp = http + // @ts-ignore + import internalauth = auth + // @ts-ignore + import internalauthsmithy = smithy + // @ts-ignore + import internalConfig = configsources + // @ts-ignore + import internalmiddleware = middleware + // @ts-ignore + import acceptencodingcust = accept_encoding + // @ts-ignore + import internalChecksum = checksum + // @ts-ignore + import presignedurlcust = presigned_url + // @ts-ignore + import s3sharedconfig = config + // @ts-ignore + import s3cust = customizations + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithyauth = auth + // @ts-ignore + import smithydocument = document + // @ts-ignore + import smithyhttp = http + // @ts-ignore + import smithyxml = xml + // @ts-ignore + import smithyio = io + // @ts-ignore + import smithytime = time + // @ts-ignore + import smithywaiter = waiter + // @ts-ignore + import smithysync = sync /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html + * AuthResolverParameters contains the set of inputs necessary for auth scheme + * resolution. */ - type _sublsXwL = noSmithyDocumentSerde - interface NotificationConfigurationFilter extends _sublsXwL { + interface AuthResolverParameters { /** - * A container for object key name prefix and suffix filtering rules. + * The name of the operation being invoked. */ - key?: S3KeyFilter + operation: string + /** + * The region in which the operation is being invoked. + */ + region: string } + // @ts-ignore + import internalcontext = context + // @ts-ignore + import awsxml = xml + // @ts-ignore + import internalendpoints = endpoints + // @ts-ignore + import smithyendpoints = endpoints /** - * Object Identifier is unique value to identify objects. + * EndpointParameters provides the parameters that influence how endpoints are + * resolved. */ - type _subUoIpQ = noSmithyDocumentSerde - interface ObjectIdentifier extends _subUoIpQ { + interface EndpointParameters { /** - * Key name of the object. + * The S3 bucket used to send the request. This is an optional parameter that will + * be set automatically for operations that are scoped to an S3 bucket. * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + * Parameter + * is required. + */ + bucket?: string + /** + * The AWS region used to dispatch the request. * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * Parameter is + * required. * - * This member is required. + * AWS::Region */ - key?: string + region?: string /** - * Version ID for the specific version of the object to delete. + * When true, send this request to the FIPS-compliant regional endpoint. If the + * configured endpoint does not have a FIPS compliant endpoint, dispatching the + * request will return an error. * - * This functionality is not supported for directory buckets. + * Defaults to false if no value is + * provided. + * + * AWS::UseFIPS */ - versionId?: string - } - /** - * The container element for an Object Lock rule. - */ - type _subBMdqo = noSmithyDocumentSerde - interface ObjectLockRule extends _subBMdqo { + useFIPS?: boolean /** - * The default Object Lock retention mode and period that you want to apply to new - * objects placed in the specified bucket. Bucket settings require both a mode and - * a period. The period can be either Days or Years but you must select one. You - * cannot specify Days and Years at the same time. + * When true, use the dual-stack endpoint. If the configured endpoint does not + * support dual-stack, dispatching the request MAY return an error. + * + * Defaults to + * false if no value is provided. + * + * AWS::UseDualStack */ - defaultRetention?: DefaultRetention - } - /** - * A container for elements related to an individual part. - */ - type _subfIADH = noSmithyDocumentSerde - interface ObjectPart extends _subfIADH { + useDualStack?: boolean /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. + * Override the endpoint used to send this request * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + * Parameter is + * required. + * + * SDK::Endpoint */ - checksumCRC32?: string + endpoint?: string /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. + * When true, force a path-style endpoint to be used where the bucket name is part + * of the path. * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + * Defaults to false if no value is + * provided. + * + * AWS::S3::ForcePathStyle */ - checksumCRC32C?: string + forcePathStyle?: boolean /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. + * When true, use S3 Accelerate. NOTE: Not all regions support S3 + * accelerate. * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + * Defaults to false if no value is provided. + * + * AWS::S3::Accelerate */ - checksumSHA1?: string + accelerate?: boolean /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. + * Whether the global endpoint should be used, rather then the regional endpoint + * for us-east-1. * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + * Defaults to false if no value is + * provided. + * + * AWS::S3::UseGlobalEndpoint */ - checksumSHA256?: string + useGlobalEndpoint?: boolean /** - * The part number identifying the part. This value is a positive integer between - * 1 and 10,000. + * Internal parameter to use object lambda endpoint for an operation (eg: + * WriteGetObjectResponse) + * + * Parameter is required. */ - partNumber?: number + useObjectLambdaEndpoint?: boolean /** - * The size of the uploaded part in bytes. + * The S3 Key used to send the request. This is an optional parameter that will be + * set automatically for operations that are scoped to an S3 Key. + * + * Parameter is + * required. */ - size?: number - } - /** - * Describes the location where the restore job's output is stored. - */ - type _subPZwEh = noSmithyDocumentSerde - interface OutputLocation extends _subPZwEh { + key?: string /** - * Describes an S3 location that will receive the results of the restore request. + * The S3 Prefix used to send the request. This is an optional parameter that will + * be set automatically for operations that are scoped to an S3 Prefix. + * + * Parameter + * is required. */ - s3?: S3Location - } - /** - * The container element for an ownership control rule. - */ - type _subfpwaA = noSmithyDocumentSerde - interface OwnershipControlsRule extends _subfpwaA { + prefix?: string /** - * The container element for object ownership for a bucket's ownership controls. - * - * BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the - * bucket owner if the objects are uploaded with the bucket-owner-full-control - * canned ACL. - * - * ObjectWriter - The uploading account will own the object if the object is - * uploaded with the bucket-owner-full-control canned ACL. - * - * BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer - * affect permissions. The bucket owner automatically owns and has full control - * over every object in the bucket. The bucket only accepts PUT requests that don't - * specify an ACL or specify bucket owner full control ACLs (such as the predefined - * bucket-owner-full-control canned ACL or a custom ACL in XML format that grants - * the same permissions). + * The Copy Source used for Copy Object request. This is an optional parameter that + * will be set automatically for operations that are scoped to Copy + * Source. * - * By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are - * disabled. We recommend keeping ACLs disabled, except in uncommon use cases where - * you must control access for each object individually. For more information about - * S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. + * Parameter is required. + */ + copySource?: string + /** + * Internal parameter to disable Access Point Buckets * - * This functionality is not supported for directory buckets. Directory buckets - * use the bucket owner enforced setting for S3 Object Ownership. + * Parameter is required. + */ + disableAccessPoints?: boolean + /** + * Whether multi-region access points (MRAP) should be disabled. * - * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * Defaults to false + * if no value is provided. * - * This member is required. + * AWS::S3::DisableMultiRegionAccessPoints */ - objectOwnership: ObjectOwnership - } - /** - * Container for Parquet. - */ - type _subpytOv = noSmithyDocumentSerde - interface ParquetInput extends _subpytOv { - } - /** - * Specifies how requests are redirected. In the event of an error, you can - * specify a different error code to return. - */ - type _subJWrUl = noSmithyDocumentSerde - interface Redirect extends _subJWrUl { + disableMultiRegionAccessPoints?: boolean /** - * The host name to use in the redirect request. + * When an Access Point ARN is provided and this flag is enabled, the SDK MUST use + * the ARN's region when constructing the endpoint instead of the client's + * configured region. + * + * Parameter is required. + * + * AWS::S3::UseArnRegion */ - hostName?: string + useArnRegion?: boolean /** - * The HTTP redirect code to use on the response. Not required if one of the - * siblings is present. + * Internal parameter to indicate whether S3Express operation should use control + * plane, (ex. CreateBucket) + * + * Parameter is required. */ - httpRedirectCode?: string + useS3ExpressControlEndpoint?: boolean /** - * Protocol to use when redirecting requests. The default is the protocol that is - * used in the original request. + * Parameter to indicate whether S3Express session auth should be + * disabled + * + * Parameter is required. */ - protocol: Protocol + disableS3ExpressSessionAuth?: boolean + } + interface EndpointParameters { /** - * The object key prefix to use in the redirect request. For example, to redirect - * requests for all pages with prefix docs/ (objects in the docs/ folder) to - * documents/ , you can set a condition block with KeyPrefixEquals set to docs/ - * and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one - * of the siblings is present. Can be present only if ReplaceKeyWith is not - * provided. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * ValidateRequired validates required parameters are set. */ - replaceKeyPrefixWith?: string + validateRequired(): void + } + interface EndpointParameters { /** - * The specific object key to use in the redirect request. For example, redirect - * request to error.html . Not required if one of the siblings is present. Can be - * present only if ReplaceKeyPrefixWith is not provided. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * WithDefaults returns a shallow copy of EndpointParameterswith default values + * applied to members where applicable. */ - replaceKeyWith?: string + withDefaults(): EndpointParameters } /** - * Specifies which Amazon S3 objects to replicate and where to store the replicas. + * SelectObjectContentEventStreamReader provides the interface for reading events + * from a stream. + * + * The writer's Close method must allow multiple concurrent calls. */ - type _subXbQuq = noSmithyDocumentSerde - interface ReplicationRule extends _subXbQuq { - /** - * A container for information about the replication destination and its - * configurations including enabling the S3 Replication Time Control (S3 RTC). - * - * This member is required. - */ - destination?: Destination + interface SelectObjectContentEventStreamReader { + [key:string]: any; + events(): undefined + close(): void + err(): void + } + // @ts-ignore + import v4 = signer +} + +/** + * Package smithy provides the core components for a Smithy SDK. + */ +namespace smithy_go { + /** + * Properties provides storing and reading metadata values. Keys may be any + * comparable value type. Get and Set will panic if a key is not comparable. + * + * The zero value for a Properties instance is ready for reads/writes without + * any additional initialization. + */ + interface Properties { + } + interface Properties { /** - * Specifies whether the rule is enabled. + * Get attempts to retrieve the value the key points to. Returns nil if the + * key was not found. * - * This member is required. + * Panics if key type is not comparable. */ - status: ReplicationRuleStatus + get(key: any): any + } + interface Properties { /** - * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter - * in your replication configuration, you must also include a - * DeleteMarkerReplication element. If your Filter includes a Tag element, the - * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does - * not support replicating delete markers for tag-based rules. For an example - * configuration, see [Basic Rule Configuration]. - * - * For more information about delete marker replication, see [Basic Rule Configuration]. - * - * If you are using an earlier version of the replication configuration, Amazon S3 - * handles replication of delete markers differently. For more information, see [Backward Compatibility]. + * Set stores the value pointed to by the key. If a value already exists at + * that key it will be replaced with the new value. * - * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html - * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations + * Panics if the key type is not comparable. */ - deleteMarkerReplication?: DeleteMarkerReplication + set(key: any, value: any): void + } + interface Properties { /** - * Optional configuration to replicate existing source bucket objects. - * - * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in - * the Amazon S3 User Guide. + * Has returns whether the key exists in the metadata. * - * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html + * Panics if the key type is not comparable. */ - existingObjectReplication?: ExistingObjectReplication + has(key: any): boolean + } + interface Properties { /** - * A filter that identifies the subset of objects to which the replication rule - * applies. A Filter must specify exactly one Prefix , Tag , or an And child - * element. + * SetAll accepts all of the given Properties into the receiver, overwriting + * any existing keys in the case of conflicts. */ - filter: ReplicationRuleFilter + setAll(other: Properties): void + } + interface Properties { /** - * A unique identifier for the rule. The maximum value is 255 characters. + * Values returns a shallow clone of the property set's values. */ - id?: string + values(): _TygojaDict + } +} + +namespace types { + interface BucketLogsPermission extends String{} + interface BucketLogsPermission { /** - * An object key name prefix that identifies the object or objects to which the - * rule applies. The maximum prefix length is 1,024 characters. To include all - * objects in a bucket, specify an empty string. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + * Values returns all known values for BucketLogsPermission. Note that this can be + * expanded in the future, and so it is only as up to date as the client. * - * Deprecated: This member has been deprecated. + * The ordering of this slice is not guaranteed to be stable across updates. */ - prefix?: string + values(): Array + } + interface BucketType extends String{} + interface BucketType { /** - * The priority indicates which rule has precedence whenever two or more - * replication rules conflict. Amazon S3 will attempt to replicate objects - * according to all replication rules. However, if there are two or more rules with - * the same destination bucket, then objects will be replicated according to the - * rule with the highest priority. The higher the number, the higher the priority. - * - * For more information, see [Replication] in the Amazon S3 User Guide. + * Values returns all known values for BucketType. Note that this can be expanded + * in the future, and so it is only as up to date as the client. * - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html + * The ordering of this slice is not guaranteed to be stable across updates. */ - priority?: number + values(): Array + } + interface DataRedundancy extends String{} + interface DataRedundancy { /** - * A container that describes additional filters for identifying the source - * objects that you want to replicate. You can choose to enable or disable the - * replication of these objects. Currently, Amazon S3 supports only the filter that - * you can specify for objects created with server-side encryption using a customer - * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). + * Values returns all known values for DataRedundancy. Note that this can be + * expanded in the future, and so it is only as up to date as the client. + * + * The ordering of this slice is not guaranteed to be stable across updates. */ - sourceSelectionCriteria?: SourceSelectionCriteria + values(): Array } - /** - * Specifies the restoration status of an object. Objects in certain storage - * classes must be restored before they can be retrieved. For more information - * about these storage classes and how to work with archived objects, see [Working with archived objects]in the - * Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. Only the S3 Express - * One Zone storage class is supported by directory buckets to store objects. - * - * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html - */ - type _subFCSIN = noSmithyDocumentSerde - interface RestoreStatus extends _subFCSIN { + interface FileHeaderInfo extends String{} + interface FileHeaderInfo { /** - * Specifies whether the object is currently being restored. If the object - * restoration is in progress, the header returns the value TRUE . For example: - * - * ``` - * x-amz-optional-object-attributes: IsRestoreInProgress="true" - * ``` - * - * If the object restoration has completed, the header returns the value FALSE . - * For example: - * - * ``` - * x-amz-optional-object-attributes: IsRestoreInProgress="false", - * RestoreExpiryDate="2012-12-21T00:00:00.000Z" - * ``` + * Values returns all known values for FileHeaderInfo. Note that this can be + * expanded in the future, and so it is only as up to date as the client. * - * If the object hasn't been restored, there is no header response. + * The ordering of this slice is not guaranteed to be stable across updates. */ - isRestoreInProgress?: boolean + values(): Array + } + interface IntelligentTieringAccessTier extends String{} + interface IntelligentTieringAccessTier { /** - * Indicates when the restored copy will expire. This value is populated only if - * the object has already been restored. For example: + * Values returns all known values for IntelligentTieringAccessTier. Note that + * this can be expanded in the future, and so it is only as up to date as the + * client. * - * ``` - * x-amz-optional-object-attributes: IsRestoreInProgress="false", - * RestoreExpiryDate="2012-12-21T00:00:00.000Z" - * ``` + * The ordering of this slice is not guaranteed to be stable across updates. */ - restoreExpiryDate?: time.Time + values(): Array } - /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Describes the parameters for Select job types. - * - * Learn [How to optimize querying your data in Amazon S3] using [Amazon Athena], [S3 Object Lambda], or client-side filtering. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [How to optimize querying your data in Amazon S3]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [Amazon Athena]: https://docs.aws.amazon.com/athena/latest/ug/what-is.html - * [S3 Object Lambda]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html - */ - type _subrGrMG = noSmithyDocumentSerde - interface SelectParameters extends _subrGrMG { + interface InventoryFrequency extends String{} + interface InventoryFrequency { /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] + * Values returns all known values for InventoryFrequency. Note that this can be + * expanded in the future, and so it is only as up to date as the client. * - * The expression that is used to query the object. + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface JSONType extends String{} + interface JSONType { + /** + * Values returns all known values for JSONType. Note that this can be expanded in + * the future, and so it is only as up to date as the client. * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + * The ordering of this slice is not guaranteed to be stable across updates. + */ + values(): Array + } + interface QuoteFields extends String{} + interface QuoteFields { + /** + * Values returns all known values for QuoteFields. Note that this can be expanded + * in the future, and so it is only as up to date as the client. * - * This member is required. + * The ordering of this slice is not guaranteed to be stable across updates. */ - expression?: string + values(): Array + } + interface ReplicationRuleStatus extends String{} + interface ReplicationRuleStatus { /** - * The type of the provided expression (for example, SQL). + * Values returns all known values for ReplicationRuleStatus. Note that this can + * be expanded in the future, and so it is only as up to date as the client. * - * This member is required. + * The ordering of this slice is not guaranteed to be stable across updates. */ - expressionType: ExpressionType + values(): Array + } + interface TransitionStorageClass extends String{} + interface TransitionStorageClass { /** - * Describes the serialization format of the object. + * Values returns all known values for TransitionStorageClass. Note that this can + * be expanded in the future, and so it is only as up to date as the client. * - * This member is required. + * The ordering of this slice is not guaranteed to be stable across updates. */ - inputSerialization?: InputSerialization + values(): Array + } + interface Type extends String{} + interface Type { /** - * Describes how the results of the Select job are serialized. + * Values returns all known values for Type. Note that this can be expanded in the + * future, and so it is only as up to date as the client. * - * This member is required. + * The ordering of this slice is not guaranteed to be stable across updates. */ - outputSerialization?: OutputSerialization + values(): Array } + // @ts-ignore + import smithy = smithy_go + // @ts-ignore + import smithydocument = document /** - * Specifies the default server-side encryption configuration. + * The container element for optionally specifying the default Object Lock + * retention settings for new objects placed in the specified bucket. * * ``` - * - General purpose buckets - If you're specifying a customer managed KMS key, - * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias - * instead, then KMS resolves the key within the requester’s account. This behavior - * can result in data that's encrypted with a KMS key that belongs to the - * requester, and not the bucket owner. + * - The DefaultRetention settings require both a mode and a period. * - * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory - * bucket, only use the key ID or key ARN. The key alias format of the KMS key - * isn't supported. + * - The DefaultRetention period can be either Days or Years but you must select + * one. You cannot specify Days and Years at the same time. * ``` - * - * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk */ - type _subdvukF = noSmithyDocumentSerde - interface ServerSideEncryptionRule extends _subdvukF { + type _subYowwS = noSmithyDocumentSerde + interface DefaultRetention extends _subYowwS { /** - * Specifies the default server-side encryption to apply to new objects in the - * bucket. If a PUT Object request doesn't specify any server-side encryption, this - * default encryption will be applied. + * The number of days that you want to specify for the default retention period. + * Must be used with Mode . */ - applyServerSideEncryptionByDefault?: ServerSideEncryptionByDefault + days?: number /** - * Specifies whether Amazon S3 should use an S3 Bucket Key with server-side - * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects - * are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 - * to use an S3 Bucket Key. - * - * ``` - * - General purpose buckets - By default, S3 Bucket Key is not enabled. For - * more information, see [Amazon S3 Bucket Keys]in the Amazon S3 User Guide. - * - * - Directory buckets - S3 Bucket Keys are always enabled for GET and PUT - * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't - * supported, when you copy SSE-KMS encrypted objects from general purpose buckets - * to directory buckets, from directory buckets to general purpose buckets, or - * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a - * call to KMS every time a copy request is made for a KMS-encrypted object. - * ``` - * - * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + * The default Object Lock retention mode you want to apply to new objects placed + * in the specified bucket. Must be used with either Days or Years . */ - bucketKeyEnabled?: boolean - } - /** - * Specifies data related to access patterns to be collected and made available to - * analyze the tradeoffs between different storage classes for an Amazon S3 bucket. - */ - type _subsJjAW = noSmithyDocumentSerde - interface StorageClassAnalysis extends _subsJjAW { + mode: ObjectLockRetentionMode /** - * Specifies how data related to the storage class analysis for an Amazon S3 - * bucket should be exported. + * The number of years that you want to specify for the default retention period. + * Must be used with Mode . */ - dataExport?: StorageClassAnalysisDataExport + years?: number } /** - * Container for granting information. + * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter + * in your replication configuration, you must also include a + * DeleteMarkerReplication element. If your Filter includes a Tag element, the + * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does + * not support replicating delete markers for tag-based rules. For an example + * configuration, see [Basic Rule Configuration]. * - * Buckets that use the bucket owner enforced setting for Object Ownership don't - * support target grants. For more information, see [Permissions server access log delivery]in the Amazon S3 User Guide. + * For more information about delete marker replication, see [Basic Rule Configuration]. * - * [Permissions server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general - */ - type _subZctQi = noSmithyDocumentSerde - interface TargetGrant extends _subZctQi { - /** - * Container for the person being granted permissions. - */ - grantee?: Grantee - /** - * Logging permissions assigned to the grantee for the bucket. - */ - permission: BucketLogsPermission - } - /** - * Amazon S3 key format for log objects. Only one format, PartitionedPrefix or - * SimplePrefix, is allowed. + * If you are using an earlier version of the replication configuration, Amazon S3 + * handles replication of delete markers differently. For more information, see [Backward Compatibility]. + * + * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html + * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations */ - type _subGqccM = noSmithyDocumentSerde - interface TargetObjectKeyFormat extends _subGqccM { - /** - * Partitioned S3 key for log objects. - */ - partitionedPrefix?: PartitionedPrefix + type _subuQntD = noSmithyDocumentSerde + interface DeleteMarkerReplication extends _subuQntD { /** - * To use the simple format for S3 keys for log objects. To specify SimplePrefix - * format, set SimplePrefix to {}. + * Indicates whether to replicate delete markers. + * + * Indicates whether to replicate delete markers. */ - simplePrefix?: SimplePrefix + status: DeleteMarkerReplicationStatus } /** - * The S3 Intelligent-Tiering storage class is designed to optimize storage costs - * by automatically moving data to the most cost-effective storage access tier, - * without additional operational overhead. + * Specifies information about where to publish analysis or configuration results + * for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). */ - type _subpntPW = noSmithyDocumentSerde - interface Tiering extends _subpntPW { + type _subrhMEC = noSmithyDocumentSerde + interface Destination extends _subrhMEC { /** - * S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently accessed objects] for a list of access tiers in the S3 - * Intelligent-Tiering storage class. - * - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access + * The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store + * the results. * * This member is required. */ - accessTier: IntelligentTieringAccessTier + bucket?: string /** - * The number of consecutive days of no access after which an object will be - * eligible to be transitioned to the corresponding tier. The minimum number of - * days specified for Archive Access tier must be at least 90 days and Deep Archive - * Access tier must be at least 180 days. The maximum can be up to 2 years (730 - * days). + * Specify this only in a cross-account scenario (where source and destination + * bucket owners are not the same), and you want to change replica ownership to the + * Amazon Web Services account that owns the destination bucket. If this is not + * specified in the replication configuration, the replicas are owned by same + * Amazon Web Services account that owns the source object. + */ + accessControlTranslation?: AccessControlTranslation + /** + * Destination bucket owner account ID. In a cross-account scenario, if you direct + * Amazon S3 to change replica ownership to the Amazon Web Services account that + * owns the destination bucket by specifying the AccessControlTranslation + * property, this is the account ID of the destination bucket owner. For more + * information, see [Replication Additional Configuration: Changing the Replica Owner]in the Amazon S3 User Guide. * - * This member is required. + * [Replication Additional Configuration: Changing the Replica Owner]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html */ - days?: number - } - /** - * Specifies when an object transitions to a specified storage class. For more - * information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 Lifecycle]in the Amazon S3 - * User Guide. - * - * [Transitioning Objects Using Amazon S3 Lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html - */ - type _subTFGzr = noSmithyDocumentSerde - interface Transition extends _subTFGzr { + account?: string /** - * Indicates when objects are transitioned to the specified storage class. The - * date value must be in ISO 8601 format. The time is always midnight UTC. + * A container that provides information about encryption. If + * SourceSelectionCriteria is specified, you must specify this element. */ - date?: time.Time + encryptionConfiguration?: EncryptionConfiguration /** - * Indicates the number of days after creation when objects are transitioned to - * the specified storage class. The value must be a positive integer. + * A container specifying replication metrics-related settings enabling + * replication metrics and events. */ - days?: number + metrics?: Metrics /** - * The storage class to which you want the object to transition. + * A container specifying S3 Replication Time Control (S3 RTC), including whether + * S3 RTC is enabled and the time when all objects and operations on objects must + * be replicated. Must be specified together with a Metrics block. */ - storageClass: TransitionStorageClass - } - interface noSmithyDocumentSerde extends smithydocument.NoSerde{} -} - -/** - * Package customizations provides customizations for the Amazon S3 API client. - * - * This package provides support for following S3 customizations - * - * ``` - * ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type - * - * UpdateEndpoint Middleware: resolves a custom endpoint as per s3 config options - * - * RemoveBucket Middleware: removes a serialized bucket name from request url path - * - * processResponseWith200Error Middleware: Deserializing response error with 200 status code - * ``` - * - * # Virtual Host style url addressing - * - * Since serializers serialize by default as path style url, we use customization - * to modify the endpoint url when `UsePathStyle` option on S3Client is unset or - * false. This flag will be ignored if `UseAccelerate` option is set to true. - * - * If UseAccelerate is not enabled, and the bucket name is not a valid hostname - * label, they SDK will fallback to forcing the request to be made as if - * UsePathStyle was enabled. This behavior is also used if UseDualStackEndpoint is enabled. - * - * https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html#dual-stack-endpoints-description - * - * # Transfer acceleration - * - * By default S3 Transfer acceleration support is disabled. By enabling `UseAccelerate` - * option on S3Client, one can enable s3 transfer acceleration support. Transfer - * acceleration only works with Virtual Host style addressing, and thus `UsePathStyle` - * option if set is ignored. Transfer acceleration is not supported for S3 operations - * DeleteBucket, ListBuckets, and CreateBucket. - * - * # Dualstack support - * - * By default dualstack support for s3 client is disabled. By enabling `UseDualstack` - * option on s3 client, you can enable dualstack endpoint support. - * - * # Endpoint customizations - * - * Customizations to lookup ARN, process ARN needs to happen before request serialization. - * UpdateEndpoint middleware which mutates resources based on Options such as - * UseDualstack, UseAccelerate for modifying resolved endpoint are executed after - * request serialization. Remove bucket middleware is executed after - * an request is serialized, and removes the serialized bucket name from request path - * - * ``` - * Middleware layering: - * - * Initialize : HTTP Request -> ARN Lookup -> Input-Validation -> Serialize step - * - * Serialize : HTTP Request -> Process ARN -> operation serializer -> Update-Endpoint customization -> Remove-Bucket -> next middleware - * ``` - * - * Customization options: - * - * ``` - * UseARNRegion (Disabled by Default) - * - * UsePathStyle (Disabled by Default) - * - * UseAccelerate (Disabled by Default) - * - * UseDualstack (Disabled by Default) - * ``` - * - * # Handle Error response with 200 status code - * - * S3 operations: CopyObject, CompleteMultipartUpload, UploadPartCopy can have an - * error Response with status code 2xx. The processResponseWith200Error middleware - * customizations enables SDK to check for an error within response body prior to - * deserialization. - * - * As the check for 2xx response containing an error needs to be performed earlier - * than response deserialization. Since the behavior of Deserialization is in - * reverse order to the other stack steps its easier to consider that "after" means - * "before". - * - * ``` - * Middleware layering: - * - * HTTP Response -> handle 200 error customization -> deserialize - * ``` - */ -namespace customizations { - // @ts-ignore - import internalauthsmithy = smithy - /** - * S3ExpressCredentialsProvider retrieves credentials for the S3Express storage - * class. - */ - interface S3ExpressCredentialsProvider { - [key:string]: any; - retrieve(ctx: context.Context, bucket: string): aws.Credentials - } - // @ts-ignore - import ictx = context - // @ts-ignore - import v4 = signer - // @ts-ignore - import smithyhttp = http - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import s3arn = arn - // @ts-ignore - import internalendpoints = endpoints -} - -/** - * Package mail implements parsing of mail messages. - * - * For the most part, this package follows the syntax as specified by RFC 5322 and - * extended by RFC 6532. - * Notable divergences: - * ``` - * - Obsolete address formats are not parsed, including addresses with - * embedded route information. - * - The full range of spacing (the CFWS syntax element) is not supported, - * such as breaking addresses across lines. - * - No unicode normalization is performed. - * - A leading From line is permitted, as in mbox format (RFC 4155). - * ``` - */ -namespace mail { - /** - * Address represents a single mail address. - * An address such as "Barry Gibbs " is represented - * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. - */ - interface Address { - name: string // Proper name; may be empty. - address: string // user@domain - } - interface Address { + replicationTime?: ReplicationTime /** - * String formats the address as a valid RFC 5322 address. - * If the address's name contains non-ASCII characters - * the name will be rendered according to RFC 2047. + * The storage class to use when replicating objects, such as S3 Standard or + * reduced redundancy. By default, Amazon S3 uses the storage class of the source + * object to create the object replica. + * + * For valid values, see the StorageClass element of the [PUT Bucket replication] action in the Amazon S3 + * API Reference. + * + * [PUT Bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html */ - string(): string + storageClass: StorageClass } -} - -namespace endpoints { /** - * Endpoint is the endpoint object returned by Endpoint resolution V2 + * Optional configuration to replicate existing source bucket objects. + * + * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in + * the Amazon S3 User Guide. + * + * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html */ - interface Endpoint { - /** - * The complete URL minimally specfiying the scheme and host. - * May optionally specify the port and base path component. - */ - uri: url.URL - /** - * An optional set of headers to be sent using transport layer headers. - */ - headers: http.Header + type _subNbEDs = noSmithyDocumentSerde + interface ExistingObjectReplication extends _subNbEDs { /** - * A grab-bag property map of endpoint attributes. The - * values present here are subject to change, or being add/removed at any - * time. + * Specifies whether Amazon S3 replicates existing source bucket objects. + * + * This member is required. */ - properties: smithy.Properties + status: ExistingObjectReplicationStatus } -} - -/** - * Package s3 provides the API client, operations, and parameter types for Amazon - * Simple Storage Service. - */ -namespace s3 { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import awshttp = http - // @ts-ignore - import internalauth = auth - // @ts-ignore - import internalauthsmithy = smithy - // @ts-ignore - import internalConfig = configsources - // @ts-ignore - import internalmiddleware = middleware - // @ts-ignore - import acceptencodingcust = accept_encoding - // @ts-ignore - import internalChecksum = checksum - // @ts-ignore - import presignedurlcust = presigned_url - // @ts-ignore - import s3sharedconfig = config - // @ts-ignore - import s3cust = customizations - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithyauth = auth - // @ts-ignore - import smithydocument = document - // @ts-ignore - import smithyhttp = http - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import smithyio = io - // @ts-ignore - import smithytime = time - // @ts-ignore - import smithywaiter = waiter - // @ts-ignore - import smithysync = sync /** - * AuthResolverParameters contains the set of inputs necessary for auth scheme - * resolution. + * A container for specifying S3 Intelligent-Tiering filters. The filters + * determine the subset of objects to which the rule applies. */ - interface AuthResolverParameters { + type _subABktB = noSmithyDocumentSerde + interface IntelligentTieringAndOperator extends _subABktB { /** - * The name of the operation being invoked. + * An object key name prefix that identifies the subset of objects to which the + * configuration applies. */ - operation: string + prefix?: string /** - * The region in which the operation is being invoked. + * All of these tags must exist in the object's tag set in order for the + * configuration to apply. */ - region: string + tags: Array } - // @ts-ignore - import internalcontext = context - // @ts-ignore - import awsxml = xml - // @ts-ignore - import internalendpoints = endpoints - // @ts-ignore - import smithyendpoints = endpoints /** - * EndpointParameters provides the parameters that influence how endpoints are - * resolved. + * Contains the bucket name, file format, bucket owner (optional), and prefix + * (optional) where inventory results are published. */ - interface EndpointParameters { + type _subaMwDp = noSmithyDocumentSerde + interface InventoryS3BucketDestination extends _subaMwDp { /** - * The S3 bucket used to send the request. This is an optional parameter that will - * be set automatically for operations that are scoped to an S3 bucket. + * The Amazon Resource Name (ARN) of the bucket where inventory results will be + * published. * - * Parameter - * is required. + * This member is required. */ bucket?: string /** - * The AWS region used to dispatch the request. - * - * Parameter is - * required. + * Specifies the output format of the inventory results. * - * AWS::Region + * This member is required. */ - region?: string + format: InventoryFormat /** - * When true, send this request to the FIPS-compliant regional endpoint. If the - * configured endpoint does not have a FIPS compliant endpoint, dispatching the - * request will return an error. - * - * Defaults to false if no value is - * provided. + * The account ID that owns the destination S3 bucket. If no account ID is + * provided, the owner is not validated before exporting data. * - * AWS::UseFIPS + * Although this value is optional, we strongly recommend that you set it to help + * prevent problems if the destination bucket ownership changes. */ - useFIPS?: boolean + accountId?: string /** - * When true, use the dual-stack endpoint. If the configured endpoint does not - * support dual-stack, dispatching the request MAY return an error. - * - * Defaults to - * false if no value is provided. - * - * AWS::UseDualStack + * Contains the type of server-side encryption used to encrypt the inventory + * results. */ - useDualStack?: boolean + encryption?: InventoryEncryption /** - * Override the endpoint used to send this request - * - * Parameter is - * required. - * - * SDK::Endpoint + * The prefix that is prepended to all inventory results. */ - endpoint?: string + prefix?: string + } + /** + * Amazon S3 keys for log objects are partitioned in the following format: + * + * ``` + * [DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] + * ``` + * + * PartitionedPrefix defaults to EventTime delivery when server access logs are + * delivered. + */ + type _subaPbjW = noSmithyDocumentSerde + interface PartitionedPrefix extends _subaPbjW { /** - * When true, force a path-style endpoint to be used where the bucket name is part - * of the path. + * Specifies the partition date source for the partitioned prefix. + * PartitionDateSource can be EventTime or DeliveryTime . * - * Defaults to false if no value is - * provided. + * For DeliveryTime , the time in the log file names corresponds to the delivery + * time for the log files. * - * AWS::S3::ForcePathStyle + * For EventTime , The logs delivered are for a specific day only. The year, month, + * and day correspond to the day on which the event occurred, and the hour, minutes + * and seconds are set to 00 in the key. */ - forcePathStyle?: boolean + partitionDateSource: PartitionDateSource + } + /** + * A filter that identifies the subset of objects to which the replication rule + * applies. A Filter must specify exactly one Prefix , Tag , or an And child + * element. + * + * The following types satisfy this interface: + * + * ``` + * ReplicationRuleFilterMemberAnd + * ReplicationRuleFilterMemberPrefix + * ReplicationRuleFilterMemberTag + * ``` + */ + interface ReplicationRuleFilter { + [key:string]: any; + } + /** + * A container for object key name prefix and suffix filtering rules. + */ + type _subaAyWd = noSmithyDocumentSerde + interface S3KeyFilter extends _subaAyWd { /** - * When true, use S3 Accelerate. NOTE: Not all regions support S3 - * accelerate. - * - * Defaults to false if no value is provided. - * - * AWS::S3::Accelerate + * A list of containers for the key-value pair that defines the criteria for the + * filter rule. */ - accelerate?: boolean + filterRules: Array + } + /** + * Describes an Amazon S3 location that will receive the results of the restore + * request. + */ + type _subKPOOV = noSmithyDocumentSerde + interface S3Location extends _subKPOOV { /** - * Whether the global endpoint should be used, rather then the regional endpoint - * for us-east-1. - * - * Defaults to false if no value is - * provided. + * The name of the bucket where the restore results will be placed. * - * AWS::S3::UseGlobalEndpoint + * This member is required. */ - useGlobalEndpoint?: boolean + bucketName?: string /** - * Internal parameter to use object lambda endpoint for an operation (eg: - * WriteGetObjectResponse) + * The prefix that is prepended to the restore results for this request. * - * Parameter is required. + * This member is required. */ - useObjectLambdaEndpoint?: boolean + prefix?: string /** - * The S3 Key used to send the request. This is an optional parameter that will be - * set automatically for operations that are scoped to an S3 Key. - * - * Parameter is - * required. + * A list of grants that control access to the staged results. */ - key?: string + accessControlList: Array /** - * The S3 Prefix used to send the request. This is an optional parameter that will - * be set automatically for operations that are scoped to an S3 Prefix. - * - * Parameter - * is required. + * The canned ACL to apply to the restore results. */ - prefix?: string + cannedACL: ObjectCannedACL /** - * The Copy Source used for Copy Object request. This is an optional parameter that - * will be set automatically for operations that are scoped to Copy - * Source. - * - * Parameter is required. + * Contains the type of server-side encryption used. */ - copySource?: string + encryption?: Encryption /** - * Internal parameter to disable Access Point Buckets - * - * Parameter is required. + * The class of storage used to store the restore results. */ - disableAccessPoints?: boolean + storageClass: StorageClass /** - * Whether multi-region access points (MRAP) should be disabled. - * - * Defaults to false - * if no value is provided. - * - * AWS::S3::DisableMultiRegionAccessPoints + * The tag-set that is applied to the restore results. */ - disableMultiRegionAccessPoints?: boolean + tagging?: Tagging /** - * When an Access Point ARN is provided and this flag is enabled, the SDK MUST use - * the ARN's region when constructing the endpoint instead of the client's - * configured region. - * - * Parameter is required. - * - * AWS::S3::UseArnRegion + * A list of metadata to store with the restore results in S3. */ - useArnRegion?: boolean + userMetadata: Array + } + /** + * Describes the default server-side encryption to apply to new objects in the + * bucket. If a PUT Object request doesn't specify any server-side encryption, this + * default encryption will be applied. For more information, see [PutBucketEncryption]. + * + * ``` + * - General purpose buckets - If you don't specify a customer managed key at + * configuration, Amazon S3 automatically creates an Amazon Web Services KMS key ( + * aws/s3 ) in your Amazon Web Services account the first time that you add an + * object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS + * key for SSE-KMS. + * + * - Directory buckets - Your SSE-KMS configuration can only support 1 [customer managed key]per + * directory bucket for the lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. + * + * - Directory buckets - For directory buckets, there are only two supported + * options for server-side encryption: SSE-S3 and SSE-KMS. + * ``` + * + * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html + * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + */ + type _subrVhbL = noSmithyDocumentSerde + interface ServerSideEncryptionByDefault extends _subrVhbL { /** - * Internal parameter to indicate whether S3Express operation should use control - * plane, (ex. CreateBucket) + * Server-side encryption algorithm to use for the default encryption. * - * Parameter is required. + * For directory buckets, there are only two supported values for server-side + * encryption: AES256 and aws:kms . + * + * This member is required. */ - useS3ExpressControlEndpoint?: boolean + sseAlgorithm: ServerSideEncryption /** - * Parameter to indicate whether S3Express session auth should be - * disabled + * Amazon Web Services Key Management Service (KMS) customer managed key ID to use + * for the default encryption. * - * Parameter is required. + * ``` + * - General purpose buckets - This parameter is allowed if and only if + * SSEAlgorithm is set to aws:kms or aws:kms:dsse . + * + * - Directory buckets - This parameter is allowed if and only if SSEAlgorithm is + * set to aws:kms . + * ``` + * + * You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the + * KMS key. + * + * ``` + * - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + * + * - Key ARN: + * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + * + * - Key Alias: alias/alias-name + * ``` + * + * If you are using encryption with cross-account or Amazon Web Services service + * operations, you must use a fully qualified KMS key ARN. For more information, + * see [Using encryption for cross-account operations]. + * + * ``` + * - General purpose buckets - If you're specifying a customer managed KMS key, + * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias + * instead, then KMS resolves the key within the requester’s account. This behavior + * can result in data that's encrypted with a KMS key that belongs to the + * requester, and not the bucket owner. Also, if you use a key ID, you can run into + * a LogDestination undeliverable error when creating a VPC flow log. + * + * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory + * bucket, only use the key ID or key ARN. The key alias format of the KMS key + * isn't supported. + * ``` + * + * Amazon S3 only supports symmetric encryption KMS keys. For more information, + * see [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. + * + * [Using encryption for cross-account operations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy + * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html */ - disableS3ExpressSessionAuth?: boolean + kmsMasterKeyID?: string } - interface EndpointParameters { + /** + * To use simple format for S3 keys for log objects, set SimplePrefix to an empty + * object. + * + * ``` + * [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] + * ``` + */ + type _subwIMUw = noSmithyDocumentSerde + interface SimplePrefix extends _subwIMUw { + } + /** + * A container that describes additional filters for identifying the source + * objects that you want to replicate. You can choose to enable or disable the + * replication of these objects. Currently, Amazon S3 supports only the filter that + * you can specify for objects created with server-side encryption using a customer + * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). + */ + type _subnEjxu = noSmithyDocumentSerde + interface SourceSelectionCriteria extends _subnEjxu { /** - * ValidateRequired validates required parameters are set. + * A filter that you can specify for selections for modifications on replicas. + * Amazon S3 doesn't replicate replica modifications by default. In the latest + * version of replication configuration (when Filter is specified), you can + * specify this element and set the status to Enabled to replicate modifications + * on replicas. + * + * If you don't specify the Filter element, Amazon S3 assumes that the replication + * configuration is the earlier version, V1. In the earlier version, this element + * is not allowed */ - validateRequired(): void - } - interface EndpointParameters { + replicaModifications?: ReplicaModifications /** - * WithDefaults returns a shallow copy of EndpointParameterswith default values - * applied to members where applicable. + * A container for filter information for the selection of Amazon S3 objects + * encrypted with Amazon Web Services KMS. If you include SourceSelectionCriteria + * in the replication configuration, this element is required. */ - withDefaults(): EndpointParameters + sseKmsEncryptedObjects?: SseKmsEncryptedObjects } /** - * SelectObjectContentEventStreamReader provides the interface for reading events - * from a stream. - * - * The writer's Close method must allow multiple concurrent calls. + * Container for data related to the storage class analysis for an Amazon S3 + * bucket for export. */ - interface SelectObjectContentEventStreamReader { - [key:string]: any; - events(): undefined - close(): void - err(): void + type _subiipYU = noSmithyDocumentSerde + interface StorageClassAnalysisDataExport extends _subiipYU { + /** + * The place to store the data for an analysis. + * + * This member is required. + */ + destination?: AnalyticsExportDestination + /** + * The version of the output schema to use when exporting data. Must be V_1 . + * + * This member is required. + */ + outputSchemaVersion: StorageClassAnalysisSchemaVersion } - // @ts-ignore - import v4 = signer -} - -namespace search { } /** @@ -43893,98 +44498,44 @@ namespace middleware { * InitializeOutput provides the result returned by the next InitializeHandler. */ interface InitializeOutput { - result: { - } - } - /** - * InitializeHandler provides the interface for the next handler the - * InitializeMiddleware will call in the middleware chain. - */ - interface InitializeHandler { - [key:string]: any; - handleInitialize(ctx: context.Context, _arg10: InitializeInput): [InitializeOutput, Metadata] - } - /** - * SerializeInput provides the input parameters for the SerializeMiddleware to - * consume. SerializeMiddleware may modify the Request value before forwarding - * SerializeInput along to the next SerializeHandler. The Parameters member - * should not be modified by SerializeMiddleware, InitializeMiddleware should - * be responsible for modifying the provided Parameter value. - */ - interface SerializeInput { - parameters: { - } - request: { - } - } - /** - * SerializeOutput provides the result returned by the next SerializeHandler. - */ - interface SerializeOutput { - result: { - } - } - /** - * SerializeHandler provides the interface for the next handler the - * SerializeMiddleware will call in the middleware chain. - */ - interface SerializeHandler { - [key:string]: any; - handleSerialize(ctx: context.Context, _arg10: SerializeInput): [SerializeOutput, Metadata] - } -} - -/** - * Package smithy provides the core components for a Smithy SDK. - */ -namespace smithy_go { - /** - * Properties provides storing and reading metadata values. Keys may be any - * comparable value type. Get and Set will panic if a key is not comparable. - * - * The zero value for a Properties instance is ready for reads/writes without - * any additional initialization. - */ - interface Properties { - } - interface Properties { - /** - * Get attempts to retrieve the value the key points to. Returns nil if the - * key was not found. - * - * Panics if key type is not comparable. - */ - get(key: any): any - } - interface Properties { - /** - * Set stores the value pointed to by the key. If a value already exists at - * that key it will be replaced with the new value. - * - * Panics if the key type is not comparable. - */ - set(key: any, value: any): void + result: { + } } - interface Properties { - /** - * Has returns whether the key exists in the metadata. - * - * Panics if the key type is not comparable. - */ - has(key: any): boolean + /** + * InitializeHandler provides the interface for the next handler the + * InitializeMiddleware will call in the middleware chain. + */ + interface InitializeHandler { + [key:string]: any; + handleInitialize(ctx: context.Context, _arg10: InitializeInput): [InitializeOutput, Metadata] } - interface Properties { - /** - * SetAll accepts all of the given Properties into the receiver, overwriting - * any existing keys in the case of conflicts. - */ - setAll(other: Properties): void + /** + * SerializeInput provides the input parameters for the SerializeMiddleware to + * consume. SerializeMiddleware may modify the Request value before forwarding + * SerializeInput along to the next SerializeHandler. The Parameters member + * should not be modified by SerializeMiddleware, InitializeMiddleware should + * be responsible for modifying the provided Parameter value. + */ + interface SerializeInput { + parameters: { + } + request: { + } } - interface Properties { - /** - * Values returns a shallow clone of the property set's values. - */ - values(): _TygojaDict + /** + * SerializeOutput provides the result returned by the next SerializeHandler. + */ + interface SerializeOutput { + result: { + } + } + /** + * SerializeHandler provides the interface for the next handler the + * SerializeMiddleware will call in the middleware chain. + */ + interface SerializeHandler { + [key:string]: any; + handleSerialize(ctx: context.Context, _arg10: SerializeInput): [SerializeOutput, Metadata] } } @@ -44123,8 +44674,8 @@ namespace http { * Request provides the HTTP specific request structure for HTTP specific * middleware steps to use to serialize input, and send an operation's request. */ - type _subOtvso = http.Request - interface Request extends _subOtvso { + type _subwSKDK = http.Request + interface Request extends _subwSKDK { } interface Request { /** @@ -44490,792 +45041,181 @@ namespace http { * create a copy that shares no state with the original, * or create a new Record with [NewRecord] * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call - * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` - * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: - * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` - * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: - * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: - * - * ``` - * type expensive struct { arg int } - * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } - * ``` - * - * Then use a value of that type in log calls: - * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - // @ts-ignore - import loginternal = internal - /** - * Kind is the kind of a [Value]. - */ - interface Kind extends Number{} - interface Kind { - string(): string - } - /** - * A LogValuer is any Go value that can convert itself into a Value for logging. - * - * This mechanism may be used to defer expensive operations until they are - * needed, or to expand a single value into a sequence of components. - */ - interface LogValuer { - [key:string]: any; - logValue(): Value - } -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - // @ts-ignore - import sdkrand = rand - /** - * DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior. - */ - interface DualStackEndpointState extends Number{} - /** - * FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. - */ - interface FIPSEndpointState extends Number{} -} - -namespace types { - interface BucketLogsPermission extends String{} - interface BucketLogsPermission { - /** - * Values returns all known values for BucketLogsPermission. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface BucketType extends String{} - interface BucketType { - /** - * Values returns all known values for BucketType. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface DataRedundancy extends String{} - interface DataRedundancy { - /** - * Values returns all known values for DataRedundancy. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface FileHeaderInfo extends String{} - interface FileHeaderInfo { - /** - * Values returns all known values for FileHeaderInfo. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface IntelligentTieringAccessTier extends String{} - interface IntelligentTieringAccessTier { - /** - * Values returns all known values for IntelligentTieringAccessTier. Note that - * this can be expanded in the future, and so it is only as up to date as the - * client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface InventoryFrequency extends String{} - interface InventoryFrequency { - /** - * Values returns all known values for InventoryFrequency. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface JSONType extends String{} - interface JSONType { - /** - * Values returns all known values for JSONType. Note that this can be expanded in - * the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface QuoteFields extends String{} - interface QuoteFields { - /** - * Values returns all known values for QuoteFields. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ReplicationRuleStatus extends String{} - interface ReplicationRuleStatus { - /** - * Values returns all known values for ReplicationRuleStatus. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface TransitionStorageClass extends String{} - interface TransitionStorageClass { - /** - * Values returns all known values for TransitionStorageClass. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface Type extends String{} - interface Type { - /** - * Values returns all known values for Type. Note that this can be expanded in the - * future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithydocument = document - /** - * The container element for optionally specifying the default Object Lock - * retention settings for new objects placed in the specified bucket. - * - * ``` - * - The DefaultRetention settings require both a mode and a period. - * - * - The DefaultRetention period can be either Days or Years but you must select - * one. You cannot specify Days and Years at the same time. - * ``` - */ - type _subrbktc = noSmithyDocumentSerde - interface DefaultRetention extends _subrbktc { - /** - * The number of days that you want to specify for the default retention period. - * Must be used with Mode . - */ - days?: number - /** - * The default Object Lock retention mode you want to apply to new objects placed - * in the specified bucket. Must be used with either Days or Years . - */ - mode: ObjectLockRetentionMode - /** - * The number of years that you want to specify for the default retention period. - * Must be used with Mode . - */ - years?: number - } - /** - * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter - * in your replication configuration, you must also include a - * DeleteMarkerReplication element. If your Filter includes a Tag element, the - * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does - * not support replicating delete markers for tag-based rules. For an example - * configuration, see [Basic Rule Configuration]. - * - * For more information about delete marker replication, see [Basic Rule Configuration]. - * - * If you are using an earlier version of the replication configuration, Amazon S3 - * handles replication of delete markers differently. For more information, see [Backward Compatibility]. - * - * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html - * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations - */ - type _subFrndK = noSmithyDocumentSerde - interface DeleteMarkerReplication extends _subFrndK { - /** - * Indicates whether to replicate delete markers. - * - * Indicates whether to replicate delete markers. - */ - status: DeleteMarkerReplicationStatus - } - /** - * Specifies information about where to publish analysis or configuration results - * for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). - */ - type _subOaKdq = noSmithyDocumentSerde - interface Destination extends _subOaKdq { - /** - * The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store - * the results. - * - * This member is required. - */ - bucket?: string - /** - * Specify this only in a cross-account scenario (where source and destination - * bucket owners are not the same), and you want to change replica ownership to the - * Amazon Web Services account that owns the destination bucket. If this is not - * specified in the replication configuration, the replicas are owned by same - * Amazon Web Services account that owns the source object. - */ - accessControlTranslation?: AccessControlTranslation - /** - * Destination bucket owner account ID. In a cross-account scenario, if you direct - * Amazon S3 to change replica ownership to the Amazon Web Services account that - * owns the destination bucket by specifying the AccessControlTranslation - * property, this is the account ID of the destination bucket owner. For more - * information, see [Replication Additional Configuration: Changing the Replica Owner]in the Amazon S3 User Guide. - * - * [Replication Additional Configuration: Changing the Replica Owner]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html - */ - account?: string - /** - * A container that provides information about encryption. If - * SourceSelectionCriteria is specified, you must specify this element. - */ - encryptionConfiguration?: EncryptionConfiguration - /** - * A container specifying replication metrics-related settings enabling - * replication metrics and events. - */ - metrics?: Metrics - /** - * A container specifying S3 Replication Time Control (S3 RTC), including whether - * S3 RTC is enabled and the time when all objects and operations on objects must - * be replicated. Must be specified together with a Metrics block. - */ - replicationTime?: ReplicationTime - /** - * The storage class to use when replicating objects, such as S3 Standard or - * reduced redundancy. By default, Amazon S3 uses the storage class of the source - * object to create the object replica. - * - * For valid values, see the StorageClass element of the [PUT Bucket replication] action in the Amazon S3 - * API Reference. - * - * [PUT Bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html - */ - storageClass: StorageClass - } - /** - * Optional configuration to replicate existing source bucket objects. - * - * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in - * the Amazon S3 User Guide. - * - * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html - */ - type _subVHygh = noSmithyDocumentSerde - interface ExistingObjectReplication extends _subVHygh { - /** - * Specifies whether Amazon S3 replicates existing source bucket objects. - * - * This member is required. - */ - status: ExistingObjectReplicationStatus - } - /** - * A container for specifying S3 Intelligent-Tiering filters. The filters - * determine the subset of objects to which the rule applies. - */ - type _subocteQ = noSmithyDocumentSerde - interface IntelligentTieringAndOperator extends _subocteQ { - /** - * An object key name prefix that identifies the subset of objects to which the - * configuration applies. - */ - prefix?: string - /** - * All of these tags must exist in the object's tag set in order for the - * configuration to apply. - */ - tags: Array - } - /** - * Contains the bucket name, file format, bucket owner (optional), and prefix - * (optional) where inventory results are published. - */ - type _subPmIjs = noSmithyDocumentSerde - interface InventoryS3BucketDestination extends _subPmIjs { - /** - * The Amazon Resource Name (ARN) of the bucket where inventory results will be - * published. - * - * This member is required. - */ - bucket?: string - /** - * Specifies the output format of the inventory results. - * - * This member is required. - */ - format: InventoryFormat - /** - * The account ID that owns the destination S3 bucket. If no account ID is - * provided, the owner is not validated before exporting data. - * - * Although this value is optional, we strongly recommend that you set it to help - * prevent problems if the destination bucket ownership changes. - */ - accountId?: string - /** - * Contains the type of server-side encryption used to encrypt the inventory - * results. - */ - encryption?: InventoryEncryption - /** - * The prefix that is prepended to all inventory results. - */ - prefix?: string - } + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal /** - * Amazon S3 keys for log objects are partitioned in the following format: - * - * ``` - * [DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] - * ``` - * - * PartitionedPrefix defaults to EventTime delivery when server access logs are - * delivered. + * Kind is the kind of a [Value]. */ - type _subyQbYy = noSmithyDocumentSerde - interface PartitionedPrefix extends _subyQbYy { - /** - * Specifies the partition date source for the partitioned prefix. - * PartitionDateSource can be EventTime or DeliveryTime . - * - * For DeliveryTime , the time in the log file names corresponds to the delivery - * time for the log files. - * - * For EventTime , The logs delivered are for a specific day only. The year, month, - * and day correspond to the day on which the event occurred, and the hour, minutes - * and seconds are set to 00 in the key. - */ - partitionDateSource: PartitionDateSource + interface Kind extends Number{} + interface Kind { + string(): string } /** - * A filter that identifies the subset of objects to which the replication rule - * applies. A Filter must specify exactly one Prefix , Tag , or an And child - * element. - * - * The following types satisfy this interface: + * A LogValuer is any Go value that can convert itself into a Value for logging. * - * ``` - * ReplicationRuleFilterMemberAnd - * ReplicationRuleFilterMemberPrefix - * ReplicationRuleFilterMemberTag - * ``` + * This mechanism may be used to defer expensive operations until they are + * needed, or to expand a single value into a sequence of components. */ - interface ReplicationRuleFilter { + interface LogValuer { [key:string]: any; - } - /** - * A container for object key name prefix and suffix filtering rules. - */ - type _subADdoW = noSmithyDocumentSerde - interface S3KeyFilter extends _subADdoW { - /** - * A list of containers for the key-value pair that defines the criteria for the - * filter rule. - */ - filterRules: Array - } - /** - * Describes an Amazon S3 location that will receive the results of the restore - * request. - */ - type _subKacLP = noSmithyDocumentSerde - interface S3Location extends _subKacLP { - /** - * The name of the bucket where the restore results will be placed. - * - * This member is required. - */ - bucketName?: string - /** - * The prefix that is prepended to the restore results for this request. - * - * This member is required. - */ - prefix?: string - /** - * A list of grants that control access to the staged results. - */ - accessControlList: Array - /** - * The canned ACL to apply to the restore results. - */ - cannedACL: ObjectCannedACL - /** - * Contains the type of server-side encryption used. - */ - encryption?: Encryption - /** - * The class of storage used to store the restore results. - */ - storageClass: StorageClass - /** - * The tag-set that is applied to the restore results. - */ - tagging?: Tagging - /** - * A list of metadata to store with the restore results in S3. - */ - userMetadata: Array - } - /** - * Describes the default server-side encryption to apply to new objects in the - * bucket. If a PUT Object request doesn't specify any server-side encryption, this - * default encryption will be applied. For more information, see [PutBucketEncryption]. - * - * ``` - * - General purpose buckets - If you don't specify a customer managed key at - * configuration, Amazon S3 automatically creates an Amazon Web Services KMS key ( - * aws/s3 ) in your Amazon Web Services account the first time that you add an - * object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS - * key for SSE-KMS. - * - * - Directory buckets - Your SSE-KMS configuration can only support 1 [customer managed key]per - * directory bucket for the lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: SSE-S3 and SSE-KMS. - * ``` - * - * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - type _subTvCNQ = noSmithyDocumentSerde - interface ServerSideEncryptionByDefault extends _subTvCNQ { - /** - * Server-side encryption algorithm to use for the default encryption. - * - * For directory buckets, there are only two supported values for server-side - * encryption: AES256 and aws:kms . - * - * This member is required. - */ - sseAlgorithm: ServerSideEncryption - /** - * Amazon Web Services Key Management Service (KMS) customer managed key ID to use - * for the default encryption. - * - * ``` - * - General purpose buckets - This parameter is allowed if and only if - * SSEAlgorithm is set to aws:kms or aws:kms:dsse . - * - * - Directory buckets - This parameter is allowed if and only if SSEAlgorithm is - * set to aws:kms . - * ``` - * - * You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the - * KMS key. - * - * ``` - * - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - * - * - Key ARN: - * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - * - * - Key Alias: alias/alias-name - * ``` - * - * If you are using encryption with cross-account or Amazon Web Services service - * operations, you must use a fully qualified KMS key ARN. For more information, - * see [Using encryption for cross-account operations]. - * - * ``` - * - General purpose buckets - If you're specifying a customer managed KMS key, - * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias - * instead, then KMS resolves the key within the requester’s account. This behavior - * can result in data that's encrypted with a KMS key that belongs to the - * requester, and not the bucket owner. Also, if you use a key ID, you can run into - * a LogDestination undeliverable error when creating a VPC flow log. - * - * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory - * bucket, only use the key ID or key ARN. The key alias format of the KMS key - * isn't supported. - * ``` - * - * Amazon S3 only supports symmetric encryption KMS keys. For more information, - * see [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. - * - * [Using encryption for cross-account operations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy - * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html - */ - kmsMasterKeyID?: string - } - /** - * To use simple format for S3 keys for log objects, set SimplePrefix to an empty - * object. - * - * ``` - * [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] - * ``` - */ - type _subXYSdU = noSmithyDocumentSerde - interface SimplePrefix extends _subXYSdU { - } - /** - * A container that describes additional filters for identifying the source - * objects that you want to replicate. You can choose to enable or disable the - * replication of these objects. Currently, Amazon S3 supports only the filter that - * you can specify for objects created with server-side encryption using a customer - * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). - */ - type _subhEJDM = noSmithyDocumentSerde - interface SourceSelectionCriteria extends _subhEJDM { - /** - * A filter that you can specify for selections for modifications on replicas. - * Amazon S3 doesn't replicate replica modifications by default. In the latest - * version of replication configuration (when Filter is specified), you can - * specify this element and set the status to Enabled to replicate modifications - * on replicas. - * - * If you don't specify the Filter element, Amazon S3 assumes that the replication - * configuration is the earlier version, V1. In the earlier version, this element - * is not allowed - */ - replicaModifications?: ReplicaModifications - /** - * A container for filter information for the selection of Amazon S3 objects - * encrypted with Amazon Web Services KMS. If you include SourceSelectionCriteria - * in the replication configuration, this element is required. - */ - sseKmsEncryptedObjects?: SseKmsEncryptedObjects - } - /** - * Container for data related to the storage class analysis for an Amazon S3 - * bucket for export. - */ - type _subaCjhj = noSmithyDocumentSerde - interface StorageClassAnalysisDataExport extends _subaCjhj { - /** - * The place to store the data for an analysis. - * - * This member is required. - */ - destination?: AnalyticsExportDestination - /** - * The version of the output schema to use when exporting data. Must be V_1 . - * - * This member is required. - */ - outputSchemaVersion: StorageClassAnalysisSchemaVersion + logValue(): Value } } /** - * Package smithy provides the core components for a Smithy SDK. + * Package aws provides the core SDK's utilities and shared types. Use this package's + * utilities to simplify setting and reading API operations parameters. + * + * # Value and Pointer Conversion Utilities + * + * This package includes a helper conversion utility for each scalar type the SDK's + * API use. These utilities make getting a pointer of the scalar, and dereferencing + * a pointer easier. + * + * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. + * The Pointer to value will safely dereference the pointer and return its value. + * If the pointer was nil, the scalar's zero value will be returned. + * + * The value to pointer functions will be named after the scalar type. So get a + * *string from a string value use the "String" function. This makes it easy to + * to get pointer of a literal string value, because getting the address of a + * literal requires assigning the value to a variable first. + * + * ``` + * var strPtr *string + * + * // Without the SDK's conversion functions + * str := "my string" + * strPtr = &str + * + * // With the SDK's conversion functions + * strPtr = aws.String("my string") + * + * // Convert *string to string value + * str = aws.ToString(strPtr) + * ``` + * + * In addition to scalars the aws package also includes conversion utilities for + * map and slice for commonly types used in API parameters. The map and slice + * conversion functions use similar naming pattern as the scalar conversion + * functions. + * + * ``` + * var strPtrs []*string + * var strs []string = []string{"Go", "Gophers", "Go"} + * + * // Convert []string to []*string + * strPtrs = aws.StringSlice(strs) + * + * // Convert []*string to []string + * strs = aws.ToStringSlice(strPtrs) + * ``` + * + * # SDK Default HTTP Client + * + * The SDK will use the http.DefaultClient if a HTTP client is not provided to + * the SDK's Session, or service client constructor. This means that if the + * http.DefaultClient is modified by other components of your application the + * modifications will be picked up by the SDK as well. + * + * In some cases this might be intended, but it is a better practice to create + * a custom HTTP Client to share explicitly through your application. You can + * configure the SDK to use the custom HTTP Client by setting the HTTPClient + * value of the SDK's Config type when creating a Session or service client. */ -namespace smithy_go { -} - /** - * Package metrics defines the metrics APIs used by Smithy clients. + * Package aws provides core functionality for making requests to AWS services. */ -namespace metrics { - /** - * InstrumentOptions represents configuration for an instrument. - */ - interface InstrumentOptions { - unitLabel: string - description: string - } - /** - * Int64Observer is the interface passed to async int64 instruments. - * - * Callers use the Observe() API of this interface to report metrics to the - * underlying collector. - */ - interface Int64Observer { - [key:string]: any; - observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void - } +namespace aws { + // @ts-ignore + import smithybearer = bearer + // @ts-ignore + import sdkrand = rand /** - * Float64Observer is the interface passed to async int64 instruments. - * - * Callers use the Observe() API of this interface to report metrics to the - * underlying collector. + * DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior. */ - interface Float64Observer { - [key:string]: any; - observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void - } + interface DualStackEndpointState extends Number{} /** - * RecordMetricOption applies configuration to a recorded metric. + * FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. */ - interface RecordMetricOption {(o: RecordMetricOptions): void } + interface FIPSEndpointState extends Number{} } /** - * Package tracing defines tracing APIs to be used by Smithy clients. + * Package smithy provides the core components for a Smithy SDK. */ -namespace tracing { - /** - * SpanStatus records the "success" state of an observed span. - */ - interface SpanStatus extends Number{} - /** - * SpanOptions represent configuration for span events. - */ - interface SpanOptions { - kind: SpanKind - properties: smithy.Properties - } - /** - * EventOption applies configuration to a span event. - */ - interface EventOption {(o: EventOptions): void } - /** - * SpanContext uniquely identifies a Span. - */ - interface SpanContext { - traceID: string - spanID: string - isRemote: boolean - } - interface SpanContext { - /** - * IsValid is true when a span has nonzero trace and span IDs. - */ - isValid(): boolean - } +namespace smithy_go { } namespace types { @@ -45339,8 +45279,8 @@ namespace types { /** * A container for information about access control for replicas. */ - type _subRSwvp = noSmithyDocumentSerde - interface AccessControlTranslation extends _subRSwvp { + type _subqSeRK = noSmithyDocumentSerde + interface AccessControlTranslation extends _subqSeRK { /** * Specifies the replica ownership. For default and valid values, see [PUT bucket replication] in the * Amazon S3 API Reference. @@ -45354,8 +45294,8 @@ namespace types { /** * Where to publish the analytics results. */ - type _subEfedq = noSmithyDocumentSerde - interface AnalyticsExportDestination extends _subEfedq { + type _subNGQDq = noSmithyDocumentSerde + interface AnalyticsExportDestination extends _subNGQDq { /** * A destination signifying output to an S3 bucket. * @@ -45366,8 +45306,8 @@ namespace types { /** * Contains the type of server-side encryption used. */ - type _subMKWRi = noSmithyDocumentSerde - interface Encryption extends _subMKWRi { + type _subhslTa = noSmithyDocumentSerde + interface Encryption extends _subhslTa { /** * The server-side encryption algorithm used when storing job results in Amazon S3 * (for example, AES256, aws:kms ). @@ -45400,8 +45340,8 @@ namespace types { * encrypted with a KMS key that belongs to the requester, and not the bucket * owner. */ - type _subYdcWm = noSmithyDocumentSerde - interface EncryptionConfiguration extends _subYdcWm { + type _subQHKNO = noSmithyDocumentSerde + interface EncryptionConfiguration extends _subQHKNO { /** * Specifies the ID (Key ARN or Alias ARN) of the customer managed Amazon Web * Services KMS key stored in Amazon Web Services Key Management Service (KMS) for @@ -45424,8 +45364,8 @@ namespace types { * similar to a prefix, but it is at the end of the object key name instead of at * the beginning. */ - type _subhdpnQ = noSmithyDocumentSerde - interface FilterRule extends _subhdpnQ { + type _subZWWhB = noSmithyDocumentSerde + interface FilterRule extends _subZWWhB { /** * The object key name prefix or suffix identifying one or more objects to which * the filtering rule applies. The maximum length is 1,024 characters. Overlapping @@ -45444,8 +45384,8 @@ namespace types { * Contains the type of server-side encryption used to encrypt the inventory * results. */ - type _subCOgLz = noSmithyDocumentSerde - interface InventoryEncryption extends _subCOgLz { + type _submkDBV = noSmithyDocumentSerde + interface InventoryEncryption extends _submkDBV { /** * Specifies the use of SSE-KMS to encrypt delivered inventory reports. */ @@ -45458,8 +45398,8 @@ namespace types { /** * A metadata key-value pair to store with an object. */ - type _subEsbzQ = noSmithyDocumentSerde - interface MetadataEntry extends _subEsbzQ { + type _subiEQYR = noSmithyDocumentSerde + interface MetadataEntry extends _subiEQYR { /** * Name of the object. */ @@ -45476,8 +45416,8 @@ namespace types { * * replication metrics and events. */ - type _subvDzQN = noSmithyDocumentSerde - interface Metrics extends _subvDzQN { + type _subWYKpu = noSmithyDocumentSerde + interface Metrics extends _subWYKpu { /** * Specifies whether the replication metrics are enabled. * @@ -45501,8 +45441,8 @@ namespace types { * configuration is the earlier version, V1. In the earlier version, this element * is not allowed. */ - type _subtrUmI = noSmithyDocumentSerde - interface ReplicaModifications extends _subtrUmI { + type _subCFAvR = noSmithyDocumentSerde + interface ReplicaModifications extends _subCFAvR { /** * Specifies whether Amazon S3 replicates modifications on replicas. * @@ -45519,8 +45459,8 @@ namespace types { * and operations on objects must be replicated. Must be specified together with a * Metrics block. */ - type _subozwUW = noSmithyDocumentSerde - interface ReplicationTime extends _subozwUW { + type _sublFYgy = noSmithyDocumentSerde + interface ReplicationTime extends _sublFYgy { /** * Specifies whether the replication time is enabled. * @@ -45539,8 +45479,8 @@ namespace types { * A container for filter information for the selection of S3 objects encrypted * with Amazon Web Services KMS. */ - type _subEQxoY = noSmithyDocumentSerde - interface SseKmsEncryptedObjects extends _subEQxoY { + type _suboeYHh = noSmithyDocumentSerde + interface SseKmsEncryptedObjects extends _suboeYHh { /** * Specifies whether Amazon S3 replicates objects created with server-side * encryption using an Amazon Web Services KMS key stored in Amazon Web Services @@ -45552,20 +45492,76 @@ namespace types { } } +/** + * Package metrics defines the metrics APIs used by Smithy clients. + */ +namespace metrics { + /** + * InstrumentOptions represents configuration for an instrument. + */ + interface InstrumentOptions { + unitLabel: string + description: string + } + /** + * Int64Observer is the interface passed to async int64 instruments. + * + * Callers use the Observe() API of this interface to report metrics to the + * underlying collector. + */ + interface Int64Observer { + [key:string]: any; + observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + } + /** + * Float64Observer is the interface passed to async int64 instruments. + * + * Callers use the Observe() API of this interface to report metrics to the + * underlying collector. + */ + interface Float64Observer { + [key:string]: any; + observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + } + /** + * RecordMetricOption applies configuration to a recorded metric. + */ + interface RecordMetricOption {(o: RecordMetricOptions): void } +} + /** * Package tracing defines tracing APIs to be used by Smithy clients. */ namespace tracing { /** - * SpanKind indicates the nature of the work being performed. + * SpanStatus records the "success" state of an observed span. */ - interface SpanKind extends Number{} + interface SpanStatus extends Number{} /** - * EventOptions represent configuration for span events. + * SpanOptions represent configuration for span events. */ - interface EventOptions { + interface SpanOptions { + kind: SpanKind properties: smithy.Properties } + /** + * EventOption applies configuration to a span event. + */ + interface EventOption {(o: EventOptions): void } + /** + * SpanContext uniquely identifies a Span. + */ + interface SpanContext { + traceID: string + spanID: string + isRemote: boolean + } + interface SpanContext { + /** + * IsValid is true when a span has nonzero trace and span IDs. + */ + isValid(): boolean + } } namespace types { @@ -45637,8 +45633,8 @@ namespace types { /** * Contains information about where to publish the analytics results. */ - type _subFeyfr = noSmithyDocumentSerde - interface AnalyticsS3BucketDestination extends _subFeyfr { + type _subDFCCP = noSmithyDocumentSerde + interface AnalyticsS3BucketDestination extends _subDFCCP { /** * The Amazon Resource Name (ARN) of the bucket to which data is exported. * @@ -45671,8 +45667,8 @@ namespace types { * * and replication metrics EventThreshold . */ - type _subSvvgY = noSmithyDocumentSerde - interface ReplicationTimeValue extends _subSvvgY { + type _subkIxFQ = noSmithyDocumentSerde + interface ReplicationTimeValue extends _subkIxFQ { /** * Contains an integer specifying time in minutes. * @@ -45683,8 +45679,8 @@ namespace types { /** * Specifies the use of SSE-KMS to encrypt delivered inventory reports. */ - type _subtGWME = noSmithyDocumentSerde - interface SSEKMS extends _subtGWME { + type _subelKLl = noSmithyDocumentSerde + interface SSEKMS extends _subelKLl { /** * Specifies the ID of the Key Management Service (KMS) symmetric encryption * customer managed key to use for encrypting inventory reports. @@ -45696,8 +45692,8 @@ namespace types { /** * Specifies the use of SSE-S3 to encrypt delivered inventory reports. */ - type _subfwKrU = noSmithyDocumentSerde - interface SSES3 extends _subfwKrU { + type _subyycin = noSmithyDocumentSerde + interface SSES3 extends _subyycin { } } @@ -45713,6 +45709,22 @@ namespace metrics { } } +/** + * Package tracing defines tracing APIs to be used by Smithy clients. + */ +namespace tracing { + /** + * SpanKind indicates the nature of the work being performed. + */ + interface SpanKind extends Number{} + /** + * EventOptions represent configuration for span events. + */ + interface EventOptions { + properties: smithy.Properties + } +} + namespace types { interface AnalyticsS3ExportFileFormat extends String{} interface AnalyticsS3ExportFileFormat { diff --git a/plugins/jsvm/internal/types/types.go b/plugins/jsvm/internal/types/types.go index e4f7728621..d472fb3ab8 100644 --- a/plugins/jsvm/internal/types/types.go +++ b/plugins/jsvm/internal/types/types.go @@ -194,22 +194,34 @@ declare var $app: PocketBase declare var $template: template.Registry /** - * readerToString reads the content of the specified io.Reader until - * EOF or maxBytes are reached. + * This method is superseded by toString. * - * If maxBytes is not specified it will read up to 32MB. + * @deprecated + * @group PocketBase + */ +declare function readerToString(reader: any, maxBytes?: number): string; + +/** + * toString stringifies the specified value. + * + * Support optional second maxBytes argument to limit the max read bytes + * when the value is a io.Reader (default to 32MB). * - * Note that after this call the reader can't be used anymore. + * Types that don't have explicit string representation are json serialized. * * Example: * * ` + "```" + `js - * const rawBody = readerToString(c.request().body) + * // io.Reader + * const ex1 = toString(e.request.body) + * + * // slice of bytes ("hello") + * const ex2 = toString([104 101 108 108 111]) * ` + "```" + ` * * @group PocketBase */ -declare function readerToString(reader: any, maxBytes?: number): string; +declare function toString(val: any, maxBytes?: number): string; /** * sleep pauses the current goroutine for at least the specified user duration (in ms). @@ -713,7 +725,7 @@ declare namespace $os { * const cmd = $os.cmd('ls', '-sl') * * // execute the command and return its standard output as string - * const output = String.fromCharCode(...cmd.output()); + * const output = toString(cmd.output()); * ` + "```" + ` */ export let cmd: exec.command From 3dd644c15c3a05d1bf17a54f2e1dd1faec38f42a Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 16:33:34 +0300 Subject: [PATCH 07/44] updated changelog and min Go version --- .github/workflows/release.yaml | 2 +- CHANGELOG.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7581d99b79..8d77976cc3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '>=1.22.5' + go-version: '>=1.22.8' # This step usually is not needed because the /ui/dist is pregenerated locally # but its here to ensure that each release embeds the latest admin ui artifacts. diff --git a/CHANGELOG.md b/CHANGELOG.md index cbbf81610c..9908c57d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +## v0.22.22 + +- Added deprecation log in case Instagram OAuth2 is used (_related to [#5652](https://github.com/pocketbase/pocketbase/discussions/5652)_). + +- Added `update` command warning to prevent unnecessary downloading PocketBase v0.23.0 since it will contain breaking changes and it will fail anyway. + +- Added global JSVM `toString()` helper (_successor of `readerToString()`_) to stringify any value (bool, number, multi-byte array, io.Reader, etc.). + _`readerToString` is still available but it is marked as deprecated. You can also use `toString` as replacement for of `String.fromCharCode` to properly stringify multi-byte unicode characters like emojis._ + ```js + decodeURIComponent(escape(String.fromCharCode(...bytes))) -> toString(bytes) + ``` + +- Backported some of the v0.23.0-rc form validators, fixes and tests. + +- Bumped GitHub action min Go version and dependencies. + + ## v0.22.21 - Lock the logs database during backup to prevent `database disk image is malformed` errors in case there is a log write running in the background ([#5541](https://github.com/pocketbase/pocketbase/discussions/5541)). From 2ff2cd874cf70edac4ab16f606e4f08c51a231a1 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 16:35:04 +0300 Subject: [PATCH 08/44] updated ui/dist --- ui/.env | 2 +- ...sno-hdt.js => AuthMethodsDocs-DOKfHUKA.js} | 2 +- ...UxU_c6D.js => AuthRefreshDocs-DOQHyuHB.js} | 2 +- ...pHU-.js => AuthWithOAuth2Docs-sv1YgvnJ.js} | 2 +- ...F0.js => AuthWithPasswordDocs-Dpy8EoRc.js} | 2 +- ...tor-CZ0EgQcM.js => CodeEditor-C-zHBmhQ.js} | 2 +- ....js => ConfirmEmailChangeDocs-DG3NuEPP.js} | 2 +- ...s => ConfirmPasswordResetDocs-CFOUXiAS.js} | 2 +- ...js => ConfirmVerificationDocs-CPe-dhLl.js} | 2 +- ...-n2O_YbPr.js => CreateApiDocs-jPKcVL6M.js} | 2 +- ...-DninUosh.js => DeleteApiDocs-EnRun5cS.js} | 2 +- ...O3HzQv.js => FieldsQueryParam-Bw7BgfEJ.js} | 2 +- ...js => FilterAutocompleteInput-BPeaOUvB.js} | 2 +- ...cs-DX-LwRkY.js => ListApiDocs-bZ1-xl-p.js} | 2 +- ...i.js => ListExternalAuthsDocs-CGAfo9a0.js} | 2 +- ...PageAdminConfirmPasswordReset-vRRTYNd2.js} | 2 +- ...PageAdminRequestPasswordReset-vLynAsfN.js} | 2 +- ... => PageOAuth2RedirectFailure-B-zxwuJd.js} | 2 +- ... => PageOAuth2RedirectSuccess-BusSuTAQ.js} | 2 +- ... PageRecordConfirmEmailChange-B7npCYXU.js} | 2 +- ...ageRecordConfirmPasswordReset-Bjhn5ho5.js} | 2 +- ...PageRecordConfirmVerification-D66thJgG.js} | 2 +- ...z63T_FK.js => RealtimeApiDocs-Bdn0UuCF.js} | 2 +- ....js => RequestEmailChangeDocs-BDG1xZdQ.js} | 2 +- ...s => RequestPasswordResetDocs-Csllfzv-.js} | 2 +- ...js => RequestVerificationDocs-BXzC-pWX.js} | 2 +- ...dkTabs-DxNNd6Sw.js => SdkTabs-DJGq8srX.js} | 2 +- ....js => UnlinkExternalAuthDocs-Cm7HyxiF.js} | 2 +- ...-CYknfZa_.js => UpdateApiDocs-DGrQC-Ly.js} | 2 +- ...cs-D09kZD3M.js => ViewApiDocs-iCTJquUd.js} | 2 +- .../{index-Bp3jGQ0J.js => index-rLaTJP5R.js} | 20 +++++++++---------- ui/dist/index.html | 2 +- 32 files changed, 41 insertions(+), 41 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-Dsno-hdt.js => AuthMethodsDocs-DOKfHUKA.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-1UxU_c6D.js => AuthRefreshDocs-DOQHyuHB.js} (97%) rename ui/dist/assets/{AuthWithOAuth2Docs-CtVYpHU-.js => AuthWithOAuth2Docs-sv1YgvnJ.js} (98%) rename ui/dist/assets/{AuthWithPasswordDocs-B1auplF0.js => AuthWithPasswordDocs-Dpy8EoRc.js} (98%) rename ui/dist/assets/{CodeEditor-CZ0EgQcM.js => CodeEditor-C-zHBmhQ.js} (99%) rename ui/dist/assets/{ConfirmEmailChangeDocs-DBFq8TK_.js => ConfirmEmailChangeDocs-DG3NuEPP.js} (97%) rename ui/dist/assets/{ConfirmPasswordResetDocs-DZJDH7s9.js => ConfirmPasswordResetDocs-CFOUXiAS.js} (98%) rename ui/dist/assets/{ConfirmVerificationDocs-CzG7odGM.js => ConfirmVerificationDocs-CPe-dhLl.js} (97%) rename ui/dist/assets/{CreateApiDocs-n2O_YbPr.js => CreateApiDocs-jPKcVL6M.js} (98%) rename ui/dist/assets/{DeleteApiDocs-DninUosh.js => DeleteApiDocs-EnRun5cS.js} (97%) rename ui/dist/assets/{FieldsQueryParam-zDO3HzQv.js => FieldsQueryParam-Bw7BgfEJ.js} (96%) rename ui/dist/assets/{FilterAutocompleteInput-l9cXyHQU.js => FilterAutocompleteInput-BPeaOUvB.js} (99%) rename ui/dist/assets/{ListApiDocs-DX-LwRkY.js => ListApiDocs-bZ1-xl-p.js} (99%) rename ui/dist/assets/{ListExternalAuthsDocs-DQacf2gi.js => ListExternalAuthsDocs-CGAfo9a0.js} (97%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-C3mHsOYN.js => PageAdminConfirmPasswordReset-vRRTYNd2.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-ByYh3pEr.js => PageAdminRequestPasswordReset-vLynAsfN.js} (98%) rename ui/dist/assets/{PageOAuth2RedirectFailure-C67m4ehZ.js => PageOAuth2RedirectFailure-B-zxwuJd.js} (86%) rename ui/dist/assets/{PageOAuth2RedirectSuccess-DEJwxR01.js => PageOAuth2RedirectSuccess-BusSuTAQ.js} (86%) rename ui/dist/assets/{PageRecordConfirmEmailChange-GhjOHgK4.js => PageRecordConfirmEmailChange-B7npCYXU.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-DiHRjH5i.js => PageRecordConfirmPasswordReset-Bjhn5ho5.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-BEu14spu.js => PageRecordConfirmVerification-D66thJgG.js} (97%) rename ui/dist/assets/{RealtimeApiDocs-Bz63T_FK.js => RealtimeApiDocs-Bdn0UuCF.js} (98%) rename ui/dist/assets/{RequestEmailChangeDocs-OulvgXBH.js => RequestEmailChangeDocs-BDG1xZdQ.js} (98%) rename ui/dist/assets/{RequestPasswordResetDocs-Ux0BhdtA.js => RequestPasswordResetDocs-Csllfzv-.js} (97%) rename ui/dist/assets/{RequestVerificationDocs-CmHx_pVy.js => RequestVerificationDocs-BXzC-pWX.js} (97%) rename ui/dist/assets/{SdkTabs-DxNNd6Sw.js => SdkTabs-DJGq8srX.js} (98%) rename ui/dist/assets/{UnlinkExternalAuthDocs-BcuOuUMj.js => UnlinkExternalAuthDocs-Cm7HyxiF.js} (98%) rename ui/dist/assets/{UpdateApiDocs-CYknfZa_.js => UpdateApiDocs-DGrQC-Ly.js} (98%) rename ui/dist/assets/{ViewApiDocs-D09kZD3M.js => ViewApiDocs-iCTJquUd.js} (97%) rename ui/dist/assets/{index-Bp3jGQ0J.js => index-rLaTJP5R.js} (99%) diff --git a/ui/.env b/ui/.env index a0c75d6e42..fee840e230 100644 --- a/ui/.env +++ b/ui/.env @@ -9,4 +9,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/" PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk" PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk" PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases" -PB_VERSION = "v0.22.21" +PB_VERSION = "v0.22.22" diff --git a/ui/dist/assets/AuthMethodsDocs-Dsno-hdt.js b/ui/dist/assets/AuthMethodsDocs-DOKfHUKA.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-Dsno-hdt.js rename to ui/dist/assets/AuthMethodsDocs-DOKfHUKA.js index 26f9dc730f..c8ba1da674 100644 --- a/ui/dist/assets/AuthMethodsDocs-Dsno-hdt.js +++ b/ui/dist/assets/AuthMethodsDocs-DOKfHUKA.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Ae,O as G,e as c,v as w,b as k,c as se,f as p,g as d,h as a,m as ae,w as U,P as ve,Q as Te,k as je,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,A as Qe,q as L,r as Ne,N as qe}from"./index-Bp3jGQ0J.js";import{S as He}from"./SdkTabs-DxNNd6Sw.js";import{F as Ke}from"./FieldsQueryParam-zDO3HzQv.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,q=n[0].name+"",E,ie,I,P,J,T,Y,$,H,ce,K,j,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,A,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new He({props:{js:` +import{S as Se,i as ye,s as Ae,O as G,e as c,v as w,b as k,c as se,f as p,g as d,h as a,m as ae,w as U,P as ve,Q as Te,k as je,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,A as Qe,q as L,r as Ne,N as qe}from"./index-rLaTJP5R.js";import{S as He}from"./SdkTabs-DJGq8srX.js";import{F as Ke}from"./FieldsQueryParam-Bw7BgfEJ.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,q=n[0].name+"",E,ie,I,P,J,T,Y,$,H,ce,K,j,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,A,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-1UxU_c6D.js b/ui/dist/assets/AuthRefreshDocs-DOQHyuHB.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-1UxU_c6D.js rename to ui/dist/assets/AuthRefreshDocs-DOQHyuHB.js index a64d0a2039..ea9ea4c894 100644 --- a/ui/dist/assets/AuthRefreshDocs-1UxU_c6D.js +++ b/ui/dist/assets/AuthRefreshDocs-DOQHyuHB.js @@ -1,4 +1,4 @@ -import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,v as k,b as p,c as K,f as b,g as d,h as o,m as I,w as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,A as Xe,q as G,r as Ye}from"./index-Bp3jGQ0J.js";import{S as Ze}from"./SdkTabs-DxNNd6Sw.js";import{F as et}from"./FieldsQueryParam-zDO3HzQv.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,z,ue,Q,M,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],qe=new Map,q;v=new Ze({props:{js:` +import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,v as k,b as p,c as K,f as b,g as d,h as o,m as I,w as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,A as Xe,q as G,r as Ye}from"./index-rLaTJP5R.js";import{S as Ze}from"./SdkTabs-DJGq8srX.js";import{F as et}from"./FieldsQueryParam-Bw7BgfEJ.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,z,ue,Q,M,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],qe=new Map,q;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-CtVYpHU-.js b/ui/dist/assets/AuthWithOAuth2Docs-sv1YgvnJ.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-CtVYpHU-.js rename to ui/dist/assets/AuthWithOAuth2Docs-sv1YgvnJ.js index af2ea6512c..0a114716f7 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-CtVYpHU-.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-sv1YgvnJ.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,v as k,b as h,c as I,f as p,g as r,h as a,m as K,w as pe,P as Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,A as Ke,q as X,r as Ge}from"./index-Bp3jGQ0J.js";import{S as Xe}from"./SdkTabs-DxNNd6Sw.js";import{F as Ye}from"./FieldsQueryParam-zDO3HzQv.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,m;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(m=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,m()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,m){r(d,n,m),K(i,n,null),a(n,f),g=!0},p(d,m){l=d;const _={};m&4&&(_.content=l[5].body),i.$set(_),(!g||m&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,m,_,v,O,P,Y,A,J,me,N,R,be,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,b,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,v as k,b as h,c as I,f as p,g as r,h as a,m as K,w as pe,P as Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,A as Ke,q as X,r as Ge}from"./index-rLaTJP5R.js";import{S as Xe}from"./SdkTabs-DJGq8srX.js";import{F as Ye}from"./FieldsQueryParam-Bw7BgfEJ.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,m;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(m=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,m()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,m){r(d,n,m),K(i,n,null),a(n,f),g=!0},p(d,m){l=d;const _={};m&4&&(_.content=l[5].body),i.$set(_),(!g||m&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,m,_,v,O,P,Y,A,J,me,N,R,be,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,b,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-B1auplF0.js b/ui/dist/assets/AuthWithPasswordDocs-Dpy8EoRc.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-B1auplF0.js rename to ui/dist/assets/AuthWithPasswordDocs-Dpy8EoRc.js index 044685e58c..e5697a8d68 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-B1auplF0.js +++ b/ui/dist/assets/AuthWithPasswordDocs-Dpy8EoRc.js @@ -1,4 +1,4 @@ -import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,v as p,b as d,c as ne,f as m,g as r,h as t,m as se,w as De,P as pt,Q as Pt,k as Rt,R as At,n as Ct,t as Z,a as x,o as c,d as ie,C as ft,A as Ot,q as re,r as Tt}from"./index-Bp3jGQ0J.js";import{S as Ut}from"./SdkTabs-DxNNd6Sw.js";import{F as Mt}from"./FieldsQueryParam-zDO3HzQv.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,A){r(R,a,A),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,A){l=R,A&16&&i!==(i=l[8].code+"")&&De(g,i),A&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,A,C,q,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,qe,he,V,be,M,me,Be,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ae,Qe,k,je,B,Je,Ke,ze,Ce,Ge,Oe,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,O=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` +import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,v as p,b as d,c as ne,f as m,g as r,h as t,m as se,w as De,P as pt,Q as Pt,k as Rt,R as At,n as Ct,t as Z,a as x,o as c,d as ie,C as ft,A as Ot,q as re,r as Tt}from"./index-rLaTJP5R.js";import{S as Ut}from"./SdkTabs-DJGq8srX.js";import{F as Mt}from"./FieldsQueryParam-Bw7BgfEJ.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,A){r(R,a,A),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,A){l=R,A&16&&i!==(i=l[8].code+"")&&De(g,i),A&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,A,C,q,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,qe,he,V,be,M,me,Be,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ae,Qe,k,je,B,Je,Ke,ze,Ce,Ge,Oe,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,O=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); diff --git a/ui/dist/assets/CodeEditor-CZ0EgQcM.js b/ui/dist/assets/CodeEditor-C-zHBmhQ.js similarity index 99% rename from ui/dist/assets/CodeEditor-CZ0EgQcM.js rename to ui/dist/assets/CodeEditor-C-zHBmhQ.js index 85c92a40c8..170e8fefee 100644 --- a/ui/dist/assets/CodeEditor-CZ0EgQcM.js +++ b/ui/dist/assets/CodeEditor-C-zHBmhQ.js @@ -1,4 +1,4 @@ -import{S as wt,i as Rt,s as Yt,e as Tt,f as Wt,U as OO,g as _t,x as BO,o as qt,J as vt,K as Ut,L as zt,I as Vt,C as jt,M as Gt}from"./index-Bp3jGQ0J.js";import{P as Ct,N as At,w as Et,D as Nt,x as qO,T as tO,I as vO,y as B,z as l,A as Mt,L as J,B as L,F as v,G as K,H as UO,J as F,v as G,K as _e,M as qe,O as ve,E as q,Q as Ue,R as S,U as It,V as Dt,W as ze,X as Bt,Y as Jt,b as C,e as Lt,f as Kt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as oa,c as la,d as na,s as ca,h as Qa,a as ha,p as ua,q as JO,C as eO}from"./index-BztyTJOx.js";var LO={};class sO{constructor(O,a,t,r,s,i,o,n,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=o,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new sO(O,[],a,t,t,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p;this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(n==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(r,n)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-s;if(o>1){let n=i&65535,Q=this.stack.length-o*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return o<<19|65536|n}}else{let o=t(i,s+1);if(o!=null)return o}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class oO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new oO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new oO(this.stack,this.pos,this.index)}}function N(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,o=!0),s+=n,o)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class da{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class z{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ve(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?N(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ve(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ve(e,O,a,t,r,s){let i=0,o=1<0){let d=e[h];if(n.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let u=O.next,c=0,f=e[i+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535){i=e[Q+f*3-1];continue O}for(;c>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u=m)c=h+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function fa(e,O,a,t){let r=HO(a,t,O);return r<0||HO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class $a{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new aO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),o=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new aO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new aO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(o>>1)){o&1?O.extended=o>>1:O.value=o>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let s=0;sO.bufferLength*4?new $a(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(o);else{if(this.advanceStack(o,t,O))continue;{r||(r=[],s=[]),r.push(o);let n=this.tokens.getMainToken(o);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,n)=>n.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((o.score-Q.score||o.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(qO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let o=s.stateSlot(O.state,4);if(o>0)return O.reduce(o),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?a.push(d):t.push(d)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return ee(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Z&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let c=o.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of o.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>o.pos?(Q==o.pos&&(Q++,n=0),o.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(n)})`),ee(o,t)):(!r||r.scoree;class je{constructor(O){this.start=O.start,this.shift=O.shift||dO,this.reduce=O.reduce||dO,this.reuse=O.reuse||dO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ct{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;oO.topRules[o][1]),r=[];for(let o=0;o=0)s(u,n,o[Q++]);else{let c=o[Q+-u];for(let f=-u;f>0;f--)s(o[Q++],n,c);Q++}}}this.nodeSet=new At(a.map((o,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:o,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Nt;let i=N(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new z(i,o):o),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new ma(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],o=i&1,n=r[s++];if(o&&t)return n;for(let Q=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=w(this.data,s+2);else break;r=a(w(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=w(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(o=>o.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=te(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const Za=54,ba=1,ka=55,xa=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ge=7,Ce=8,Ae=9,Ee=10,Ra=11,Ya=12,Ta=13,fO=57,Wa=14,re=58,Ne=20,_a=22,Me=23,qa=24,XO=26,Ie=27,va=28,Ua=31,za=34,Va=36,ja=37,Ga=0,Ca=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,oe=null,le=0;function yO(e,O){let a=e.pos+O;if(le==a&&oe==e)return se;let t=e.peek(O);for(;De(t);)t=e.peek(++O);let r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return oe=e,le=a,se=r?r.toLowerCase():t==Ma||t==Ia?void 0:null}const Be=60,cO=62,zO=47,Ma=63,Ia=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ba=[nO,Ee,Ge,Ce,Ae],Ja=new je({start:null,shift(e,O,a,t){return Ba.indexOf(O)>-1?new ne(yO(t,1)||"",e):e},reduce(e,O){return O==Ne&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==nO||r==Va?new ne(yO(t,1)||"",e):e},strict:!1}),La=new k((e,O)=>{if(e.next!=Be){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==zO;a&&e.advance();let t=yO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Wa:nO);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ra);if(r&&Ea[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ga))return e.acceptToken(Ya);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(Ta)}else{if(t=="script")return e.acceptToken(Ge);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(t))return e.acceptToken(Ee);r&&ie[r]&&ie[r][t]?e.acceptToken(fO,-1):e.acceptToken(nO)}},{contextual:!0}),Ka=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){a>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new k((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let a=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(a?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function VO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(O);break}if(s==0&&r.next==Be||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=VO("script",Za,ba),er=VO("style",ka,xa),tr=VO("textarea",Xa,ya),ar=B({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),rr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=o.type.id;if(Q==va)return $O(o,n,a);if(Q==Ua)return $O(o,n,t);if(Q==za)return $O(o,n,r);if(Q==Ne&&s.length){let u=o.node,c=u.firstChild,f=c&&ce(c,n),h;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(h||(h=Je(c,n))))){let P=u.lastChild,m=P.type.id==ja?P.from:u.to;if(m>c.to)return{parser:d.parser,overlay:[{from:c.to,to:m}]}}}}if(i&&Q==Me){let u=o.node,c;if(c=u.firstChild){let f=i[n.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let d=u.lastChild;if(d.type.id==XO){let P=d.from+1,m=d.lastChild,x=d.to-(m&&m.isError?0:1);if(x>P)return{parser:h.parser,overlay:[{from:P,to:x}]}}else if(d.type.id==Ie)return{parser:h.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,Qe=1,sr=100,or=101,he=2,Ke=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],lr=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,dr=92,fr=10;function M(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new k((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=e;if(M(s)||s==rO||s==Fe||a&&He(s))!a&&(s!=rO||r>0)&&(a=!0),t===r&&s==rO&&t++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),a=!0;else{a&&e.acceptToken(s==nr?sr:t==2&&O.canShift(he)?he:or);break}}}),Pr=new k(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(M(O)||O==Fe||O==hr||O==Qr||O==cr||O==lr&&M(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),mr=new k(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),M(O)){do e.advance();while(M(e.next)||He(e.next));e.acceptToken(Qe)}}}),gr=B({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,KeyframeRangeName:l.operatorKeyword,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ColorLiteral:l.color,"ParenthesizedContent StringLiteral":l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),Sr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},kr=T.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,mr,$r,1,2,3,4,new lO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>Sr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1200});let PO=null;function mO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));PO=O.sort().map(t=>({type:"property",label:t}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),xr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Y=/^(\w[\w-]*|-\w[\w-]*|)$/,Xr=/^-(-[\w-]*)?$/;function yr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const de=new _e,wr=["Declaration"];function Rr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,a){if(O.to-O.from>4096){let t=de.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(vO.IncludeAnonymous);if(i.firstChild())do for(let o of Ot(e,i.node,a))s.has(o.label)||(s.add(o.label),r.push(o));while(i.nextSibling());return de.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(wr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let o=e.sliceString(s.from,s.to);r.has(o)||(r.add(o),t.push({label:o,type:"variable"}))}}),t}}const Yr=e=>O=>{let{state:a,pos:t}=O,r=G(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:Y};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:Y};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:Y};if(e(r)||(O.explicit||s)&&yr(r,a.doc))return{from:e(r)||s?r.from:t,options:Ot(a.doc,Rr(r),e),validFor:Xr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:Y};return{from:r.from,options:xr,validFor:Y}}if(!O.explicit)return null;let i=r.resolve(t),o=i.childBefore(t);return o&&o.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:ue,validFor:Y}:o&&o.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pe,validFor:Y}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:Y}:null},Tr=Yr(e=>e.name=="VariableName"),QO=J.define({name:"css",parser:kr.configure({props:[L.add({Declaration:v()}),K.add({"Block KeyframeList":UO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Wr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const _r=312,fe=1,qr=2,vr=3,Ur=4,zr=313,Vr=315,jr=316,Gr=5,Cr=6,Ar=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Er=59,RO=47,Nr=42,Mr=43,Ir=45,Dr=60,Br=44,Jr=63,Lr=46,Kr=new je({start:!1,shift(e,O){return O==Gr||O==Cr||O==Vr?e:O==jr},strict:!1}),Fr=new k((e,O)=>{let{next:a}=e;(a==et||a==-1||O.context)&&e.acceptToken(zr)},{contextual:!0,fallback:!0}),Hr=new k((e,O)=>{let{next:a}=e,t;wO.indexOf(a)>-1||a==RO&&((t=e.peek(1))==RO||t==Nr)||a!=et&&a!=Er&&a!=-1&&!O.context&&e.acceptToken(_r)},{contextual:!0}),Oi=new k((e,O)=>{let{next:a}=e;if(a==Mr||a==Ir){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift(fe);e.acceptToken(t?fe:qr)}}else a==Jr&&e.peek(1)==Lr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(vr))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ei=new k((e,O)=>{if(e.next!=Dr||!O.dialectEnabled(Ar)||(e.advance(),e.next==RO))return;let a=0;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==Br)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(Ur,-a)}),ti=B({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const using function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,"LineComment Hashbang":l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),ai={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},ri={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ii={__proto__:null,"<":187},si=T.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:Kr,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[ti],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-ai[e]||-1},{term:338,get:e=>ri[e]||-1},{term:92,get:e=>ii[e]||-1}],tokenPrec:14749}),tt=[S("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),S("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),S("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),S("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),S("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),S(`try { +import{S as wt,i as Rt,s as Yt,e as Tt,f as Wt,U as OO,g as _t,x as BO,o as qt,J as vt,K as Ut,L as zt,I as Vt,C as jt,M as Gt}from"./index-rLaTJP5R.js";import{P as Ct,N as At,w as Et,D as Nt,x as qO,T as tO,I as vO,y as B,z as l,A as Mt,L as J,B as L,F as v,G as K,H as UO,J as F,v as G,K as _e,M as qe,O as ve,E as q,Q as Ue,R as S,U as It,V as Dt,W as ze,X as Bt,Y as Jt,b as C,e as Lt,f as Kt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as oa,c as la,d as na,s as ca,h as Qa,a as ha,p as ua,q as JO,C as eO}from"./index-BztyTJOx.js";var LO={};class sO{constructor(O,a,t,r,s,i,o,n,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=o,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new sO(O,[],a,t,t,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p;this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(n==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(r,n)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-s;if(o>1){let n=i&65535,Q=this.stack.length-o*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return o<<19|65536|n}}else{let o=t(i,s+1);if(o!=null)return o}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class oO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new oO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new oO(this.stack,this.pos,this.index)}}function N(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,o=!0),s+=n,o)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class da{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class z{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ve(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?N(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ve(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ve(e,O,a,t,r,s){let i=0,o=1<0){let d=e[h];if(n.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let u=O.next,c=0,f=e[i+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535){i=e[Q+f*3-1];continue O}for(;c>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u=m)c=h+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function fa(e,O,a,t){let r=HO(a,t,O);return r<0||HO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class $a{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new aO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),o=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new aO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new aO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(o>>1)){o&1?O.extended=o>>1:O.value=o>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let s=0;sO.bufferLength*4?new $a(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(o);else{if(this.advanceStack(o,t,O))continue;{r||(r=[],s=[]),r.push(o);let n=this.tokens.getMainToken(o);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,n)=>n.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((o.score-Q.score||o.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(qO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let o=s.stateSlot(O.state,4);if(o>0)return O.reduce(o),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?a.push(d):t.push(d)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return ee(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Z&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let c=o.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of o.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>o.pos?(Q==o.pos&&(Q++,n=0),o.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(n)})`),ee(o,t)):(!r||r.scoree;class je{constructor(O){this.start=O.start,this.shift=O.shift||dO,this.reduce=O.reduce||dO,this.reuse=O.reuse||dO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ct{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;oO.topRules[o][1]),r=[];for(let o=0;o=0)s(u,n,o[Q++]);else{let c=o[Q+-u];for(let f=-u;f>0;f--)s(o[Q++],n,c);Q++}}}this.nodeSet=new At(a.map((o,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:o,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Nt;let i=N(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new z(i,o):o),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new ma(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],o=i&1,n=r[s++];if(o&&t)return n;for(let Q=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=w(this.data,s+2);else break;r=a(w(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=w(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(o=>o.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=te(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const Za=54,ba=1,ka=55,xa=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ge=7,Ce=8,Ae=9,Ee=10,Ra=11,Ya=12,Ta=13,fO=57,Wa=14,re=58,Ne=20,_a=22,Me=23,qa=24,XO=26,Ie=27,va=28,Ua=31,za=34,Va=36,ja=37,Ga=0,Ca=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,oe=null,le=0;function yO(e,O){let a=e.pos+O;if(le==a&&oe==e)return se;let t=e.peek(O);for(;De(t);)t=e.peek(++O);let r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return oe=e,le=a,se=r?r.toLowerCase():t==Ma||t==Ia?void 0:null}const Be=60,cO=62,zO=47,Ma=63,Ia=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ba=[nO,Ee,Ge,Ce,Ae],Ja=new je({start:null,shift(e,O,a,t){return Ba.indexOf(O)>-1?new ne(yO(t,1)||"",e):e},reduce(e,O){return O==Ne&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==nO||r==Va?new ne(yO(t,1)||"",e):e},strict:!1}),La=new k((e,O)=>{if(e.next!=Be){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==zO;a&&e.advance();let t=yO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Wa:nO);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ra);if(r&&Ea[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ga))return e.acceptToken(Ya);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(Ta)}else{if(t=="script")return e.acceptToken(Ge);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(t))return e.acceptToken(Ee);r&&ie[r]&&ie[r][t]?e.acceptToken(fO,-1):e.acceptToken(nO)}},{contextual:!0}),Ka=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){a>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new k((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let a=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(a?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function VO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(O);break}if(s==0&&r.next==Be||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=VO("script",Za,ba),er=VO("style",ka,xa),tr=VO("textarea",Xa,ya),ar=B({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),rr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=o.type.id;if(Q==va)return $O(o,n,a);if(Q==Ua)return $O(o,n,t);if(Q==za)return $O(o,n,r);if(Q==Ne&&s.length){let u=o.node,c=u.firstChild,f=c&&ce(c,n),h;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(h||(h=Je(c,n))))){let P=u.lastChild,m=P.type.id==ja?P.from:u.to;if(m>c.to)return{parser:d.parser,overlay:[{from:c.to,to:m}]}}}}if(i&&Q==Me){let u=o.node,c;if(c=u.firstChild){let f=i[n.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let d=u.lastChild;if(d.type.id==XO){let P=d.from+1,m=d.lastChild,x=d.to-(m&&m.isError?0:1);if(x>P)return{parser:h.parser,overlay:[{from:P,to:x}]}}else if(d.type.id==Ie)return{parser:h.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,Qe=1,sr=100,or=101,he=2,Ke=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],lr=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,dr=92,fr=10;function M(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new k((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=e;if(M(s)||s==rO||s==Fe||a&&He(s))!a&&(s!=rO||r>0)&&(a=!0),t===r&&s==rO&&t++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),a=!0;else{a&&e.acceptToken(s==nr?sr:t==2&&O.canShift(he)?he:or);break}}}),Pr=new k(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(M(O)||O==Fe||O==hr||O==Qr||O==cr||O==lr&&M(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),mr=new k(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),M(O)){do e.advance();while(M(e.next)||He(e.next));e.acceptToken(Qe)}}}),gr=B({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,KeyframeRangeName:l.operatorKeyword,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ColorLiteral:l.color,"ParenthesizedContent StringLiteral":l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),Sr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},kr=T.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,mr,$r,1,2,3,4,new lO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>Sr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1200});let PO=null;function mO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));PO=O.sort().map(t=>({type:"property",label:t}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),xr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Y=/^(\w[\w-]*|-\w[\w-]*|)$/,Xr=/^-(-[\w-]*)?$/;function yr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const de=new _e,wr=["Declaration"];function Rr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,a){if(O.to-O.from>4096){let t=de.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(vO.IncludeAnonymous);if(i.firstChild())do for(let o of Ot(e,i.node,a))s.has(o.label)||(s.add(o.label),r.push(o));while(i.nextSibling());return de.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(wr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let o=e.sliceString(s.from,s.to);r.has(o)||(r.add(o),t.push({label:o,type:"variable"}))}}),t}}const Yr=e=>O=>{let{state:a,pos:t}=O,r=G(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:Y};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:Y};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:Y};if(e(r)||(O.explicit||s)&&yr(r,a.doc))return{from:e(r)||s?r.from:t,options:Ot(a.doc,Rr(r),e),validFor:Xr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:Y};return{from:r.from,options:xr,validFor:Y}}if(!O.explicit)return null;let i=r.resolve(t),o=i.childBefore(t);return o&&o.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:ue,validFor:Y}:o&&o.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pe,validFor:Y}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:Y}:null},Tr=Yr(e=>e.name=="VariableName"),QO=J.define({name:"css",parser:kr.configure({props:[L.add({Declaration:v()}),K.add({"Block KeyframeList":UO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Wr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const _r=312,fe=1,qr=2,vr=3,Ur=4,zr=313,Vr=315,jr=316,Gr=5,Cr=6,Ar=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Er=59,RO=47,Nr=42,Mr=43,Ir=45,Dr=60,Br=44,Jr=63,Lr=46,Kr=new je({start:!1,shift(e,O){return O==Gr||O==Cr||O==Vr?e:O==jr},strict:!1}),Fr=new k((e,O)=>{let{next:a}=e;(a==et||a==-1||O.context)&&e.acceptToken(zr)},{contextual:!0,fallback:!0}),Hr=new k((e,O)=>{let{next:a}=e,t;wO.indexOf(a)>-1||a==RO&&((t=e.peek(1))==RO||t==Nr)||a!=et&&a!=Er&&a!=-1&&!O.context&&e.acceptToken(_r)},{contextual:!0}),Oi=new k((e,O)=>{let{next:a}=e;if(a==Mr||a==Ir){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift(fe);e.acceptToken(t?fe:qr)}}else a==Jr&&e.peek(1)==Lr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(vr))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ei=new k((e,O)=>{if(e.next!=Dr||!O.dialectEnabled(Ar)||(e.advance(),e.next==RO))return;let a=0;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==Br)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(Ur,-a)}),ti=B({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const using function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,"LineComment Hashbang":l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),ai={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},ri={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ii={__proto__:null,"<":187},si=T.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:Kr,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[ti],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-ai[e]||-1},{term:338,get:e=>ri[e]||-1},{term:92,get:e=>ii[e]||-1}],tokenPrec:14749}),tt=[S("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),S("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),S("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),S("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),S("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),S(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-DBFq8TK_.js b/ui/dist/assets/ConfirmEmailChangeDocs-DG3NuEPP.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-DBFq8TK_.js rename to ui/dist/assets/ConfirmEmailChangeDocs-DG3NuEPP.js index 05f86ad6de..13aba19177 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-DBFq8TK_.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-DG3NuEPP.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Oe,O as Y,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as $e,w as j,P as _e,Q as ye,k as Re,R as Te,n as Ae,t as ee,a as te,o as m,d as we,C as Ee,A as qe,q as H,r as Be,N as Ue}from"./index-Bp3jGQ0J.js";import{S as De}from"./SdkTabs-DxNNd6Sw.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,A,Z,E,x,S,q,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` +import{S as Pe,i as Se,s as Oe,O as Y,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as $e,w as j,P as _e,Q as ye,k as Re,R as Te,n as Ae,t as ee,a as te,o as m,d as we,C as Ee,A as qe,q as H,r as Be,N as Ue}from"./index-rLaTJP5R.js";import{S as De}from"./SdkTabs-DJGq8srX.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,A,Z,E,x,S,q,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-DZJDH7s9.js b/ui/dist/assets/ConfirmPasswordResetDocs-CFOUXiAS.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-DZJDH7s9.js rename to ui/dist/assets/ConfirmPasswordResetDocs-CFOUXiAS.js index 553af60ef3..e6bffd8123 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-DZJDH7s9.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-CFOUXiAS.js @@ -1,4 +1,4 @@ -import{S as Ne,i as $e,s as Ce,O as K,e as c,v as w,b as k,c as Ae,f as b,g as r,h as n,m as Re,w as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,A as Be,q as j,r as Me,N as Fe}from"./index-Bp3jGQ0J.js";import{S as Ie}from"./SdkTabs-DxNNd6Sw.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Ae(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Re(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,A,y,v=[],ie=new Map,de,D,h=[],ce=new Map,R;W=new Ie({props:{js:` +import{S as Ne,i as $e,s as Ce,O as K,e as c,v as w,b as k,c as Ae,f as b,g as r,h as n,m as Re,w as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,A as Be,q as j,r as Me,N as Fe}from"./index-rLaTJP5R.js";import{S as Ie}from"./SdkTabs-DJGq8srX.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Ae(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Re(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,A,y,v=[],ie=new Map,de,D,h=[],ce=new Map,R;W=new Ie({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-CzG7odGM.js b/ui/dist/assets/ConfirmVerificationDocs-CPe-dhLl.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-CzG7odGM.js rename to ui/dist/assets/ConfirmVerificationDocs-CPe-dhLl.js index c39aa94279..a9fdd95a09 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-CzG7odGM.js +++ b/ui/dist/assets/ConfirmVerificationDocs-CPe-dhLl.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,v as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,w as H,P as ke,Q as qe,k as Re,R as Oe,n as Ae,t as x,a as ee,o as d,d as Pe,C as Ee,A as Ne,q as F,r as Ve,N as Ke}from"./index-Bp3jGQ0J.js";import{S as Me}from"./SdkTabs-DxNNd6Sw.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ve(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Ke({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,V=o[0].name+"",I,te,L,y,Q,T,z,C,K,le,M,B,se,G,U=o[0].name+"",J,ae,W,q,X,R,Y,O,Z,P,A,v=[],oe=new Map,ne,E,_=[],ie=new Map,S;y=new Me({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,v as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,w as H,P as ke,Q as qe,k as Re,R as Oe,n as Ae,t as x,a as ee,o as d,d as Pe,C as Ee,A as Ne,q as F,r as Ve,N as Ke}from"./index-rLaTJP5R.js";import{S as Me}from"./SdkTabs-DJGq8srX.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ve(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Ke({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,V=o[0].name+"",I,te,L,y,Q,T,z,C,K,le,M,B,se,G,U=o[0].name+"",J,ae,W,q,X,R,Y,O,Z,P,A,v=[],oe=new Map,ne,E,_=[],ie=new Map,S;y=new Me({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-n2O_YbPr.js b/ui/dist/assets/CreateApiDocs-jPKcVL6M.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-n2O_YbPr.js rename to ui/dist/assets/CreateApiDocs-jPKcVL6M.js index 9d75e5d2f0..82584a5123 100644 --- a/ui/dist/assets/CreateApiDocs-n2O_YbPr.js +++ b/ui/dist/assets/CreateApiDocs-jPKcVL6M.js @@ -1,4 +1,4 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as s,v as _,b as f,c as _e,f as v,g as r,h as n,m as he,w as x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as fe,a as ue,o as d,d as ke,A as At,q as ye,r as Ft,x as ae}from"./index-Bp3jGQ0J.js";import{S as Rt}from"./SdkTabs-DxNNd6Sw.js";import{F as Bt}from"./FieldsQueryParam-zDO3HzQv.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=s("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,u,m,c,p,y,S,T,w,H,D,E,P,I,j,B,C,N,q,g,b;function O(h,$){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),A=z(o);return{c(){e=s("tr"),e.innerHTML='Auth fields',t=f(),a=s("tr"),a.innerHTML=`
Optional username
String The username of the auth record. +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as s,v as _,b as f,c as _e,f as v,g as r,h as n,m as he,w as x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as fe,a as ue,o as d,d as ke,A as At,q as ye,r as Ft,x as ae}from"./index-rLaTJP5R.js";import{S as Rt}from"./SdkTabs-DJGq8srX.js";import{F as Bt}from"./FieldsQueryParam-Bw7BgfEJ.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=s("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,u,m,c,p,y,S,T,w,H,D,E,P,I,j,B,C,N,q,g,b;function O(h,$){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),A=z(o);return{c(){e=s("tr"),e.innerHTML='Auth fields',t=f(),a=s("tr"),a.innerHTML=`
Optional username
String The username of the auth record.
If not set, it will be auto generated.`,u=f(),m=s("tr"),c=s("td"),p=s("div"),A.c(),y=f(),S=s("span"),S.textContent="email",T=f(),w=s("td"),w.innerHTML='String',H=f(),D=s("td"),D.textContent="Auth record email address.",E=f(),P=s("tr"),P.innerHTML='
Optional emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.',I=f(),j=s("tr"),j.innerHTML='
Required password
String Auth record password.',B=f(),C=s("tr"),C.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',N=f(),q=s("tr"),q.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
diff --git a/ui/dist/assets/DeleteApiDocs-DninUosh.js b/ui/dist/assets/DeleteApiDocs-EnRun5cS.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-DninUosh.js rename to ui/dist/assets/DeleteApiDocs-EnRun5cS.js index bb030664a9..0e9bc65d5a 100644 --- a/ui/dist/assets/DeleteApiDocs-DninUosh.js +++ b/ui/dist/assets/DeleteApiDocs-EnRun5cS.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,v as y,b as k,c as Ce,f as m,g as p,h as i,m as De,w as ee,P as he,Q as Oe,k as Te,R as Ae,n as Be,t as te,a as le,o as u,d as we,C as Ie,A as qe,q as N,r as Me,N as Se}from"./index-Bp3jGQ0J.js";import{S as He}from"./SdkTabs-DxNNd6Sw.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Me(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),Ce(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),De(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,C,z,M=a[0].name+"",F,se,K,D,Q,E,G,g,S,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,A,x,w,B,v=[],ce=new Map,de,I,b=[],re=new Map,R;D=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,v as y,b as k,c as Ce,f as m,g as p,h as i,m as De,w as ee,P as he,Q as Oe,k as Te,R as Ae,n as Be,t as te,a as le,o as u,d as we,C as Ie,A as qe,q as N,r as Me,N as Se}from"./index-rLaTJP5R.js";import{S as He}from"./SdkTabs-DJGq8srX.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Me(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),Ce(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),De(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,C,z,M=a[0].name+"",F,se,K,D,Q,E,G,g,S,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,A,x,w,B,v=[],ce=new Map,de,I,b=[],re=new Map,R;D=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/FieldsQueryParam-zDO3HzQv.js b/ui/dist/assets/FieldsQueryParam-Bw7BgfEJ.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-zDO3HzQv.js rename to ui/dist/assets/FieldsQueryParam-Bw7BgfEJ.js index f5642514d6..b73aba3b41 100644 --- a/ui/dist/assets/FieldsQueryParam-zDO3HzQv.js +++ b/ui/dist/assets/FieldsQueryParam-Bw7BgfEJ.js @@ -1,4 +1,4 @@ -import{S as J,i as O,s as P,N as Q,e as t,b as c,v as i,c as R,f as j,g as z,h as e,m as A,w as D,t as G,a as K,o as U,d as V}from"./index-Bp3jGQ0J.js";function W(f){let n,o,u,d,k,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,v,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',k=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as O,s as P,N as Q,e as t,b as c,v as i,c as R,f as j,g as z,h as e,m as A,w as D,t as G,a as K,o as U,d as V}from"./index-rLaTJP5R.js";function W(f){let n,o,u,d,k,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,v,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',k=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),h=t("em"),h.textContent="(by default returns all fields)",y=i(`. Ex.: `),R(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-l9cXyHQU.js b/ui/dist/assets/FilterAutocompleteInput-BPeaOUvB.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-l9cXyHQU.js rename to ui/dist/assets/FilterAutocompleteInput-BPeaOUvB.js index e23dd41652..ed30e48213 100644 --- a/ui/dist/assets/FilterAutocompleteInput-l9cXyHQU.js +++ b/ui/dist/assets/FilterAutocompleteInput-BPeaOUvB.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,e as ne,f as re,g as ae,x as O,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-Bp3jGQ0J.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as j,C as R,S as qe,t as We,u as ve,v as _e}from"./index-BztyTJOx.js";function De(e){return new Worker(""+new URL("autocomplete.worker-Dy9W6Fpj.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Oe(e){G(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,W=new De,B=[],H=[],T=[],K="",v="";function _(){d==null||d.focus()}let D=null;W.onmessage=n=>{T=n.data.baseKeys||[],B=n.data.requestKeys||[],H=n.data.collectionJoinKeys||[]};function V(){clearTimeout(D),D=setTimeout(()=>{W.postMessage({baseCollection:s,collections:z(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function z(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function N(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(T||[]),n&&(l=l.concat(B||[])),c&&(l=l.concat(H||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Oe({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(We),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(ve,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(j(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(D),U(),d==null||d.destroy(),W.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=Te(s)),e.$$.dirty[0]&25352&&!a&&(v!=K||b!==-1||m!==-1)&&(t(14,v=K),V()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(j(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,K,v,Y]}class Pe extends ${constructor(r){super(),ee(this,r,Fe,He,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; +import{S as $,i as ee,s as te,e as ne,f as re,g as ae,x as O,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-rLaTJP5R.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as j,C as R,S as qe,t as We,u as ve,v as _e}from"./index-BztyTJOx.js";function De(e){return new Worker(""+new URL("autocomplete.worker-Dy9W6Fpj.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Oe(e){G(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,W=new De,B=[],H=[],T=[],K="",v="";function _(){d==null||d.focus()}let D=null;W.onmessage=n=>{T=n.data.baseKeys||[],B=n.data.requestKeys||[],H=n.data.collectionJoinKeys||[]};function V(){clearTimeout(D),D=setTimeout(()=>{W.postMessage({baseCollection:s,collections:z(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function z(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function N(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(T||[]),n&&(l=l.concat(B||[])),c&&(l=l.concat(H||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Oe({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(We),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(ve,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(j(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(D),U(),d==null||d.destroy(),W.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=Te(s)),e.$$.dirty[0]&25352&&!a&&(v!=K||b!==-1||m!==-1)&&(t(14,v=K),V()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(j(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,K,v,Y]}class Pe extends ${constructor(r){super(),ee(this,r,Fe,He,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; diff --git a/ui/dist/assets/ListApiDocs-DX-LwRkY.js b/ui/dist/assets/ListApiDocs-bZ1-xl-p.js similarity index 99% rename from ui/dist/assets/ListApiDocs-DX-LwRkY.js rename to ui/dist/assets/ListApiDocs-bZ1-xl-p.js index bbca7a75e0..663421fcf1 100644 --- a/ui/dist/assets/ListApiDocs-DX-LwRkY.js +++ b/ui/dist/assets/ListApiDocs-bZ1-xl-p.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,r as ll,x as Qe,o as m,v as _,h as t,N as Fe,O as se,c as Qt,m as Ut,w as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,A as cl,q as Le}from"./index-Bp3jGQ0J.js";import{S as dl}from"./SdkTabs-DxNNd6Sw.js";import{F as pl}from"./FieldsQueryParam-zDO3HzQv.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,r as ll,x as Qe,o as m,v as _,h as t,N as Fe,O as se,c as Qt,m as Ut,w as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,A as cl,q as Le}from"./index-rLaTJP5R.js";import{S as dl}from"./SdkTabs-DJGq8srX.js";import{F as pl}from"./FieldsQueryParam-Bw7BgfEJ.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-DQacf2gi.js b/ui/dist/assets/ListExternalAuthsDocs-CGAfo9a0.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-DQacf2gi.js rename to ui/dist/assets/ListExternalAuthsDocs-CGAfo9a0.js index 6dfdeb29a2..37e85dbefc 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-DQacf2gi.js +++ b/ui/dist/assets/ListExternalAuthsDocs-CGAfo9a0.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,v,b as m,c as pe,f as b,g as c,h as a,m as ue,w as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,A as Je,q as J,r as Ve,N as Xe}from"./index-Bp3jGQ0J.js";import{S as Ye}from"./SdkTabs-DxNNd6Sw.js";import{F as Ze}from"./FieldsQueryParam-zDO3HzQv.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Te,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,A,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,q,ae,B,oe,L,ne,C,ie,$e,ce,E,de,M,re,T,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,v,b as m,c as pe,f as b,g as c,h as a,m as ue,w as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,A as Je,q as J,r as Ve,N as Xe}from"./index-rLaTJP5R.js";import{S as Ye}from"./SdkTabs-DJGq8srX.js";import{F as Ze}from"./FieldsQueryParam-Bw7BgfEJ.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Te,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,A,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,q,ae,B,oe,L,ne,C,ie,$e,ce,E,de,M,re,T,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-C3mHsOYN.js b/ui/dist/assets/PageAdminConfirmPasswordReset-vRRTYNd2.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-C3mHsOYN.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-vRRTYNd2.js index f8a522b266..cb54878221 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-C3mHsOYN.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-vRRTYNd2.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as F,m as R,t as B,a as N,d as T,C as M,p as H,e as _,v as P,b as h,f,q as J,g as b,h as c,r as j,u as O,j as Q,l as U,o as w,z as V,A as L,B as X,D as Y,w as Z,y as q}from"./index-Bp3jGQ0J.js";function W(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,k,v,C,A,y,m=i[3]&&W(i);return u=new H({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new H({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as F,m as R,t as B,a as N,d as T,C as M,p as H,e as _,v as P,b as h,f,q as J,g as b,h as c,r as j,u as O,j as Q,l as U,o as w,z as V,A as L,B as X,D as Y,w as Z,y as q}from"./index-rLaTJP5R.js";function W(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,k,v,C,A,y,m=i[3]&&W(i);return u=new H({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new H({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password `),m&&m.c(),t=h(),F(u.$$.fragment),p=h(),F(d.$$.fragment),r=h(),a=_("button"),g=_("span"),g.textContent="Set new password",S=h(),k=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],J(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(k,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),R(u,e,null),c(e,p),R(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,k,$),c(k,v),C=!0,A||(y=[j(e,"submit",O(i[4])),Q(U.call(null,v))],A=!0)},p(o,$){o[3]?m?m.p(o,$):(m=W(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:o}),u.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:o}),d.$set(D),(!C||$&4)&&(a.disabled=o[2]),(!C||$&4)&&J(a,"btn-loading",o[2])},i(o){C||(B(u.$$.fragment,o),B(d.$$.fragment,o),C=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),C=!1},d(o){o&&(w(e),w(S),w(k)),m&&m.d(),T(u),T(d),A=!1,V(y)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},m(s,l){R(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await L.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){L.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-ByYh3pEr.js b/ui/dist/assets/PageAdminRequestPasswordReset-vLynAsfN.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-ByYh3pEr.js rename to ui/dist/assets/PageAdminRequestPasswordReset-vLynAsfN.js index 7537756651..0736334b25 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-ByYh3pEr.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-vLynAsfN.js @@ -1 +1 @@ -import{S as H,i as M,s as T,F as j,c as L,m as R,t as w,a as y,d as S,b as v,e as _,f as p,g,h as d,j as B,l as N,k as z,n as D,o as k,A as C,p as G,q as F,r as E,u as I,v as h,w as J,x as P,y as A}from"./index-Bp3jGQ0J.js";function K(u){let e,s,n,l,t,i,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

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

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

Forgotten admin password

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

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

Auth failed.

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

Auth failed.

You can close this window and go back to the app to try again.
',l(t,"class","content txt-hint txt-center p-base")},m(e,s){u(e,t,s)},p:a,i:a,o:a,d(e){e&&d(t)}}}function p(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,p,f,c,{})}}export{x as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-DEJwxR01.js b/ui/dist/assets/PageOAuth2RedirectSuccess-BusSuTAQ.js similarity index 86% rename from ui/dist/assets/PageOAuth2RedirectSuccess-DEJwxR01.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-BusSuTAQ.js index 44cdca76b5..d875197bf6 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-DEJwxR01.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-BusSuTAQ.js @@ -1 +1 @@ -import{S as o,i as c,s as i,e as r,f as u,g as l,x as s,o as d,I as h}from"./index-Bp3jGQ0J.js";function p(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

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

Auth completed.

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

Successfully changed the user email address.

You can now sign in with your new email address.

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

Successfully changed the user password.

You can now sign in with your new password.

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

Invalid or expired verification token.

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

Successfully verified email address.

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

Invalid or expired verification token.

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

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){r(i,t,o),r(i,s,o),r(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(a(t),a(s),a(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&a(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-Bz63T_FK.js b/ui/dist/assets/RealtimeApiDocs-Bdn0UuCF.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-Bz63T_FK.js rename to ui/dist/assets/RealtimeApiDocs-Bdn0UuCF.js index 2106cbbd61..1a0f11dc2a 100644 --- a/ui/dist/assets/RealtimeApiDocs-Bz63T_FK.js +++ b/ui/dist/assets/RealtimeApiDocs-Bdn0UuCF.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as u,g as s,h as I,m as ne,w as ue,t as ie,a as ce,o as n,d as le,A as me}from"./index-Bp3jGQ0J.js";import{S as de}from"./SdkTabs-DxNNd6Sw.js";function he(t){var B,U,A,W,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,C,$,S,g,w,v,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as u,g as s,h as I,m as ne,w as ue,t as ie,a as ce,o as n,d as le,A as me}from"./index-rLaTJP5R.js";import{S as de}from"./SdkTabs-DJGq8srX.js";function he(t){var B,U,A,W,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,C,$,S,g,w,v,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-OulvgXBH.js b/ui/dist/assets/RequestEmailChangeDocs-BDG1xZdQ.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-OulvgXBH.js rename to ui/dist/assets/RequestEmailChangeDocs-BDG1xZdQ.js index 734d5384a8..b785de9484 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-OulvgXBH.js +++ b/ui/dist/assets/RequestEmailChangeDocs-BDG1xZdQ.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as ye,w as N,P as ve,Q as Ae,k as Re,R as Me,n as We,t as ee,a as te,o as m,d as Te,C as ze,A as He,q as F,r as Oe,N as Ue}from"./index-Bp3jGQ0J.js";import{S as je}from"./SdkTabs-DxNNd6Sw.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,A,x,C,R,g=[],ie=new Map,ce,M,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as ye,w as N,P as ve,Q as Ae,k as Re,R as Me,n as We,t as ee,a as te,o as m,d as Te,C as ze,A as He,q as F,r as Oe,N as Ue}from"./index-rLaTJP5R.js";import{S as je}from"./SdkTabs-DJGq8srX.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,A,x,C,R,g=[],ie=new Map,ce,M,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-Ux0BhdtA.js b/ui/dist/assets/RequestPasswordResetDocs-Csllfzv-.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-Ux0BhdtA.js rename to ui/dist/assets/RequestPasswordResetDocs-Csllfzv-.js index 836f9e491b..0ea4baea6c 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-Ux0BhdtA.js +++ b/ui/dist/assets/RequestPasswordResetDocs-Csllfzv-.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as L,P as fe,Q as ye,k as Re,R as Ce,n as Be,t as x,a as ee,o as p,d as we,C as Se,A as Te,q as N,r as Ae,N as Me}from"./index-Bp3jGQ0J.js";import{S as Ue}from"./SdkTabs-DxNNd6Sw.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,m;function u(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(m=Ae(l,"click",u),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,m()}}}function he(o,s){let l,a,_,f;return a=new Me({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,m){d(i,l,m),ge(a,l,null),n(l,_),f=!0},p(i,m){s=i;const u={};m&4&&(u.content=s[5].body),a.$set(u),(!f||m&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,m,u,w,P,D=o[0].name+"",Q,te,z,$,G,C,J,q,H,se,O,B,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,A,Z,y,M,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as L,P as fe,Q as ye,k as Re,R as Ce,n as Be,t as x,a as ee,o as p,d as we,C as Se,A as Te,q as N,r as Ae,N as Me}from"./index-rLaTJP5R.js";import{S as Ue}from"./SdkTabs-DJGq8srX.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,m;function u(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(m=Ae(l,"click",u),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,m()}}}function he(o,s){let l,a,_,f;return a=new Me({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,m){d(i,l,m),ge(a,l,null),n(l,_),f=!0},p(i,m){s=i;const u={};m&4&&(u.content=s[5].body),a.$set(u),(!f||m&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,m,u,w,P,D=o[0].name+"",Q,te,z,$,G,C,J,q,H,se,O,B,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,A,Z,y,M,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-CmHx_pVy.js b/ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-CmHx_pVy.js rename to ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js index e0f3992d88..123b5f2345 100644 --- a/ui/dist/assets/RequestVerificationDocs-CmHx_pVy.js +++ b/ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as I,P as pe,Q as ye,k as Ce,R as Be,n as Se,t as x,a as ee,o as f,d as $e,C as Te,A as Ae,q as L,r as Re,N as Ve}from"./index-Bp3jGQ0J.js";import{S as Me}from"./SdkTabs-DxNNd6Sw.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,m;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(m=Re(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,m()}}}function he(o,l){let s,a,_,p;return a=new Ve({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,m){d(i,s,m),ge(a,s,null),n(s,_),p=!0},p(i,m){l=i;const u={};m&4&&(u.content=l[5].body),a.$set(u),(!p||m&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,m,u,$,q,j=o[0].name+"",N,te,Q,w,z,B,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,A,Y,R,Z,y,V,v=[],oe=new Map,ne,M,k=[],ie=new Map,C;w=new Me({props:{js:` +import{S as qe,i as we,s as Pe,O as F,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as I,P as pe,Q as ye,k as Ce,R as Be,n as Se,t as x,a as ee,o as f,d as $e,C as Te,A as Ae,q as L,r as Re,N as Ve}from"./index-rLaTJP5R.js";import{S as Me}from"./SdkTabs-DJGq8srX.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,m;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(m=Re(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,m()}}}function he(o,l){let s,a,_,p;return a=new Ve({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,m){d(i,s,m),ge(a,s,null),n(s,_),p=!0},p(i,m){l=i;const u={};m&4&&(u.content=l[5].body),a.$set(u),(!p||m&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,m,u,$,q,j=o[0].name+"",N,te,Q,w,z,B,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,A,Y,R,Z,y,V,v=[],oe=new Map,ne,M,k=[],ie=new Map,C;w=new Me({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/SdkTabs-DxNNd6Sw.js b/ui/dist/assets/SdkTabs-DJGq8srX.js similarity index 98% rename from ui/dist/assets/SdkTabs-DxNNd6Sw.js rename to ui/dist/assets/SdkTabs-DJGq8srX.js index 31959419fd..6b392cbb22 100644 --- a/ui/dist/assets/SdkTabs-DxNNd6Sw.js +++ b/ui/dist/assets/SdkTabs-DJGq8srX.js @@ -1 +1 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,v as w,q as E,r as A,w as T,N as G,c as H,m as L,d as U}from"./index-Bp3jGQ0J.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function q(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&T(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&T(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,v as w,q as E,r as A,w as T,N as G,c as H,m as L,d as U}from"./index-rLaTJP5R.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function q(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&T(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&T(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-BcuOuUMj.js b/ui/dist/assets/UnlinkExternalAuthDocs-Cm7HyxiF.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-BcuOuUMj.js rename to ui/dist/assets/UnlinkExternalAuthDocs-Cm7HyxiF.js index 3b566860a9..c4b046746f 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-BcuOuUMj.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-Cm7HyxiF.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,v as g,b as f,c as Be,f as h,g as d,h as a,m as qe,w as I,P as ye,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as Ue,C as Re,A as je,q as N,r as Ie,N as Ne}from"./index-Bp3jGQ0J.js";import{S as Ke}from"./SdkTabs-DxNNd6Sw.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,b,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),b=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,b),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,b;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),qe(s,o,null),a(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(oe(s.$$.fragment,c),b=!0)},o(c){ae(s.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,b,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,y,G,E,J,w,W,ie,z,A,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,q,le,C,U,v=[],pe=new Map,me,O,k=[],he=new Map,T;y=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,v as g,b as f,c as Be,f as h,g as d,h as a,m as qe,w as I,P as ye,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as Ue,C as Re,A as je,q as N,r as Ie,N as Ne}from"./index-rLaTJP5R.js";import{S as Ke}from"./SdkTabs-DJGq8srX.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,b,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),b=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,b),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,b;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),qe(s,o,null),a(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(oe(s.$$.fragment,c),b=!0)},o(c){ae(s.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,b,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,y,G,E,J,w,W,ie,z,A,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,q,le,C,U,v=[],pe=new Map,me,O,k=[],he=new Map,T;y=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-CYknfZa_.js b/ui/dist/assets/UpdateApiDocs-DGrQC-Ly.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-CYknfZa_.js rename to ui/dist/assets/UpdateApiDocs-DGrQC-Ly.js index 0cd7875c4b..286bda1cbb 100644 --- a/ui/dist/assets/UpdateApiDocs-CYknfZa_.js +++ b/ui/dist/assets/UpdateApiDocs-DGrQC-Ly.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,v as b,b as f,c as he,f as v,g as i,h as s,m as ye,w as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,A as Lt,q as ve,r as Pt,x as ee}from"./index-Bp3jGQ0J.js";import{S as Ft}from"./SdkTabs-DxNNd6Sw.js";import{F as At}from"./FieldsQueryParam-zDO3HzQv.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,v as b,b as f,c as he,f as v,g as i,h as s,m as ye,w as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,A as Lt,q as ve,r as Pt,x as ee}from"./index-rLaTJP5R.js";import{S as Ft}from"./SdkTabs-DJGq8srX.js";import{F as At}from"./FieldsQueryParam-Bw7BgfEJ.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
Optional username
String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/ViewApiDocs-D09kZD3M.js b/ui/dist/assets/ViewApiDocs-iCTJquUd.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-D09kZD3M.js rename to ui/dist/assets/ViewApiDocs-iCTJquUd.js index c1fa0810e6..c3b322be42 100644 --- a/ui/dist/assets/ViewApiDocs-D09kZD3M.js +++ b/ui/dist/assets/ViewApiDocs-iCTJquUd.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,v as _,b as m,c as W,f as b,g as r,h as l,m as X,w as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,A as dt,q as Z,r as ct}from"./index-Bp3jGQ0J.js";import{S as pt}from"./SdkTabs-DxNNd6Sw.js";import{F as ut}from"./FieldsQueryParam-zDO3HzQv.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,S,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,q,ce,x,pe,R,ue,Re,I,O,fe,Oe,me,Pe,h,De,A,Te,Ae,Ee,be,Se,_e,Be,qe,xe,he,Ie,Me,E,ke,M,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,v as _,b as m,c as W,f as b,g as r,h as l,m as X,w as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,A as dt,q as Z,r as ct}from"./index-rLaTJP5R.js";import{S as pt}from"./SdkTabs-DJGq8srX.js";import{F as ut}from"./FieldsQueryParam-Bw7BgfEJ.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,S,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,q,ce,x,pe,R,ue,Re,I,O,fe,Oe,me,Pe,h,De,A,Te,Ae,Ee,be,Se,_e,Be,qe,xe,he,Ie,Me,E,ke,M,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-Bp3jGQ0J.js b/ui/dist/assets/index-rLaTJP5R.js similarity index 99% rename from ui/dist/assets/index-Bp3jGQ0J.js rename to ui/dist/assets/index-rLaTJP5R.js index 6a0da7ca40..0e3dd41839 100644 --- a/ui/dist/assets/index-Bp3jGQ0J.js +++ b/ui/dist/assets/index-rLaTJP5R.js @@ -1,18 +1,18 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-l9cXyHQU.js","./index-BztyTJOx.js","./CodeEditor-CZ0EgQcM.js","./ListApiDocs-DX-LwRkY.js","./SdkTabs-DxNNd6Sw.js","./SdkTabs-lBWmLVyw.css","./FieldsQueryParam-zDO3HzQv.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-D09kZD3M.js","./CreateApiDocs-n2O_YbPr.js","./UpdateApiDocs-CYknfZa_.js","./DeleteApiDocs-DninUosh.js","./RealtimeApiDocs-Bz63T_FK.js","./AuthWithPasswordDocs-B1auplF0.js","./AuthWithOAuth2Docs-CtVYpHU-.js","./AuthRefreshDocs-1UxU_c6D.js","./RequestVerificationDocs-CmHx_pVy.js","./ConfirmVerificationDocs-CzG7odGM.js","./RequestPasswordResetDocs-Ux0BhdtA.js","./ConfirmPasswordResetDocs-DZJDH7s9.js","./RequestEmailChangeDocs-OulvgXBH.js","./ConfirmEmailChangeDocs-DBFq8TK_.js","./AuthMethodsDocs-Dsno-hdt.js","./ListExternalAuthsDocs-DQacf2gi.js","./UnlinkExternalAuthDocs-BcuOuUMj.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-BPeaOUvB.js","./index-BztyTJOx.js","./CodeEditor-C-zHBmhQ.js","./ListApiDocs-bZ1-xl-p.js","./SdkTabs-DJGq8srX.js","./SdkTabs-lBWmLVyw.css","./FieldsQueryParam-Bw7BgfEJ.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-iCTJquUd.js","./CreateApiDocs-jPKcVL6M.js","./UpdateApiDocs-DGrQC-Ly.js","./DeleteApiDocs-EnRun5cS.js","./RealtimeApiDocs-Bdn0UuCF.js","./AuthWithPasswordDocs-Dpy8EoRc.js","./AuthWithOAuth2Docs-sv1YgvnJ.js","./AuthRefreshDocs-DOQHyuHB.js","./RequestVerificationDocs-BXzC-pWX.js","./ConfirmVerificationDocs-CPe-dhLl.js","./RequestPasswordResetDocs-Csllfzv-.js","./ConfirmPasswordResetDocs-CFOUXiAS.js","./RequestEmailChangeDocs-BDG1xZdQ.js","./ConfirmEmailChangeDocs-DG3NuEPP.js","./AuthMethodsDocs-DOKfHUKA.js","./ListExternalAuthsDocs-CGAfo9a0.js","./UnlinkExternalAuthDocs-Cm7HyxiF.js"])))=>i.map(i=>d[i]); var f0=Object.defineProperty;var u0=(n,e,t)=>e in n?f0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>u0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const gs=n=>n;function Ie(n,e){for(const t in e)n[t]=e[t];return n}function c0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Tg(n){return n()}function Za(){return Object.create(null)}function $e(n){n.forEach(Tg)}function Ct(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ds;function en(n,e){return n===e?!0:(Ds||(Ds=document.createElement("a")),Ds.href=e,n===Ds.href)}function d0(n){return Object.keys(n).length===0}function oa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Cg(n){let e;return oa(n,t=>e=t)(),e}function Ue(n,e,t){n.$$.on_destroy.push(oa(e,t))}function wt(n,e,t,i){if(n){const l=Og(n,e,t,i);return n[0](l)}}function Og(n,e,t,i){return n[1]&&i?Ie(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ra=Mg?n=>requestAnimationFrame(n):Q;const bl=new Set;function Dg(n){bl.forEach(e=>{e.c(n)||(bl.delete(e),e.f())}),bl.size!==0&&ra(Dg)}function Ro(n){let e;return bl.size===0&&ra(Dg),{promise:new Promise(t=>{bl.add(e={c:n,f:t})}),abort(){bl.delete(e)}}}function k(n,e){n.appendChild(e)}function Eg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function p0(n){const e=b("style");return e.textContent="/* empty */",m0(Eg(n),e),e.sheet}function m0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const h0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&h0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function _0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function g0(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function b0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Ig(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const bo=new Map;let ko=0;function k0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function y0(n,e){const t={stylesheet:p0(e),rules:{}};return bo.set(n,t),t}function is(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ `;for(let g=0;g<=1;g+=a){const y=e+(t-e)*s(g);f+=g*100+`%{${o(y,1-y)}} `}const u=f+`100% {${o(t,1-t)}} }`,c=`__svelte_${k0(u)}_${r}`,d=Eg(n),{stylesheet:m,rules:h}=bo.get(d)||y0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,ko+=1,c}function ls(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),ko-=l,ko||v0())}function v0(){ra(()=>{ko||(bo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),bo.clear())})}function w0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=gs,start:a=Fo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=is(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&ls(n,h),d=!1}return Ro(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function S0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ag(n,l)}}function Ag(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ss;function di(n){ss=n}function bs(){if(!ss)throw new Error("Function called outside component initialization");return ss}function Ht(n){bs().$$.on_mount.push(n)}function $0(n){bs().$$.after_update.push(n)}function ks(n){bs().$$.on_destroy.push(n)}function lt(){const n=bs();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Ig(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _l=[],ee=[];let kl=[];const Fr=[],Lg=Promise.resolve();let Rr=!1;function Ng(){Rr||(Rr=!0,Lg.then(aa))}function Qt(){return Ng(),Lg}function Ke(n){kl.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let cl=0;function aa(){if(cl!==0)return;const n=ss;do{try{for(;cl<_l.length;){const e=_l[cl];cl++,di(e),T0(e.$$)}}catch(e){throw _l.length=0,cl=0,e}for(di(null),_l.length=0,cl=0;ee.length;)ee.pop()();for(let e=0;en.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),kl=e}let Rl;function fa(){return Rl||(Rl=Promise.resolve(),Rl.then(()=>{Rl=null})),Rl}function Ki(n,e,t){n.dispatchEvent(Ig(`${e?"intro":"outro"}${t}`))}const io=new Set;let xn;function le(){xn={r:0,c:[],p:xn}}function se(){xn.r||$e(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),xn.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Pg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&ls(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=gs,tick:_=Q,css:g}=l||ua;g&&(o=is(n,0,1,m,d,h,g,a++)),_(0,1);const y=Fo()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Ki(n,!0,"start")),r=Ro(T=>{if(s){if(T>=S)return _(1,0),Ki(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,ls(n),Ct(l)?(l=l(i),fa().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ca(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=gs,tick:m=Q,css:h}=l||ua;h&&(o=is(n,1,0,c,u,d,h));const _=Fo()+u,g=_+c;Ke(()=>Ki(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Ro(y=>{if(s){if(y>=g)return m(0,1),Ki(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Ct(l)?fa().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&ls(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&ls(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=gs,tick:S=Q,css:T}=s||ua,$={start:Fo()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=is(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Ki(n,h,"start")),Ro(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ki(n,r.b,"start"),T&&(c(),f=is(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Ct(s)?fa().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function Xa(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(le(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),se())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&aa()}if(c0(n)){const l=bs();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function O0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function ue(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ii(n,e){n.d(1),e.delete(n.key)}function Et(n,e){A(n,1,1,()=>{e.delete(n.key)})}function M0(n,e){n.f(),Et(n,e)}function at(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return $e(T),g}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ot(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Tg).filter(Ct);n.$$.on_destroy?n.$$.on_destroy.push(...s):$e(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(C0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function D0(n,e){n.$$.dirty[0]===-1&&(_l.push(n),Ng(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&D0(n,c)),d}):[],f.update(),u=!0,$e(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=g0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),z(n,e.target,e.anchor),aa()}di(a)}class ge{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!Ct(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!d0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const E0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(E0);const dl=[];function Fg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function Rg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Fg(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Ct(h)?h:Q},m=l.map((h,_)=>oa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){$e(m),c(),a=!1}})}function qg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function I0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&4?pt(l,[Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function A0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function L0(n){let e,t,i,l;const s=[A0,I0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Qa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qo=Fg(null,function(e){e(Qa());const t=()=>{e(Qa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Rg(qo,n=>n.location);const jo=Rg(qo,n=>n.querystring),xa=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function nn(n,e){if(e=tf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return ef(n,e),{update(t){t=tf(t),ef(n,t)}}}function N0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function ef(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||P0(i.currentTarget.getAttribute("href"))})}function tf(n){return n&&typeof n=="string"?{href:n}:n||{}}function P0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function F0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=qg(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),$0(()=>{N0(m)}));let _=null,g=null;const y=qo.subscribe(async $=>{_=$;let C=0;for(;C{xa.set(f)});return}t(0,a=null),g=null,xa.set(void 0)});ks(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class R0 extends ge{constructor(e){super(),_e(this,e,F0,L0,me,{routes:3,prefix:4,restoreScrollState:5})}}const lo=[];let jg;function Hg(n){const e=n.pattern.test(jg);nf(n,n.className,e),nf(n,n.inactiveClassName,!e)}function nf(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{jg=n.location+(n.querystring?"?"+n.querystring:""),lo.map(Hg)});function Ln(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?qg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return lo.push(i),Hg(i),{destroy(){lo.splice(lo.indexOf(i),1)}}}const q0="modulepreload",j0=function(n,e){return new URL(n,e).href},lf={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const s=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),r=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));l=Promise.all(t.map(a=>{if(a=j0(a,i),a in lf)return;lf[a]=!0;const f=a.endsWith(".css"),u=f?'[rel="stylesheet"]':"";if(!!i)for(let m=s.length-1;m>=0;m--){const h=s[m];if(h.href===a&&(!f||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${u}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":q0,f||(d.as="script",d.crossOrigin=""),d.href=a,r&&d.setAttribute("nonce",r),document.head.appendChild(d),f)return new Promise((m,h)=>{d.addEventListener("load",m),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}return l.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function At(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}zg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const of="pb_auth";class B0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!da(this.token)}get isAdmin(){return so(this.token).type==="admin"}get isAuthRecord(){return so(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=of){const i=H0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=of){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=so(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=sf(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=sf(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Vg extends B0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class U0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class pa extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function nr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class W0 extends pa{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||nr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){nr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&nr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&da(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&f.authStore.token){$[O]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Y0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Bg(n){if(n){n.query=n.query||{};for(let e in n)Y0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Ug extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Bg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class K0 extends pa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Ug(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=rf(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new gn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=rf(h)})(d)}catch(c){r(),f(new gn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function rf(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class J0 extends pa{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class Z0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class G0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class X0 extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Q0 extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Ho{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Vg,this.admins=new W0(this),this.collections=new J0(this),this.files=new X0(this),this.logs=new Z0(this),this.settings=new U0(this),this.realtime=new Ug(this),this.health=new G0(this),this.backups=new Q0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new K0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Bg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class x0 extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ek extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class tk extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class gl extends il{}class Wg extends il{constructor(e){super(`Invalid unit ${e}`)}}class mn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Me="numeric",Wn="short",$n="long",yo={year:Me,month:Me,day:Me},Yg={year:Me,month:Wn,day:Me},nk={year:Me,month:Wn,day:Me,weekday:Wn},Kg={year:Me,month:$n,day:Me},Jg={year:Me,month:$n,day:Me,weekday:$n},Zg={hour:Me,minute:Me},Gg={hour:Me,minute:Me,second:Me},Xg={hour:Me,minute:Me,second:Me,timeZoneName:Wn},Qg={hour:Me,minute:Me,second:Me,timeZoneName:$n},xg={hour:Me,minute:Me,hourCycle:"h23"},e1={hour:Me,minute:Me,second:Me,hourCycle:"h23"},t1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:Wn},n1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:$n},i1={year:Me,month:Me,day:Me,hour:Me,minute:Me},l1={year:Me,month:Me,day:Me,hour:Me,minute:Me,second:Me},s1={year:Me,month:Wn,day:Me,hour:Me,minute:Me},o1={year:Me,month:Wn,day:Me,hour:Me,minute:Me,second:Me},ik={year:Me,month:Wn,day:Me,weekday:Wn,hour:Me,minute:Me},r1={year:Me,month:$n,day:Me,hour:Me,minute:Me,timeZoneName:Wn},a1={year:Me,month:$n,day:Me,hour:Me,minute:Me,second:Me,timeZoneName:Wn},f1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,timeZoneName:$n},u1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,second:Me,timeZoneName:$n};class ys{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let ir=null;class zo extends ys{static get instance(){return ir===null&&(ir=new zo),ir}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return k1(e,t,i)}formatOffset(e,t){return Zl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let oo={};function lk(n){return oo[n]||(oo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oo[n]}const sk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ok(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function rk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let af={};function ak(n,e={}){const t=JSON.stringify([n,e]);let i=af[t];return i||(i=new Intl.ListFormat(n,e),af[t]=i),i}let qr={};function jr(n,e={}){const t=JSON.stringify([n,e]);let i=qr[t];return i||(i=new Intl.DateTimeFormat(n,e),qr[t]=i),i}let Hr={};function fk(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.NumberFormat(n,e),Hr[t]=i),i}let zr={};function uk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=zr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),zr[l]=s),s}let Wl=null;function ck(){return Wl||(Wl=new Intl.DateTimeFormat().resolvedOptions().locale,Wl)}let ff={};function dk(n){let e=ff[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,ff[n]=e}return e}function pk(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=jr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=jr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function mk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function hk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function _k(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function As(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function gk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class bk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=fk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ga(e,3);return Vt(t,this.padTo)}}}class kk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=jr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class yk{constructor(e,t,i){this.opts={style:"long",...i},!t&&g1()&&(this.rtf=uk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Hk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const vk={firstDay:1,minimalDays:4,weekend:[6,7]};class kt{static fromOpts(e){return kt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||qt.defaultLocale,r=o||(s?"en-US":ck()),a=t||qt.defaultNumberingSystem,f=i||qt.defaultOutputCalendar,u=Vr(l)||qt.defaultWeekSettings;return new kt(r,a,f,u,o)}static resetCache(){Wl=null,qr={},Hr={},zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return kt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=pk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=mk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=gk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:kt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Vr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return As(this,e,w1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=hk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return As(this,e,T1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=_k(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return As(this,void 0,()=>C1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return As(this,e,O1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new bk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new kk(e,this.intl,t)}relFormatter(e={}){return new yk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ak(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:b1()?dk(this.locale):vk}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let lr=null;class un extends ys{static get utcInstance(){return lr===null&&(lr=new un(0)),lr}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Uo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Zl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Zl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Zl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class wk extends ys{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(We(n)||n===null)return e;if(n instanceof ys)return n;if(Tk(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?zo.instance:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||pi.create(n)}else return Ji(n)?un.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new wk(n)}let uf=()=>Date.now(),cf="system",df=null,pf=null,mf=null,hf=60,_f,gf=null;class qt{static get now(){return uf}static set now(e){uf=e}static set defaultZone(e){cf=e}static get defaultZone(){return Si(cf,zo.instance)}static get defaultLocale(){return df}static set defaultLocale(e){df=e}static get defaultNumberingSystem(){return pf}static set defaultNumberingSystem(e){pf=e}static get defaultOutputCalendar(){return mf}static set defaultOutputCalendar(e){mf=e}static get defaultWeekSettings(){return gf}static set defaultWeekSettings(e){gf=Vr(e)}static get twoDigitCutoffYear(){return hf}static set twoDigitCutoffYear(e){hf=e%100}static get throwOnInvalid(){return _f}static set throwOnInvalid(e){_f=e}static resetCaches(){kt.resetCache(),pi.resetCache()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const c1=[0,31,59,90,120,151,181,212,243,273,304,334],d1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ma(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function p1(n,e,t){return t+(vs(n)?d1:c1)[e-1]}function m1(n,e){const t=vs(n)?d1:c1,i=t.findIndex(s=>sos(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Wo(n)}}function bf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ha(ma(i,1,e),t),r=yl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=yl(f)):a>r?(f=i+1,a-=yl(i)):f=i;const{month:u,day:c}=m1(f,a);return{year:f,month:u,day:c,...Wo(n)}}function sr(n){const{year:e,month:t,day:i}=n,l=p1(e,t,i);return{year:e,ordinal:l,...Wo(n)}}function kf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=m1(e,t);return{year:e,month:i,day:l,...Wo(n)}}function yf(n,e){if(!We(n.localWeekday)||!We(n.localWeekNumber)||!We(n.localWeekYear)){if(!We(n.weekday)||!We(n.weekNumber)||!We(n.weekYear))throw new gl("Cannot mix locale-based week fields with ISO-based week fields");return We(n.localWeekday)||(n.weekday=n.localWeekday),We(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),We(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Sk(n,e=4,t=1){const i=Vo(n.weekYear),l=Pn(n.weekNumber,1,os(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function $k(n){const e=Vo(n.year),t=Pn(n.ordinal,1,yl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function h1(n){const e=Vo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,wo(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function _1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function We(n){return typeof n>"u"}function Ji(n){return typeof n=="number"}function Vo(n){return typeof n=="number"&&n%1===0}function Tk(n){return typeof n=="string"}function Ck(n){return Object.prototype.toString.call(n)==="[object Date]"}function g1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function b1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ok(n){return Array.isArray(n)?n:[n]}function vf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Mk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Tl(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Vr(n){if(n==null)return null;if(typeof n!="object")throw new mn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new mn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return Vo(n)&&n>=e&&n<=t}function Dk(n,e){return n-e*Math.floor(n/e)}function Vt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(We(n)||n===null||n===""))return parseInt(n,10)}function Ni(n){if(!(We(n)||n===null||n===""))return parseFloat(n)}function _a(n){if(!(We(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ga(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function vs(n){return n%4===0&&(n%100!==0||n%400===0)}function yl(n){return vs(n)?366:365}function wo(n,e){const t=Dk(e-1,12)+1,i=n+(e-t)/12;return t===2?vs(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Bo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function wf(n,e,t){return-ha(ma(n,1,e),t)+e-1}function os(n,e=4,t=1){const i=wf(n,e,t),l=wf(n+1,e,t);return(yl(n)-i+l)/7}function Br(n){return n>99?n:n>qt.twoDigitCutoffYear?1900+n:2e3+n}function k1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Uo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function y1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new mn(`Invalid unit value ${n}`);return e}function So(n,e){const t={};for(const i in n)if(Tl(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=y1(l)}return t}function Zl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Vt(t,2)}:${Vt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Vt(t,2)}${Vt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Wo(n){return Mk(n,["hour","minute","second","millisecond"])}const Ek=["January","February","March","April","May","June","July","August","September","October","November","December"],v1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ik=["J","F","M","A","M","J","J","A","S","O","N","D"];function w1(n){switch(n){case"narrow":return[...Ik];case"short":return[...v1];case"long":return[...Ek];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const S1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ak=["M","T","W","T","F","S","S"];function T1(n){switch(n){case"narrow":return[...Ak];case"short":return[...$1];case"long":return[...S1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const C1=["AM","PM"],Lk=["Before Christ","Anno Domini"],Nk=["BC","AD"],Pk=["B","A"];function O1(n){switch(n){case"narrow":return[...Pk];case"short":return[...Nk];case"long":return[...Lk];default:return null}}function Fk(n){return C1[n.hour<12?0:1]}function Rk(n,e){return T1(e)[n.weekday-1]}function qk(n,e){return w1(e)[n.month-1]}function jk(n,e){return O1(e)[n.year<0?0:1]}function Hk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function Sf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const zk={D:yo,DD:Yg,DDD:Kg,DDDD:Jg,t:Zg,tt:Gg,ttt:Xg,tttt:Qg,T:xg,TT:e1,TTT:t1,TTTT:n1,f:i1,ff:s1,fff:r1,ffff:f1,F:l1,FF:o1,FFF:a1,FFFF:u1};class ln{static create(e,t={}){return new ln(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return zk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Vt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Fk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?qk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Rk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=ln.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?jk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Sf(ln.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=ln.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Sf(s,l(r))}}const M1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function El(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Il(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Al(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function D1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Ni(t)),months:d(Ni(i)),weeks:d(Ni(l)),days:d(Ni(s)),hours:d(Ni(o)),minutes:d(Ni(r)),seconds:d(Ni(a),a==="-0"),milliseconds:d(_a(f),c)}]}const ey={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ya(n,e,t,i,l,s,o){const r={year:e.length===2?Br(vi(e)):vi(e),month:v1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?S1.indexOf(n)+1:$1.indexOf(n)+1),r}const ty=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ny(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=ya(e,l,i,t,s,o,r);let m;return a?m=ey[a]:f?m=0:m=Uo(u,c),[d,new un(m)]}function iy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ly=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,sy=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,oy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function $f(n){const[,e,t,i,l,s,o,r]=n;return[ya(e,l,i,t,s,o,r),un.utcInstance]}function ry(n){const[,e,t,i,l,s,o,r]=n;return[ya(e,r,t,i,l,s,o),un.utcInstance]}const ay=El(Bk,ka),fy=El(Uk,ka),uy=El(Wk,ka),cy=El(I1),L1=Il(Gk,Ll,ws,Ss),dy=Il(Yk,Ll,ws,Ss),py=Il(Kk,Ll,ws,Ss),my=Il(Ll,ws,Ss);function hy(n){return Al(n,[ay,L1],[fy,dy],[uy,py],[cy,my])}function _y(n){return Al(iy(n),[ty,ny])}function gy(n){return Al(n,[ly,$f],[sy,$f],[oy,ry])}function by(n){return Al(n,[Qk,xk])}const ky=Il(Ll);function yy(n){return Al(n,[Xk,ky])}const vy=El(Jk,Zk),wy=El(A1),Sy=Il(Ll,ws,Ss);function $y(n){return Al(n,[vy,L1],[wy,Sy])}const Tf="Invalid Duration",N1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ty={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...N1},Dn=146097/400,pl=146097/4800,Cy={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...N1},Ui=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Oy=Ui.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function P1(n,e){let t=e.milliseconds??0;for(const i of Oy.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Cf(n,e){const t=P1(n,e)<0?-1:1;Ui.reduceRight((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Ui.reduce((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function My(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Cy:Ty;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||kt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new mn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:So(e,st.normalizeUnit),loc:kt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ji(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new mn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=by(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=yy(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new mn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(qt.throwOnInvalid)throw new tk(i);return new st({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Wg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?ln.create(this.loc,i).formatDurationFromString(this,e):Tf}toHuman(e={}){if(!this.isValid)return Tf;const t=Ui.map(i=>{const l=this.values[i];return We(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ga(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?P1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Ui)(Tl(t.values,l)||Tl(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=y1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...So(e,st.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Cf(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=My(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Ui)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Ji(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Ji(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Cf(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Ui)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Dy(n,e){return!n||!n.isValid?Ft.invalid("missing or invalid start"):!e||!e.isValid?Ft.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ft.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(jl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Ft.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Ft.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ft.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ft.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Ft.fromDateTimes(t,a.time)),t=null);return Ft.merge(l)}difference(...e){return Ft.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=yo,t={}){return this.isValid?ln.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return Ft.fromDateTimes(e(this.s),e(this.e))}}class Ls{static hasDST(e=qt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,qt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||kt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||kt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||kt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||kt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||kt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||kt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||kt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return kt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return kt.create(t,null,"gregory").eras(e)}static features(){return{relative:g1(),localeWeek:b1()}}}function Of(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function Ey(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=Of(a,f);return(u-u%7)/7}],["days",Of]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Iy(n,e,t,i){let[l,s,o,r]=Ey(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?st.fromMillis(a,i).shiftTo(...f).plus(u):u}const va={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ay=va.hanidec.replace(/[\[|\]]/g,"").split("");function Ly(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function jn({numberingSystem:n},e=""){return new RegExp(`${va[n||"latn"]}${e}`)}const Ny="missing Intl.DateTimeFormat.formatToParts support";function ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Ly(t))}}const Py=" ",F1=`[ ${Py}]`,R1=new RegExp(F1,"g");function Fy(n){return n.replace(/\./g,"\\.?").replace(R1,F1)}function Df(n){return n.replace(/\./g,"").replace(R1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Fy).join("|")),deser:([t])=>n.findIndex(i=>Df(t)===Df(i))+e}}function Ef(n,e){return{regex:n,deser:([,t,i])=>Uo(t,i),groups:e}}function Ns(n){return{regex:n,deser:([e])=>e}}function Ry(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function qy(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(Ry(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ct(f);case"yy":return ct(c,Br);case"yyyy":return ct(s);case"yyyyy":return ct(d);case"yyyyyy":return ct(o);case"M":return ct(r);case"MM":return ct(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ct(r);case"LL":return ct(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ct(r);case"dd":return ct(i);case"o":return ct(a);case"ooo":return ct(l);case"HH":return ct(i);case"H":return ct(r);case"hh":return ct(i);case"h":return ct(r);case"mm":return ct(i);case"m":return ct(r);case"q":return ct(r);case"qq":return ct(i);case"s":return ct(r);case"ss":return ct(i);case"S":return ct(a);case"SSS":return ct(l);case"u":return Ns(u);case"uu":return Ns(r);case"uuu":return ct(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ct(s);case"kk":return ct(c,Br);case"W":return ct(r);case"WW":return ct(i);case"E":case"c":return ct(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ef(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ef(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Ns(/[a-z_+-/]{1,256}?/i);case" ":return Ns(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:Ny};return _.token=n,_}const jy={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Hy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=jy[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function zy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Vy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Tl(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function By(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return We(n.z)||(t=pi.create(n.z)),We(n.Z)||(t||(t=new un(n.Z)),i=n.Z),We(n.q)||(n.M=(n.q-1)*3+1),We(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),We(n.u)||(n.S=_a(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let or=null;function Uy(){return or||(or=je.fromMillis(1555555555555)),or}function Wy(n,e){if(n.literal)return n;const t=ln.macroTokenToFormatOpts(n.val),i=H1(t,e);return i==null||i.includes(void 0)?n:i}function q1(n,e){return Array.prototype.concat(...n.map(t=>Wy(t,e)))}function j1(n,e,t){const i=q1(ln.parseFormat(t),n),l=i.map(o=>qy(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=zy(l),a=RegExp(o,"i"),[f,u]=Vy(e,a,r),[c,d,m]=u?By(u):[null,null,void 0];if(Tl(u,"a")&&Tl(u,"H"))throw new gl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:f,matches:u,result:c,zone:d,specificOffset:m}}}function Yy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=j1(n,e,t);return[i,l,s,o]}function H1(n,e){if(!n)return null;const i=ln.create(e,n).dtFormatter(Uy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Hy(o,n,s))}const rr="Invalid DateTime",If=864e13;function Ps(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ar(n){return n.weekData===null&&(n.weekData=vo(n.c)),n.weekData}function fr(n){return n.localWeekData===null&&(n.localWeekData=vo(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Pi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function z1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Fs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ro(n,e,t){return z1(Bo(n),e,t)}function Af(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,wo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Bo(s);let[a,f]=z1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function ql(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Rs(n,e,t=!0){return n.isValid?ln.create(kt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ur(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Vt(n.c.year,t?6:4),e?(i+="-",i+=Vt(n.c.month),i+="-",i+=Vt(n.c.day)):(i+=Vt(n.c.month),i+=Vt(n.c.day)),i}function Lf(n,e,t,i,l,s){let o=Vt(n.c.hour);return e?(o+=":",o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Vt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Vt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Vt(Math.trunc(-n.o/60)),o+=":",o+=Vt(Math.trunc(-n.o%60))):(o+="+",o+=Vt(Math.trunc(n.o/60)),o+=":",o+=Vt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const V1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ky={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Jy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},B1=["year","month","day","hour","minute","second","millisecond"],Zy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Gy=["year","ordinal","hour","minute","second","millisecond"];function Xy(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Wg(n);return e}function Nf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Xy(n)}}function Pf(n,e){const t=Si(e.zone,qt.defaultZone),i=kt.fromObject(e),l=qt.now();let s,o;if(We(n.year))s=l;else{for(const f of B1)We(n[f])&&(n[f]=V1[f]);const r=h1(n)||_1(n);if(r)return je.invalid(r);const a=t.offset(l);[s,o]=ro(n,a,t)}return new je({ts:s,zone:t,loc:i,o})}function Ff(n,e,t){const i=We(t.round)?!0:t.round,l=(o,r)=>(o=ga(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Rf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class je{constructor(e){const t=e.zone||qt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Ps(t));this.ts=We(e.ts)?qt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Fs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||kt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Rf(arguments),[i,l,s,o,r,a,f]=t;return Pf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Rf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=un.utcInstance,Pf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Ck(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,qt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:kt.fromObject(t)}):je.invalid(Ps(l))}static fromMillis(e,t={}){if(Ji(e))return e<-If||e>If?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,qt.defaultZone),loc:kt.fromObject(t)});throw new mn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new je({ts:e*1e3,zone:Si(t.zone,qt.defaultZone),loc:kt.fromObject(t)});throw new mn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,qt.defaultZone);if(!i.isValid)return je.invalid(Ps(i));const l=kt.fromObject(t),s=So(e,Nf),{minDaysInFirstWeek:o,startOfWeek:r}=yf(s,l),a=qt.now(),f=We(t.specificOffset)?i.offset(a):t.specificOffset,u=!We(s.ordinal),c=!We(s.year),d=!We(s.month)||!We(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new gl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Fs(a,f);_?(g=Zy,y=Ky,S=vo(S,o,r)):u?(g=Gy,y=Jy,S=sr(S)):(g=B1,y=V1);let T=!1;for(const R of g){const F=s[R];We(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Sk(s,o,r):u?$k(s):h1(s),C=$||_1(s);if(C)return je.invalid(C);const O=_?bf(s,o,r):u?kf(s):s,[D,I]=ro(O,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L}static fromISO(e,t={}){const[i,l]=hy(e);return ql(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=_y(e);return ql(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=gy(e);return ql(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(We(e)||We(t))throw new mn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=kt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Yy(o,e,t);return u?je.invalid(u):ql(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=$y(e);return ql(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new mn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(qt.throwOnInvalid)throw new x0(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=H1(e,kt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return q1(ln.parseFormat(e),kt.fromObject(t)).map(l=>l.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ar(this).weekYear:NaN}get weekNumber(){return this.isValid?ar(this).weekNumber:NaN}get weekday(){return this.isValid?ar(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fr(this).weekday:NaN}get localWeekNumber(){return this.isValid?fr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fr(this).weekYear:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ls.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ls.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ls.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ls.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Bo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Fs(a,o),c=Fs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Pi(this,{ts:a}),Pi(this,{ts:f})]:[this]}get isInLeapYear(){return vs(this.year)}get daysInMonth(){return wo(this.year,this.month)}get daysInYear(){return this.isValid?yl(this.year):NaN}get weeksInWeekYear(){return this.isValid?os(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?os(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=ln.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(qt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,qt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ro(o,s,e)}return Pi(this,{ts:l,zone:e})}else return je.invalid(Ps(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Pi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=So(e,Nf),{minDaysInFirstWeek:i,startOfWeek:l}=yf(t,this.loc),s=!We(t.weekYear)||!We(t.weekNumber)||!We(t.weekday),o=!We(t.ordinal),r=!We(t.year),a=!We(t.month)||!We(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new gl("Can't mix ordinal dates with month/day");let c;s?c=bf({...vo(this.c,i,l),...t},i,l):We(t.ordinal)?(c={...this.toObject(),...t},We(t.day)&&(c.day=Math.min(wo(c.year,c.month),c.day))):c=kf({...sr(this.c),...t});const[d,m]=ro(c,this.o,this.zone);return Pi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Pi(this,Af(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Pi(this,Af(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Iy(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Ft.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new mn("max requires all arguments be DateTimes");return vf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=kt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return j1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return yo}static get DATE_MED(){return Yg}static get DATE_MED_WITH_WEEKDAY(){return nk}static get DATE_FULL(){return Kg}static get DATE_HUGE(){return Jg}static get TIME_SIMPLE(){return Zg}static get TIME_WITH_SECONDS(){return Gg}static get TIME_WITH_SHORT_OFFSET(){return Xg}static get TIME_WITH_LONG_OFFSET(){return Qg}static get TIME_24_SIMPLE(){return xg}static get TIME_24_WITH_SECONDS(){return e1}static get TIME_24_WITH_SHORT_OFFSET(){return t1}static get TIME_24_WITH_LONG_OFFSET(){return n1}static get DATETIME_SHORT(){return i1}static get DATETIME_SHORT_WITH_SECONDS(){return l1}static get DATETIME_MED(){return s1}static get DATETIME_MED_WITH_SECONDS(){return o1}static get DATETIME_MED_WITH_WEEKDAY(){return ik}static get DATETIME_FULL(){return r1}static get DATETIME_FULL_WITH_SECONDS(){return a1}static get DATETIME_HUGE(){return f1}static get DATETIME_HUGE_WITH_SECONDS(){return u1}}function jl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new mn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Qy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],xy=[".mp4",".avi",".mov",".3gp",".wmv"],ev=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],tv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],U1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Qy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!xy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!ev.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!tv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,f;let s=e.find(u=>u.name==t||u.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const u of s.schema){const c=i+u.name;if(u.type=="relation"&&((r=u.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,u.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=u.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(u.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const u of e){u.schema=u.schema||[];for(const c of u.schema)if(c.type=="relation"&&((f=c.options)==null?void 0:f.collectionId)==s.id){const d=i+u.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,u.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Yo=Cn([]);function $o(n,e=4e3){return Ko(n,"info",e)}function Lt(n,e=3e3){return Ko(n,"success",e)}function ii(n,e=4500){return Ko(n,"error",e)}function nv(n,e=4500){return Ko(n,"warning",e)}function Ko(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{W1(i)},t)};Yo.update(l=>(Sa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function W1(n){Yo.update(e=>(Sa(e,n),e))}function wa(){Yo.update(n=>{for(let e of n)Sa(n,e);return[]})}function Sa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const $a=Cn({});function Ur(n){$a.set(n||{})}const Rn=Cn([]),Yn=Cn({}),To=Cn(!1),Y1=Cn({});let Gl;typeof BroadcastChannel<"u"&&(Gl=new BroadcastChannel("collections"),Gl.onmessage=()=>{var n;J1((n=Cg(Yn))==null?void 0:n.id)});function K1(){Gl==null||Gl.postMessage("reload")}function iv(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function lv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ta(),K1(),j.sortCollections(e)))}function sv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ta(),K1(),e))}async function J1(n=null){To.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ta()}catch(e){ae.error(e)}To.set(!1)}function Ta(){Y1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const cr="pb_admin_file_token";Ho.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Ho.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Ho.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Cg(Y1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||da(t,10))&&(t&&localStorage.removeItem(cr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(cr,t),this._adminFileTokenRequest=null),t};class ov extends Vg{save(e,t){super.save(e,t),t&&!t.collectionId&&Ur(t)}clear(){super.clear(),Ur(null)}}const ao=new Ho("../",new ov("pb_admin_auth"));ao.authStore.model&&!ao.authStore.model.collectionId&&Ur(ao.authStore.model);const ae=ao,rv=n=>({}),qf=n=>({});function av(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],qf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.21",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,rv):Tt(S[2]),qf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function fv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,fv,av,me,{center:0,class:1})}}function jf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function uv(n){let e,t,i,l=!n[0]&&jf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=jf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function cv(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[uv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Z1 extends ge{constructor(e){super(),_e(this,e,dv,cv,me,{nobranding:0})}}function Jo(n){const e=n-1;return e*e*e+1}function rs(n,{delay:e=0,duration:t=400,easing:i=gs}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Jo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=Ga(l),[m,h]=Ga(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Yo=Cn([]);function $o(n,e=4e3){return Ko(n,"info",e)}function Lt(n,e=3e3){return Ko(n,"success",e)}function ii(n,e=4500){return Ko(n,"error",e)}function nv(n,e=4500){return Ko(n,"warning",e)}function Ko(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{W1(i)},t)};Yo.update(l=>(Sa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function W1(n){Yo.update(e=>(Sa(e,n),e))}function wa(){Yo.update(n=>{for(let e of n)Sa(n,e);return[]})}function Sa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const $a=Cn({});function Ur(n){$a.set(n||{})}const Rn=Cn([]),Yn=Cn({}),To=Cn(!1),Y1=Cn({});let Gl;typeof BroadcastChannel<"u"&&(Gl=new BroadcastChannel("collections"),Gl.onmessage=()=>{var n;J1((n=Cg(Yn))==null?void 0:n.id)});function K1(){Gl==null||Gl.postMessage("reload")}function iv(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function lv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ta(),K1(),j.sortCollections(e)))}function sv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ta(),K1(),e))}async function J1(n=null){To.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ta()}catch(e){ae.error(e)}To.set(!1)}function Ta(){Y1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const cr="pb_admin_file_token";Ho.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Ho.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Ho.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Cg(Y1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||da(t,10))&&(t&&localStorage.removeItem(cr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(cr,t),this._adminFileTokenRequest=null),t};class ov extends Vg{save(e,t){super.save(e,t),t&&!t.collectionId&&Ur(t)}clear(){super.clear(),Ur(null)}}const ao=new Ho("../",new ov("pb_admin_auth"));ao.authStore.model&&!ao.authStore.model.collectionId&&Ur(ao.authStore.model);const ae=ao,rv=n=>({}),qf=n=>({});function av(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],qf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.22",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,rv):Tt(S[2]),qf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function fv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,fv,av,me,{center:0,class:1})}}function jf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function uv(n){let e,t,i,l=!n[0]&&jf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=jf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function cv(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[uv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Z1 extends ge{constructor(e){super(),_e(this,e,dv,cv,me,{nobranding:0})}}function Jo(n){const e=n-1;return e*e*e+1}function rs(n,{delay:e=0,duration:t=400,easing:i=gs}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Jo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=Ga(l),[m,h]=Ga(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` transform: ${f} translate(${(1-_)*c}${d}, ${(1-_)*m}${h}); opacity: ${a-u*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Jo,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Wt(n,{delay:e=0,duration:t=400,easing:i=Jo,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-f*d}); opacity: ${r-u*d} `}}let Wr,Fi;const Yr="app-tooltip";function Hf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return Fi=Fi||document.querySelector("."+Yr),Fi||(Fi=document.createElement("div"),Fi.classList.add(Yr),document.body.appendChild(Fi)),Fi}function G1(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Kr();return}t.textContent=e.text,t.className=Yr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Kr(){clearTimeout(Wr),Oi().classList.remove("active"),Oi().activeNode=void 0}function pv(n,e){Oi().activeNode=n,clearTimeout(Wr),Wr=setTimeout(()=>{Oi().classList.add("active"),G1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Hf(e);function i(){pv(n,t)}function l(){Kr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Oi(),{update(s){var o,r;t=Hf(s),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&G1(n,t)},destroy(){var s,o;(o=(s=Oi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Kr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function zf(n,e,t){const i=n.slice();return i[12]=e[t],i}const mv=n=>({}),Vf=n=>({uniqueId:n[4]});function hv(n){let e,t,i=ue(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Bf(n){let e,t,i=Co(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Co(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function gv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Vf),u=[_v,hv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,mv):Tt(m[8]),Vf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Uf="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Uf:n||Uf}function bv(n,e,t){let i;Ue(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,bv,gv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function kv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function yv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function vv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function wv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[kv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[yv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[vv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Sv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class $v extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{})}}function Wf(n){let e,t;return e=new Z1({props:{$$slots:{default:[Tv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Tv(n){let e,t;return e=new $v({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Cv(n){let e,t,i=n[0]&&Wf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Wf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ov(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Mv extends ge{constructor(e){super(),_e(this,e,Ov,Cv,me,{})}}const It=Cn(""),Oo=Cn(""),Xi=Cn(!1);function Dv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Ev(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Yf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Kf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Iv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Ev,Dv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Yf(),g=(n[0].length||n[7].length)&&Kf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Yf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Kf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Av(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-l9cXyHQU.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class $s extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Lv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function Nv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Zo extends ge{constructor(e){super(),_e(this,e,Nv,Lv,me,{tooltip:0,class:1})}}function Pv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function Fv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,Fv,Pv,me,{class:1,name:2,sort:0,disable:3})}}const Rv=n=>({}),Jf=n=>({}),qv=n=>({}),Zf=n=>({});function jv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Zf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Jf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,qv):Tt(_[10]),Zf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Rv):Tt(_[10]),Jf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Hv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Go extends ge{constructor(e){super(),_e(this,e,Hv,jv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function zv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Vv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=U1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class X1 extends ge{constructor(e){super(),_e(this,e,Vv,zv,me,{level:0})}}function Bv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Uv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,Uv,Bv,me,{date:0})}}function Gf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=n2(i[31]);return i[33]=s,i}function Xf(n,e,t){const i=n.slice();return i[36]=e[t],i}function Wv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Yv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Zv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qf(n){let e;function t(s,o){return s[7]?Xv:Gv}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Gv(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&xf(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=xf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Xv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=eu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function e2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Yv:Wv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Kv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[Jv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Zv]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,nu,null,Gf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=Qf(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function lu(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function t2(n){let e,t,i,l,s;e=new Go({props:{class:"table-wrapper",$$slots:{default:[e2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&iu(n),r=n[5]&&lu(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=iu(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=lu(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const su=50,dr=/[-:\. ]/gi;function n2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function i2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,su,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(dr,"")+".json");const Y=U[0].created.replaceAll(dr,""),ie=U[U.length-1].created.replaceAll(dr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=su),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class l2 extends ge{constructor(e){super(),_e(this,e,i2,t2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! +`)})},i(a){s||(a&&Ke(()=>{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Bf(n){let e,t,i=Co(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Co(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function gv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Vf),u=[_v,hv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,mv):Tt(m[8]),Vf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Uf="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Uf:n||Uf}function bv(n,e,t){let i;Ue(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,bv,gv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function kv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function yv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function vv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function wv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[kv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[yv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[vv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Sv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class $v extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{})}}function Wf(n){let e,t;return e=new Z1({props:{$$slots:{default:[Tv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Tv(n){let e,t;return e=new $v({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Cv(n){let e,t,i=n[0]&&Wf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Wf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ov(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Mv extends ge{constructor(e){super(),_e(this,e,Ov,Cv,me,{})}}const It=Cn(""),Oo=Cn(""),Xi=Cn(!1);function Dv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Ev(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Yf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Kf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Iv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Ev,Dv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Yf(),g=(n[0].length||n[7].length)&&Kf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Yf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Kf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Av(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-BPeaOUvB.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class $s extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Lv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function Nv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Zo extends ge{constructor(e){super(),_e(this,e,Nv,Lv,me,{tooltip:0,class:1})}}function Pv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function Fv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,Fv,Pv,me,{class:1,name:2,sort:0,disable:3})}}const Rv=n=>({}),Jf=n=>({}),qv=n=>({}),Zf=n=>({});function jv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Zf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Jf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,qv):Tt(_[10]),Zf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Rv):Tt(_[10]),Jf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Hv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Go extends ge{constructor(e){super(),_e(this,e,Hv,jv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function zv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Vv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=U1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class X1 extends ge{constructor(e){super(),_e(this,e,Vv,zv,me,{level:0})}}function Bv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Uv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,Uv,Bv,me,{date:0})}}function Gf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=n2(i[31]);return i[33]=s,i}function Xf(n,e,t){const i=n.slice();return i[36]=e[t],i}function Wv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Yv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Zv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qf(n){let e;function t(s,o){return s[7]?Xv:Gv}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Gv(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&xf(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=xf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Xv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=eu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function e2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Yv:Wv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Kv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[Jv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Zv]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,nu,null,Gf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=Qf(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function lu(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function t2(n){let e,t,i,l,s;e=new Go({props:{class:"table-wrapper",$$slots:{default:[e2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&iu(n),r=n[5]&&lu(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=iu(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=lu(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const su=50,dr=/[-:\. ]/gi;function n2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function i2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,su,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(dr,"")+".json");const Y=U[0].created.replaceAll(dr,""),ie=U[U.length-1].created.replaceAll(dr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=su),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class l2 extends ge{constructor(e){super(),_e(this,e,i2,t2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela @@ -35,7 +35,7 @@ var f0=Object.defineProperty;var u0=(n,e,t)=>e in n?f0(n,e,{enumerable:!0,config * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license */const uS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};wb._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return uS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function wc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function cS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&wc();return{c(){e=b("div"),t=b("div"),i=K("Found "),l=K(n[1]),s=M(),r=K(o),a=M(),c&&c.c(),f=M(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&oe(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&oe(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=wc(),c.c(),E(c,1),c.m(e,f)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function dS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}Ht(()=>(ci.register(Ti,mo,uo,la,ps,G4,lS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class pS extends ge{constructor(e){super(),_e(this,e,dS,cS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function mS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function hS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Rb extends ge{constructor(e){super(),_e(this,e,hS,mS,me,{content:2,language:3,class:0})}}const _S=n=>({}),Sc=n=>({}),gS=n=>({}),$c=n=>({});function Tc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Cc(n);const $=n[19].header,C=wt($,n,n[18],$c);let O=n[4]&&n[2]&&Oc(n);const D=n[19].default,I=wt(D,n,n[18],null),L=n[19].footer,R=wt(L,n,n[18],Sc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),f=M(),u=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[J(t,"click",Be(n[20])),J(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Cc(n),T.c(),E(T,1),T.m(o,r)):T&&(le(),A(T,1,1,()=>{T=null}),se()),C&&C.p&&(!g||N[0]&262144)&&$t(C,$,n,n[18],g?St($,n[18],N,gS):Tt(n[18]),$c),n[4]&&n[2]?O?O.p(n,N):(O=Oc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&$t(I,D,n,n[18],g?St(D,n[18],N,null):Tt(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&$t(R,L,n,n[18],g?St(L,n[18],N,_S):Tt(n[18]),Sc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,rs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=Pg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,rs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ca(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,$e(S)}}}function Cc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,rs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,rs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Oc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function bS(n){let e,t,i,l,s=n[0]&&Tc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Tc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,$e(l)}}}let Hi,Sr=[];function qb(){return Hi=Hi||document.querySelector(".overlays"),Hi||(Hi=document.createElement("div"),Hi.classList.add("overlays"),document.body.appendChild(Hi)),Hi}let wi=150;function Mc(){return 1e3+qb().querySelectorAll(".overlay-panel-container.active").length}function kS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Mc(),_):t(6,_.style="",_))}function R(){j.pushUnique(Sr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Sr,h),Sr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Mc()&&(Y.preventDefault(),O())}function P(Y){o&&q(g)}function q(Y,ie){ie&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Ht(()=>(qb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const H=()=>a?O():!0;function W(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function U(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,O,_,g,T,N,P,q,u,c,d,C,D,$,l,i,H,W,G,U]}class Zt extends ge{constructor(e){super(),_e(this,e,kS,bS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function yS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[Se(i=Pe.call(null,e,n[3]?void 0:n[0])),J(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Ct(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function vS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function f(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Ht(()=>()=>{a&&clearTimeout(a)}),n.$$set=u=>{"value"in u&&t(5,i=u.value),"tooltip"in u&&t(0,l=u.tooltip),"idleClasses"in u&&t(1,s=u.idleClasses),"successClasses"in u&&t(2,o=u.successClasses),"successDuration"in u&&t(6,r=u.successDuration)},[l,s,o,a,f,i,r]}class sl extends ge{constructor(e){super(),_e(this,e,vS,yS,me,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Dc(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function wS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new X1({props:{level:n[1].level}}),I=new Q1({props:{date:n[1].created}});let N=!n[4]&&Ec(n),P=ue(n[5](n[1].data)),q=[];for(let W=0;WA(q[W],1,1,()=>{q[W]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("div"),d=K(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),B(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),B(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let W=0;W',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ec(n){let e,t,i,l;function s(a,f){return a[1].message?TS:$S}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function $S(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TS(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&oe(i,t)},d(l){l&&v(e)}}}function CS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=K(t),s=K(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function OS(n){let e,t;return e=new Rb({props:{content:n[17],language:"html"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function MS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function DS(n){let e,t;return e=new Rb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ES(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ic(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[ES,DS,MS,OS,CS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=K("data."),s=K(l),o=M(),r=b("td"),u.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&oe(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function IS(n){let e,t,i,l;const s=[SS,wS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(le(),A(o[u],1,1,()=>{o[u]=null}),se()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function AS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[J(e,"click",n[9]),J(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,$e(a)}}}function NS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[LS],header:[AS],default:[IS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}const Ac="log_view";function PS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Ac),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Ac})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class FS extends ge{constructor(e){super(),_e(this,e,PS,NS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function RS(n,e,t){const i=n.slice();return i[1]=e[t],i}function qS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function jS(n){let e,t,i,l=ue(U1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class jb extends ge{constructor(e){super(),_e(this,e,HS,jS,me,{class:0})}}function zS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[BS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[US,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[WS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function VS(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function BS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function US(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new jb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function WS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function YS(n){let e,t,i,l;const s=[VS,zS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function KS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function ZS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[JS],header:[KS],default:[YS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function GS(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class XS extends ge{constructor(e){super(),_e(this,e,GS,ZS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function QS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Lc(n){let e,t;return e=new pS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Nc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new l2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function xS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Zo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[QS,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new $s({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new jb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Lc(n),N=Nc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Lc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Nc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function e$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[xS]},$$scope:{ctx:n}}});let r={};i=new FS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new XS({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const xs="logId",Pc="adminRequests",Fc="adminLogRequests";function t$(n,e,t){var L;let i,l,s;Ue(n,jo,R=>t(19,l=R)),Ue(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Pc)||((L=window.localStorage)==null?void 0:L.getItem(Fc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Pc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[xs]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[xs]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(xs)&&r&&r.show(o.get(xs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Fc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{})}}function i$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function l$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class s$ extends ge{constructor(e){super(),_e(this,e,l$,i$,me,{tolerance:3})}}function o$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new s$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const Rc="@adminSidebarWidth";function r$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Rc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Rc,a))},[s,o,a,r,l,i,f,u,c,d]}class Hb extends ge{constructor(e){super(),_e(this,e,r$,o$,me,{class:0})}}const za=Cn({});function fn(n,e,t){za.set({text:n,yesCallback:e,noCallback:t})}function zb(){za.set({})}function qc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function a$(n){let e,t,i,l,s=n[0]&&qc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=qc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function f$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function jc(n,e,t){const i=n.slice();return i[27]=e[t],i}function u$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function c$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function d$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function p$(n){let e,t,i,l;const s=[d$,c$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Hc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[p$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Hc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Hc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function h$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Vc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function _$(n){let e,t,i,l,s,o,r=n[5]!=""&&Vc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Vc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function g$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[_$],header:[h$],default:[m$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-CZ0EgQcM.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class k$ extends ge{constructor(e){super(),_e(this,e,b$,g$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Bc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Uc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Wc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Yc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Uc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Uc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Yc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function y$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Yc=n=>n.name;function v$(n,e,t){let i;Ue(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class w$ extends ge{constructor(e){super(),_e(this,e,v$,y$,me,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Jc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function S$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class C$ extends ge{constructor(e){super(),_e(this,e,T$,$$,me,{class:0})}}const O$=n=>({interactive:n&64,hasErrors:n&32}),Zc=n=>({interactive:n[6],hasErrors:n[5]}),M$=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]}),D$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]});function Qc(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xc(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function E$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&xc(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=xc(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function I$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function A$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function L$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function ed(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Gc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[N$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[P$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Zc);let g=!n[0].toDelete&&td(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,M$):Tt(y[19]),Gc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,O$):Tt(y[19]),Zc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=td(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function N$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function td(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[F$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function F$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function R$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qc();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[E$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],Xc),m=d||I$();function h(S,T){if(S[0].toDelete)return L$;if(S[6])return A$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&ed(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=Qc(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,D$):Tt(S[19]),Xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=ed(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let $r=[];function q$(n,e,t){let i,l,s,o;Ue(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of $r)N.id!=f&&N.collapse()}Ht(()=>($r.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey($r,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,q$,R$,me,{key:1,field:0})}}function j$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function H$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function z$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function V$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[j$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[H$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[z$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function B$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[V$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function U$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class W$ extends ge{constructor(e){super(),_e(this,e,U$,B$,me,{field:0,key:1})}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function J$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[Y$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[K$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function Z$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function G$(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[Z$,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function X$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[G$],options:[J$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Q$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class x$ extends ge{constructor(e){super(),_e(this,e,Q$,X$,me,{field:0,key:1})}}function eT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function tT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class nT extends ge{constructor(e){super(),_e(this,e,tT,eT,me,{field:0,key:1})}}function iT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Nl extends ge{constructor(e){super(),_e(this,e,lT,iT,me,{value:0,separator:1,readonly:2,disabled:3})}}function sT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. + `),i=b("div");for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class jb extends ge{constructor(e){super(),_e(this,e,HS,jS,me,{class:0})}}function zS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[BS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[US,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[WS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function VS(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function BS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function US(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new jb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function WS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function YS(n){let e,t,i,l;const s=[VS,zS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function KS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function ZS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[JS],header:[KS],default:[YS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function GS(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class XS extends ge{constructor(e){super(),_e(this,e,GS,ZS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function QS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Lc(n){let e,t;return e=new pS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Nc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new l2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function xS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Zo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[QS,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new $s({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new jb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Lc(n),N=Nc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Lc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Nc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function e$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[xS]},$$scope:{ctx:n}}});let r={};i=new FS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new XS({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const xs="logId",Pc="adminRequests",Fc="adminLogRequests";function t$(n,e,t){var L;let i,l,s;Ue(n,jo,R=>t(19,l=R)),Ue(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Pc)||((L=window.localStorage)==null?void 0:L.getItem(Fc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Pc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[xs]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[xs]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(xs)&&r&&r.show(o.get(xs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Fc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{})}}function i$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function l$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class s$ extends ge{constructor(e){super(),_e(this,e,l$,i$,me,{tolerance:3})}}function o$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new s$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const Rc="@adminSidebarWidth";function r$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Rc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Rc,a))},[s,o,a,r,l,i,f,u,c,d]}class Hb extends ge{constructor(e){super(),_e(this,e,r$,o$,me,{class:0})}}const za=Cn({});function fn(n,e,t){za.set({text:n,yesCallback:e,noCallback:t})}function zb(){za.set({})}function qc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function a$(n){let e,t,i,l,s=n[0]&&qc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=qc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function f$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function jc(n,e,t){const i=n.slice();return i[27]=e[t],i}function u$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function c$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function d$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function p$(n){let e,t,i,l;const s=[d$,c$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Hc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[p$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Hc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Hc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function h$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Vc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function _$(n){let e,t,i,l,s,o,r=n[5]!=""&&Vc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Vc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function g$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[_$],header:[h$],default:[m$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-C-zHBmhQ.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class k$ extends ge{constructor(e){super(),_e(this,e,b$,g$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Bc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Uc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Wc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Yc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Uc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Uc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Yc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function y$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Yc=n=>n.name;function v$(n,e,t){let i;Ue(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class w$ extends ge{constructor(e){super(),_e(this,e,v$,y$,me,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Jc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function S$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class C$ extends ge{constructor(e){super(),_e(this,e,T$,$$,me,{class:0})}}const O$=n=>({interactive:n&64,hasErrors:n&32}),Zc=n=>({interactive:n[6],hasErrors:n[5]}),M$=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]}),D$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]});function Qc(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xc(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function E$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&xc(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=xc(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function I$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function A$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function L$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function ed(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Gc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[N$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[P$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Zc);let g=!n[0].toDelete&&td(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,M$):Tt(y[19]),Gc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,O$):Tt(y[19]),Zc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=td(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function N$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function td(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[F$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function F$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function R$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qc();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[E$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],Xc),m=d||I$();function h(S,T){if(S[0].toDelete)return L$;if(S[6])return A$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&ed(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=Qc(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,D$):Tt(S[19]),Xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=ed(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let $r=[];function q$(n,e,t){let i,l,s,o;Ue(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of $r)N.id!=f&&N.collapse()}Ht(()=>($r.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey($r,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,q$,R$,me,{key:1,field:0})}}function j$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function H$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function z$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function V$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[j$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[H$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[z$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function B$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[V$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function U$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class W$ extends ge{constructor(e){super(),_e(this,e,U$,B$,me,{field:0,key:1})}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function J$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[Y$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[K$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function Z$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function G$(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[Z$,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function X$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[G$],options:[J$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Q$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class x$ extends ge{constructor(e){super(),_e(this,e,Q$,X$,me,{field:0,key:1})}}function eT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function tT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class nT extends ge{constructor(e){super(),_e(this,e,tT,eT,me,{field:0,key:1})}}function iT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Nl extends ge{constructor(e){super(),_e(this,e,lT,iT,me,{value:0,separator:1,readonly:2,disabled:3})}}function sT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function oT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are ONLY allowed. This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function rT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[sT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[oT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function aT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[rT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function fT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Vb extends ge{constructor(e){super(),_e(this,e,fT,aT,me,{field:0,key:1})}}function uT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function cT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class dT extends ge{constructor(e){super(),_e(this,e,cT,uT,me,{field:0,key:1})}}function pT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function mT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[pT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function hT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[mT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function _T(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class gT extends ge{constructor(e){super(),_e(this,e,_T,hT,me,{field:0,key:1})}}var Tr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],wl={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ms={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function nd(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Cr=function(n){return n instanceof Array?n:[n]};function an(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function dt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Bb(n,e){if(e(n))return n;if(n.parentNode)return Bb(n.parentNode,e)}function to(n,e){var t=dt("div","numInputWrapper"),i=dt("input","numInput "+n),l=dt("span","arrowUp"),s=dt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Or=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},bT={D:Or,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Or,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Or,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Bi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ns={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ns.w(n,e,t)]},F:function(n,e,t){return Po(ns.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(ns.h(n,e,t))},H:function(n){return pn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Ub=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ms:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ns[c]&&m[d-1]!=="\\"?ns[c](r,u,t):c!=="\\"?c:""}).join("")}},sa=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ms:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||wl).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Dr(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var fe=t._input.value;c(),Kt(),t._input.value!==fe&&t._debouncedChange()}function f(Z,X){return Z%12+12*In(X===t.l10n.amPM[1])}function u(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=f(Z,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Mr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Mr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Mr(Z,X,ne);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(ne)))}function h(Z){var X=yn(Z),ne=parseInt(X.value)+(Z.delta||0);(ne/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&Mt(ne)}function _(Z,X,ne,fe){if(X instanceof Array)return X.forEach(function(Te){return _(Z,Te,ne,fe)});if(Z instanceof Array)return Z.forEach(function(Te){return _(Te,X,ne,fe)});Z.addEventListener(X,ne,fe),t._handlers.push({remove:function(){return Z.removeEventListener(X,ne,fe)}})}function g(){bt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(fe){return _(fe,"click",t[ne])})}),t.isMobile){al();return}var Z=nd(ze,50);if(t._debouncedChange=nd(g,wT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ae(yn(ne))}),_(t._input,"keydown",De),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",De),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ut),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(Z,X){var ne=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=dt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Z,X,ne,fe){var Te=ft(X,!0),Le=dt("span",Z,X.getDate().toString());return Le.dateObj=X,Le.$i=fe,Le.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Te?(Le.tabIndex=-1,Mn(X)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(an(Le,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),an(Le,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),bt("onDayCreate",Le),Le}function D(Z){Z.focus(),t.config.mode==="range"&&Ae(Z)}function I(Z){for(var X=Z>0?0:t.config.showMonths-1,ne=Z>0?t.config.showMonths:-1,fe=X;fe!=ne;fe+=Z)for(var Te=t.daysContainer.children[fe],Le=Z>0?0:Te.children.length-1,Je=Z>0?Te.children.length:-1,qe=Le;qe!=Je;qe+=Z){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&ft(Qe.dateObj))return Qe}}function L(Z,X){for(var ne=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,fe=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Le=ne-t.currentMonth;Le!=fe;Le+=Te)for(var Je=t.daysContainer.children[Le],qe=ne-t.currentMonth===Le?Z.$i+X:X<0?Je.children.length-1:0,Qe=Je.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=Te){var Ve=Je.children[Re];if(Ve.className.indexOf("hidden")===-1&&ft(Ve.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(Z,X){var ne=s(),fe=mt(ne||document.body),Te=Z!==void 0?Z:fe?ne:t.selectedDateElem!==void 0&&mt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&mt(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():fe?L(Te,X):D(Te)}function F(Z,X){for(var ne=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((X-1+12)%12,Z),Te=t.utils.getDaysInMonth(X,Z),Le=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",Qe=Je?"nextMonthDay hidden":"nextMonthDay",Re=fe+1-ne,Ve=0;Re<=fe;Re++,Ve++)Le.appendChild(O("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Le.appendChild(O("flatpickr-day",new Date(Z,X,Re),Re,Ve));for(var yt=Te+1;yt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);yt++,Ve++)Le.appendChild(O("flatpickr-day "+Qe,new Date(Z,X+1,yt%Te),yt,Ve));var Jn=dt("div","dayContainer");return Jn.appendChild(Le),Jn}function N(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ne=dt("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Po(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Z=dt("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=dt("span","cur-month"):(t.monthsDropdownContainer=dt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),bt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var fe=to("cur-year",{tabindex:"-1"}),Te=fe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=dt("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(fe),X.appendChild(Le),Z.appendChild(X),{container:Z,yearElement:Te,monthElement:ne}}function H(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){return t.monthNav=dt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(an(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(an(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Oe(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Dr(t.config);t.timeContainer=dt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=dt("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var fe=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:u(Z.hours)),t.minuteElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=to("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(dt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=dt("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function U(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=dt("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=dt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=id(t.l10n.weekdays.shorthand);Z>0&&Z @@ -67,7 +67,7 @@ var f0=Object.defineProperty;var u0=(n,e,t)=>e in n?f0(n,e,{enumerable:!0,config `),l=b("code"),l.textContent="id",s=K(` , `),o=b("code"),o.textContent="created",r=K(` , `),a=b("code"),a.textContent="updated",f=M(),D&&D.c(),u=K(` - .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class WC extends ge{constructor(e){super(),_e(this,e,UC,BC,me,{collection:0})}}const YC=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),KC=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),JC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]});function ZC(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[XC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Nd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Pd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function XC(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Ld),C=n[12].afterLabel,O=wt(C,n,n[15],Ad);let D=!n[9]&&Nd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Pd(n);const N=n[12].default,P=wt(N,n,n[15],Id);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,JC):Tt(q[15]),Ld),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,KC):Tt(q[15]),Ad),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Nd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Pd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,YC):Tt(q[15]),Id)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function QC(n){let e,t,i,l;const s=[GC,ZC],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Fd;function xC(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=Fd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-l9cXyHQU.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),Fd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class $l extends ge{constructor(e){super(),_e(this,e,xC,QC,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Rd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request
filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule: + .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class WC extends ge{constructor(e){super(),_e(this,e,UC,BC,me,{collection:0})}}const YC=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),KC=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),JC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]});function ZC(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[XC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Nd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Pd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function XC(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Ld),C=n[12].afterLabel,O=wt(C,n,n[15],Ad);let D=!n[9]&&Nd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Pd(n);const N=n[12].default,P=wt(N,n,n[15],Id);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,JC):Tt(q[15]),Ld),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,KC):Tt(q[15]),Ad),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Nd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Pd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,YC):Tt(q[15]),Id)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function QC(n){let e,t,i,l;const s=[GC,ZC],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Fd;function xC(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=Fd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-BPeaOUvB.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),Fd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class $l extends ge{constructor(e){super(),_e(this,e,xC,QC,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Rd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule:
@request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function jd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&oe(i,t)},d(l){l&&v(e)}}}function Hd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[e5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $l({props:c}),ee.push(()=>be(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new $l({props:m}),ee.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new $l({props:_}),ee.push(()=>be(r,"rule",h)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(g,y){z(e,g,y),w(g,i,y),z(l,g,y),w(g,o,y),z(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),V(e,g),V(l,g),V(r,g)}}}function zd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function e5(n){let e,t=!n[10]&&zd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=zd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Vd(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[t5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new $l({props:s}),ee.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function t5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function n5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&qd(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new $l({props:D}),ee.push(()=>be(u,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),ee.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Hd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Vd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the @@ -76,7 +76,7 @@ var f0=Object.defineProperty;var u0=(n,e,t)=>e in n?f0(n,e,{enumerable:!0,config
If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Ud(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function a5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[r5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function f5(n,e,t){let i;Ue(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-CZ0EgQcM.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class u5 extends ge{constructor(e){super(),_e(this,e,f5,a5,me,{collection:0})}}const c5=n=>({active:n&1}),Yd=n=>({active:n[0]});function Kd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function d5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Yd);let u=n[0]&&Kd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,c5):Tt(c[14]),Yd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Kd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function p5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class ho extends ge{constructor(e){super(),_e(this,e,p5,d5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function m5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function h5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[m5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function b5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?g5:_5}let a=r(n),f=a(n),u=n[3]&&Jd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Jd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Zd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[y5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[v5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function y5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. + MAX(balance) as maxBalance).`,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Ud(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function a5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[r5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function f5(n,e,t){let i;Ue(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-C-zHBmhQ.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class u5 extends ge{constructor(e){super(),_e(this,e,f5,a5,me,{collection:0})}}const c5=n=>({active:n&1}),Yd=n=>({active:n[0]});function Kd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function d5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Yd);let u=n[0]&&Kd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,c5):Tt(c[14]),Yd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Kd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function p5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class ho extends ge{constructor(e){super(),_e(this,e,p5,d5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function m5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function h5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[m5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function b5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?g5:_5}let a=r(n),f=a(n),u=n[3]&&Jd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Jd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Zd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[y5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[v5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function y5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function v5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function w5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[k5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Zd(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Zd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function S5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function T5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?$5:S5}let a=r(n),f=a(n),u=n[2]&&Gd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function C5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function O5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[C5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&Xd();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=Xd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function E5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?D5:M5}let a=r(n),f=a(n),u=n[1]&&Qd();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=Qd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function A5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[11]),Se(Pe.call(null,r,{text:`The constraint is applied only for new records. Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function L5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[12]),Se(Pe.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` @@ -84,9 +84,9 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),l=b("strong"),o=K(s),r=M(),a=b("i"),f=M(),u=b("strong"),d=K(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&oe(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&oe(d,c)},d(_){_&&v(e)}}}function sp(n){let e,t,i,l=ue(n[6]),s=[];for(let u=0;u',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=np(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=ip(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function q5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function j5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function H5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[j5],header:[q5],default:[R5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function z5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class V5 extends ge{constructor(e){super(),_e(this,e,z5,H5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function fp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function B5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new WC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function U5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new u5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function up(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new l5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function cp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new F5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Dl)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function W5(n){let e,t,i,l,s,o,r;const a=[U5,B5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===hs&&up(n),d=n[15]&&cp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===hs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=up(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=cp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function dp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[Y5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Y5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function pp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[K5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function mp(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function K5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=pp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=hp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function _p(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function gp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function bp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&kp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=kp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Dl)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Z5(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&dp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[J5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&_p(n),P=O&&gp(),q=n[15]&&bp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===hs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,mt,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=dp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=_p(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((mt=pe[5])==null?void 0:mt.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=gp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===hs),pe[15]?q?q.p(pe,Ne):(q=bp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function G5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function X5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[G5],header:[Z5],default:[W5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new V5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",hs="api_rules",Dl="options",Q5="base",yp="auth",vp="view";function Er(n){return JSON.stringify(n)}function x5(n,e,t){let i,l,s,o,r,a;Ue(n,mi,ve=>t(5,a=ve));const f={};f[Q5]="Base",f[vp]="View",f[yp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Er(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Er(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{wa(),lv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&fn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),sv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(hs),Xe=()=>$(Dl);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function mt(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function gt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===yp),n.$$.dirty[0]&4&&t(14,l=h.type===vp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Er(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Dl&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,mt,Gt,De,Ae,ze,gt,de]}class Ba extends ge{constructor(e){super(),_e(this,e,x5,X5,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function e6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function t6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function n6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?t6:e6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(nn.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function i6(n,e,t){let i,l;Ue(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Yb extends ge{constructor(e){super(),_e(this,e,i6,n6,me,{collection:0,pinnedIds:4})}}function wp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[22]=e[t],i}function $p(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Cp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Op(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Dp(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ep(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function l6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&$p(n),T=n[5].length&&Cp(n),$=n[3].length&&!n[2].length&&Dp(),C=!n[9]&&Ep(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=$p(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Cp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Dp(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ep(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function s6(n){let e,t,i,l;e=new Hb({props:{class:"collection-sidebar",$$slots:{default:[l6]},$$scope:{ctx:n}}});let s={};return i=new Ba({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Ip="@pinnedCollections";function o6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function r6(n,e,t){let i,l,s,o,r,a,f,u,c;Ue(n,Rn,L=>t(11,a=L)),Ue(n,Yn,L=>t(19,f=L)),Ue(n,To,L=>t(8,u=L)),Ue(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Ip);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),o6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Ip,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class a6 extends ge{constructor(e){super(),_e(this,e,r6,s6,me,{})}}function Ap(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Lp(n){n[18]=n[19].default}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Pp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Fp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Pp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Pp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function Rp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:c6,then:u6,catch:f6,value:19,blocks:[,,,]};return Xa(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&Xa(t,l)||O0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function f6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function u6(n){Lp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Lp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function c6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function qp(n,e){let t,i,l,s=e[5]===e[14]&&Rp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=Rp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function d6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function m6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[p6],default:[d6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function h6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-DX-LwRkY.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-D09kZD3M.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-n2O_YbPr.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-CYknfZa_.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-DninUosh.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-Bz63T_FK.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-B1auplF0.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-CtVYpHU-.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-1UxU_c6D.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-CmHx_pVy.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-CzG7odGM.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-Ux0BhdtA.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-DZJDH7s9.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-OulvgXBH.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-DBFq8TK_.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-Dsno-hdt.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-DQacf2gi.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-BcuOuUMj.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class _6 extends ge{constructor(e){super(),_e(this,e,h6,m6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function g6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` + you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=np(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=ip(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function q5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function j5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function H5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[j5],header:[q5],default:[R5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function z5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class V5 extends ge{constructor(e){super(),_e(this,e,z5,H5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function fp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function B5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new WC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function U5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new u5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function up(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new l5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function cp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new F5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Dl)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function W5(n){let e,t,i,l,s,o,r;const a=[U5,B5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===hs&&up(n),d=n[15]&&cp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===hs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=up(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=cp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function dp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[Y5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Y5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function pp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[K5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function mp(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function K5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=pp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=hp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function _p(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function gp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function bp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&kp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=kp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Dl)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Z5(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&dp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[J5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&_p(n),P=O&&gp(),q=n[15]&&bp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===hs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,mt,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=dp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=_p(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((mt=pe[5])==null?void 0:mt.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=gp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===hs),pe[15]?q?q.p(pe,Ne):(q=bp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function G5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function X5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[G5],header:[Z5],default:[W5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new V5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",hs="api_rules",Dl="options",Q5="base",yp="auth",vp="view";function Er(n){return JSON.stringify(n)}function x5(n,e,t){let i,l,s,o,r,a;Ue(n,mi,ve=>t(5,a=ve));const f={};f[Q5]="Base",f[vp]="View",f[yp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Er(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Er(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{wa(),lv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&fn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),sv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(hs),Xe=()=>$(Dl);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function mt(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function gt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===yp),n.$$.dirty[0]&4&&t(14,l=h.type===vp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Er(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Dl&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,mt,Gt,De,Ae,ze,gt,de]}class Ba extends ge{constructor(e){super(),_e(this,e,x5,X5,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function e6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function t6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function n6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?t6:e6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(nn.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function i6(n,e,t){let i,l;Ue(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Yb extends ge{constructor(e){super(),_e(this,e,i6,n6,me,{collection:0,pinnedIds:4})}}function wp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[22]=e[t],i}function $p(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Cp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Op(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Dp(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ep(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function l6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&$p(n),T=n[5].length&&Cp(n),$=n[3].length&&!n[2].length&&Dp(),C=!n[9]&&Ep(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=$p(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Cp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Dp(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ep(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function s6(n){let e,t,i,l;e=new Hb({props:{class:"collection-sidebar",$$slots:{default:[l6]},$$scope:{ctx:n}}});let s={};return i=new Ba({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Ip="@pinnedCollections";function o6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function r6(n,e,t){let i,l,s,o,r,a,f,u,c;Ue(n,Rn,L=>t(11,a=L)),Ue(n,Yn,L=>t(19,f=L)),Ue(n,To,L=>t(8,u=L)),Ue(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Ip);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),o6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Ip,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class a6 extends ge{constructor(e){super(),_e(this,e,r6,s6,me,{})}}function Ap(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Lp(n){n[18]=n[19].default}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Pp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Fp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Pp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Pp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function Rp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:c6,then:u6,catch:f6,value:19,blocks:[,,,]};return Xa(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&Xa(t,l)||O0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function f6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function u6(n){Lp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Lp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function c6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function qp(n,e){let t,i,l,s=e[5]===e[14]&&Rp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=Rp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function d6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function m6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[p6],default:[d6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function h6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-bZ1-xl-p.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-iCTJquUd.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-jPKcVL6M.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-DGrQC-Ly.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-EnRun5cS.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-Bdn0UuCF.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-Dpy8EoRc.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-sv1YgvnJ.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-DOQHyuHB.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-BXzC-pWX.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-CPe-dhLl.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-Csllfzv-.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-CFOUXiAS.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-BDG1xZdQ.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-DG3NuEPP.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-DOKfHUKA.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-CGAfo9a0.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-Cm7HyxiF.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class _6 extends ge{constructor(e){super(),_e(this,e,h6,m6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function g6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&Ct(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const jp="yyyy-MM-dd HH:mm:ss.SSS";function b6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,jp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,jp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Kb extends ge{constructor(e){super(),_e(this,e,b6,g6,me,{model:1})}}function k6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function y6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[k6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function v6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Jb extends ge{constructor(e){super(),_e(this,e,v6,y6,me,{class:0,length:5})}}function w6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function S6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Hp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[$6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function zp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[T6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[C6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function T6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Jb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function C6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function O6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function M6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[w6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[S6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Hp(n),_=(n[2]||n[3])&&zp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Hp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=zp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function D6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||fn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class E6 extends ge{constructor(e){super(),_e(this,e,D6,M6,me,{record:0,collection:1,isNew:2})}}function I6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class L6 extends ge{constructor(e){super(),_e(this,e,A6,I6,me,{value:0,maxHeight:4})}}function N6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new L6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function P6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function F6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class R6 extends ge{constructor(e){super(),_e(this,e,F6,P6,me,{field:1,value:0})}}function q6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function j6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[q6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function H6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class z6 extends ge{constructor(e){super(),_e(this,e,H6,j6,me,{field:1,value:0})}}function V6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function B6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[V6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class W6 extends ge{constructor(e){super(),_e(this,e,U6,B6,me,{field:1,value:0})}}function Y6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function K6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function J6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Z6 extends ge{constructor(e){super(),_e(this,e,J6,K6,me,{field:1,value:0})}}function G6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function X6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[G6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Q6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class x6 extends ge{constructor(e){super(),_e(this,e,Q6,X6,me,{field:1,value:0})}}function Vp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function eO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Vp(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Va({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Vp($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function tO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[eO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class iO extends ge{constructor(e){super(),_e(this,e,nO,tO,me,{field:1,value:0})}}function Bp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function lO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Wb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Bp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Bp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function sO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[lO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function oO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class rO extends ge{constructor(e){super(),_e(this,e,oO,sO,me,{field:1,value:0})}}function aO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function uO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function cO(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function dO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?fO:aO}let $=T(n),C=$(n);const O=[cO,uO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function pO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Up(n){return typeof n=="string"&&Zb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Zb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function mO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Up(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-CZ0EgQcM.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Up(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Zb(r))},[s,l,r,o,i,a]}class hO extends ge{constructor(e){super(),_e(this,e,mO,pO,me,{field:1,value:0})}}function _O(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function gO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function bO(n){let e;function t(s,o){return s[2]?gO:_O}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function kO(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{file:0,size:1})}}function Wp(n){let e;function t(s,o){return s[4]==="image"?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function vO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Wp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Wp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function $O(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function TO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function CO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[TO],header:[$O],default:[SO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function OO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class MO extends ge{constructor(e){super(),_e(this,e,OO,CO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function DO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?LO:f[3]==="video"||f[3]==="audio"?AO:IO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function EO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function IO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Yp(n){let e,t,i={};return e=new MO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function NO(n){let e,t,i;function l(a,f){return a[2]?EO:DO}let s=l(n),o=s(n),r=n[7]&&Yp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Yp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function PO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ua extends ge{constructor(e){super(),_e(this,e,PO,NO,me,{record:9,filename:0,size:1})}}function Kp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function FO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function RO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function qO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ua({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?RO:FO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Zp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[qO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function jO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new yO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Gp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[jO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function HO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Kb extends ge{constructor(e){super(),_e(this,e,b6,g6,me,{model:1})}}function k6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function y6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[k6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function v6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Jb extends ge{constructor(e){super(),_e(this,e,v6,y6,me,{class:0,length:5})}}function w6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function S6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Hp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[$6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function zp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[T6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[C6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function T6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Jb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function C6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function O6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function M6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[w6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[S6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Hp(n),_=(n[2]||n[3])&&zp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Hp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=zp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function D6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||fn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class E6 extends ge{constructor(e){super(),_e(this,e,D6,M6,me,{record:0,collection:1,isNew:2})}}function I6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class L6 extends ge{constructor(e){super(),_e(this,e,A6,I6,me,{value:0,maxHeight:4})}}function N6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new L6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function P6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function F6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class R6 extends ge{constructor(e){super(),_e(this,e,F6,P6,me,{field:1,value:0})}}function q6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function j6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[q6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function H6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class z6 extends ge{constructor(e){super(),_e(this,e,H6,j6,me,{field:1,value:0})}}function V6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function B6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[V6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class W6 extends ge{constructor(e){super(),_e(this,e,U6,B6,me,{field:1,value:0})}}function Y6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function K6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function J6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Z6 extends ge{constructor(e){super(),_e(this,e,J6,K6,me,{field:1,value:0})}}function G6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function X6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[G6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Q6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class x6 extends ge{constructor(e){super(),_e(this,e,Q6,X6,me,{field:1,value:0})}}function Vp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function eO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Vp(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Va({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Vp($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function tO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[eO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class iO extends ge{constructor(e){super(),_e(this,e,nO,tO,me,{field:1,value:0})}}function Bp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function lO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Wb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Bp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Bp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function sO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[lO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function oO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class rO extends ge{constructor(e){super(),_e(this,e,oO,sO,me,{field:1,value:0})}}function aO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function uO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function cO(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function dO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?fO:aO}let $=T(n),C=$(n);const O=[cO,uO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function pO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Up(n){return typeof n=="string"&&Zb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Zb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function mO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Up(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-C-zHBmhQ.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Up(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Zb(r))},[s,l,r,o,i,a]}class hO extends ge{constructor(e){super(),_e(this,e,mO,pO,me,{field:1,value:0})}}function _O(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function gO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function bO(n){let e;function t(s,o){return s[2]?gO:_O}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function kO(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{file:0,size:1})}}function Wp(n){let e;function t(s,o){return s[4]==="image"?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function vO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Wp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Wp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function $O(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function TO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function CO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[TO],header:[$O],default:[SO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function OO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class MO extends ge{constructor(e){super(),_e(this,e,OO,CO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function DO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?LO:f[3]==="video"||f[3]==="audio"?AO:IO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function EO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function IO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Yp(n){let e,t,i={};return e=new MO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function NO(n){let e,t,i;function l(a,f){return a[2]?EO:DO}let s=l(n),o=s(n),r=n[7]&&Yp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Yp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function PO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ua extends ge{constructor(e){super(),_e(this,e,PO,NO,me,{record:9,filename:0,size:1})}}function Kp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function FO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function RO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function qO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ua({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?RO:FO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Zp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[qO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function jO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new yO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Gp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[jO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function HO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function tI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[GE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[XE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[eI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Gh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function nI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Gh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Gh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function iI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[nI],default:[tI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=Xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-CZ0EgQcM.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),Xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),$o(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Ja extends ge{constructor(e){super(),_e(this,e,lI,iI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Qh(n,e,t){const i=n.slice();return i[21]=e[t],i}function xh(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=_0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function sI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[oI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function aI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function uI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[fI],header:[aI],default:[rI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Nr="last_email_test",e_="email_test_request";function cI(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Nr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Nr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(e_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:e_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class dI extends ge{constructor(e){super(),_e(this,e,cI,uI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function pI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[hI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[_I,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&t_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&n_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&i_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[gI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&l_(n);function L(N,P){return N[5]?MI:OI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=t_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=n_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=i_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=l_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function mI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function hI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function _I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function t_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function n_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function i_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function l_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[bI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[kI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[yI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[vI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?SI:wI}let O=C(n),D=O(n),I=n[4]&&s_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=s_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function bI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function kI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function wI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function SI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function s_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[$I,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[TI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[CI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function $I(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function TI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function CI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function OI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function MI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function DI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[mI,pI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function EI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[DI]},$$scope:{ctx:n}}});let r={};return s=new dI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function II(n,e,t){let i,l,s;Ue(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class AI extends ge{constructor(e){super(),_e(this,e,II,EI,me,{},null,[-1,-1])}}const LI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),o_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function NI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[PI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[FI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[RI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[qI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[jI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function PI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function FI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function jI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function HI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function zI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[NI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],o_);let a=n[0].enabled&&r_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,LI):Tt(f[15]),o_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=r_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const Pr="s3_test_request";function VI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(Pr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(Pr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:Pr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class Xb extends ge{constructor(e){super(),_e(this,e,VI,zI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function BI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[WI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new Xb({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&f_(n),O=n[6]&&u_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=f_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=u_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function UI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function a_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually + `),g=b("button"),g.textContent="{ACTION_URL} ",y=K("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[J(u,"click",n[22]),J(d,"click",n[23]),J(h,"click",n[24]),J(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(le(),A(O[R],1,1,()=>{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function tI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[GE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[XE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[eI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Gh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function nI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Gh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Gh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function iI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[nI],default:[tI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=Xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-C-zHBmhQ.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),Xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),$o(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Ja extends ge{constructor(e){super(),_e(this,e,lI,iI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Qh(n,e,t){const i=n.slice();return i[21]=e[t],i}function xh(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=_0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function sI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[oI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function aI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function uI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[fI],header:[aI],default:[rI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Nr="last_email_test",e_="email_test_request";function cI(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Nr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Nr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(e_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:e_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class dI extends ge{constructor(e){super(),_e(this,e,cI,uI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function pI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[hI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[_I,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&t_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&n_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&i_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[gI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&l_(n);function L(N,P){return N[5]?MI:OI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=t_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=n_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=i_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=l_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function mI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function hI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function _I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function t_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function n_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function i_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function l_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[bI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[kI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[yI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[vI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?SI:wI}let O=C(n),D=O(n),I=n[4]&&s_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=s_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function bI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function kI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function wI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function SI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function s_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[$I,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[TI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[CI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function $I(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function TI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function CI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function OI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function MI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function DI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[mI,pI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function EI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[DI]},$$scope:{ctx:n}}});let r={};return s=new dI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function II(n,e,t){let i,l,s;Ue(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class AI extends ge{constructor(e){super(),_e(this,e,II,EI,me,{},null,[-1,-1])}}const LI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),o_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function NI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[PI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[FI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[RI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[qI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[jI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function PI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function FI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function jI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function HI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function zI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[NI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],o_);let a=n[0].enabled&&r_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,LI):Tt(f[15]),o_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=r_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const Pr="s3_test_request";function VI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(Pr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(Pr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:Pr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class Xb extends ge{constructor(e){super(),_e(this,e,VI,zI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function BI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[WI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new Xb({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&f_(n),O=n[6]&&u_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=f_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=u_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function UI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function a_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),f=K(a),u=K(` to the @@ -149,4 +149,4 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t @weekly @daily @midnight -@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function D7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function kg(n){let e;function t(s,o){return s[7]?A7:s[8]?I7:E7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function E7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function I7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function A7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function L7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Zo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new S7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new y7({props:N}),n[15](y);function P(G,U){return G[6]?T7:$7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&gg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=gg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function N7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[L7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function P7(n,e,t){let i,l;Ue(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class F7 extends ge{constructor(e){super(),_e(this,e,P7,N7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],R7={"/login":At({component:FE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-ByYh3pEr.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-C3mHsOYN.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:iE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:n$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:WE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:EE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:AI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:xI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:_A,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:TA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:LA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:xA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:F7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-DiHRjH5i.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-DiHRjH5i.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-BEu14spu.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-BEu14spu.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-GhjOHgK4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-GhjOHgK4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-DEJwxR01.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-C67m4ehZ.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Mv,userData:{showAppSidebar:!1}})};function q7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Jo}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function vg(n,e,t){const i=n.slice();return i[2]=e[t],i}function j7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function H7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function z7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function V7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wg(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?V7:O[2].type==="success"?z7:O[2].type==="warning"?H7:j7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){S0(t),h(),Ag(t,m)},a(){h(),h=w0(t,m,q7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Pg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ca(t,rs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function B7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>W1(s)]}class W7 extends ge{constructor(e){super(),_e(this,e,U7,B7,me,{})}}function Y7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function K7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function J7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[K7],header:[Y7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function Z7(n,e,t){let i;Ue(n,za,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),zb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function Sg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[X7]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(nn.call(null,t)),Se(nn.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(nn.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(nn.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function X7(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(nn.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function $g(n){let e,t,i;return t=new Wa({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Q7(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Sg(n);o=new R0({props:{routes:R7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new W7({}),u=new G7({});let _=n[1]&&!n[2]&&$g(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Sg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=$g(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function x7(n,e,t){let i,l,s,o;Ue(n,Xi,_=>t(10,i=_)),Ue(n,Oo,_=>t(3,l=_)),Ue(n,$a,_=>t(0,s=_)),Ue(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),zb())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Oo,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class eL extends ge{constructor(e){super(),_e(this,e,x7,Q7,me,{})}}new eL({target:document.getElementById("app")});export{ae as A,Lt as B,j as C,tl as D,ye as E,Z1 as F,Ho as G,so as H,Ht as I,Ue as J,Rn as K,lt as L,ee as M,Rb as N,ue as O,at as P,Ii as Q,Et as R,ge as S,ot as T,b0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,nn as l,z as m,se as n,v as o,ce as p,x as q,J as r,me as s,E as t,Be as u,K as v,oe as w,Q as x,re as y,$e as z}; +@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function D7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function kg(n){let e;function t(s,o){return s[7]?A7:s[8]?I7:E7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function E7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function I7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function A7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function L7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Zo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new S7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new y7({props:N}),n[15](y);function P(G,U){return G[6]?T7:$7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&gg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=gg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function N7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[L7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function P7(n,e,t){let i,l;Ue(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class F7 extends ge{constructor(e){super(),_e(this,e,P7,N7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],R7={"/login":At({component:FE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-vLynAsfN.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-vRRTYNd2.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:iE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:n$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:WE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:EE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:AI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:xI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:_A,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:TA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:LA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:xA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:F7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-Bjhn5ho5.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-Bjhn5ho5.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-D66thJgG.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-D66thJgG.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B7npCYXU.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B7npCYXU.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-BusSuTAQ.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-B-zxwuJd.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Mv,userData:{showAppSidebar:!1}})};function q7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Jo}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function vg(n,e,t){const i=n.slice();return i[2]=e[t],i}function j7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function H7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function z7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function V7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wg(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?V7:O[2].type==="success"?z7:O[2].type==="warning"?H7:j7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){S0(t),h(),Ag(t,m)},a(){h(),h=w0(t,m,q7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Pg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ca(t,rs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function B7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>W1(s)]}class W7 extends ge{constructor(e){super(),_e(this,e,U7,B7,me,{})}}function Y7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function K7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function J7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[K7],header:[Y7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function Z7(n,e,t){let i;Ue(n,za,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),zb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function Sg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[X7]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(nn.call(null,t)),Se(nn.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(nn.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(nn.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function X7(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(nn.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function $g(n){let e,t,i;return t=new Wa({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Q7(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Sg(n);o=new R0({props:{routes:R7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new W7({}),u=new G7({});let _=n[1]&&!n[2]&&$g(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Sg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=$g(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function x7(n,e,t){let i,l,s,o;Ue(n,Xi,_=>t(10,i=_)),Ue(n,Oo,_=>t(3,l=_)),Ue(n,$a,_=>t(0,s=_)),Ue(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),zb())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Oo,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class eL extends ge{constructor(e){super(),_e(this,e,x7,Q7,me,{})}}new eL({target:document.getElementById("app")});export{ae as A,Lt as B,j as C,tl as D,ye as E,Z1 as F,Ho as G,so as H,Ht as I,Ue as J,Rn as K,lt as L,ee as M,Rb as N,ue as O,at as P,Ii as Q,Et as R,ge as S,ot as T,b0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,nn as l,z as m,se as n,v as o,ce as p,x as q,J as r,me as s,E as t,Be as u,K as v,oe as w,Q as x,re as y,$e as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 09cefd2047..5bf12ceea8 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -47,7 +47,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + From 58a0b286642296e0a57156080e39e42ef310778c Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 17:07:53 +0300 Subject: [PATCH 09/44] updated aws-sdk-go-v2 and moved the trimmed s3 driver in internal to preven getting included in the jsvm types --- go.mod | 5 +- go.sum | 5 + .../jsvm/internal/types/generated/types.d.ts | 41760 ++++------------ tools/filesystem/filesystem.go | 23 +- .../s3lite/s3lite.go} | 169 +- 5 files changed, 8387 insertions(+), 33575 deletions(-) rename tools/filesystem/{s3_trimmed.go => internal/s3lite/s3lite.go} (82%) diff --git a/go.mod b/go.mod index b22ea8de96..388f761ac2 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,12 @@ go 1.22.0 require ( github.com/AlecAivazis/survey/v2 v2.3.7 - github.com/aws/aws-sdk-go-v2 v1.30.4 + github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/config v1.27.31 github.com/aws/aws-sdk-go-v2/credentials v1.17.30 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.15 github.com/aws/aws-sdk-go-v2/service/s3 v1.60.1 - github.com/aws/smithy-go v1.20.4 + github.com/aws/smithy-go v1.22.0 github.com/disintegration/imaging v1.6.2 github.com/domodwyer/mailyak/v3 v3.6.2 github.com/dop251/goja v0.0.0-20241009100908-5f46f2705ca3 @@ -59,6 +59,7 @@ require ( github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index 965ec0ec24..8234ea16ad 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,8 @@ github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8= github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= +github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= +github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 h1:70PVAiL15/aBMh5LThwgXdSQorVr91L127ttckI9QQU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4/go.mod h1:/MQxMqci8tlqDH+pjmoLu1i0tbWCUP1hhyMRuFxpQCw= github.com/aws/aws-sdk-go-v2/config v1.27.31 h1:kxBoRsjhT3pq0cKthgj6RU6bXTm/2SgdoUMyrVw0rAI= @@ -63,6 +65,7 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wI github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -161,6 +164,7 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -339,6 +343,7 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index 748f815302..7af79814f6 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -1,4 +1,4 @@ -// 1729258253 +// 1729260365 // GENERATED CODE - DO NOT MODIFY BY HAND // ------------------------------------------------------------------- @@ -1721,8 +1721,8 @@ namespace os { * than ReadFrom. This is used to permit ReadFrom to call io.Copy * without leading to a recursive call to ReadFrom. */ - type _subGmEUB = noReadFrom&File - interface fileWithoutReadFrom extends _subGmEUB { + type _subQGbno = noReadFrom&File + interface fileWithoutReadFrom extends _subQGbno { } interface File { /** @@ -1766,8 +1766,8 @@ namespace os { * than WriteTo. This is used to permit WriteTo to call io.Copy * without leading to a recursive call to WriteTo. */ - type _subnBkIH = noWriteTo&File - interface fileWithoutWriteTo extends _subnBkIH { + type _subzUnAX = noWriteTo&File + interface fileWithoutWriteTo extends _subzUnAX { } interface File { /** @@ -2411,8 +2411,8 @@ namespace os { * * The methods of File are safe for concurrent use. */ - type _subQXiyH = file - interface File extends _subQXiyH { + type _subJHFOr = file + interface File extends _subJHFOr { } /** * A FileInfo describes a file and is returned by [Stat] and [Lstat]. @@ -2804,142 +2804,6 @@ namespace filepath { } } -namespace security { - interface s256Challenge { - /** - * S256Challenge creates base64 encoded sha256 challenge string derived from code. - * The padding of the result base64 string is stripped per [RFC 7636]. - * - * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 - */ - (code: string): string - } - interface md5 { - /** - * MD5 creates md5 hash from the provided plain text. - */ - (text: string): string - } - interface sha256 { - /** - * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface sha512 { - /** - * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface hs256 { - /** - * HS256 creates a HMAC hash with sha256 digest algorithm. - */ - (text: string, secret: string): string - } - interface hs512 { - /** - * HS512 creates a HMAC hash with sha512 digest algorithm. - */ - (text: string, secret: string): string - } - interface equal { - /** - * Equal compares two hash strings for equality without leaking timing information. - */ - (hash1: string, hash2: string): boolean - } - // @ts-ignore - import crand = rand - interface encrypt { - /** - * Encrypt encrypts "data" with the specified "key" (must be valid 32 char AES key). - * - * This method uses AES-256-GCM block cypher mode. - */ - (data: string|Array, key: string): string - } - interface decrypt { - /** - * Decrypt decrypts encrypted text with key (must be valid 32 chars AES key). - * - * This method uses AES-256-GCM block cypher mode. - */ - (cipherText: string, key: string): string|Array - } - interface parseUnverifiedJWT { - /** - * ParseUnverifiedJWT parses JWT and returns its claims - * but DOES NOT verify the signature. - * - * It verifies only the exp, iat and nbf claims. - */ - (token: string): jwt.MapClaims - } - interface parseJWT { - /** - * ParseJWT verifies and parses JWT and returns its claims. - */ - (token: string, verificationKey: string): jwt.MapClaims - } - interface newJWT { - /** - * NewJWT generates and returns new HS256 signed JWT. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - interface newToken { - /** - * Deprecated: - * Consider replacing with NewJWT(). - * - * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - // @ts-ignore - import cryptoRand = rand - // @ts-ignore - import mathRand = rand - interface randomString { - /** - * RandomString generates a cryptographically random string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - */ - (length: number): string - } - interface randomStringWithAlphabet { - /** - * RandomStringWithAlphabet generates a cryptographically random string - * with the specified length and characters set. - * - * It panics if for some reason rand.Int returns a non-nil error. - */ - (length: number, alphabet: string): string - } - interface pseudorandomString { - /** - * PseudorandomString generates a pseudorandom string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - * - * For a cryptographically random string (but a little bit slower) use RandomString instead. - */ - (length: number): string - } - interface pseudorandomStringWithAlphabet { - /** - * PseudorandomStringWithAlphabet generates a pseudorandom string - * with the specified length and characters set. - * - * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. - */ - (length: number, alphabet: string): string - } -} - /** * Package validation provides configurable and extensible rules for validating data of various types. */ @@ -3294,14 +3158,14 @@ namespace dbx { /** * MssqlBuilder is the builder for SQL Server databases. */ - type _subycxul = BaseBuilder - interface MssqlBuilder extends _subycxul { + type _subXcJPM = BaseBuilder + interface MssqlBuilder extends _subXcJPM { } /** * MssqlQueryBuilder is the query builder for SQL Server databases. */ - type _subxozvl = BaseQueryBuilder - interface MssqlQueryBuilder extends _subxozvl { + type _subWcWPA = BaseQueryBuilder + interface MssqlQueryBuilder extends _subWcWPA { } interface newMssqlBuilder { /** @@ -3372,8 +3236,8 @@ namespace dbx { /** * MysqlBuilder is the builder for MySQL databases. */ - type _subuBlWt = BaseBuilder - interface MysqlBuilder extends _subuBlWt { + type _subErsOC = BaseBuilder + interface MysqlBuilder extends _subErsOC { } interface newMysqlBuilder { /** @@ -3448,14 +3312,14 @@ namespace dbx { /** * OciBuilder is the builder for Oracle databases. */ - type _submEsSq = BaseBuilder - interface OciBuilder extends _submEsSq { + type _subPcUPD = BaseBuilder + interface OciBuilder extends _subPcUPD { } /** * OciQueryBuilder is the query builder for Oracle databases. */ - type _subSwOZs = BaseQueryBuilder - interface OciQueryBuilder extends _subSwOZs { + type _subsNvOu = BaseQueryBuilder + interface OciQueryBuilder extends _subsNvOu { } interface newOciBuilder { /** @@ -3518,8 +3382,8 @@ namespace dbx { /** * PgsqlBuilder is the builder for PostgreSQL databases. */ - type _subJVUHR = BaseBuilder - interface PgsqlBuilder extends _subJVUHR { + type _submlQbp = BaseBuilder + interface PgsqlBuilder extends _submlQbp { } interface newPgsqlBuilder { /** @@ -3586,8 +3450,8 @@ namespace dbx { /** * SqliteBuilder is the builder for SQLite databases. */ - type _subRxOcr = BaseBuilder - interface SqliteBuilder extends _subRxOcr { + type _subRbLKA = BaseBuilder + interface SqliteBuilder extends _subRbLKA { } interface newSqliteBuilder { /** @@ -3686,8 +3550,8 @@ namespace dbx { /** * StandardBuilder is the builder that is used by DB for an unknown driver. */ - type _subNMrLZ = BaseBuilder - interface StandardBuilder extends _subNMrLZ { + type _subYlvLr = BaseBuilder + interface StandardBuilder extends _subYlvLr { } interface newStandardBuilder { /** @@ -3753,8 +3617,8 @@ namespace dbx { * DB enhances sql.DB by providing a set of DB-agnostic query building methods. * DB allows easier query building and population of data into Go variables. */ - type _subGFJZU = Builder - interface DB extends _subGFJZU { + type _subXZmGg = Builder + interface DB extends _subXZmGg { /** * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ @@ -4558,8 +4422,8 @@ namespace dbx { * Rows enhances sql.Rows by providing additional data query methods. * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. */ - type _submSehx = sql.Rows - interface Rows extends _submSehx { + type _subCDslK = sql.Rows + interface Rows extends _subCDslK { } interface Rows { /** @@ -4917,8 +4781,8 @@ namespace dbx { }): string } interface structInfo { } - type _subLIODH = structInfo - interface structValue extends _subLIODH { + type _subnkbkR = structInfo + interface structValue extends _subnkbkR { } interface fieldInfo { } @@ -4957,8 +4821,8 @@ namespace dbx { /** * Tx enhances sql.Tx with additional querying methods. */ - type _subYHNBD = Builder - interface Tx extends _subYHNBD { + type _subWeWlx = Builder + interface Tx extends _subWeWlx { } interface Tx { /** @@ -5100,119 +4964,255 @@ namespace exec { } } -namespace filesystem { - /** - * FileReader defines an interface for a file resource reader. - */ - interface FileReader { - [key:string]: any; - open(): io.ReadSeekCloser - } - /** - * File defines a single file [io.ReadSeekCloser] resource. - * - * The file could be from a local path, multipart/form-data header, etc. - */ - interface File { - reader: FileReader - name: string - originalName: string - size: number - } - interface newFileFromPath { +namespace security { + interface s256Challenge { /** - * NewFileFromPath creates a new File instance from the provided local file path. + * S256Challenge creates base64 encoded sha256 challenge string derived from code. + * The padding of the result base64 string is stripped per [RFC 7636]. + * + * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 */ - (path: string): (File) + (code: string): string } - interface newFileFromBytes { + interface md5 { /** - * NewFileFromBytes creates a new File instance from the provided byte slice. + * MD5 creates md5 hash from the provided plain text. */ - (b: string|Array, name: string): (File) + (text: string): string } - interface newFileFromMultipart { + interface sha256 { /** - * NewFileFromMultipart creates a new File from the provided multipart header. + * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. */ - (mh: multipart.FileHeader): (File) + (text: string): string } - interface newFileFromUrl { + interface sha512 { /** - * NewFileFromUrl creates a new File from the provided url by - * downloading the resource and load it as BytesReader. - * - * Example - * - * ``` - * ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - * defer cancel() - * - * file, err := filesystem.NewFileFromUrl(ctx, "https://example.com/image.png") - * ``` + * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. */ - (ctx: context.Context, url: string): (File) - } - /** - * MultipartReader defines a FileReader from [multipart.FileHeader]. - */ - interface MultipartReader { - header?: multipart.FileHeader + (text: string): string } - interface MultipartReader { + interface hs256 { /** - * Open implements the [filesystem.FileReader] interface. + * HS256 creates a HMAC hash with sha256 digest algorithm. */ - open(): io.ReadSeekCloser - } - /** - * PathReader defines a FileReader from a local file path. - */ - interface PathReader { - path: string + (text: string, secret: string): string } - interface PathReader { + interface hs512 { /** - * Open implements the [filesystem.FileReader] interface. + * HS512 creates a HMAC hash with sha512 digest algorithm. */ - open(): io.ReadSeekCloser - } - /** - * BytesReader defines a FileReader from bytes content. - */ - interface BytesReader { - bytes: string|Array + (text: string, secret: string): string } - interface BytesReader { + interface equal { /** - * Open implements the [filesystem.FileReader] interface. + * Equal compares two hash strings for equality without leaking timing information. */ - open(): io.ReadSeekCloser - } - type _subVzkKp = bytes.Reader - interface bytesReadSeekCloser extends _subVzkKp { + (hash1: string, hash2: string): boolean } - interface bytesReadSeekCloser { + // @ts-ignore + import crand = rand + interface encrypt { /** - * Close implements the [io.ReadSeekCloser] interface. + * Encrypt encrypts "data" with the specified "key" (must be valid 32 char AES key). + * + * This method uses AES-256-GCM block cypher mode. */ - close(): void - } - interface System { + (data: string|Array, key: string): string } - interface newS3 { + interface decrypt { /** - * NewS3 initializes an S3 filesystem instance. + * Decrypt decrypts encrypted text with key (must be valid 32 chars AES key). * - * NB! Make sure to call `Close()` after you are done working with it. + * This method uses AES-256-GCM block cypher mode. */ - (bucketName: string, region: string, endpoint: string, accessKey: string, secretKey: string, s3ForcePathStyle: boolean): (System) + (cipherText: string, key: string): string|Array } - interface newLocal { + interface parseUnverifiedJWT { /** - * NewLocal initializes a new local filesystem instance. + * ParseUnverifiedJWT parses JWT and returns its claims + * but DOES NOT verify the signature. * - * NB! Make sure to call `Close()` after you are done working with it. + * It verifies only the exp, iat and nbf claims. + */ + (token: string): jwt.MapClaims + } + interface parseJWT { + /** + * ParseJWT verifies and parses JWT and returns its claims. + */ + (token: string, verificationKey: string): jwt.MapClaims + } + interface newJWT { + /** + * NewJWT generates and returns new HS256 signed JWT. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + interface newToken { + /** + * Deprecated: + * Consider replacing with NewJWT(). + * + * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + // @ts-ignore + import cryptoRand = rand + // @ts-ignore + import mathRand = rand + interface randomString { + /** + * RandomString generates a cryptographically random string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + */ + (length: number): string + } + interface randomStringWithAlphabet { + /** + * RandomStringWithAlphabet generates a cryptographically random string + * with the specified length and characters set. + * + * It panics if for some reason rand.Int returns a non-nil error. + */ + (length: number, alphabet: string): string + } + interface pseudorandomString { + /** + * PseudorandomString generates a pseudorandom string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + * + * For a cryptographically random string (but a little bit slower) use RandomString instead. + */ + (length: number): string + } + interface pseudorandomStringWithAlphabet { + /** + * PseudorandomStringWithAlphabet generates a pseudorandom string + * with the specified length and characters set. + * + * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. + */ + (length: number, alphabet: string): string + } +} + +namespace filesystem { + /** + * FileReader defines an interface for a file resource reader. + */ + interface FileReader { + [key:string]: any; + open(): io.ReadSeekCloser + } + /** + * File defines a single file [io.ReadSeekCloser] resource. + * + * The file could be from a local path, multipart/form-data header, etc. + */ + interface File { + reader: FileReader + name: string + originalName: string + size: number + } + interface newFileFromPath { + /** + * NewFileFromPath creates a new File instance from the provided local file path. + */ + (path: string): (File) + } + interface newFileFromBytes { + /** + * NewFileFromBytes creates a new File instance from the provided byte slice. + */ + (b: string|Array, name: string): (File) + } + interface newFileFromMultipart { + /** + * NewFileFromMultipart creates a new File from the provided multipart header. + */ + (mh: multipart.FileHeader): (File) + } + interface newFileFromUrl { + /** + * NewFileFromUrl creates a new File from the provided url by + * downloading the resource and load it as BytesReader. + * + * Example + * + * ``` + * ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + * defer cancel() + * + * file, err := filesystem.NewFileFromUrl(ctx, "https://example.com/image.png") + * ``` + */ + (ctx: context.Context, url: string): (File) + } + /** + * MultipartReader defines a FileReader from [multipart.FileHeader]. + */ + interface MultipartReader { + header?: multipart.FileHeader + } + interface MultipartReader { + /** + * Open implements the [filesystem.FileReader] interface. + */ + open(): io.ReadSeekCloser + } + /** + * PathReader defines a FileReader from a local file path. + */ + interface PathReader { + path: string + } + interface PathReader { + /** + * Open implements the [filesystem.FileReader] interface. + */ + open(): io.ReadSeekCloser + } + /** + * BytesReader defines a FileReader from bytes content. + */ + interface BytesReader { + bytes: string|Array + } + interface BytesReader { + /** + * Open implements the [filesystem.FileReader] interface. + */ + open(): io.ReadSeekCloser + } + type _subIhEHH = bytes.Reader + interface bytesReadSeekCloser extends _subIhEHH { + } + interface bytesReadSeekCloser { + /** + * Close implements the [io.ReadSeekCloser] interface. + */ + close(): void + } + interface System { + } + interface newS3 { + /** + * NewS3 initializes an S3 filesystem instance. + * + * NB! Make sure to call `Close()` after you are done working with it. + */ + (bucketName: string, region: string, endpoint: string, accessKey: string, secretKey: string, s3ForcePathStyle: boolean): (System) + } + interface newLocal { + /** + * NewLocal initializes a new local filesystem instance. + * + * NB! Make sure to call `Close()` after you are done working with it. */ (dirPath: string): (System) } @@ -5324,341 +5324,92 @@ namespace filesystem { import smithyhttp = http interface ignoredHeadersKey { } - // @ts-ignore - import awsv2 = aws - // @ts-ignore - import awsv2cfg = config - // @ts-ignore - import s3managerv2 = manager - // @ts-ignore - import s3v2 = s3 - // @ts-ignore - import typesv2 = types - interface hexEscape { +} + +/** + * Package tokens implements various user and admin tokens generation methods. + */ +namespace tokens { + interface newAdminAuthToken { /** - * HexEscape returns s, with all runes for which shouldEscape returns true - * escaped to "__0xXXX__", where XXX is the hex representation of the rune - * value. For example, " " would escape to "__0x20__". - * - * Non-UTF-8 strings will have their non-UTF-8 characters escaped to - * unicode.ReplacementChar; the original value is lost. Please file an - * issue if you need non-UTF8 support. - * - * Note: shouldEscape takes the whole string as a slice of runes and an - * index. Passing it a single byte or a single rune doesn't provide - * enough context for some escape decisions; for example, the caller might - * want to escape the second "/" in "//" but not the first one. - * We pass a slice of runes instead of the string or a slice of bytes - * because some decisions will be made on a rune basis (e.g., encode - * all non-ASCII runes). + * NewAdminAuthToken generates and returns a new admin authentication token. */ - (s: string, shouldEscape: (s: Array, i: number) => boolean): string + (app: CoreApp, admin: models.Admin): string } - interface hexUnescape { + interface newAdminResetPasswordToken { /** - * HexUnescape reverses HexEscape. + * NewAdminResetPasswordToken generates and returns a new admin password reset request token. */ - (s: string): string + (app: CoreApp, admin: models.Admin): string } - interface urlEscape { + interface newAdminFileToken { /** - * URLEscape uses url.PathEscape to escape s. + * NewAdminFileToken generates and returns a new admin private file access token. */ - (s: string): string + (app: CoreApp, admin: models.Admin): string } - interface urlUnescape { + interface newRecordAuthToken { /** - * URLUnescape reverses URLEscape using url.PathUnescape. If the unescape - * returns an error, it returns s. + * NewRecordAuthToken generates and returns a new auth record authentication token. */ - (s: string): string + (app: CoreApp, record: models.Record): string } - interface useV2 { + interface newRecordVerifyToken { /** - * UseV2 returns true iff the URL parameters indicate that the provider - * should use the AWS SDK v2. - * - * "awssdk=v1" will force V1. - * "awssdk=v2" will force V2. - * No "awssdk" parameter (or any other value) will return the default, currently V1. - * Note that the default may change in the future. + * NewRecordVerifyToken generates and returns a new record verification token. */ - (q: url.Values): boolean + (app: CoreApp, record: models.Record): string } - interface newDefaultV2Config { + interface newRecordResetPasswordToken { /** - * NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options. + * NewRecordResetPasswordToken generates and returns a new auth record password reset request token. */ - (ctx: context.Context): awsv2.Config + (app: CoreApp, record: models.Record): string } - interface v2ConfigFromURLParams { + interface newRecordChangeEmailToken { /** - * V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL - * parameters in q. It is intended to be used by URLOpeners for AWS services if - * UseV2 returns true. - * - * https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config - * - * It returns an error if q contains any unknown query parameters; callers - * should remove any query parameters they know about from q before calling - * V2ConfigFromURLParams. - * - * The following query options are supported: - * ``` - * - region: The AWS region for requests; sets WithRegion. - * - profile: The shared config profile to use; sets SharedConfigProfile. - * - endpoint: The AWS service endpoint to send HTTP request. - * ``` + * NewRecordChangeEmailToken generates and returns a new auth record change email request token. */ - (ctx: context.Context, q: url.Values): awsv2.Config - } - interface urlSessionOpener { - } - interface urlSessionOpener { - openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) + (app: CoreApp, record: models.Record, newEmail: string): string } - /** - * URLOpener opens S3 URLs like "s3://mybucket". - * - * The URL host is used as the bucket name. - * - * Use "awssdk=v1" to force using AWS SDK v1, "awssdk=v2" to force using AWS SDK v2, - * or anything else to accept the default. - * - * For V1, see gocloud.dev/aws/ConfigFromURLParams for supported query parameters - * for overriding the aws.Session from the URL. - * For V2, see gocloud.dev/aws/V2ConfigFromURLParams. - */ - interface URLOpener { + interface newRecordFileToken { /** - * UseV2 indicates whether the AWS SDK V2 should be used. + * NewRecordFileToken generates and returns a new record private file access token. */ - useV2: boolean + (app: CoreApp, record: models.Record): string + } +} + +/** + * Package mails implements various helper methods for sending user and admin + * emails like forgotten password, verification, etc. + */ +namespace mails { + interface sendAdminPasswordReset { /** - * Options specifies the options to pass to OpenBucket. + * SendAdminPasswordReset sends a password reset request email to the specified admin. */ - options: Options + (app: CoreApp, admin: models.Admin): void } - interface URLOpener { + interface sendRecordPasswordLoginAlert { /** - * OpenBucketURL opens a blob.Bucket based on u. + * @todo remove after the refactoring + * + * SendRecordPasswordLoginAlert sends a OAuth2 password login alert to the specified auth record. */ - openBucketURL(ctx: context.Context, u: url.URL): (blob.Bucket) + (app: CoreApp, authRecord: models.Record, ...providerNames: string[]): void } - /** - * Options sets options for constructing a *blob.Bucket backed by fileblob. - */ - interface Options { + interface sendRecordPasswordReset { /** - * UseLegacyList forces the use of ListObjects instead of ListObjectsV2. - * Some S3-compatible services (like CEPH) do not currently support - * ListObjectsV2. + * SendRecordPasswordReset sends a password reset request email to the specified user. */ - useLegacyList: boolean + (app: CoreApp, authRecord: models.Record): void } - interface openBucketV2 { + interface sendRecordVerification { /** - * OpenBucketV2 returns a *blob.Bucket backed by S3, using AWS SDK v2. + * SendRecordVerification sends a verification request email to the specified user. */ - (ctx: context.Context, client: s3v2.Client, bucketName: string, opts: Options): (blob.Bucket) - } - /** - * reader reads an S3 object. It implements io.ReadCloser. - */ - interface reader { - } - interface reader { - read(p: string|Array): number - } - interface reader { - /** - * Close closes the reader itself. It must be called when done reading. - */ - close(): void - } - interface reader { - as(i: { - }): boolean - } - interface reader { - attributes(): (any) - } - /** - * writer writes an S3 object, it implements io.WriteCloser. - */ - interface writer { - } - interface writer { - /** - * Write appends p to w.pw. User must call Close to close the w after done writing. - */ - write(p: string|Array): number - } - interface writer { - /** - * Upload reads from r. Per the driver, it is guaranteed to be the only - * write call for this writer. - */ - upload(r: io.Reader): void - } - interface writer { - /** - * Close completes the writer and closes it. Any error occurring during write - * will be returned. If a writer is closed before any Write is called, Close - * will create an empty file at the given key. - */ - close(): void - } - /** - * bucket represents an S3 bucket and handles read, write and delete operations. - */ - interface bucket { - } - interface bucket { - close(): void - } - interface bucket { - errorCode(err: Error): gcerrors.ErrorCode - } - interface bucket { - /** - * ListPaged implements driver.ListPaged. - */ - listPaged(ctx: context.Context, opts: any): (any) - } - interface bucket { - /** - * As implements driver.As. - */ - as(i: { - }): boolean - } - interface bucket { - /** - * As implements driver.ErrorAs. - */ - errorAs(err: Error, i: { - }): boolean - } - interface bucket { - /** - * Attributes implements driver.Attributes. - */ - attributes(ctx: context.Context, key: string): (any) - } - interface bucket { - /** - * NewRangeReader implements driver.NewRangeReader. - */ - newRangeReader(ctx: context.Context, key: string, offset: number, length: number, opts: any): any - } - interface bucket { - /** - * NewTypedWriter implements driver.NewTypedWriter. - */ - newTypedWriter(ctx: context.Context, key: string, contentType: string, opts: any): any - } - interface bucket { - /** - * Copy implements driver.Copy. - */ - copy(ctx: context.Context, dstKey: string, srcKey: string, opts: any): void - } - interface bucket { - /** - * Delete implements driver.Delete. - */ - delete(ctx: context.Context, key: string): void - } - interface bucket { - signedURL(ctx: context.Context, key: string, opts: any): string - } -} - -/** - * Package tokens implements various user and admin tokens generation methods. - */ -namespace tokens { - interface newAdminAuthToken { - /** - * NewAdminAuthToken generates and returns a new admin authentication token. - */ - (app: CoreApp, admin: models.Admin): string - } - interface newAdminResetPasswordToken { - /** - * NewAdminResetPasswordToken generates and returns a new admin password reset request token. - */ - (app: CoreApp, admin: models.Admin): string - } - interface newAdminFileToken { - /** - * NewAdminFileToken generates and returns a new admin private file access token. - */ - (app: CoreApp, admin: models.Admin): string - } - interface newRecordAuthToken { - /** - * NewRecordAuthToken generates and returns a new auth record authentication token. - */ - (app: CoreApp, record: models.Record): string - } - interface newRecordVerifyToken { - /** - * NewRecordVerifyToken generates and returns a new record verification token. - */ - (app: CoreApp, record: models.Record): string - } - interface newRecordResetPasswordToken { - /** - * NewRecordResetPasswordToken generates and returns a new auth record password reset request token. - */ - (app: CoreApp, record: models.Record): string - } - interface newRecordChangeEmailToken { - /** - * NewRecordChangeEmailToken generates and returns a new auth record change email request token. - */ - (app: CoreApp, record: models.Record, newEmail: string): string - } - interface newRecordFileToken { - /** - * NewRecordFileToken generates and returns a new record private file access token. - */ - (app: CoreApp, record: models.Record): string - } -} - -/** - * Package mails implements various helper methods for sending user and admin - * emails like forgotten password, verification, etc. - */ -namespace mails { - interface sendAdminPasswordReset { - /** - * SendAdminPasswordReset sends a password reset request email to the specified admin. - */ - (app: CoreApp, admin: models.Admin): void - } - interface sendRecordPasswordLoginAlert { - /** - * @todo remove after the refactoring - * - * SendRecordPasswordLoginAlert sends a OAuth2 password login alert to the specified auth record. - */ - (app: CoreApp, authRecord: models.Record, ...providerNames: string[]): void - } - interface sendRecordPasswordReset { - /** - * SendRecordPasswordReset sends a password reset request email to the specified user. - */ - (app: CoreApp, authRecord: models.Record): void - } - interface sendRecordVerification { - /** - * SendRecordVerification sends a verification request email to the specified user. - */ - (app: CoreApp, authRecord: models.Record): void + (app: CoreApp, authRecord: models.Record): void } interface sendRecordChangeEmail { /** @@ -6585,8 +6336,8 @@ namespace forms { /** * SettingsUpsert is a [settings.Settings] upsert (create/update) form. */ - type _subWkaUd = settings.Settings - interface SettingsUpsert extends _subWkaUd { + type _subezsfi = settings.Settings + interface SettingsUpsert extends _subezsfi { } interface newSettingsUpsert { /** @@ -7032,103 +6783,6 @@ namespace apis { } } -namespace pocketbase { - /** - * appWrapper serves as a private CoreApp instance wrapper. - */ - type _subVcKSq = CoreApp - interface appWrapper extends _subVcKSq { - } - /** - * PocketBase defines a PocketBase app launcher. - * - * It implements [CoreApp] via embedding and all of the app interface methods - * could be accessed directly through the instance (eg. PocketBase.DataDir()). - */ - type _subOvaiK = appWrapper - interface PocketBase extends _subOvaiK { - /** - * RootCmd is the main console command - */ - rootCmd?: cobra.Command - } - /** - * Config is the PocketBase initialization config struct. - */ - interface Config { - /** - * optional default values for the console flags - */ - defaultDev: boolean - defaultDataDir: string // if not set, it will fallback to "./pb_data" - defaultEncryptionEnv: string - /** - * hide the default console server info on app startup - */ - hideStartBanner: boolean - /** - * optional DB configurations - */ - dataMaxOpenConns: number // default to core.DefaultDataMaxOpenConns - dataMaxIdleConns: number // default to core.DefaultDataMaxIdleConns - logsMaxOpenConns: number // default to core.DefaultLogsMaxOpenConns - logsMaxIdleConns: number // default to core.DefaultLogsMaxIdleConns - } - interface _new { - /** - * New creates a new PocketBase instance with the default configuration. - * Use [NewWithConfig()] if you want to provide a custom configuration. - * - * Note that the application will not be initialized/bootstrapped yet, - * aka. DB connections, migrations, app settings, etc. will not be accessible. - * Everything will be initialized when [Start()] is executed. - * If you want to initialize the application before calling [Start()], - * then you'll have to manually call [Bootstrap()]. - */ - (): (PocketBase) - } - interface newWithConfig { - /** - * NewWithConfig creates a new PocketBase instance with the provided config. - * - * Note that the application will not be initialized/bootstrapped yet, - * aka. DB connections, migrations, app settings, etc. will not be accessible. - * Everything will be initialized when [Start()] is executed. - * If you want to initialize the application before calling [Start()], - * then you'll have to manually call [Bootstrap()]. - */ - (config: Config): (PocketBase) - } - interface PocketBase { - /** - * Start starts the application, aka. registers the default system - * commands (serve, migrate, version) and executes pb.RootCmd. - */ - start(): void - } - interface PocketBase { - /** - * Execute initializes the application (if not already) and executes - * the pb.RootCmd with graceful shutdown support. - * - * This method differs from pb.Start() by not registering the default - * system commands! - */ - execute(): void - } - /** - * coloredWriter is a small wrapper struct to construct a [color.Color] writter. - */ - interface coloredWriter { - } - interface coloredWriter { - /** - * Write writes the p bytes using the colored writer. - */ - write(p: string|Array): number - } -} - /** * Package template is a thin wrapper around the standard html/template * and text/template packages that implements a convenient registry to @@ -7234,22 +6888,119 @@ namespace template { } } -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { +namespace pocketbase { /** - * Reader is the interface that wraps the basic Read method. - * - * Read reads up to len(p) bytes into p. It returns the number of bytes - * read (0 <= n <= len(p)) and any error encountered. Even if Read + * appWrapper serves as a private CoreApp instance wrapper. + */ + type _subbEwaR = CoreApp + interface appWrapper extends _subbEwaR { + } + /** + * PocketBase defines a PocketBase app launcher. + * + * It implements [CoreApp] via embedding and all of the app interface methods + * could be accessed directly through the instance (eg. PocketBase.DataDir()). + */ + type _subbKhhl = appWrapper + interface PocketBase extends _subbKhhl { + /** + * RootCmd is the main console command + */ + rootCmd?: cobra.Command + } + /** + * Config is the PocketBase initialization config struct. + */ + interface Config { + /** + * optional default values for the console flags + */ + defaultDev: boolean + defaultDataDir: string // if not set, it will fallback to "./pb_data" + defaultEncryptionEnv: string + /** + * hide the default console server info on app startup + */ + hideStartBanner: boolean + /** + * optional DB configurations + */ + dataMaxOpenConns: number // default to core.DefaultDataMaxOpenConns + dataMaxIdleConns: number // default to core.DefaultDataMaxIdleConns + logsMaxOpenConns: number // default to core.DefaultLogsMaxOpenConns + logsMaxIdleConns: number // default to core.DefaultLogsMaxIdleConns + } + interface _new { + /** + * New creates a new PocketBase instance with the default configuration. + * Use [NewWithConfig()] if you want to provide a custom configuration. + * + * Note that the application will not be initialized/bootstrapped yet, + * aka. DB connections, migrations, app settings, etc. will not be accessible. + * Everything will be initialized when [Start()] is executed. + * If you want to initialize the application before calling [Start()], + * then you'll have to manually call [Bootstrap()]. + */ + (): (PocketBase) + } + interface newWithConfig { + /** + * NewWithConfig creates a new PocketBase instance with the provided config. + * + * Note that the application will not be initialized/bootstrapped yet, + * aka. DB connections, migrations, app settings, etc. will not be accessible. + * Everything will be initialized when [Start()] is executed. + * If you want to initialize the application before calling [Start()], + * then you'll have to manually call [Bootstrap()]. + */ + (config: Config): (PocketBase) + } + interface PocketBase { + /** + * Start starts the application, aka. registers the default system + * commands (serve, migrate, version) and executes pb.RootCmd. + */ + start(): void + } + interface PocketBase { + /** + * Execute initializes the application (if not already) and executes + * the pb.RootCmd with graceful shutdown support. + * + * This method differs from pb.Start() by not registering the default + * system commands! + */ + execute(): void + } + /** + * coloredWriter is a small wrapper struct to construct a [color.Color] writter. + */ + interface coloredWriter { + } + interface coloredWriter { + /** + * Write writes the p bytes using the colored writer. + */ + write(p: string|Array): number + } +} + +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * Reader is the interface that wraps the basic Read method. + * + * Read reads up to len(p) bytes into p. It returns the number of bytes + * read (0 <= n <= len(p)) and any error encountered. Even if Read * returns n < len(p), it may use all of p as scratch space during the call. * If some data is available but not len(p) bytes, Read conventionally * returns what is available instead of waiting for more. @@ -7306,6 +7057,91 @@ namespace io { } } +/** + * Package bytes implements functions for the manipulation of byte slices. + * It is analogous to the facilities of the [strings] package. + */ +namespace bytes { + /** + * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], + * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from + * a byte slice. + * Unlike a [Buffer], a Reader is read-only and supports seeking. + * The zero value for Reader operates like a Reader of an empty slice. + */ + interface Reader { + } + interface Reader { + /** + * Len returns the number of bytes of the unread portion of the + * slice. + */ + len(): number + } + interface Reader { + /** + * Size returns the original length of the underlying byte slice. + * Size is the number of bytes available for reading via [Reader.ReadAt]. + * The result is unaffected by any method calls except [Reader.Reset]. + */ + size(): number + } + interface Reader { + /** + * Read implements the [io.Reader] interface. + */ + read(b: string|Array): number + } + interface Reader { + /** + * ReadAt implements the [io.ReaderAt] interface. + */ + readAt(b: string|Array, off: number): number + } + interface Reader { + /** + * ReadByte implements the [io.ByteReader] interface. + */ + readByte(): number + } + interface Reader { + /** + * UnreadByte complements [Reader.ReadByte] in implementing the [io.ByteScanner] interface. + */ + unreadByte(): void + } + interface Reader { + /** + * ReadRune implements the [io.RuneReader] interface. + */ + readRune(): [number, number] + } + interface Reader { + /** + * UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface. + */ + unreadRune(): void + } + interface Reader { + /** + * Seek implements the [io.Seeker] interface. + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * WriteTo implements the [io.WriterTo] interface. + */ + writeTo(w: io.Writer): number + } + interface Reader { + /** + * Reset resets the [Reader] to be reading from b. + */ + reset(b: string|Array): void + } +} + /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -8040,20 +7876,183 @@ namespace time { } /** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. + * Package context defines the Context type, which carries deadlines, + * cancellation signals, and other request-scoped values across API boundaries + * and between processes. * - * See the [testing/fstest] package for support with testing - * implementations of file systems. + * Incoming requests to a server should create a [Context], and outgoing + * calls to servers should accept a Context. The chain of function + * calls between them must propagate the Context, optionally replacing + * it with a derived Context created using [WithCancel], [WithDeadline], + * [WithTimeout], or [WithValue]. When a Context is canceled, all + * Contexts derived from it are also canceled. + * + * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a + * Context (the parent) and return a derived Context (the child) and a + * [CancelFunc]. Calling the CancelFunc cancels the child and its + * children, removes the parent's reference to the child, and stops + * any associated timers. Failing to call the CancelFunc leaks the + * child and its children until the parent is canceled or the timer + * fires. The go vet tool checks that CancelFuncs are used on all + * control-flow paths. + * + * The [WithCancelCause] function returns a [CancelCauseFunc], which + * takes an error and records it as the cancellation cause. Calling + * [Cause] on the canceled context or any of its children retrieves + * the cause. If no cause is specified, Cause(ctx) returns the same + * value as ctx.Err(). + * + * Programs that use Contexts should follow these rules to keep interfaces + * consistent across packages and enable static analysis tools to check context + * propagation: + * + * Do not store Contexts inside a struct type; instead, pass a Context + * explicitly to each function that needs it. The Context should be the first + * parameter, typically named ctx: + * + * ``` + * func DoSomething(ctx context.Context, arg Arg) error { + * // ... use ctx ... + * } + * ``` + * + * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] + * if you are unsure about which Context to use. + * + * Use context Values only for request-scoped data that transits processes and + * APIs, not for passing optional parameters to functions. + * + * The same Context may be passed to functions running in different goroutines; + * Contexts are safe for simultaneous use by multiple goroutines. + * + * See https://blog.golang.org/context for example code for a server that uses + * Contexts. */ -namespace fs { +namespace context { /** - * An FS provides access to a hierarchical file system. - * - * The FS interface is the minimum implementation required of the file system. - * A file system may implement additional interfaces, - * such as [ReadFileFS], to provide additional or optimized functionality. + * A Context carries a deadline, a cancellation signal, and other values across + * API boundaries. + * + * Context's methods may be called by multiple goroutines simultaneously. + */ + interface Context { + [key:string]: any; + /** + * Deadline returns the time when work done on behalf of this context + * should be canceled. Deadline returns ok==false when no deadline is + * set. Successive calls to Deadline return the same results. + */ + deadline(): [time.Time, boolean] + /** + * Done returns a channel that's closed when work done on behalf of this + * context should be canceled. Done may return nil if this context can + * never be canceled. Successive calls to Done return the same value. + * The close of the Done channel may happen asynchronously, + * after the cancel function returns. + * + * WithCancel arranges for Done to be closed when cancel is called; + * WithDeadline arranges for Done to be closed when the deadline + * expires; WithTimeout arranges for Done to be closed when the timeout + * elapses. + * + * Done is provided for use in select statements: + * + * // Stream generates values with DoSomething and sends them to out + * // until DoSomething returns an error or ctx.Done is closed. + * func Stream(ctx context.Context, out chan<- Value) error { + * for { + * v, err := DoSomething(ctx) + * if err != nil { + * return err + * } + * select { + * case <-ctx.Done(): + * return ctx.Err() + * case out <- v: + * } + * } + * } + * + * See https://blog.golang.org/pipelines for more examples of how to use + * a Done channel for cancellation. + */ + done(): undefined + /** + * If Done is not yet closed, Err returns nil. + * If Done is closed, Err returns a non-nil error explaining why: + * Canceled if the context was canceled + * or DeadlineExceeded if the context's deadline passed. + * After Err returns a non-nil error, successive calls to Err return the same error. + */ + err(): void + /** + * Value returns the value associated with this context for key, or nil + * if no value is associated with key. Successive calls to Value with + * the same key returns the same result. + * + * Use context values only for request-scoped data that transits + * processes and API boundaries, not for passing optional parameters to + * functions. + * + * A key identifies a specific value in a Context. Functions that wish + * to store values in Context typically allocate a key in a global + * variable then use that key as the argument to context.WithValue and + * Context.Value. A key can be any type that supports equality; + * packages should define keys as an unexported type to avoid + * collisions. + * + * Packages that define a Context key should provide type-safe accessors + * for the values stored using that key: + * + * ``` + * // Package user defines a User type that's stored in Contexts. + * package user + * + * import "context" + * + * // User is the type of value stored in the Contexts. + * type User struct {...} + * + * // key is an unexported type for keys defined in this package. + * // This prevents collisions with keys defined in other packages. + * type key int + * + * // userKey is the key for user.User values in Contexts. It is + * // unexported; clients use user.NewContext and user.FromContext + * // instead of using this key directly. + * var userKey key + * + * // NewContext returns a new Context that carries value u. + * func NewContext(ctx context.Context, u *User) context.Context { + * return context.WithValue(ctx, userKey, u) + * } + * + * // FromContext returns the User value stored in ctx, if any. + * func FromContext(ctx context.Context) (*User, bool) { + * u, ok := ctx.Value(userKey).(*User) + * return u, ok + * } + * ``` + */ + value(key: any): any + } +} + +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + * + * See the [testing/fstest] package for support with testing + * implementations of file systems. + */ +namespace fs { + /** + * An FS provides access to a hierarchical file system. + * + * The FS interface is the minimum implementation required of the file system. + * A file system may implement additional interfaces, + * such as [ReadFileFS], to provide additional or optimized functionality. * * [testing/fstest.TestFS] may be used to test implementations of an FS for * correctness. @@ -8240,488 +8239,504 @@ namespace fs { } /** - * Package bytes implements functions for the manipulation of byte slices. - * It is analogous to the facilities of the [strings] package. + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions [Command] and [LookPath] look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run [LookPath]("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * These will not find and run ./prog or .\prog.exe, + * no matter how the current path is configured. + * + * Code that always wants to run a program from the current directory + * can be rewritten to say "./prog" instead of "prog". + * + * Code that insists on including results from relative path entries + * can instead override the error using an errors.Is check: + * + * ``` + * path, err := exec.LookPath("prog") + * if errors.Is(err, exec.ErrDot) { + * err = nil + * } + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if errors.Is(cmd.Err, exec.ErrDot) { + * cmd.Err = nil + * } + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * Setting the environment variable GODEBUG=execerrdot=0 + * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 + * behavior for programs that are unable to apply more targeted fixes. + * A future version of Go may remove support for this variable. + * + * Before adding such overrides, make sure you understand the + * security implications of doing so. + * See https://go.dev/blog/path-security for more information. */ -namespace bytes { +namespace exec { /** - * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], - * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from - * a byte slice. - * Unlike a [Buffer], a Reader is read-only and supports seeking. - * The zero value for Reader operates like a Reader of an empty slice. + * Cmd represents an external command being prepared or run. + * + * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] + * methods. */ - interface Reader { - } - interface Reader { + interface Cmd { /** - * Len returns the number of bytes of the unread portion of the - * slice. + * Path is the path of the command to run. + * + * This is the only field that must be set to a non-zero + * value. If Path is relative, it is evaluated relative + * to Dir. */ - len(): number - } - interface Reader { + path: string /** - * Size returns the original length of the underlying byte slice. - * Size is the number of bytes available for reading via [Reader.ReadAt]. - * The result is unaffected by any method calls except [Reader.Reset]. + * Args holds command line arguments, including the command as Args[0]. + * If the Args field is empty or nil, Run uses {Path}. + * + * In typical use, both Path and Args are set by calling Command. */ - size(): number - } - interface Reader { + args: Array /** - * Read implements the [io.Reader] interface. - */ - read(b: string|Array): number + * Env specifies the environment of the process. + * Each entry is of the form "key=value". + * If Env is nil, the new process uses the current process's + * environment. + * If Env contains duplicate environment keys, only the last + * value in the slice for each duplicate key is used. + * As a special case on Windows, SYSTEMROOT is always added if + * missing and not explicitly set to the empty string. + */ + env: Array + /** + * Dir specifies the working directory of the command. + * If Dir is the empty string, Run runs the command in the + * calling process's current directory. + */ + dir: string + /** + * Stdin specifies the process's standard input. + * + * If Stdin is nil, the process reads from the null device (os.DevNull). + * + * If Stdin is an *os.File, the process's standard input is connected + * directly to that file. + * + * Otherwise, during the execution of the command a separate + * goroutine reads from Stdin and delivers that data to the command + * over a pipe. In this case, Wait does not complete until the goroutine + * stops copying, either because it has reached the end of Stdin + * (EOF or a read error), or because writing to the pipe returned an error, + * or because a nonzero WaitDelay was set and expired. + */ + stdin: io.Reader + /** + * Stdout and Stderr specify the process's standard output and error. + * + * If either is nil, Run connects the corresponding file descriptor + * to the null device (os.DevNull). + * + * If either is an *os.File, the corresponding output from the process + * is connected directly to that file. + * + * Otherwise, during the execution of the command a separate goroutine + * reads from the process over a pipe and delivers that data to the + * corresponding Writer. In this case, Wait does not complete until the + * goroutine reaches EOF or encounters an error or a nonzero WaitDelay + * expires. + * + * If Stdout and Stderr are the same writer, and have a type that can + * be compared with ==, at most one goroutine at a time will call Write. + */ + stdout: io.Writer + stderr: io.Writer + /** + * ExtraFiles specifies additional open files to be inherited by the + * new process. It does not include standard input, standard output, or + * standard error. If non-nil, entry i becomes file descriptor 3+i. + * + * ExtraFiles is not supported on Windows. + */ + extraFiles: Array<(os.File | undefined)> + /** + * SysProcAttr holds optional, operating system-specific attributes. + * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. + */ + sysProcAttr?: syscall.SysProcAttr + /** + * Process is the underlying process, once started. + */ + process?: os.Process + /** + * ProcessState contains information about an exited process. + * If the process was started successfully, Wait or Run will + * populate its ProcessState when the command completes. + */ + processState?: os.ProcessState + err: Error // LookPath error, if any. + /** + * If Cancel is non-nil, the command must have been created with + * CommandContext and Cancel will be called when the command's + * Context is done. By default, CommandContext sets Cancel to + * call the Kill method on the command's Process. + * + * Typically a custom Cancel will send a signal to the command's + * Process, but it may instead take other actions to initiate cancellation, + * such as closing a stdin or stdout pipe or sending a shutdown request on a + * network socket. + * + * If the command exits with a success status after Cancel is + * called, and Cancel does not return an error equivalent to + * os.ErrProcessDone, then Wait and similar methods will return a non-nil + * error: either an error wrapping the one returned by Cancel, + * or the error from the Context. + * (If the command exits with a non-success status, or Cancel + * returns an error that wraps os.ErrProcessDone, Wait and similar methods + * continue to return the command's usual exit status.) + * + * If Cancel is set to nil, nothing will happen immediately when the command's + * Context is done, but a nonzero WaitDelay will still take effect. That may + * be useful, for example, to work around deadlocks in commands that do not + * support shutdown signals but are expected to always finish quickly. + * + * Cancel will not be called if Start returns a non-nil error. + */ + cancel: () => void + /** + * If WaitDelay is non-zero, it bounds the time spent waiting on two sources + * of unexpected delay in Wait: a child process that fails to exit after the + * associated Context is canceled, and a child process that exits but leaves + * its I/O pipes unclosed. + * + * The WaitDelay timer starts when either the associated Context is done or a + * call to Wait observes that the child process has exited, whichever occurs + * first. When the delay has elapsed, the command shuts down the child process + * and/or its I/O pipes. + * + * If the child process has failed to exit — perhaps because it ignored or + * failed to receive a shutdown signal from a Cancel function, or because no + * Cancel function was set — then it will be terminated using os.Process.Kill. + * + * Then, if the I/O pipes communicating with the child process are still open, + * those pipes are closed in order to unblock any goroutines currently blocked + * on Read or Write calls. + * + * If pipes are closed due to WaitDelay, no Cancel call has occurred, + * and the command has otherwise exited with a successful status, Wait and + * similar methods will return ErrWaitDelay instead of nil. + * + * If WaitDelay is zero (the default), I/O pipes will be read until EOF, + * which might not occur until orphaned subprocesses of the command have + * also closed their descriptors for the pipes. + */ + waitDelay: time.Duration } - interface Reader { + interface Cmd { /** - * ReadAt implements the [io.ReaderAt] interface. + * String returns a human-readable description of c. + * It is intended only for debugging. + * In particular, it is not suitable for use as input to a shell. + * The output of String may vary across Go releases. */ - readAt(b: string|Array, off: number): number + string(): string } - interface Reader { + interface Cmd { /** - * ReadByte implements the [io.ByteReader] interface. + * Run starts the specified command and waits for it to complete. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command starts but does not complete successfully, the error is of + * type [*ExitError]. Other error types may be returned for other situations. + * + * If the calling goroutine has locked the operating system thread + * with [runtime.LockOSThread] and modified any inheritable OS-level + * thread state (for example, Linux or Plan 9 name spaces), the new + * process will inherit the caller's thread state. */ - readByte(): number + run(): void } - interface Reader { + interface Cmd { /** - * UnreadByte complements [Reader.ReadByte] in implementing the [io.ByteScanner] interface. + * Start starts the specified command but does not wait for it to complete. + * + * If Start returns successfully, the c.Process field will be set. + * + * After a successful call to Start the [Cmd.Wait] method must be called in + * order to release associated system resources. */ - unreadByte(): void + start(): void } - interface Reader { + interface Cmd { /** - * ReadRune implements the [io.RuneReader] interface. + * Wait waits for the command to exit and waits for any copying to + * stdin or copying from stdout or stderr to complete. + * + * The command must have been started by [Cmd.Start]. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command fails to run or doesn't complete successfully, the + * error is of type [*ExitError]. Other error types may be + * returned for I/O problems. + * + * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits + * for the respective I/O loop copying to or from the process to complete. + * + * Wait releases any resources associated with the [Cmd]. */ - readRune(): [number, number] + wait(): void } - interface Reader { + interface Cmd { /** - * UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface. + * Output runs the command and returns its standard output. + * Any returned error will usually be of type [*ExitError]. + * If c.Stderr was nil, Output populates [ExitError.Stderr]. */ - unreadRune(): void + output(): string|Array } - interface Reader { + interface Cmd { /** - * Seek implements the [io.Seeker] interface. + * CombinedOutput runs the command and returns its combined standard + * output and standard error. */ - seek(offset: number, whence: number): number + combinedOutput(): string|Array } - interface Reader { + interface Cmd { /** - * WriteTo implements the [io.WriterTo] interface. + * StdinPipe returns a pipe that will be connected to the command's + * standard input when the command starts. + * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. + * A caller need only call Close to force the pipe to close sooner. + * For example, if the command being run will not exit until standard input + * is closed, the caller must close the pipe. */ - writeTo(w: io.Writer): number + stdinPipe(): io.WriteCloser } - interface Reader { + interface Cmd { /** - * Reset resets the [Reader] to be reading from b. + * StdoutPipe returns a pipe that will be connected to the command's + * standard output when the command starts. + * + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. + * See the example for idiomatic usage. */ - reset(b: string|Array): void + stdoutPipe(): io.ReadCloser + } + interface Cmd { + /** + * StderrPipe returns a pipe that will be connected to the command's + * standard error when the command starts. + * + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. + * See the StdoutPipe example for idiomatic usage. + */ + stderrPipe(): io.ReadCloser + } + interface Cmd { + /** + * Environ returns a copy of the environment in which the command would be run + * as it is currently configured. + */ + environ(): Array } } /** - * Package context defines the Context type, which carries deadlines, - * cancellation signals, and other request-scoped values across API boundaries - * and between processes. + * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html * - * Incoming requests to a server should create a [Context], and outgoing - * calls to servers should accept a Context. The chain of function - * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using [WithCancel], [WithDeadline], - * [WithTimeout], or [WithValue]. When a Context is canceled, all - * Contexts derived from it are also canceled. - * - * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a - * Context (the parent) and return a derived Context (the child) and a - * [CancelFunc]. Calling the CancelFunc cancels the child and its - * children, removes the parent's reference to the child, and stops - * any associated timers. Failing to call the CancelFunc leaks the - * child and its children until the parent is canceled or the timer - * fires. The go vet tool checks that CancelFuncs are used on all - * control-flow paths. - * - * The [WithCancelCause] function returns a [CancelCauseFunc], which - * takes an error and records it as the cancellation cause. Calling - * [Cause] on the canceled context or any of its children retrieves - * the cause. If no cause is specified, Cause(ctx) returns the same - * value as ctx.Err(). - * - * Programs that use Contexts should follow these rules to keep interfaces - * consistent across packages and enable static analysis tools to check context - * propagation: - * - * Do not store Contexts inside a struct type; instead, pass a Context - * explicitly to each function that needs it. The Context should be the first - * parameter, typically named ctx: - * - * ``` - * func DoSomething(ctx context.Context, arg Arg) error { - * // ... use ctx ... - * } - * ``` - * - * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] - * if you are unsure about which Context to use. - * - * Use context Values only for request-scoped data that transits processes and - * APIs, not for passing optional parameters to functions. - * - * The same Context may be passed to functions running in different goroutines; - * Contexts are safe for simultaneous use by multiple goroutines. - * - * See https://blog.golang.org/context for example code for a server that uses - * Contexts. + * See README.md for more info. */ -namespace context { +namespace jwt { /** - * A Context carries a deadline, a cancellation signal, and other values across - * API boundaries. - * - * Context's methods may be called by multiple goroutines simultaneously. + * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. + * This is the default claims type if you don't supply one */ - interface Context { - [key:string]: any; + interface MapClaims extends _TygojaDict{} + interface MapClaims { /** - * Deadline returns the time when work done on behalf of this context - * should be canceled. Deadline returns ok==false when no deadline is - * set. Successive calls to Deadline return the same results. + * VerifyAudience Compares the aud claim against cmp. + * If required is false, this method will return true if the value matches or is unset */ - deadline(): [time.Time, boolean] + verifyAudience(cmp: string, req: boolean): boolean + } + interface MapClaims { /** - * Done returns a channel that's closed when work done on behalf of this - * context should be canceled. Done may return nil if this context can - * never be canceled. Successive calls to Done return the same value. - * The close of the Done channel may happen asynchronously, - * after the cancel function returns. - * - * WithCancel arranges for Done to be closed when cancel is called; - * WithDeadline arranges for Done to be closed when the deadline - * expires; WithTimeout arranges for Done to be closed when the timeout - * elapses. - * - * Done is provided for use in select statements: - * - * // Stream generates values with DoSomething and sends them to out - * // until DoSomething returns an error or ctx.Done is closed. - * func Stream(ctx context.Context, out chan<- Value) error { - * for { - * v, err := DoSomething(ctx) - * if err != nil { - * return err - * } - * select { - * case <-ctx.Done(): - * return ctx.Err() - * case out <- v: - * } - * } - * } - * - * See https://blog.golang.org/pipelines for more examples of how to use - * a Done channel for cancellation. + * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). + * If req is false, it will return true, if exp is unset. */ - done(): undefined + verifyExpiresAt(cmp: number, req: boolean): boolean + } + interface MapClaims { /** - * If Done is not yet closed, Err returns nil. - * If Done is closed, Err returns a non-nil error explaining why: - * Canceled if the context was canceled - * or DeadlineExceeded if the context's deadline passed. - * After Err returns a non-nil error, successive calls to Err return the same error. + * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). + * If req is false, it will return true, if iat is unset. */ - err(): void + verifyIssuedAt(cmp: number, req: boolean): boolean + } + interface MapClaims { /** - * Value returns the value associated with this context for key, or nil - * if no value is associated with key. Successive calls to Value with - * the same key returns the same result. - * - * Use context values only for request-scoped data that transits - * processes and API boundaries, not for passing optional parameters to - * functions. - * - * A key identifies a specific value in a Context. Functions that wish - * to store values in Context typically allocate a key in a global - * variable then use that key as the argument to context.WithValue and - * Context.Value. A key can be any type that supports equality; - * packages should define keys as an unexported type to avoid - * collisions. - * - * Packages that define a Context key should provide type-safe accessors - * for the values stored using that key: - * - * ``` - * // Package user defines a User type that's stored in Contexts. - * package user - * - * import "context" - * - * // User is the type of value stored in the Contexts. - * type User struct {...} - * - * // key is an unexported type for keys defined in this package. - * // This prevents collisions with keys defined in other packages. - * type key int - * - * // userKey is the key for user.User values in Contexts. It is - * // unexported; clients use user.NewContext and user.FromContext - * // instead of using this key directly. - * var userKey key - * - * // NewContext returns a new Context that carries value u. - * func NewContext(ctx context.Context, u *User) context.Context { - * return context.WithValue(ctx, userKey, u) - * } - * - * // FromContext returns the User value stored in ctx, if any. - * func FromContext(ctx context.Context) (*User, bool) { - * u, ok := ctx.Value(userKey).(*User) - * return u, ok - * } - * ``` + * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). + * If req is false, it will return true, if nbf is unset. */ - value(key: any): any + verifyNotBefore(cmp: number, req: boolean): boolean + } + interface MapClaims { + /** + * VerifyIssuer compares the iss claim against cmp. + * If required is false, this method will return true if the value matches or is unset + */ + verifyIssuer(cmp: string, req: boolean): boolean + } + interface MapClaims { + /** + * Valid validates time based claims "exp, iat, nbf". + * There is no accounting for clock skew. + * As well, if any of the above claims are not in the token, it will still + * be considered a valid claim. + */ + valid(): void } } /** - * Package url parses URLs and implements query escaping. + * Package types implements some commonly used db serializable types + * like datetime, json, etc. */ -namespace url { +namespace types { /** - * A URL represents a parsed URL (technically, a URI reference). - * - * The general form represented is: - * - * ``` - * [scheme:][//[userinfo@]host][/]path[?query][#fragment] - * ``` - * - * URLs that do not start with a slash after the scheme are interpreted as: - * - * ``` - * scheme:opaque[?query][#fragment] - * ``` - * - * The Host field contains the host and port subcomponents of the URL. - * When the port is present, it is separated from the host with a colon. - * When the host is an IPv6 address, it must be enclosed in square brackets: - * "[fe80::1]:80". The [net.JoinHostPort] function combines a host and port - * into a string suitable for the Host field, adding square brackets to - * the host when necessary. - * - * Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. - * A consequence is that it is impossible to tell which slashes in the Path were - * slashes in the raw URL and which were %2f. This distinction is rarely important, - * but when it is, the code should use the [URL.EscapedPath] method, which preserves - * the original encoding of Path. - * - * The RawPath field is an optional field which is only set when the default - * encoding of Path is different from the escaped path. See the EscapedPath method - * for more details. - * - * URL's String method uses the EscapedPath method to obtain the path. + * JsonArray defines a slice that is safe for json and db read/write. */ - interface URL { - scheme: string - opaque: string // encoded opaque data - user?: Userinfo // username and password information - host: string // host or host:port (see Hostname and Port methods) - path: string // path (relative paths may omit leading slash) - rawPath: string // encoded path hint (see EscapedPath method) - omitHost: boolean // do not emit empty host (authority) - forceQuery: boolean // append a query ('?') even if RawQuery is empty - rawQuery: string // encoded query values, without '?' - fragment: string // fragment for references, without '#' - rawFragment: string // encoded fragment hint (see EscapedFragment method) + interface JsonArray extends Array{} + interface JsonArray { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array } - interface URL { + interface JsonArray { /** - * EscapedPath returns the escaped form of u.Path. - * In general there are multiple possible escaped forms of any path. - * EscapedPath returns u.RawPath when it is a valid escaping of u.Path. - * Otherwise EscapedPath ignores u.RawPath and computes an escaped - * form on its own. - * The [URL.String] and [URL.RequestURI] methods use EscapedPath to construct - * their results. - * In general, code should call EscapedPath instead of - * reading u.RawPath directly. + * Value implements the [driver.Valuer] interface. */ - escapedPath(): string + value(): any } - interface URL { + interface JsonArray { /** - * EscapedFragment returns the escaped form of u.Fragment. - * In general there are multiple possible escaped forms of any fragment. - * EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. - * Otherwise EscapedFragment ignores u.RawFragment and computes an escaped - * form on its own. - * The [URL.String] method uses EscapedFragment to construct its result. - * In general, code should call EscapedFragment instead of - * reading u.RawFragment directly. - */ - escapedFragment(): string - } - interface URL { - /** - * String reassembles the [URL] into a valid URL string. - * The general form of the result is one of: - * - * ``` - * scheme:opaque?query#fragment - * scheme://userinfo@host/path?query#fragment - * ``` - * - * If u.Opaque is non-empty, String uses the first form; - * otherwise it uses the second form. - * Any non-ASCII characters in host are escaped. - * To obtain the path, String uses u.EscapedPath(). - * - * In the second form, the following rules apply: - * ``` - * - if u.Scheme is empty, scheme: is omitted. - * - if u.User is nil, userinfo@ is omitted. - * - if u.Host is empty, host/ is omitted. - * - if u.Scheme and u.Host are empty and u.User is nil, - * the entire scheme://userinfo@host/ is omitted. - * - if u.Host is non-empty and u.Path begins with a /, - * the form host/path does not add its own /. - * - if u.RawQuery is empty, ?query is omitted. - * - if u.Fragment is empty, #fragment is omitted. - * ``` - */ - string(): string - } - interface URL { - /** - * Redacted is like [URL.String] but replaces any password with "xxxxx". - * Only the password in u.User is redacted. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonArray[T] instance. */ - redacted(): string + scan(value: any): void } /** - * Values maps a string key to a list of values. - * It is typically used for query parameters and form values. - * Unlike in the http.Header map, the keys in a Values map - * are case-sensitive. + * JsonMap defines a map that is safe for json and db read/write. */ - interface Values extends _TygojaDict{} - interface Values { - /** - * Get gets the first value associated with the given key. - * If there are no values associated with the key, Get returns - * the empty string. To access multiple values, use the map - * directly. - */ - get(key: string): string - } - interface Values { - /** - * Set sets the key to value. It replaces any existing - * values. - */ - set(key: string, value: string): void - } - interface Values { - /** - * Add adds the value to key. It appends to any existing - * values associated with key. - */ - add(key: string, value: string): void - } - interface Values { - /** - * Del deletes the values associated with key. - */ - del(key: string): void - } - interface Values { - /** - * Has checks whether a given key is set. - */ - has(key: string): boolean - } - interface Values { - /** - * Encode encodes the values into “URL encoded” form - * ("bar=baz&foo=quux") sorted by key. - */ - encode(): string - } - interface URL { - /** - * IsAbs reports whether the [URL] is absolute. - * Absolute means that it has a non-empty scheme. - */ - isAbs(): boolean - } - interface URL { - /** - * Parse parses a [URL] in the context of the receiver. The provided URL - * may be relative or absolute. Parse returns nil, err on parse - * failure, otherwise its return value is the same as [URL.ResolveReference]. - */ - parse(ref: string): (URL) - } - interface URL { - /** - * ResolveReference resolves a URI reference to an absolute URI from - * an absolute base URI u, per RFC 3986 Section 5.2. The URI reference - * may be relative or absolute. ResolveReference always returns a new - * [URL] instance, even if the returned URL is identical to either the - * base or reference. If ref is an absolute URL, then ResolveReference - * ignores base and returns a copy of ref. - */ - resolveReference(ref: URL): (URL) - } - interface URL { + interface JsonMap extends _TygojaDict{} + interface JsonMap { /** - * Query parses RawQuery and returns the corresponding values. - * It silently discards malformed value pairs. - * To check errors use [ParseQuery]. + * MarshalJSON implements the [json.Marshaler] interface. */ - query(): Values + marshalJSON(): string|Array } - interface URL { + interface JsonMap { /** - * RequestURI returns the encoded path?query or opaque?query - * string that would be used in an HTTP request for u. + * Get retrieves a single value from the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). */ - requestURI(): string + get(key: string): any } - interface URL { + interface JsonMap { /** - * Hostname returns u.Host, stripping any valid port number if present. + * Set sets a single value in the current JsonMap. * - * If the result is enclosed in square brackets, as literal IPv6 addresses are, - * the square brackets are removed from the result. + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). */ - hostname(): string + set(key: string, value: any): void } - interface URL { + interface JsonMap { /** - * Port returns the port part of u.Host, without the leading colon. - * - * If u.Host doesn't contain a valid numeric port, Port returns an empty string. + * Value implements the [driver.Valuer] interface. */ - port(): string - } - interface URL { - marshalBinary(): string|Array - } - interface URL { - unmarshalBinary(text: string|Array): void + value(): any } - interface URL { + interface JsonMap { /** - * JoinPath returns a new [URL] with the provided path elements joined to - * any existing path and the resulting path cleaned of any ./ or ../ elements. - * Any sequences of multiple / characters will be reduced to a single /. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current `JsonMap` instance. */ - joinPath(...elem: string[]): (URL) + scan(value: any): void } } @@ -9706,9972 +9721,4174 @@ namespace http { } } -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { +namespace auth { /** - * TxOptions holds the transaction options to be used in [DB.BeginTx]. + * AuthUser defines a standardized oauth2 user data structure. */ - interface TxOptions { - /** - * Isolation is the transaction isolation level. - * If zero, the driver or database's default level is used. - */ - isolation: IsolationLevel - readOnly: boolean + interface AuthUser { + id: string + name: string + username: string + email: string + avatarUrl: string + accessToken: string + refreshToken: string + expiry: types.DateTime + rawUser: _TygojaDict } /** - * DB is a database handle representing a pool of zero or more - * underlying connections. It's safe for concurrent use by multiple - * goroutines. - * - * The sql package creates and frees connections automatically; it - * also maintains a free pool of idle connections. If the database has - * a concept of per-connection state, such state can be reliably observed - * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the - * returned [Tx] is bound to a single connection. Once [Tx.Commit] or - * [Tx.Rollback] is called on the transaction, that transaction's - * connection is returned to [DB]'s idle connection pool. The pool size - * can be controlled with [DB.SetMaxIdleConns]. + * Provider defines a common interface for an OAuth2 client. */ - interface DB { - } - interface DB { + interface Provider { + [key:string]: any; /** - * PingContext verifies a connection to the database is still alive, - * establishing a connection if necessary. + * Context returns the context associated with the provider (if any). */ - pingContext(ctx: context.Context): void - } - interface DB { + context(): context.Context /** - * Ping verifies a connection to the database is still alive, - * establishing a connection if necessary. - * - * Ping uses [context.Background] internally; to specify the context, use - * [DB.PingContext]. + * SetContext assigns the specified context to the current provider. */ - ping(): void - } - interface DB { + setContext(ctx: context.Context): void /** - * Close closes the database and prevents new queries from starting. - * Close then waits for all queries that have started processing on the server - * to finish. - * - * It is rare to Close a [DB], as the [DB] handle is meant to be - * long-lived and shared between many goroutines. + * PKCE indicates whether the provider can use the PKCE flow. */ - close(): void - } - interface DB { + pkce(): boolean /** - * SetMaxIdleConns sets the maximum number of connections in the idle - * connection pool. - * - * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, - * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. - * - * If n <= 0, no idle connections are retained. - * - * The default max idle connections is currently 2. This may change in - * a future release. + * SetPKCE toggles the state whether the provider can use the PKCE flow or not. */ - setMaxIdleConns(n: number): void - } - interface DB { + setPKCE(enable: boolean): void /** - * SetMaxOpenConns sets the maximum number of open connections to the database. - * - * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than - * MaxIdleConns, then MaxIdleConns will be reduced to match the new - * MaxOpenConns limit. - * - * If n <= 0, then there is no limit on the number of open connections. - * The default is 0 (unlimited). + * DisplayName usually returns provider name as it is officially written + * and it could be used directly in the UI. */ - setMaxOpenConns(n: number): void - } - interface DB { + displayName(): string /** - * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's age. + * SetDisplayName sets the provider's display name. */ - setConnMaxLifetime(d: time.Duration): void - } - interface DB { + setDisplayName(displayName: string): void /** - * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's idle time. + * Scopes returns the provider access permissions that will be requested. */ - setConnMaxIdleTime(d: time.Duration): void - } - interface DB { + scopes(): Array /** - * Stats returns database statistics. + * SetScopes sets the provider access permissions that will be requested later. */ - stats(): DBStats - } - interface DB { + setScopes(scopes: Array): void /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. + * ClientId returns the provider client's app ID. */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface DB { + clientId(): string /** - * Prepare creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * Prepare uses [context.Background] internally; to specify the context, use - * [DB.PrepareContext]. + * SetClientId sets the provider client's ID. */ - prepare(query: string): (Stmt) - } - interface DB { + setClientId(clientId: string): void /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. + * ClientSecret returns the provider client's app secret. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface DB { + clientSecret(): string /** - * Exec executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - * - * Exec uses [context.Background] internally; to specify the context, use - * [DB.ExecContext]. + * SetClientSecret sets the provider client's app secret. */ - exec(query: string, ...args: any[]): Result - } - interface DB { + setClientSecret(secret: string): void /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. + * RedirectUrl returns the end address to redirect the user + * going through the OAuth flow. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface DB { + redirectUrl(): string /** - * Query executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - * - * Query uses [context.Background] internally; to specify the context, use - * [DB.QueryContext]. + * SetRedirectUrl sets the provider's RedirectUrl. */ - query(query: string, ...args: any[]): (Rows) - } - interface DB { + setRedirectUrl(url: string): void /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. + * AuthUrl returns the provider's authorization service url. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface DB { + authUrl(): string /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [DB.QueryRowContext]. + * SetAuthUrl sets the provider's AuthUrl. */ - queryRow(query: string, ...args: any[]): (Row) - } - interface DB { + setAuthUrl(url: string): void /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. + * TokenUrl returns the provider's token exchange service url. */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) - } - interface DB { + tokenUrl(): string /** - * Begin starts a transaction. The default isolation level is dependent on - * the driver. - * - * Begin uses [context.Background] internally; to specify the context, use - * [DB.BeginTx]. + * SetTokenUrl sets the provider's TokenUrl. */ - begin(): (Tx) - } - interface DB { + setTokenUrl(url: string): void /** - * Driver returns the database's underlying driver. + * UserApiUrl returns the provider's user info api url. */ - driver(): any - } - interface DB { + userApiUrl(): string /** - * Conn returns a single connection by either opening a new connection - * or returning an existing connection from the connection pool. Conn will - * block until either a connection is returned or ctx is canceled. - * Queries run on the same Conn will be run in the same database session. - * - * Every Conn must be returned to the database pool after use by - * calling [Conn.Close]. + * SetUserApiUrl sets the provider's UserApiUrl. */ - conn(ctx: context.Context): (Conn) - } - /** - * Tx is an in-progress database transaction. - * - * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. - * - * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the - * transaction fail with [ErrTxDone]. - * - * The statements prepared for a transaction by calling - * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed - * by the call to [Tx.Commit] or [Tx.Rollback]. - */ - interface Tx { - } - interface Tx { + setUserApiUrl(url: string): void /** - * Commit commits the transaction. + * Client returns an http client using the provided token. */ - commit(): void - } - interface Tx { + client(token: oauth2.Token): (any) /** - * Rollback aborts the transaction. + * BuildAuthUrl returns a URL to the provider's consent page + * that asks for permissions for the required scopes explicitly. */ - rollback(): void - } - interface Tx { + buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string /** - * PrepareContext creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. - * - * The provided context will be used for the preparation of the context, not - * for the execution of the returned statement. The returned statement - * will run in the transaction context. + * FetchToken converts an authorization code to token. */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface Tx { + fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) /** - * Prepare creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. - * - * Prepare uses [context.Background] internally; to specify the context, use - * [Tx.PrepareContext]. + * FetchRawUserData requests and marshalizes into `result` the + * the OAuth user api response. */ - prepare(query: string): (Stmt) - } - interface Tx { + fetchRawUserData(token: oauth2.Token): string|Array /** - * StmtContext returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) - * ``` - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. + * FetchAuthUser is similar to FetchRawUserData, but normalizes and + * marshalizes the user api response into a standardized AuthUser struct. */ - stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) + fetchAuthUser(token: oauth2.Token): (AuthUser) } - interface Tx { +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + /** + * Context represents the context of the current HTTP request. It holds request and + * response objects, path, path parameters, data and registered handler. + */ + interface Context { + [key:string]: any; /** - * Stmt returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) - * ``` - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * Stmt uses [context.Background] internally; to specify the context, use - * [Tx.StmtContext]. + * Request returns `*http.Request`. */ - stmt(stmt: Stmt): (Stmt) - } - interface Tx { + request(): (http.Request) /** - * ExecContext executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. + * SetRequest sets `*http.Request`. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface Tx { + setRequest(r: http.Request): void /** - * Exec executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Tx.ExecContext]. + * SetResponse sets `*Response`. */ - exec(query: string, ...args: any[]): Result - } - interface Tx { + setResponse(r: Response): void /** - * QueryContext executes a query that returns rows, typically a SELECT. + * Response returns `*Response`. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface Tx { + response(): (Response) /** - * Query executes a query that returns rows, typically a SELECT. - * - * Query uses [context.Background] internally; to specify the context, use - * [Tx.QueryContext]. + * IsTLS returns true if HTTP connection is TLS otherwise false. */ - query(query: string, ...args: any[]): (Rows) - } - interface Tx { + isTLS(): boolean /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * IsWebSocket returns true if HTTP connection is WebSocket otherwise false. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface Tx { + isWebSocket(): boolean /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Tx.QueryRowContext]. + * Scheme returns the HTTP protocol scheme, `http` or `https`. */ - queryRow(query: string, ...args: any[]): (Row) - } - /** - * Stmt is a prepared statement. - * A Stmt is safe for concurrent use by multiple goroutines. - * - * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single - * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will - * become unusable and all operations will return an error. - * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the - * [DB]. When the Stmt needs to execute on a new underlying connection, it will - * prepare itself on the new connection automatically. - */ - interface Stmt { - } - interface Stmt { + scheme(): string /** - * ExecContext executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. + * RealIP returns the client's network address based on `X-Forwarded-For` + * or `X-Real-IP` request header. + * The behavior can be configured using `Echo#IPExtractor`. */ - execContext(ctx: context.Context, ...args: any[]): Result - } - interface Stmt { + realIP(): string /** - * Exec executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Stmt.ExecContext]. + * RouteInfo returns current request route information. Method, Path, Name and params if they exist for matched route. + * In case of 404 (route not found) and 405 (method not allowed) RouteInfo returns generic struct for these cases. */ - exec(...args: any[]): Result - } - interface Stmt { + routeInfo(): RouteInfo /** - * QueryContext executes a prepared query statement with the given arguments - * and returns the query results as a [*Rows]. + * Path returns the registered path for the handler. */ - queryContext(ctx: context.Context, ...args: any[]): (Rows) - } - interface Stmt { + path(): string /** - * Query executes a prepared query statement with the given arguments - * and returns the query results as a *Rows. + * PathParam returns path parameter by name. + */ + pathParam(name: string): string + /** + * PathParamDefault returns the path parameter or default value for the provided name. * - * Query uses [context.Background] internally; to specify the context, use - * [Stmt.QueryContext]. + * Notes for DefaultRouter implementation: + * Path parameter could be empty for cases like that: + * * route `/release-:version/bin` and request URL is `/release-/bin` + * * route `/api/:version/image.jpg` and request URL is `/api//image.jpg` + * but not when path parameter is last part of route path + * * route `/download/file.:ext` will not match request `/download/file.` */ - query(...args: any[]): (Rows) - } - interface Stmt { + pathParamDefault(name: string, defaultValue: string): string /** - * QueryRowContext executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * PathParams returns path parameter values. */ - queryRowContext(ctx: context.Context, ...args: any[]): (Row) - } - interface Stmt { + pathParams(): PathParams /** - * QueryRow executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - * - * Example usage: - * - * ``` - * var name string - * err := nameByUseridStmt.QueryRow(id).Scan(&name) - * ``` - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Stmt.QueryRowContext]. + * SetPathParams sets path parameters for current request. */ - queryRow(...args: any[]): (Row) - } - interface Stmt { + setPathParams(params: PathParams): void /** - * Close closes the statement. + * QueryParam returns the query param for the provided name. */ - close(): void - } - /** - * Rows is the result of a query. Its cursor starts before the first row - * of the result set. Use [Rows.Next] to advance from row to row. - */ - interface Rows { - } - interface Rows { + queryParam(name: string): string /** - * Next prepares the next result row for reading with the [Rows.Scan] method. It - * returns true on success, or false if there is no next result row or an error - * happened while preparing it. [Rows.Err] should be consulted to distinguish between - * the two cases. - * - * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. + * QueryParamDefault returns the query param or default value for the provided name. */ - next(): boolean - } - interface Rows { + queryParamDefault(name: string, defaultValue: string): string /** - * NextResultSet prepares the next result set for reading. It reports whether - * there is further result sets, or false if there is no further result set - * or if there is an error advancing to it. The [Rows.Err] method should be consulted - * to distinguish between the two cases. - * - * After calling NextResultSet, the [Rows.Next] method should always be called before - * scanning. If there are further result sets they may not have rows in the result - * set. + * QueryParams returns the query parameters as `url.Values`. */ - nextResultSet(): boolean - } - interface Rows { + queryParams(): url.Values /** - * Err returns the error, if any, that was encountered during iteration. - * Err may be called after an explicit or implicit [Rows.Close]. + * QueryString returns the URL query string. */ - err(): void - } - interface Rows { + queryString(): string /** - * Columns returns the column names. - * Columns returns an error if the rows are closed. + * FormValue returns the form field value for the provided name. */ - columns(): Array - } - interface Rows { + formValue(name: string): string /** - * ColumnTypes returns column information such as column type, length, - * and nullable. Some information may not be available from some drivers. + * FormValueDefault returns the form field value or default value for the provided name. */ - columnTypes(): Array<(ColumnType | undefined)> - } - interface Rows { + formValueDefault(name: string, defaultValue: string): string /** - * Scan copies the columns in the current row into the values pointed - * at by dest. The number of values in dest must be the same as the - * number of columns in [Rows]. - * - * Scan converts columns read from the database into the following - * common Go types and special types provided by the sql package: - * - * ``` - * *string - * *[]byte - * *int, *int8, *int16, *int32, *int64 - * *uint, *uint8, *uint16, *uint32, *uint64 - * *bool - * *float32, *float64 - * *interface{} - * *RawBytes - * *Rows (cursor value) - * any type implementing Scanner (see Scanner docs) - * ``` - * - * In the most simple case, if the type of the value from the source - * column is an integer, bool or string type T and dest is of type *T, - * Scan simply assigns the value through the pointer. - * - * Scan also converts between string and numeric types, as long as no - * information would be lost. While Scan stringifies all numbers - * scanned from numeric database columns into *string, scans into - * numeric types are checked for overflow. For example, a float64 with - * value 300 or a string with value "300" can scan into a uint16, but - * not into a uint8, though float64(255) or "255" can scan into a - * uint8. One exception is that scans of some float64 numbers to - * strings may lose information when stringifying. In general, scan - * floating point columns into *float64. - * - * If a dest argument has type *[]byte, Scan saves in that argument a - * copy of the corresponding data. The copy is owned by the caller and - * can be modified and held indefinitely. The copy can be avoided by - * using an argument of type [*RawBytes] instead; see the documentation - * for [RawBytes] for restrictions on its use. - * - * If an argument has type *interface{}, Scan copies the value - * provided by the underlying driver without conversion. When scanning - * from a source value of type []byte to *interface{}, a copy of the - * slice is made and the caller owns the result. - * - * Source values of type [time.Time] may be scanned into values of type - * *time.Time, *interface{}, *string, or *[]byte. When converting to - * the latter two, [time.RFC3339Nano] is used. - * - * Source values of type bool may be scanned into types *bool, - * *interface{}, *string, *[]byte, or [*RawBytes]. - * - * For scanning into *bool, the source may be true, false, 1, 0, or - * string inputs parseable by [strconv.ParseBool]. - * - * Scan can also convert a cursor returned from a query, such as - * "select cursor(select * from my_table) from dual", into a - * [*Rows] value that can itself be scanned from. The parent - * select query will close any cursor [*Rows] if the parent [*Rows] is closed. - * - * If any of the first arguments implementing [Scanner] returns an error, - * that error will be wrapped in the returned error. + * FormValues returns the form field values as `url.Values`. */ - scan(...dest: any[]): void - } - interface Rows { + formValues(): url.Values /** - * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called - * and returns false and there are no further result sets, - * the [Rows] are closed automatically and it will suffice to check the - * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. + * FormFile returns the multipart form file for the provided name. */ - close(): void - } - /** - * A Result summarizes an executed SQL command. - */ - interface Result { - [key:string]: any; + formFile(name: string): (multipart.FileHeader) /** - * LastInsertId returns the integer generated by the database - * in response to a command. Typically this will be from an - * "auto increment" column when inserting a new row. Not all - * databases support this feature, and the syntax of such - * statements varies. + * MultipartForm returns the multipart form. */ - lastInsertId(): number + multipartForm(): (multipart.Form) /** - * RowsAffected returns the number of rows affected by an - * update, insert, or delete. Not every database or database - * driver may support this. + * Cookie returns the named cookie provided in the request. */ - rowsAffected(): number + cookie(name: string): (http.Cookie) + /** + * SetCookie adds a `Set-Cookie` header in HTTP response. + */ + setCookie(cookie: http.Cookie): void + /** + * Cookies returns the HTTP cookies sent with the request. + */ + cookies(): Array<(http.Cookie | undefined)> + /** + * Get retrieves data from the context. + */ + get(key: string): { } -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - /** - * A Config provides service configuration for service clients. - */ - interface Config { /** - * The region to send requests to. This parameter is required and must - * be configured globally or on a per-client basis unless otherwise - * noted. A full list of regions is found in the "Regions and Endpoints" - * document. - * - * See http://docs.aws.amazon.com/general/latest/gr/rande.html for - * information on AWS regions. + * Set saves data in the context. */ - region: string + set(key: string, val: { + }): void /** - * The credentials object to use when signing requests. - * Use the LoadDefaultConfig to load configuration from all the SDK's supported - * sources, and resolve credentials using the SDK's default credential chain. + * Bind binds path params, query params and the request body into provided type `i`. The default binder + * binds body based on Content-Type header. */ - credentials: CredentialsProvider + bind(i: { + }): void /** - * The Bearer Authentication token provider to use for authenticating API - * operation calls with a Bearer Authentication token. The API clients and - * operation must support Bearer Authentication scheme in order for the - * token provider to be used. API clients created with NewFromConfig will - * automatically be configured with this option, if the API client support - * Bearer Authentication. - * - * The SDK's config.LoadDefaultConfig can automatically populate this - * option for external configuration options such as SSO session. - * https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html + * Validate validates provided `i`. It is usually called after `Context#Bind()`. + * Validator must be registered using `Echo#Validator`. */ - bearerAuthTokenProvider: smithybearer.TokenProvider + validate(i: { + }): void /** - * The HTTP Client the SDK's API clients will use to invoke HTTP requests. - * The SDK defaults to a BuildableClient allowing API clients to create - * copies of the HTTP Client for service specific customizations. - * - * Use a (*http.Client) for custom behavior. Using a custom http.Client - * will prevent the SDK from modifying the HTTP client. + * Render renders a template with data and sends a text/html response with status + * code. Renderer must be registered using `Echo.Renderer`. */ - httpClient: HTTPClient + render(code: number, name: string, data: { + }): void /** - * An endpoint resolver that can be used to provide or override an endpoint - * for the given service and region. - * - * See the `aws.EndpointResolver` documentation for additional usage - * information. - * - * Deprecated: See Config.EndpointResolverWithOptions + * HTML sends an HTTP response with status code. */ - endpointResolver: EndpointResolver + html(code: number, html: string): void /** - * An endpoint resolver that can be used to provide or override an endpoint - * for the given service and region. - * - * When EndpointResolverWithOptions is specified, it will be used by a - * service client rather than using EndpointResolver if also specified. - * - * See the `aws.EndpointResolverWithOptions` documentation for additional - * usage information. - * - * Deprecated: with the release of endpoint resolution v2 in API clients, - * EndpointResolver and EndpointResolverWithOptions are deprecated. - * Providing a value for this field will likely prevent you from using - * newer endpoint-related service features. See API client options - * EndpointResolverV2 and BaseEndpoint. + * HTMLBlob sends an HTTP blob response with status code. */ - endpointResolverWithOptions: EndpointResolverWithOptions + htmlBlob(code: number, b: string|Array): void /** - * RetryMaxAttempts specifies the maximum number attempts an API client - * will call an operation that fails with a retryable error. - * - * API Clients will only use this value to construct a retryer if the - * Config.Retryer member is not nil. This value will be ignored if - * Retryer is not nil. + * String sends a string response with status code. */ - retryMaxAttempts: number + string(code: number, s: string): void /** - * RetryMode specifies the retry model the API client will be created with. - * - * API Clients will only use this value to construct a retryer if the - * Config.Retryer member is not nil. This value will be ignored if - * Retryer is not nil. + * JSON sends a JSON response with status code. */ - retryMode: RetryMode + json(code: number, i: { + }): void /** - * Retryer is a function that provides a Retryer implementation. A Retryer - * guides how HTTP requests should be retried in case of recoverable - * failures. When nil the API client will use a default retryer. - * - * In general, the provider function should return a new instance of a - * Retryer if you are attempting to provide a consistent Retryer - * configuration across all clients. This will ensure that each client will - * be provided a new instance of the Retryer implementation, and will avoid - * issues such as sharing the same retry token bucket across services. - * - * If not nil, RetryMaxAttempts, and RetryMode will be ignored by API - * clients. + * JSONPretty sends a pretty-print JSON with status code. */ - retryer: () => Retryer + jsonPretty(code: number, i: { + }, indent: string): void /** - * ConfigSources are the sources that were used to construct the Config. - * Allows for additional configuration to be loaded by clients. + * JSONBlob sends a JSON blob response with status code. */ - configSources: Array<{ - }> + jsonBlob(code: number, b: string|Array): void /** - * APIOptions provides the set of middleware mutations modify how the API - * client requests will be handled. This is useful for adding additional - * tracing data to a request, or changing behavior of the SDK's client. + * JSONP sends a JSONP response with status code. It uses `callback` to construct + * the JSONP payload. */ - apiOptions: Array<(_arg0: middleware.Stack) => void> + jsonp(code: number, callback: string, i: { + }): void /** - * The logger writer interface to write logging messages to. Defaults to - * standard error. + * JSONPBlob sends a JSONP blob response with status code. It uses `callback` + * to construct the JSONP payload. */ - logger: logging.Logger + jsonpBlob(code: number, callback: string, b: string|Array): void /** - * Configures the events that will be sent to the configured logger. This - * can be used to configure the logging of signing, retries, request, and - * responses of the SDK clients. - * - * See the ClientLogMode type documentation for the complete set of logging - * modes and available configuration. + * XML sends an XML response with status code. */ - clientLogMode: ClientLogMode + xml(code: number, i: { + }): void /** - * The configured DefaultsMode. If not specified, service clients will - * default to legacy. - * - * Supported modes are: auto, cross-region, in-region, legacy, mobile, - * standard + * XMLPretty sends a pretty-print XML with status code. */ - defaultsMode: DefaultsMode + xmlPretty(code: number, i: { + }, indent: string): void /** - * The RuntimeEnvironment configuration, only populated if the DefaultsMode - * is set to DefaultsModeAuto and is initialized by - * `config.LoadDefaultConfig`. You should not populate this structure - * programmatically, or rely on the values here within your applications. + * XMLBlob sends an XML blob response with status code. */ - runtimeEnvironment: RuntimeEnvironment + xmlBlob(code: number, b: string|Array): void /** - * AppId is an optional application specific identifier that can be set. - * When set it will be appended to the User-Agent header of every request - * in the form of App/{AppId}. This variable is sourced from environment - * variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id. - * See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for - * more information on environment variables and shared config settings. + * Blob sends a blob response with status code and content type. */ - appID: string + blob(code: number, contentType: string, b: string|Array): void /** - * BaseEndpoint is an intermediary transfer location to a service specific - * BaseEndpoint on a service's Options. + * Stream sends a streaming response with status code and content type. */ - baseEndpoint?: string + stream(code: number, contentType: string, r: io.Reader): void /** - * DisableRequestCompression toggles if an operation request could be - * compressed or not. Will be set to false by default. This variable is sourced from - * environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute - * disable_request_compression + * File sends a response with the content of the file. */ - disableRequestCompression: boolean + file(file: string): void /** - * RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be - * compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively. - * This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or - * the shared config profile attribute request_min_compression_size_bytes + * FileFS sends a response with the content of the file from given filesystem. */ - requestMinCompressSizeBytes: number + fileFS(file: string, filesystem: fs.FS): void /** - * Controls how a resolved AWS account ID is handled for endpoint routing. + * Attachment sends a response as attachment, prompting client to save the + * file. */ - accountIDEndpointMode: AccountIDEndpointMode - } - interface Config { + attachment(file: string, name: string): void /** - * Copy will return a shallow copy of the Config object. + * Inline sends a response as inline, opening the file in the browser. */ - copy(): Config - } - // @ts-ignore - import sdkrand = rand -} - -/** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the [path/filepath] package's Glob function. - * To expand environment variables, use package os's ExpandEnv. - * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. - * - * # Executables in the current directory - * - * The functions [Command] and [LookPath] look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. - * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run [LookPath]("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying [errors.Is](err, [ErrDot]). - * - * For example, consider these two program snippets: - * - * ``` - * path, err := exec.LookPath("prog") - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * These will not find and run ./prog or .\prog.exe, - * no matter how the current path is configured. - * - * Code that always wants to run a program from the current directory - * can be rewritten to say "./prog" instead of "prog". - * - * Code that insists on including results from relative path entries - * can instead override the error using an errors.Is check: - * - * ``` - * path, err := exec.LookPath("prog") - * if errors.Is(err, exec.ErrDot) { - * err = nil - * } - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if errors.Is(cmd.Err, exec.ErrDot) { - * cmd.Err = nil - * } - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * Setting the environment variable GODEBUG=execerrdot=0 - * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 - * behavior for programs that are unable to apply more targeted fixes. - * A future version of Go may remove support for this variable. - * - * Before adding such overrides, make sure you understand the - * security implications of doing so. - * See https://go.dev/blog/path-security for more information. - */ -namespace exec { + inline(file: string, name: string): void + /** + * NoContent sends a response with no body and a status code. + */ + noContent(code: number): void + /** + * Redirect redirects the request to a provided URL with status code. + */ + redirect(code: number, url: string): void + /** + * Error invokes the registered global HTTP error handler. Generally used by middleware. + * A side-effect of calling global error handler is that now Response has been committed (sent to the client) and + * middlewares up in chain can not change Response status code or Response body anymore. + * + * Avoid using this method in handlers as no middleware will be able to effectively handle errors after that. + * Instead of calling this method in handler return your error and let it be handled by middlewares or global error handler. + */ + error(err: Error): void + /** + * Echo returns the `Echo` instance. + * + * WARNING: Remember that Echo public fields and methods are coroutine safe ONLY when you are NOT mutating them + * anywhere in your code after Echo server has started. + */ + echo(): (Echo) + } + // @ts-ignore + import stdContext = context /** - * Cmd represents an external command being prepared or run. + * Echo is the top-level framework instance. * - * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] - * methods. + * Goroutine safety: Do not mutate Echo instance fields after server has started. Accessing these + * fields from handlers/middlewares and changing field values at the same time leads to data-races. + * Same rule applies to adding new routes after server has been started - Adding a route is not Goroutine safe action. */ - interface Cmd { + interface Echo { /** - * Path is the path of the command to run. - * - * This is the only field that must be set to a non-zero - * value. If Path is relative, it is evaluated relative - * to Dir. + * NewContextFunc allows using custom context implementations, instead of default *echo.context */ - path: string + newContextFunc: (e: Echo, pathParamAllocSize: number) => ServableContext + debug: boolean + httpErrorHandler: HTTPErrorHandler + binder: Binder + jsonSerializer: JSONSerializer + validator: Validator + renderer: Renderer + logger: Logger + ipExtractor: IPExtractor /** - * Args holds command line arguments, including the command as Args[0]. - * If the Args field is empty or nil, Run uses {Path}. + * Filesystem is file system used by Static and File handlers to access files. + * Defaults to os.DirFS(".") * - * In typical use, both Path and Args are set by calling Command. + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - args: Array + filesystem: fs.FS /** - * Env specifies the environment of the process. - * Each entry is of the form "key=value". - * If Env is nil, the new process uses the current process's - * environment. - * If Env contains duplicate environment keys, only the last - * value in the slice for each duplicate key is used. - * As a special case on Windows, SYSTEMROOT is always added if - * missing and not explicitly set to the empty string. + * OnAddRoute is called when Echo adds new route to specific host router. Handler is called for every router + * and before route is added to the host router. */ - env: Array + onAddRoute: (host: string, route: Routable) => void + } + /** + * HandlerFunc defines a function to serve HTTP requests. + */ + interface HandlerFunc {(c: Context): void } + /** + * MiddlewareFunc defines a function to process middleware. + */ + interface MiddlewareFunc {(next: HandlerFunc): HandlerFunc } + interface Echo { /** - * Dir specifies the working directory of the command. - * If Dir is the empty string, Run runs the command in the - * calling process's current directory. + * NewContext returns a new Context instance. + * + * Note: both request and response can be left to nil as Echo.ServeHTTP will call c.Reset(req,resp) anyway + * these arguments are useful when creating context for tests and cases like that. */ - dir: string + newContext(r: http.Request, w: http.ResponseWriter): Context + } + interface Echo { /** - * Stdin specifies the process's standard input. - * - * If Stdin is nil, the process reads from the null device (os.DevNull). - * - * If Stdin is an *os.File, the process's standard input is connected - * directly to that file. - * - * Otherwise, during the execution of the command a separate - * goroutine reads from Stdin and delivers that data to the command - * over a pipe. In this case, Wait does not complete until the goroutine - * stops copying, either because it has reached the end of Stdin - * (EOF or a read error), or because writing to the pipe returned an error, - * or because a nonzero WaitDelay was set and expired. + * Router returns the default router. */ - stdin: io.Reader + router(): Router + } + interface Echo { /** - * Stdout and Stderr specify the process's standard output and error. - * - * If either is nil, Run connects the corresponding file descriptor - * to the null device (os.DevNull). - * - * If either is an *os.File, the corresponding output from the process - * is connected directly to that file. - * - * Otherwise, during the execution of the command a separate goroutine - * reads from the process over a pipe and delivers that data to the - * corresponding Writer. In this case, Wait does not complete until the - * goroutine reaches EOF or encounters an error or a nonzero WaitDelay - * expires. - * - * If Stdout and Stderr are the same writer, and have a type that can - * be compared with ==, at most one goroutine at a time will call Write. + * Routers returns the new map of host => router. */ - stdout: io.Writer - stderr: io.Writer + routers(): _TygojaDict + } + interface Echo { /** - * ExtraFiles specifies additional open files to be inherited by the - * new process. It does not include standard input, standard output, or - * standard error. If non-nil, entry i becomes file descriptor 3+i. - * - * ExtraFiles is not supported on Windows. + * RouterFor returns Router for given host. When host is left empty the default router is returned. */ - extraFiles: Array<(os.File | undefined)> + routerFor(host: string): [Router, boolean] + } + interface Echo { /** - * SysProcAttr holds optional, operating system-specific attributes. - * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. + * ResetRouterCreator resets callback for creating new router instances. + * Note: current (default) router is immediately replaced with router created with creator func and vhost routers are cleared. */ - sysProcAttr?: syscall.SysProcAttr + resetRouterCreator(creator: (e: Echo) => Router): void + } + interface Echo { /** - * Process is the underlying process, once started. + * Pre adds middleware to the chain which is run before router tries to find matching route. + * Meaning middleware is executed even for 404 (not found) cases. */ - process?: os.Process + pre(...middleware: MiddlewareFunc[]): void + } + interface Echo { /** - * ProcessState contains information about an exited process. - * If the process was started successfully, Wait or Run will - * populate its ProcessState when the command completes. + * Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed. */ - processState?: os.ProcessState - err: Error // LookPath error, if any. + use(...middleware: MiddlewareFunc[]): void + } + interface Echo { /** - * If Cancel is non-nil, the command must have been created with - * CommandContext and Cancel will be called when the command's - * Context is done. By default, CommandContext sets Cancel to - * call the Kill method on the command's Process. - * - * Typically a custom Cancel will send a signal to the command's - * Process, but it may instead take other actions to initiate cancellation, - * such as closing a stdin or stdout pipe or sending a shutdown request on a - * network socket. - * - * If the command exits with a success status after Cancel is - * called, and Cancel does not return an error equivalent to - * os.ErrProcessDone, then Wait and similar methods will return a non-nil - * error: either an error wrapping the one returned by Cancel, - * or the error from the Context. - * (If the command exits with a non-success status, or Cancel - * returns an error that wraps os.ErrProcessDone, Wait and similar methods - * continue to return the command's usual exit status.) - * - * If Cancel is set to nil, nothing will happen immediately when the command's - * Context is done, but a nonzero WaitDelay will still take effect. That may - * be useful, for example, to work around deadlocks in commands that do not - * support shutdown signals but are expected to always finish quickly. - * - * Cancel will not be called if Start returns a non-nil error. + * CONNECT registers a new CONNECT route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - cancel: () => void + connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + } + interface Echo { /** - * If WaitDelay is non-zero, it bounds the time spent waiting on two sources - * of unexpected delay in Wait: a child process that fails to exit after the - * associated Context is canceled, and a child process that exits but leaves - * its I/O pipes unclosed. - * - * The WaitDelay timer starts when either the associated Context is done or a - * call to Wait observes that the child process has exited, whichever occurs - * first. When the delay has elapsed, the command shuts down the child process - * and/or its I/O pipes. - * - * If the child process has failed to exit — perhaps because it ignored or - * failed to receive a shutdown signal from a Cancel function, or because no - * Cancel function was set — then it will be terminated using os.Process.Kill. - * - * Then, if the I/O pipes communicating with the child process are still open, - * those pipes are closed in order to unblock any goroutines currently blocked - * on Read or Write calls. - * - * If pipes are closed due to WaitDelay, no Cancel call has occurred, - * and the command has otherwise exited with a successful status, Wait and - * similar methods will return ErrWaitDelay instead of nil. - * - * If WaitDelay is zero (the default), I/O pipes will be read until EOF, - * which might not occur until orphaned subprocesses of the command have - * also closed their descriptors for the pipes. + * DELETE registers a new DELETE route for a path with matching handler in the router + * with optional route-level middleware. Panics on error. */ - waitDelay: time.Duration + delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * String returns a human-readable description of c. - * It is intended only for debugging. - * In particular, it is not suitable for use as input to a shell. - * The output of String may vary across Go releases. + * GET registers a new GET route for a path with matching handler in the router + * with optional route-level middleware. Panics on error. */ - string(): string + get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * Run starts the specified command and waits for it to complete. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command starts but does not complete successfully, the error is of - * type [*ExitError]. Other error types may be returned for other situations. - * - * If the calling goroutine has locked the operating system thread - * with [runtime.LockOSThread] and modified any inheritable OS-level - * thread state (for example, Linux or Plan 9 name spaces), the new - * process will inherit the caller's thread state. + * HEAD registers a new HEAD route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - run(): void + head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * Start starts the specified command but does not wait for it to complete. - * - * If Start returns successfully, the c.Process field will be set. - * - * After a successful call to Start the [Cmd.Wait] method must be called in - * order to release associated system resources. + * OPTIONS registers a new OPTIONS route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - start(): void + options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * Wait waits for the command to exit and waits for any copying to - * stdin or copying from stdout or stderr to complete. - * - * The command must have been started by [Cmd.Start]. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command fails to run or doesn't complete successfully, the - * error is of type [*ExitError]. Other error types may be - * returned for I/O problems. - * - * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits - * for the respective I/O loop copying to or from the process to complete. - * - * Wait releases any resources associated with the [Cmd]. + * PATCH registers a new PATCH route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - wait(): void + patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * Output runs the command and returns its standard output. - * Any returned error will usually be of type [*ExitError]. - * If c.Stderr was nil, Output populates [ExitError.Stderr]. + * POST registers a new POST route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - output(): string|Array + post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * CombinedOutput runs the command and returns its combined standard - * output and standard error. + * PUT registers a new PUT route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - combinedOutput(): string|Array + put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * StdinPipe returns a pipe that will be connected to the command's - * standard input when the command starts. - * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. - * A caller need only call Close to force the pipe to close sooner. - * For example, if the command being run will not exit until standard input - * is closed, the caller must close the pipe. + * TRACE registers a new TRACE route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - stdinPipe(): io.WriteCloser + trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * StdoutPipe returns a pipe that will be connected to the command's - * standard output when the command starts. + * RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) + * for current request URL. + * Path supports static and named/any parameters just like other http method is defined. Generally path is ended with + * wildcard/match-any character (`/*`, `/download/*` etc). * - * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. - * See the example for idiomatic usage. + * Example: `e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` */ - stdoutPipe(): io.ReadCloser + routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Cmd { + interface Echo { /** - * StderrPipe returns a pipe that will be connected to the command's - * standard error when the command starts. + * Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler + * in the router with optional route-level middleware. * - * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. - * See the StdoutPipe example for idiomatic usage. + * Note: this method only adds specific set of supported HTTP methods as handler and is not true + * "catch-any-arbitrary-method" way of matching requests. */ - stderrPipe(): io.ReadCloser + any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Cmd { + interface Echo { /** - * Environ returns a copy of the environment in which the command would be run - * as it is currently configured. + * Match registers a new route for multiple HTTP methods and path with matching + * handler in the router with optional route-level middleware. Panics on error. */ - environ(): Array + match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } -} - -/** - * Package s3 provides the API client, operations, and parameter types for Amazon - * Simple Storage Service. - */ -namespace s3 { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import awshttp = http - // @ts-ignore - import internalauth = auth - // @ts-ignore - import internalauthsmithy = smithy - // @ts-ignore - import internalConfig = configsources - // @ts-ignore - import internalmiddleware = middleware - // @ts-ignore - import acceptencodingcust = accept_encoding - // @ts-ignore - import internalChecksum = checksum - // @ts-ignore - import presignedurlcust = presigned_url - // @ts-ignore - import s3sharedconfig = config - // @ts-ignore - import s3cust = customizations - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithyauth = auth - // @ts-ignore - import smithydocument = document - // @ts-ignore - import smithyhttp = http - /** - * Client provides the API client to make operations call for Amazon Simple - * Storage Service. - */ - interface Client { + interface Echo { + /** + * Static registers a new route with path prefix to serve static files from the provided root directory. + */ + static(pathPrefix: string, fsRoot: string): RouteInfo } - interface Client { + interface Echo { /** - * Options returns a copy of the client configuration. + * StaticFS registers a new route with path prefix to serve static files from the provided file system. * - * Callers SHOULD NOT perform mutations on any inner structures within client - * config. Config overrides should instead be made on a per-operation basis through - * functional options. + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - options(): Options + staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo } - interface Client { + interface Echo { /** - * This operation aborts a multipart upload. After a multipart upload is aborted, - * no additional parts can be uploaded using that upload ID. The storage consumed - * by any previously uploaded parts will be freed. However, if any part uploads are - * currently in progress, those part uploads might or might not succeed. As a - * result, it might be necessary to abort a given multipart upload multiple times - * in order to completely free all storage consumed by all parts. - * - * To verify that all parts have been removed and prevent getting charged for the - * part storage, you should call the [ListParts]API operation and ensure that the parts list - * is empty. - * - * ``` - * - Directory buckets - If multipart uploads in a directory bucket are in - * progress, you can't delete the bucket until all the in-progress multipart - * uploads are aborted or completed. To delete these in-progress multipart uploads, - * use the ListMultipartUploads operation to list the in-progress multipart - * uploads in the bucket and use the AbortMultupartUpload operation to abort all - * the in-progress multipart uploads. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * ``` - * - * Permissions - * - * ``` - * - General purpose bucket permissions - For information about permissions - * required to use the multipart upload, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to AbortMultipartUpload : - * - * [CreateMultipartUpload] - * - * [UploadPart] - * - * [CompleteMultipartUpload] - * - * [ListParts] - * - * [ListMultipartUploads] - * - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * FileFS registers a new route with path to serve file from the provided file system. */ - abortMultipartUpload(ctx: context.Context, params: AbortMultipartUploadInput, ...optFns: ((_arg0: Options) => void)[]): (AbortMultipartUploadOutput) + fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo } - interface Client { + interface Echo { /** - * Completes a multipart upload by assembling previously uploaded parts. - * - * You first initiate the multipart upload and then upload all parts using the [UploadPart] - * operation or the [UploadPartCopy]operation. After successfully uploading all relevant parts of - * an upload, you call this CompleteMultipartUpload operation to complete the - * upload. Upon receiving this request, Amazon S3 concatenates all the parts in - * ascending order by part number to create a new object. In the - * CompleteMultipartUpload request, you must provide the parts list and ensure that - * the parts list is complete. The CompleteMultipartUpload API operation - * concatenates the parts that you provide in the list. For each part in the list, - * you must provide the PartNumber value and the ETag value that are returned - * after that part was uploaded. - * - * The processing of a CompleteMultipartUpload request could take several minutes - * to finalize. After Amazon S3 begins processing the request, it sends an HTTP - * response header that specifies a 200 OK response. While processing is in - * progress, Amazon S3 periodically sends white space characters to keep the - * connection from timing out. A request could fail after the initial 200 OK - * response has been sent. This means that a 200 OK response can contain either a - * success or an error. The error response might be embedded in the 200 OK - * response. If you call this API operation directly, make sure to design your - * application to parse the contents of the response and handle it appropriately. - * If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect - * the embedded error and apply error handling per your configuration settings - * (including automatically retrying the request as appropriate). If the condition - * persists, the SDKs throw an exception (or, for the SDKs that don't use - * exceptions, they return an error). - * - * Note that if CompleteMultipartUpload fails, applications should be prepared to - * retry any failed requests (including 500 error responses). For more information, - * see [Amazon S3 Error Best Practices]. - * - * You can't use Content-Type: application/x-www-form-urlencoded for the - * CompleteMultipartUpload requests. Also, if you don't provide a Content-Type - * header, CompleteMultipartUpload can still return a 200 OK response. - * - * For more information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Zonal endpoint. These endpoints support virtual-hosted-style - * requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Permissions - * ``` - * - General purpose bucket permissions - For information about permissions - * required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. - * ``` - * - * If you provide an [additional checksum value]in your MultipartUpload requests and the object is encrypted - * - * ``` - * with Key Management Service, you must have permission to use the kms:Decrypt - * action for the CompleteMultipartUpload request to succeed. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * If the object is encrypted with SSE-KMS, you must also have the - * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` - * - * Special errors - * - * ``` - * - Error Code: EntityTooSmall - * - * - Description: Your proposed upload is smaller than the minimum allowed - * object size. Each part must be at least 5 MB in size, except the last part. - * - * - HTTP Status Code: 400 Bad Request - * - * - Error Code: InvalidPart - * - * - Description: One or more of the specified parts could not be found. The - * part might not have been uploaded, or the specified ETag might not have matched - * the uploaded part's ETag. - * - * - HTTP Status Code: 400 Bad Request - * - * - Error Code: InvalidPartOrder - * - * - Description: The list of parts was not in ascending order. The parts list - * must be specified in order by part number. - * - * - HTTP Status Code: 400 Bad Request - * - * - Error Code: NoSuchUpload - * - * - Description: The specified multipart upload does not exist. The upload ID - * might be invalid, or the multipart upload might have been aborted or completed. - * - * - HTTP Status Code: 404 Not Found - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to CompleteMultipartUpload : - * - * [CreateMultipartUpload] - * - * [UploadPart] - * - * [AbortMultipartUpload] - * - * [ListParts] - * - * [ListMultipartUploads] - * - * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html - * [Amazon S3 Error Best Practices]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [additional checksum value]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html - * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html - * - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * File registers a new route with path to serve a static file with optional route-level middleware. Panics on error. */ - completeMultipartUpload(ctx: context.Context, params: CompleteMultipartUploadInput, ...optFns: ((_arg0: Options) => void)[]): (CompleteMultipartUploadOutput) + file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Client { + interface Echo { /** - * Creates a copy of an object that is already stored in Amazon S3. - * - * You can store individual objects of up to 5 TB in Amazon S3. You create a copy - * of your object up to 5 GB in size in a single atomic action using this API. - * However, to copy an object greater than 5 GB, you must use the multipart upload - * Upload Part - Copy (UploadPartCopy) API. For more information, see [Copy Object Using the REST Multipart Upload API]. - * - * You can copy individual objects between general purpose buckets, between - * directory buckets, and between general purpose buckets and directory buckets. - * - * ``` - * - Amazon S3 supports copy operations using Multi-Region Access Points only as - * a destination when using the Multi-Region Access Point ARN. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * - * - VPC endpoints don't support cross-Region requests (including copies). If - * you're using VPC endpoints, your source and destination buckets should be in the - * same Amazon Web Services Region as your VPC endpoint. - * ``` - * - * Both the Region that you want to copy the object from and the Region that you - * want to copy the object to must be enabled for your account. For more - * information about how to enable a Region for your account, see [Enable or disable a Region for standalone accounts]in the Amazon - * Web Services Account Management Guide. - * - * Amazon S3 transfer acceleration does not support cross-Region copies. If you - * request a cross-Region copy using a transfer acceleration endpoint, you get a - * 400 Bad Request error. For more information, see [Transfer Acceleration]. - * - * Authentication and authorization All CopyObject requests must be authenticated - * and signed by using IAM credentials (access key ID and secret access key for the - * IAM identities). All headers with the x-amz- prefix, including x-amz-copy-source - * , must be signed. For more information, see [REST Authentication]. - * - * Directory buckets - You must use the IAM credentials to authenticate and - * authorize your access to the CopyObject API operation, instead of using the - * temporary security credentials through the CreateSession API operation. - * - * Amazon Web Services CLI or SDKs handles authentication and authorization on - * your behalf. - * - * Permissions You must have read access to the source object and write access to - * the destination bucket. - * - * ``` - * - General purpose bucket permissions - You must have permissions in an IAM - * policy based on the source and destination bucket types in a CopyObject - * operation. - * - * - If the source object is in a general purpose bucket, you must have - * s3:GetObject permission to read the source object that is being copied. - * - * - If the destination bucket is a general purpose bucket, you must have - * s3:PutObject permission to write the object copy to the destination bucket. - * - * - Directory bucket permissions - You must have permissions in a bucket policy - * or an IAM identity-based policy based on the source and destination bucket types - * in a CopyObject operation. - * - * - If the source object that you want to copy is in a directory bucket, you - * must have the s3express:CreateSession permission in the Action element of a - * policy to read the object. By default, the session is in the ReadWrite mode. - * If you want to restrict the access, you can explicitly set the - * s3express:SessionMode condition key to ReadOnly on the copy source bucket. - * - * - If the copy destination is a directory bucket, you must have the - * s3express:CreateSession permission in the Action element of a policy to write - * the object to the destination. The s3express:SessionMode condition key can't - * be set to ReadOnly on the copy destination bucket. - * ``` - * - * If the object is encrypted with SSE-KMS, you must also have the - * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` - * - * For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. - * - * Response and special errors When the request is an HTTP 1.1 request, the - * response is chunk encoded. When the request is not an HTTP 1.1 request, the - * response would not contain the Content-Length . You always need to read the - * entire response body to check if the copy succeeds. - * - * ``` - * - If the copy is successful, you receive a response with information about - * the copied object. - * - * - A copy request might return an error when Amazon S3 receives the copy - * request or while Amazon S3 is copying the files. A 200 OK response can contain - * either a success or an error. - * - * - If the error occurs before the copy action starts, you receive a standard - * Amazon S3 error. - * - * - If the error occurs during the copy operation, the error response is - * embedded in the 200 OK response. For example, in a cross-region copy, you may - * encounter throttling and receive a 200 OK response. For more information, see [Resolve the Error 200 response when copying objects to Amazon S3] - * . The 200 OK status code means the copy was accepted, but it doesn't mean the - * copy is complete. Another example is when you disconnect from Amazon S3 before - * the copy is complete, Amazon S3 might cancel the copy and you may receive a - * 200 OK response. You must stay connected to Amazon S3 until the entire - * response is successfully received and processed. - * ``` - * - * If you call this API operation directly, make sure to design your application - * - * ``` - * to parse the content of the response and handle it appropriately. If you use - * Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the - * embedded error and apply error handling per your configuration settings - * (including automatically retrying the request as appropriate). If the condition - * persists, the SDKs throw an exception (or, for the SDKs that don't use - * exceptions, they return an error). - * ``` - * - * Charge The copy request charge is based on the storage class and Region that - * you specify for the destination object. The request can also result in a data - * retrieval charge for the source if the source storage class bills for data - * retrieval. If the copy source is in a different region, the data transfer is - * billed to the copy source account. For pricing information, see [Amazon S3 pricing]. - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to CopyObject : - * - * [PutObject] - * - * [GetObject] - * - * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html - * [Resolve the Error 200 response when copying objects to Amazon S3]: https://repost.aws/knowledge-center/s3-resolve-200-internalerror - * [Copy Object Using the REST Multipart Upload API]: https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html - * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Enable or disable a Region for standalone accounts]: https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html#manage-acct-regions-enable-standalone - * [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [Amazon S3 pricing]: http://aws.amazon.com/s3/pricing/ + * AddRoute registers a new Route with default host Router */ - copyObject(ctx: context.Context, params: CopyObjectInput, ...optFns: ((_arg0: Options) => void)[]): (CopyObjectOutput) + addRoute(route: Routable): RouteInfo } - interface Client { + interface Echo { /** - * This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts - * bucket, see [CreateBucket]CreateBucket . - * - * Creates a new S3 bucket. To create a bucket, you must set up Amazon S3 and have - * a valid Amazon Web Services Access Key ID to authenticate requests. Anonymous - * requests are never allowed to create buckets. By creating the bucket, you become - * the bucket owner. - * - * There are two types of buckets: general purpose buckets and directory buckets. - * For more information about these bucket types, see [Creating, configuring, and working with Amazon S3 buckets]in the Amazon S3 User Guide. - * - * ``` - * - General purpose buckets - If you send your CreateBucket request to the - * s3.amazonaws.com global endpoint, the request goes to the us-east-1 Region. So - * the signature calculations in Signature Version 4 must use us-east-1 as the - * Region, even if the location constraint in the request specifies another Region - * where the bucket is to be created. If you create a bucket in a Region other than - * US East (N. Virginia), your application must be able to handle 307 redirect. For - * more information, see [Virtual hosting of buckets]in the Amazon S3 User Guide. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Regional endpoint. These endpoints support path-style - * requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * ``` - * - * Permissions - * - * ``` - * - General purpose bucket permissions - In addition to the s3:CreateBucket - * permission, the following permissions are required in a policy when your - * CreateBucket request includes specific headers: - * - * - Access control lists (ACLs) - In your CreateBucket request, if you specify - * an access control list (ACL) and set it to public-read , public-read-write , - * authenticated-read , or if you explicitly specify any other custom ACLs, both - * s3:CreateBucket and s3:PutBucketAcl permissions are required. In your - * CreateBucket request, if you set the ACL to private , or if you don't specify - * any ACLs, only the s3:CreateBucket permission is required. - * - * - Object Lock - In your CreateBucket request, if you set - * x-amz-bucket-object-lock-enabled to true, the - * s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning permissions are - * required. - * - * - S3 Object Ownership - If your CreateBucket request includes the - * x-amz-object-ownership header, then the s3:PutBucketOwnershipControls - * permission is required. - * ``` - * - * To set an ACL on a bucket as part of a CreateBucket request, you must explicitly - * - * ``` - * set S3 Object Ownership for the bucket to a different value than the default, - * BucketOwnerEnforced . Additionally, if your desired bucket ACL grants public - * access, you must first create the bucket (without the bucket ACL) and then - * explicitly disable Block Public Access on the bucket before using PutBucketAcl - * to set the ACL. If you try to create a bucket with a public ACL, the request - * will fail. - * ``` - * - * For the majority of modern use cases in S3, we recommend that you keep all - * - * ``` - * Block Public Access settings enabled and keep ACLs disabled. If you would like - * to share data with users outside of your account, you can use bucket policies as - * needed. For more information, see [Controlling ownership of objects and disabling ACLs for your bucket]and [Blocking public access to your Amazon S3 storage]in the Amazon S3 User Guide. - * - * - S3 Block Public Access - If your specific use case requires granting public - * access to your S3 resources, you can disable Block Public Access. Specifically, - * you can create a new bucket with Block Public Access enabled, then separately - * call the [DeletePublicAccessBlock]DeletePublicAccessBlock API. To use this operation, you must have the - * s3:PutBucketPublicAccessBlock permission. For more information about S3 Block - * Public Access, see [Blocking public access to your Amazon S3 storage]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - You must have the s3express:CreateBucket - * permission in an IAM identity-based policy instead of a bucket policy. - * Cross-account access to this API operation isn't supported. This operation can - * only be performed by the Amazon Web Services account that owns the resource. For - * more information about directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the - * Amazon S3 User Guide. - * ``` - * - * The permissions for ACLs, Object Lock, S3 Object Ownership, and S3 Block Public - * - * ``` - * Access are not supported for directory buckets. For directory buckets, all Block - * Public Access settings are enabled at the bucket level and S3 Object Ownership - * is set to Bucket owner enforced (ACLs disabled). These settings can't be - * modified. - * ``` - * - * For more information about permissions for creating and working with directory - * - * ``` - * buckets, see [Directory buckets]in the Amazon S3 User Guide. For more information about - * supported S3 features for directory buckets, see [Features of S3 Express One Zone]in the Amazon S3 User Guide. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * The following operations are related to CreateBucket : - * - * [PutObject] - * - * [DeleteBucket] - * - * [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html - * [Virtual hosting of buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html - * - * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html - * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html - * [Features of S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-one-zone.html#s3-express-features - * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - * [Blocking public access to your Amazon S3 storage]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * Add registers a new route for an HTTP method and path with matching handler + * in the router with optional route-level middleware. */ - createBucket(ctx: context.Context, params: CreateBucketInput, ...optFns: ((_arg0: Options) => void)[]): (CreateBucketOutput) + add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Client { + interface Echo { /** - * This action initiates a multipart upload and returns an upload ID. This upload - * ID is used to associate all of the parts in the specific multipart upload. You - * specify this upload ID in each of your subsequent upload part requests (see [UploadPart]). - * You also include this upload ID in the final request to either complete or abort - * the multipart upload request. For more information about multipart uploads, see [Multipart Upload Overview] - * in the Amazon S3 User Guide. - * - * After you initiate a multipart upload and upload one or more parts, to stop - * being charged for storing the uploaded parts, you must either complete or abort - * the multipart upload. Amazon S3 frees up the space used to store the parts and - * stops charging you for storing them only after you either complete or abort a - * multipart upload. - * - * If you have configured a lifecycle rule to abort incomplete multipart uploads, - * the created multipart upload must be completed within the number of days - * specified in the bucket lifecycle configuration. Otherwise, the incomplete - * multipart upload becomes eligible for an abort action and Amazon S3 aborts the - * multipart upload. For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]. - * - * ``` - * - Directory buckets - S3 Lifecycle is not supported by directory buckets. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * ``` - * - * Request signing For request signing, multipart upload is just a series of - * regular requests. You initiate a multipart upload, send one or more requests to - * upload parts, and then complete the multipart upload process. You sign each - * request individually. There is nothing special about signing multipart upload - * requests. For more information about signing, see [Authenticating Requests (Amazon Web Services Signature Version 4)]in the Amazon S3 User Guide. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - To perform a multipart upload with - * encryption using an Key Management Service (KMS) KMS key, the requester must - * have permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. - * The requester must also have permissions for the kms:GenerateDataKey action - * for the CreateMultipartUpload API. Then, the requester needs permissions for - * the kms:Decrypt action on the UploadPart and UploadPartCopy APIs. These - * permissions are required because Amazon S3 must decrypt and read data from the - * encrypted file parts before it completes the multipart upload. For more - * information, see [Multipart upload API and permissions]and [Protecting data using server-side encryption with Amazon Web Services KMS]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * Encryption - * - * ``` - * - General purpose buckets - Server-side encryption is for data encryption at - * rest. Amazon S3 encrypts your data as it writes it to disks in its data centers - * and decrypts it when you access it. Amazon S3 automatically encrypts all new - * objects that are uploaded to an S3 bucket. When doing a multipart upload, if you - * don't specify encryption information in your request, the encryption setting of - * the uploaded parts is set to the default encryption configuration of the - * destination bucket. By default, all buckets have a base level of encryption - * configuration that uses server-side encryption with Amazon S3 managed keys - * (SSE-S3). If the destination bucket has a default encryption configuration that - * uses server-side encryption with an Key Management Service (KMS) key (SSE-KMS), - * or a customer-provided encryption key (SSE-C), Amazon S3 uses the corresponding - * KMS key, or a customer-provided key to encrypt the uploaded parts. When you - * perform a CreateMultipartUpload operation, if you want to use a different type - * of encryption setting for the uploaded parts, you can request that Amazon S3 - * encrypts the object with a different encryption key (such as an Amazon S3 - * managed key, a KMS key, or a customer-provided key). When the encryption setting - * in your request is different from the default encryption configuration of the - * destination bucket, the encryption setting in your request takes precedence. If - * you choose to provide your own encryption key, the request headers you provide - * in [UploadPart]and [UploadPartCopy]requests must match the headers you used in the CreateMultipartUpload - * request. - * - * - Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key ( - * aws/s3 ) and KMS customer managed keys stored in Key Management Service (KMS) - * – If you want Amazon Web Services to manage the keys used to encrypt data, - * specify the following headers in the request. - * - * - x-amz-server-side-encryption - * - * - x-amz-server-side-encryption-aws-kms-key-id - * - * - x-amz-server-side-encryption-context - * - * - If you specify x-amz-server-side-encryption:aws:kms , but don't provide - * x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web - * Services managed key ( aws/s3 key) in KMS to protect the data. - * - * - To perform a multipart upload with encryption by using an Amazon Web - * Services KMS key, the requester must have permission to the kms:Decrypt and - * kms:GenerateDataKey* actions on the key. These permissions are required - * because Amazon S3 must decrypt and read data from the encrypted file parts - * before it completes the multipart upload. For more information, see [Multipart upload API and permissions]and [Protecting data using server-side encryption with Amazon Web Services KMS]in - * the Amazon S3 User Guide. - * - * - If your Identity and Access Management (IAM) user or role is in the same - * Amazon Web Services account as the KMS key, then you must have these permissions - * on the key policy. If your IAM user or role is in a different account from the - * key, then you must have the permissions on both the key policy and your IAM user - * or role. - * - * - All GET and PUT requests for an object protected by KMS fail if you don't - * make them by using Secure Sockets Layer (SSL), Transport Layer Security (TLS), - * or Signature Version 4. For information about configuring any of the officially - * supported Amazon Web Services SDKs and Amazon Web Services CLI, see [Specifying the Signature Version in Request Authentication]in the - * Amazon S3 User Guide. - * ``` - * - * For more information about server-side encryption with KMS keys (SSE-KMS), see [Protecting Data Using Server-Side Encryption with KMS keys] - * - * ``` - * in the Amazon S3 User Guide. - * - * - Use customer-provided encryption keys (SSE-C) – If you want to manage your - * own encryption keys, provide all the following headers in the request. - * - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information about server-side encryption with customer-provided - * - * ``` - * encryption keys (SSE-C), see [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]in the Amazon S3 User Guide. - * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: server-side encryption with Amazon S3 - * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys - * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses - * the desired encryption configuration and you don't override the bucket default - * encryption in your CreateSession requests or PUT object requests. Then, new - * objects are automatically encrypted with the desired encryption settings. For - * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about - * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. - * ``` - * - * In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the - * - * ``` - * encryption request headers must match the encryption settings that are specified - * in the CreateSession request. You can't override the values of the encryption - * settings ( x-amz-server-side-encryption , - * x-amz-server-side-encryption-aws-kms-key-id , - * x-amz-server-side-encryption-context , and - * x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the - * CreateSession request. You don't need to explicitly specify these encryption - * settings values in Zonal endpoint API calls, and Amazon S3 will use the - * encryption settings values from the CreateSession request to protect new - * objects in the directory bucket. - * ``` - * - * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the - * - * ``` - * session token refreshes automatically to avoid service interruptions when a - * session expires. The CLI or the Amazon Web Services SDKs use the bucket's - * default encryption configuration for the CreateSession request. It's not - * supported to override the encryption settings values in the CreateSession - * request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption - * request headers must match the default encryption configuration of the directory - * bucket. - * ``` - * - * For directory buckets, when you perform a CreateMultipartUpload operation and an - * - * ``` - * UploadPartCopy operation, the request headers you provide in the - * CreateMultipartUpload request must match the default encryption configuration - * of the destination bucket. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to CreateMultipartUpload : - * - * [UploadPart] - * - * [CompleteMultipartUpload] - * - * [AbortMultipartUpload] - * - * [ListParts] - * - * [ListMultipartUploads] - * - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Protecting Data Using Server-Side Encryption with KMS keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Specifying the Signature Version in Request Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version - * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [Authenticating Requests (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html - * [Protecting data using server-side encryption with Amazon Web Services KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html - * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html - * - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * Host creates a new router group for the provided host and optional host-level middleware. */ - createMultipartUpload(ctx: context.Context, params: CreateMultipartUploadInput, ...optFns: ((_arg0: Options) => void)[]): (CreateMultipartUploadOutput) + host(name: string, ...m: MiddlewareFunc[]): (Group) } - interface Client { + interface Echo { /** - * Creates a session that establishes temporary security credentials to support - * fast authentication and authorization for the Zonal endpoint API operations on - * directory buckets. For more information about Zonal endpoint API operations that - * include the Availability Zone in the request endpoint, see [S3 Express One Zone APIs]in the Amazon S3 - * User Guide. - * - * To make Zonal endpoint API requests on a directory bucket, use the CreateSession - * API operation. Specifically, you grant s3express:CreateSession permission to a - * bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM - * credentials to make the CreateSession API request on the bucket, which returns - * temporary security credentials that include the access key ID, secret access - * key, session token, and expiration. These credentials have associated - * permissions to access the Zonal endpoint API operations. After the session is - * created, you don’t need to use other policies to grant permissions to each Zonal - * endpoint API individually. Instead, in your Zonal endpoint API requests, you - * sign your requests by applying the temporary security credentials of the session - * to the request headers and following the SigV4 protocol for authentication. You - * also apply the session token to the x-amz-s3session-token request header for - * authorization. Temporary security credentials are scoped to the bucket and - * expire after 5 minutes. After the expiration time, any calls that you make with - * those credentials will fail. You must use IAM credentials again to make a - * CreateSession API request that generates a new set of temporary credentials for - * use. Temporary credentials cannot be extended or refreshed beyond the original - * specified interval. - * - * If you use Amazon Web Services SDKs, SDKs handle the session token refreshes - * automatically to avoid service interruptions when a session expires. We - * recommend that you use the Amazon Web Services SDKs to initiate and manage - * requests to the CreateSession API. For more information, see [Performance guidelines and design patterns]in the Amazon S3 - * User Guide. - * - * ``` - * - You must make requests for this API operation to the Zonal endpoint. These - * endpoints support virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests - * are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User Guide. - * - * - CopyObject API operation - Unlike other Zonal endpoint API operations, the - * CopyObject API operation doesn't use the temporary security credentials - * returned from the CreateSession API operation for authentication and - * authorization. For information about authentication and authorization of the - * CopyObject API operation on directory buckets, see [CopyObject]. - * - * - HeadBucket API operation - Unlike other Zonal endpoint API operations, the - * HeadBucket API operation doesn't use the temporary security credentials - * returned from the CreateSession API operation for authentication and - * authorization. For information about authentication and authorization of the - * HeadBucket API operation on directory buckets, see [HeadBucket]. - * ``` - * - * Permissions To obtain temporary security credentials, you must create a bucket - * policy or an IAM identity-based policy that grants s3express:CreateSession - * permission to the bucket. In a policy, you can have the s3express:SessionMode - * condition key to control who can create a ReadWrite or ReadOnly session. For - * more information about ReadWrite or ReadOnly sessions, see [x-amz-create-session-mode] - * x-amz-create-session-mode . For example policies, see [Example bucket policies for S3 Express One Zone] and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone] in the Amazon S3 - * User Guide. - * - * To grant cross-account access to Zonal endpoint API operations, the bucket - * policy should also grant both accounts the s3express:CreateSession permission. - * - * If you want to encrypt objects with SSE-KMS, you must also have the - * kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based - * policies and KMS key policies for the target KMS key. - * - * Encryption For directory buckets, there are only two supported options for - * server-side encryption: server-side encryption with Amazon S3 managed keys - * (SSE-S3) ( AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms - * ). We recommend that the bucket's default encryption uses the desired encryption - * configuration and you don't override the bucket default encryption in your - * CreateSession requests or PUT object requests. Then, new objects are - * automatically encrypted with the desired encryption settings. For more - * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about the - * encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. - * - * For [Zonal endpoint (object-level) API operations] except [CopyObject] and [UploadPartCopy], you authenticate and authorize requests through [CreateSession] for low - * latency. To encrypt new objects in a directory bucket with SSE-KMS, you must - * specify SSE-KMS as the directory bucket's default encryption configuration with - * a KMS key (specifically, a [customer managed key]). Then, when a session is created for Zonal - * endpoint API operations, new objects are automatically encrypted and decrypted - * with SSE-KMS and S3 Bucket Keys during the session. - * - * Only 1 [customer managed key] is supported per directory bucket for the lifetime of the bucket. [Amazon Web Services managed key] ( - * aws/s3 ) isn't supported. After you specify SSE-KMS as your bucket's default - * encryption configuration with a customer managed key, you can't change the - * customer managed key for the bucket's SSE-KMS configuration. - * - * In the Zonal endpoint API calls (except [CopyObject] and [UploadPartCopy]) using the REST API, you can't - * override the values of the encryption settings ( x-amz-server-side-encryption , - * x-amz-server-side-encryption-aws-kms-key-id , - * x-amz-server-side-encryption-context , and - * x-amz-server-side-encryption-bucket-key-enabled ) from the CreateSession - * request. You don't need to explicitly specify these encryption settings values - * in Zonal endpoint API calls, and Amazon S3 will use the encryption settings - * values from the CreateSession request to protect new objects in the directory - * bucket. - * - * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the - * session token refreshes automatically to avoid service interruptions when a - * session expires. The CLI or the Amazon Web Services SDKs use the bucket's - * default encryption configuration for the CreateSession request. It's not - * supported to override the encryption settings values in the CreateSession - * request. Also, in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), it's not - * supported to override the values of the encryption settings from the - * CreateSession request. - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [Performance guidelines and design patterns]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-optimizing-performance-guidelines-design-patterns.html#s3-express-optimizing-performance-session-authentication - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [S3 Express One Zone APIs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-APIs.html - * [HeadBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html - * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [x-amz-create-session-mode]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html#API_CreateSession_RequestParameters - * [Zonal endpoint (object-level) API operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-differences.html#s3-express-differences-api-operations - */ - createSession(ctx: context.Context, params: CreateSessionInput, ...optFns: ((_arg0: Options) => void)[]): (CreateSessionOutput) + * Group creates a new router group with prefix and optional group-level middleware. + */ + group(prefix: string, ...m: MiddlewareFunc[]): (Group) } - interface Client { + interface Echo { /** - * Deletes the S3 bucket. All objects (including all object versions and delete - * markers) in the bucket must be deleted before the bucket itself can be deleted. - * - * ``` - * - Directory buckets - If multipart uploads in a directory bucket are in - * progress, you can't delete the bucket until all the in-progress multipart - * uploads are aborted or completed. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Regional endpoint. These endpoints support path-style - * requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * ``` - * - * Permissions - * - * ``` - * - General purpose bucket permissions - You must have the s3:DeleteBucket - * permission on the specified bucket in a policy. - * - * - Directory bucket permissions - You must have the s3express:DeleteBucket - * permission in an IAM identity-based policy instead of a bucket policy. - * Cross-account access to this API operation isn't supported. This operation can - * only be performed by the Amazon Web Services account that owns the resource. For - * more information about directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the - * Amazon S3 User Guide. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * The following operations are related to DeleteBucket : - * - * [CreateBucket] - * - * [DeleteObject] - * - * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * AcquireContext returns an empty `Context` instance from the pool. + * You must return the context by calling `ReleaseContext()`. */ - deleteBucket(ctx: context.Context, params: DeleteBucketInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketOutput) + acquireContext(): Context } - interface Client { + interface Echo { /** - * This operation is not supported by directory buckets. - * - * Deletes an analytics configuration for the bucket (specified by the analytics - * configuration ID). - * - * To use this operation, you must have permissions to perform the - * s3:PutAnalyticsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about the Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis]. - * - * The following operations are related to DeleteBucketAnalyticsConfiguration : - * - * [GetBucketAnalyticsConfiguration] - * - * [ListBucketAnalyticsConfigurations] - * - * [PutBucketAnalyticsConfiguration] - * - * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html - * [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html - * [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * ReleaseContext returns the `Context` instance back to the pool. + * You must call it after `AcquireContext()`. */ - deleteBucketAnalyticsConfiguration(ctx: context.Context, params: DeleteBucketAnalyticsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketAnalyticsConfigurationOutput) + releaseContext(c: Context): void } - interface Client { + interface Echo { /** - * This operation is not supported by directory buckets. - * - * Deletes the cors configuration information set for the bucket. - * - * To use this operation, you must have permission to perform the s3:PutBucketCORS - * action. The bucket owner has this permission by default and can grant this - * permission to others. - * - * For information about cors , see [Enabling Cross-Origin Resource Sharing] in the Amazon S3 User Guide. - * - * # Related Resources - * - * [PutBucketCors] - * - * [RESTOPTIONSobject] - * - * [PutBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html - * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html - * [RESTOPTIONSobject]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html + * ServeHTTP implements `http.Handler` interface, which serves HTTP requests. */ - deleteBucketCors(ctx: context.Context, params: DeleteBucketCorsInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketCorsOutput) + serveHTTP(w: http.ResponseWriter, r: http.Request): void } - interface Client { + interface Echo { /** - * This implementation of the DELETE action resets the default encryption for the - * bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). - * - * ``` - * - General purpose buckets - For information about the bucket default - * encryption feature, see [Amazon S3 Bucket Default Encryption]in the Amazon S3 User Guide. + * Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by + * sending os.Interrupt signal with `ctrl+c`. * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: SSE-S3 and SSE-KMS. For information about - * the default encryption configuration in directory buckets, see [Setting default server-side encryption behavior for directory buckets]. - * ``` + * Note: this method is created for use in examples/demos and is deliberately simple without providing configuration + * options. * - * Permissions + * In need of customization use: * * ``` - * - General purpose bucket permissions - The s3:PutEncryptionConfiguration - * permission is required in a policy. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * - Directory bucket permissions - To grant access to this API operation, you - * must have the s3express:PutEncryptionConfiguration permission in an IAM - * identity-based policy instead of a bucket policy. Cross-account access to this - * API operation isn't supported. This operation can only be performed by the - * Amazon Web Services account that owns the resource. For more information about - * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. + * sc := echo.StartConfig{Address: ":8080"} + * if err := sc.Start(e); err != http.ErrServerClosed { + * log.Fatal(err) + * } * ``` * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * The following operations are related to DeleteBucketEncryption : - * - * [PutBucketEncryption] - * - * [GetBucketEncryption] - * - * [GetBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html - * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html - * [Setting default server-side encryption behavior for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html - * [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html - */ - deleteBucketEncryption(ctx: context.Context, params: DeleteBucketEncryptionInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketEncryptionOutput) - } - interface Client { - /** - * This operation is not supported by directory buckets. - * - * Deletes the S3 Intelligent-Tiering configuration from the specified bucket. - * - * The S3 Intelligent-Tiering storage class is designed to optimize storage costs - * by automatically moving data to the most cost-effective storage access tier, - * without performance impact or operational overhead. S3 Intelligent-Tiering - * delivers automatic cost savings in three low latency and high throughput access - * tiers. To get the lowest storage cost on data that can be accessed in minutes to - * hours, you can choose to activate additional archiving capabilities. - * - * The S3 Intelligent-Tiering storage class is the ideal storage class for data - * with unknown, changing, or unpredictable access patterns, independent of object - * size or retention period. If the size of an object is less than 128 KB, it is - * not monitored and not eligible for auto-tiering. Smaller objects can be stored, - * but they are always charged at the Frequent Access tier rates in the S3 - * Intelligent-Tiering storage class. - * - * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. - * - * Operations related to DeleteBucketIntelligentTieringConfiguration include: - * - * [GetBucketIntelligentTieringConfiguration] - * - * [PutBucketIntelligentTieringConfiguration] - * - * [ListBucketIntelligentTieringConfigurations] - * - * [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html - * [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html - * [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access - */ - deleteBucketIntelligentTieringConfiguration(ctx: context.Context, params: DeleteBucketIntelligentTieringConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketIntelligentTieringConfigurationOutput) - } - interface Client { - /** - * This operation is not supported by directory buckets. - * - * Deletes an inventory configuration (identified by the inventory ID) from the - * bucket. - * - * To use this operation, you must have permissions to perform the - * s3:PutInventoryConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory]. - * - * Operations related to DeleteBucketInventoryConfiguration include: - * - * [GetBucketInventoryConfiguration] - * - * [PutBucketInventoryConfiguration] - * - * [ListBucketInventoryConfigurations] + * // or standard library `http.Server` * - * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html - * [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html - * [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html + * ``` + * s := http.Server{Addr: ":8080", Handler: e} + * if err := s.ListenAndServe(); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * ``` */ - deleteBucketInventoryConfiguration(ctx: context.Context, params: DeleteBucketInventoryConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketInventoryConfigurationOutput) + start(address: string): void } - interface Client { - /** - * This operation is not supported by directory buckets. - * - * Deletes the lifecycle configuration from the specified bucket. Amazon S3 - * removes all the lifecycle configuration rules in the lifecycle subresource - * associated with the bucket. Your objects never expire, and Amazon S3 no longer - * automatically deletes any objects on the basis of rules contained in the deleted - * lifecycle configuration. - * - * To use this operation, you must have permission to perform the - * s3:PutLifecycleConfiguration action. By default, the bucket owner has this - * permission and the bucket owner can grant this permission to others. - * - * There is usually some time lag before lifecycle configuration deletion is fully - * propagated to all the Amazon S3 systems. - * - * For more information about the object expiration, see [Elements to Describe Lifecycle Actions]. - * - * Related actions include: - * - * [PutBucketLifecycleConfiguration] - * - * [GetBucketLifecycleConfiguration] - * - * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html - * [Elements to Describe Lifecycle Actions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions - * [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html - */ - deleteBucketLifecycle(ctx: context.Context, params: DeleteBucketLifecycleInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketLifecycleOutput) +} + +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { + /** + * Reader reads bytes from a blob. + * It implements io.ReadSeekCloser, and must be closed after + * reads are finished. + */ + interface Reader { } - interface Client { + interface Reader { /** - * This operation is not supported by directory buckets. - * - * Deletes a metrics configuration for the Amazon CloudWatch request metrics - * (specified by the metrics configuration ID) from the bucket. Note that this - * doesn't include the daily storage metrics. - * - * To use this operation, you must have permissions to perform the - * s3:PutMetricsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. - * - * The following operations are related to DeleteBucketMetricsConfiguration : - * - * [GetBucketMetricsConfiguration] - * - * [PutBucketMetricsConfiguration] - * - * [ListBucketMetricsConfigurations] - * - * [Monitoring Metrics with Amazon CloudWatch] - * - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html - * [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html - * [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html - * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * Read implements io.Reader (https://golang.org/pkg/io/#Reader). */ - deleteBucketMetricsConfiguration(ctx: context.Context, params: DeleteBucketMetricsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketMetricsConfigurationOutput) + read(p: string|Array): number } - interface Client { + interface Reader { /** - * This operation is not supported by directory buckets. - * - * Removes OwnershipControls for an Amazon S3 bucket. To use this operation, you - * must have the s3:PutBucketOwnershipControls permission. For more information - * about Amazon S3 permissions, see [Specifying Permissions in a Policy]. - * - * For information about Amazon S3 Object Ownership, see [Using Object Ownership]. - * - * The following operations are related to DeleteBucketOwnershipControls : - * - * # GetBucketOwnershipControls - * - * # PutBucketOwnershipControls - * - * [Using Object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). */ - deleteBucketOwnershipControls(ctx: context.Context, params: DeleteBucketOwnershipControlsInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketOwnershipControlsOutput) + seek(offset: number, whence: number): number } - interface Client { + interface Reader { /** - * Deletes the policy of a specified bucket. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Regional endpoint. These endpoints support path-style requests - * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * - * Permissions If you are using an identity other than the root user of the Amazon - * Web Services account that owns the bucket, the calling identity must both have - * the DeleteBucketPolicy permissions on the specified bucket and belong to the - * bucket owner's account in order to use this operation. - * - * If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 - * Access Denied error. If you have the correct permissions, but you're not using - * an identity that belongs to the bucket owner's account, Amazon S3 returns a 405 - * Method Not Allowed error. - * - * To ensure that bucket owners don't inadvertently lock themselves out of their - * own buckets, the root principal in a bucket owner's Amazon Web Services account - * can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API - * actions, even if their bucket policy explicitly denies the root principal's - * access. Bucket owner root principals can only be blocked from performing these - * API actions by VPC endpoint policies and Amazon Web Services Organizations - * policies. - * - * ``` - * - General purpose bucket permissions - The s3:DeleteBucketPolicy permission is - * required in a policy. For more information about general purpose buckets bucket - * policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation, you - * must have the s3express:DeleteBucketPolicy permission in an IAM identity-based - * policy instead of a bucket policy. Cross-account access to this API operation - * isn't supported. This operation can only be performed by the Amazon Web Services - * account that owns the resource. For more information about directory bucket - * policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * # The following operations are related to DeleteBucketPolicy - * - * [CreateBucket] - * - * [DeleteObject] - * - * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * Close implements io.Closer (https://golang.org/pkg/io/#Closer). */ - deleteBucketPolicy(ctx: context.Context, params: DeleteBucketPolicyInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketPolicyOutput) + close(): void } - interface Client { + interface Reader { /** - * This operation is not supported by directory buckets. - * - * Deletes the replication configuration from the bucket. - * - * To use this operation, you must have permissions to perform the - * s3:PutReplicationConfiguration action. The bucket owner has these permissions by - * default and can grant it to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] - * and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * It can take a while for the deletion of a replication configuration to fully - * propagate. - * - * For information about replication configuration, see [Replication] in the Amazon S3 User - * Guide. - * - * The following operations are related to DeleteBucketReplication : - * - * [PutBucketReplication] - * - * [GetBucketReplication] - * - * [GetBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [PutBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * ContentType returns the MIME type of the blob. */ - deleteBucketReplication(ctx: context.Context, params: DeleteBucketReplicationInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketReplicationOutput) + contentType(): string } - interface Client { + interface Reader { /** - * This operation is not supported by directory buckets. - * - * Deletes the tags from the bucket. - * - * To use this operation, you must have permission to perform the - * s3:PutBucketTagging action. By default, the bucket owner has this permission and - * can grant this permission to others. - * - * The following operations are related to DeleteBucketTagging : - * - * [GetBucketTagging] - * - * [PutBucketTagging] - * - * [GetBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html - * [PutBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html + * ModTime returns the time the blob was last modified. */ - deleteBucketTagging(ctx: context.Context, params: DeleteBucketTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketTaggingOutput) + modTime(): time.Time } - interface Client { + interface Reader { /** - * This operation is not supported by directory buckets. - * - * This action removes the website configuration for a bucket. Amazon S3 returns a - * 200 OK response upon successfully deleting a website configuration on the - * specified bucket. You will get a 200 OK response if the website configuration - * you are trying to delete does not exist on the bucket. Amazon S3 returns a 404 - * response if the bucket specified in the request does not exist. - * - * This DELETE action requires the S3:DeleteBucketWebsite permission. By default, - * only the bucket owner can delete the website configuration attached to a bucket. - * However, bucket owners can grant other users permission to delete the website - * configuration by writing a bucket policy granting them the - * S3:DeleteBucketWebsite permission. - * - * For more information about hosting websites, see [Hosting Websites on Amazon S3]. - * - * The following operations are related to DeleteBucketWebsite : - * - * [GetBucketWebsite] - * - * [PutBucketWebsite] - * - * [GetBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html - * [PutBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html - * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html + * Size returns the size of the blob content in bytes. */ - deleteBucketWebsite(ctx: context.Context, params: DeleteBucketWebsiteInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteBucketWebsiteOutput) + size(): number } - interface Client { + interface Reader { /** - * Removes an object from a bucket. The behavior depends on the bucket's - * versioning state: - * - * ``` - * - If bucket versioning is not enabled, the operation permanently deletes the - * object. - * - * - If bucket versioning is enabled, the operation inserts a delete marker, - * which becomes the current version of the object. To permanently delete an object - * in a versioned bucket, you must include the object’s versionId in the request. - * For more information about versioning-enabled buckets, see [Deleting object versions from a versioning-enabled bucket]. - * - * - If bucket versioning is suspended, the operation removes the object that - * has a null versionId , if there is one, and inserts a delete marker that - * becomes the current version of the object. If there isn't an object with a null - * versionId , and all versions of the object have a versionId , Amazon S3 does - * not remove the object and only inserts a delete marker. To permanently delete an - * object that has a versionId , you must include the object’s versionId in the - * request. For more information about versioning-suspended buckets, see [Deleting objects from versioning-suspended buckets]. - * - * - Directory buckets - S3 Versioning isn't enabled and supported for directory - * buckets. For this API operation, only the null value of the version ID is - * supported by directory buckets. You can only specify null to the versionId - * query parameter in the request. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * ``` - * - * To remove a specific version, you must use the versionId query parameter. Using - * this query parameter permanently deletes the version. If the object deleted is a - * delete marker, Amazon S3 sets the response header x-amz-delete-marker to true. - * - * If the object you want to delete is in a bucket where the bucket versioning - * configuration is MFA Delete enabled, you must include the x-amz-mfa request - * header in the DELETE versionId request. Requests that include x-amz-mfa must - * use HTTPS. For more information about MFA Delete, see [Using MFA Delete]in the Amazon S3 User - * Guide. To see sample requests that use versioning, see [Sample Request]. - * - * Directory buckets - MFA delete is not supported by directory buckets. - * - * You can delete objects by explicitly calling DELETE Object or calling ([PutBucketLifecycle] ) to - * enable Amazon S3 to remove them for you. If you want to block users or accounts - * from removing or deleting objects from your bucket, you must deny them the - * s3:DeleteObject , s3:DeleteObjectVersion , and s3:PutLifeCycleConfiguration - * actions. - * - * Directory buckets - S3 Lifecycle is not supported by directory buckets. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - The following permissions are required - * in your policies when your DeleteObjects request includes specific headers. - * - * - s3:DeleteObject - To delete an object from a bucket, you must always have - * the s3:DeleteObject permission. - * - * - s3:DeleteObjectVersion - To delete a specific version of an object from a - * versioning-enabled bucket, you must have the s3:DeleteObjectVersion permission. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following action is related to DeleteObject : - * - * [PutObject] - * - * [Sample Request]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Deleting objects from versioning-suspended buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [Deleting object versions from a versioning-enabled bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html - * [Using MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - deleteObject(ctx: context.Context, params: DeleteObjectInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteObjectOutput) + as(i: { + }): boolean } - interface Client { + interface Reader { /** - * This operation is not supported by directory buckets. - * - * Removes the entire tag set from the specified object. For more information - * about managing object tags, see [Object Tagging]. - * - * To use this operation, you must have permission to perform the - * s3:DeleteObjectTagging action. - * - * To delete tags of a specific object version, add the versionId query parameter - * in the request. You will need permission for the s3:DeleteObjectVersionTagging - * action. - * - * The following operations are related to DeleteObjectTagging : - * - * [PutObjectTagging] - * - * [GetObjectTagging] + * WriteTo reads from r and writes to w until there's no more data or + * an error occurs. + * The return value is the number of bytes written to w. * - * [PutObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html - * [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html - * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html + * It implements the io.WriterTo interface. */ - deleteObjectTagging(ctx: context.Context, params: DeleteObjectTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteObjectTaggingOutput) + writeTo(w: io.Writer): number } - interface Client { + /** + * Attributes contains attributes about a blob. + */ + interface Attributes { /** - * This operation enables you to delete multiple objects from a bucket using a - * single HTTP request. If you know the object keys that you want to delete, then - * this operation provides a suitable alternative to sending individual delete - * requests, reducing per-request overhead. - * - * The request can contain a list of up to 1000 keys that you want to delete. In - * the XML, you provide the object key names, and optionally, version IDs if you - * want to delete a specific version of the object from a versioning-enabled - * bucket. For each key, Amazon S3 performs a delete operation and returns the - * result of that delete, success or failure, in the response. Note that if the - * object specified in the request is not found, Amazon S3 returns the result as - * deleted. - * - * ``` - * - Directory buckets - S3 Versioning isn't enabled and supported for directory - * buckets. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * ``` - * - * The operation supports two modes for the response: verbose and quiet. By - * default, the operation uses verbose mode in which the response includes the - * result of deletion of each key in your request. In quiet mode the response - * includes only keys where the delete operation encountered an error. For a - * successful deletion in a quiet mode, the operation does not return any - * information about the delete in the response body. - * - * When performing this action on an MFA Delete enabled bucket, that attempts to - * delete any versioned objects, you must include an MFA token. If you do not - * provide one, the entire request will fail, even if there are non-versioned - * objects you are trying to delete. If you provide an invalid token, whether there - * are versioned keys in the request or not, the entire Multi-Object Delete request - * will fail. For information about MFA Delete, see [MFA Delete]in the Amazon S3 User Guide. - * - * Directory buckets - MFA delete is not supported by directory buckets. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - The following permissions are required - * in your policies when your DeleteObjects request includes specific headers. - * - * - s3:DeleteObject - To delete an object from a bucket, you must always specify - * the s3:DeleteObject permission. - * - * - s3:DeleteObjectVersion - To delete a specific version of an object from a - * versioning-enabled bucket, you must specify the s3:DeleteObjectVersion - * permission. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * Content-MD5 request header - * - * ``` - * - General purpose bucket - The Content-MD5 request header is required for all - * Multi-Object Delete requests. Amazon S3 uses the header value to ensure that - * your request body has not been altered in transit. - * - * - Directory bucket - The Content-MD5 request header or a additional checksum - * request header (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , - * x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is required for all - * Multi-Object Delete requests. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to DeleteObjects : - * - * [CreateMultipartUpload] - * - * [UploadPart] - * - * [CompleteMultipartUpload] - * - * [ListParts] - * - * [AbortMultipartUpload] - * - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control */ - deleteObjects(ctx: context.Context, params: DeleteObjectsInput, ...optFns: ((_arg0: Options) => void)[]): (DeleteObjectsOutput) - } - interface Client { + cacheControl: string /** - * This operation is not supported by directory buckets. - * - * Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use - * this operation, you must have the s3:PutBucketPublicAccessBlock permission. For - * more information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * The following operations are related to DeletePublicAccessBlock : - * - * [Using Amazon S3 Block Public Access] - * - * [GetPublicAccessBlock] - * - * [PutPublicAccessBlock] - * - * [GetBucketPolicyStatus] - * - * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html - * [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [GetBucketPolicyStatus]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition */ - deletePublicAccessBlock(ctx: context.Context, params: DeletePublicAccessBlockInput, ...optFns: ((_arg0: Options) => void)[]): (DeletePublicAccessBlockOutput) - } - interface Client { + contentDisposition: string /** - * This operation is not supported by directory buckets. - * - * This implementation of the GET action uses the accelerate subresource to return - * the Transfer Acceleration state of a bucket, which is either Enabled or - * Suspended . Amazon S3 Transfer Acceleration is a bucket-level feature that - * enables you to perform faster data transfers to and from Amazon S3. - * - * To use this operation, you must have permission to perform the - * s3:GetAccelerateConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to your Amazon S3 Resources] in the Amazon S3 User Guide. - * - * You set the Transfer Acceleration state of an existing bucket to Enabled or - * Suspended by using the [PutBucketAccelerateConfiguration] operation. - * - * A GET accelerate request does not return a state value for a bucket that has no - * transfer acceleration state. A bucket has no Transfer Acceleration state if a - * state has never been set on the bucket. - * - * For more information about transfer acceleration, see [Transfer Acceleration] in the Amazon S3 User - * Guide. - * - * The following operations are related to GetBucketAccelerateConfiguration : - * - * [PutBucketAccelerateConfiguration] - * - * [PutBucketAccelerateConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Managing Access Permissions to your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding */ - getBucketAccelerateConfiguration(ctx: context.Context, params: GetBucketAccelerateConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketAccelerateConfigurationOutput) - } - interface Client { + contentEncoding: string /** - * This operation is not supported by directory buckets. - * - * This implementation of the GET action uses the acl subresource to return the - * access control list (ACL) of a bucket. To use GET to return the ACL of the - * bucket, you must have the READ_ACP access to the bucket. If READ_ACP permission - * is granted to the anonymous user, you can return the ACL of the bucket without - * using an authorization header. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, - * requests to read ACLs are still supported and return the - * bucket-owner-full-control ACL with the owner being the account that created the - * bucket. For more information, see [Controlling object ownership and disabling ACLs]in the Amazon S3 User Guide. - * - * The following operations are related to GetBucketAcl : - * - * [ListObjects] - * - * [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * [Controlling object ownership and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language */ - getBucketAcl(ctx: context.Context, params: GetBucketAclInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketAclOutput) - } - interface Client { + contentLanguage: string /** - * This operation is not supported by directory buckets. - * - * This implementation of the GET action returns an analytics configuration - * (identified by the analytics configuration ID) from the bucket. - * - * To use this operation, you must have permissions to perform the - * s3:GetAnalyticsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources] in the Amazon S3 User Guide. - * - * For information about Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis] in the Amazon S3 User - * Guide. - * - * The following operations are related to GetBucketAnalyticsConfiguration : - * - * [DeleteBucketAnalyticsConfiguration] - * - * [ListBucketAnalyticsConfigurations] - * - * [PutBucketAnalyticsConfiguration] - * - * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html - * [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html - * [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * ContentType is the MIME type of the blob. It will not be empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type */ - getBucketAnalyticsConfiguration(ctx: context.Context, params: GetBucketAnalyticsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketAnalyticsConfigurationOutput) + contentType: string + /** + * Metadata holds key/value pairs associated with the blob. + * Keys are guaranteed to be in lowercase, even if the backend service + * has case-sensitive keys (although note that Metadata written via + * this package will always be lowercased). If there are duplicate + * case-insensitive keys (e.g., "foo" and "FOO"), only one value + * will be kept, and it is undefined which one. + */ + metadata: _TygojaDict + /** + * CreateTime is the time the blob was created, if available. If not available, + * CreateTime will be the zero time. + */ + createTime: time.Time + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string|Array + /** + * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + */ + eTag: string } - interface Client { + interface Attributes { /** - * This operation is not supported by directory buckets. - * - * Returns the Cross-Origin Resource Sharing (CORS) configuration information set - * for the bucket. - * - * To use this operation, you must have permission to perform the s3:GetBucketCORS - * action. By default, the bucket owner has this permission and can grant it to - * others. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * For more information about CORS, see [Enabling Cross-Origin Resource Sharing]. - * - * The following operations are related to GetBucketCors : - * - * [PutBucketCors] - * - * [DeleteBucketCors] - * - * [PutBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html - * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * [DeleteBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - getBucketCors(ctx: context.Context, params: GetBucketCorsInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketCorsOutput) + as(i: { + }): boolean } - interface Client { + /** + * ListObject represents a single blob returned from List. + */ + interface ListObject { /** - * Returns the default encryption configuration for an Amazon S3 bucket. By - * default, all buckets have a default encryption configuration that uses - * server-side encryption with Amazon S3 managed keys (SSE-S3). - * - * ``` - * - General purpose buckets - For information about the bucket default - * encryption feature, see [Amazon S3 Bucket Default Encryption]in the Amazon S3 User Guide. - * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: SSE-S3 and SSE-KMS. For information about - * the default encryption configuration in directory buckets, see [Setting default server-side encryption behavior for directory buckets]. - * ``` - * - * Permissions - * - * ``` - * - General purpose bucket permissions - The s3:GetEncryptionConfiguration - * permission is required in a policy. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * - Directory bucket permissions - To grant access to this API operation, you - * must have the s3express:GetEncryptionConfiguration permission in an IAM - * identity-based policy instead of a bucket policy. Cross-account access to this - * API operation isn't supported. This operation can only be performed by the - * Amazon Web Services account that owns the resource. For more information about - * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * The following operations are related to GetBucketEncryption : - * - * [PutBucketEncryption] - * - * [DeleteBucketEncryption] - * - * [DeleteBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html - * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html - * [Setting default server-side encryption behavior for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html - * [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * Key is the key for this blob. + */ + key: string + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string|Array + /** + * IsDir indicates that this result represents a "directory" in the + * hierarchical namespace, ending in ListOptions.Delimiter. Key can be + * passed as ListOptions.Prefix to list items in the "directory". + * Fields other than Key and IsDir will not be set if IsDir is true. */ - getBucketEncryption(ctx: context.Context, params: GetBucketEncryptionInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketEncryptionOutput) + isDir: boolean } - interface Client { + interface ListObject { /** - * This operation is not supported by directory buckets. - * - * Gets the S3 Intelligent-Tiering configuration from the specified bucket. - * - * The S3 Intelligent-Tiering storage class is designed to optimize storage costs - * by automatically moving data to the most cost-effective storage access tier, - * without performance impact or operational overhead. S3 Intelligent-Tiering - * delivers automatic cost savings in three low latency and high throughput access - * tiers. To get the lowest storage cost on data that can be accessed in minutes to - * hours, you can choose to activate additional archiving capabilities. - * - * The S3 Intelligent-Tiering storage class is the ideal storage class for data - * with unknown, changing, or unpredictable access patterns, independent of object - * size or retention period. If the size of an object is less than 128 KB, it is - * not monitored and not eligible for auto-tiering. Smaller objects can be stored, - * but they are always charged at the Frequent Access tier rates in the S3 - * Intelligent-Tiering storage class. - * - * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. - * - * Operations related to GetBucketIntelligentTieringConfiguration include: - * - * [DeleteBucketIntelligentTieringConfiguration] - * - * [PutBucketIntelligentTieringConfiguration] - * - * [ListBucketIntelligentTieringConfigurations] - * - * [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html - * [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access - * [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - getBucketIntelligentTieringConfiguration(ctx: context.Context, params: GetBucketIntelligentTieringConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketIntelligentTieringConfigurationOutput) + as(i: { + }): boolean } - interface Client { +} + +/** + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. + * + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. + * + * Drivers that do not support context cancellation will not return until + * after the query is completed. + * + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. + */ +namespace sql { + /** + * TxOptions holds the transaction options to be used in [DB.BeginTx]. + */ + interface TxOptions { /** - * This operation is not supported by directory buckets. - * - * Returns an inventory configuration (identified by the inventory configuration - * ID) from the bucket. - * - * To use this operation, you must have permissions to perform the - * s3:GetInventoryConfiguration action. The bucket owner has this permission by - * default and can grant this permission to others. For more information about - * permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory]. - * - * The following operations are related to GetBucketInventoryConfiguration : - * - * [DeleteBucketInventoryConfiguration] - * - * [ListBucketInventoryConfigurations] - * - * [PutBucketInventoryConfiguration] - * - * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html - * [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html + * Isolation is the transaction isolation level. + * If zero, the driver or database's default level is used. */ - getBucketInventoryConfiguration(ctx: context.Context, params: GetBucketInventoryConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketInventoryConfigurationOutput) + isolation: IsolationLevel + readOnly: boolean } - interface Client { + /** + * DB is a database handle representing a pool of zero or more + * underlying connections. It's safe for concurrent use by multiple + * goroutines. + * + * The sql package creates and frees connections automatically; it + * also maintains a free pool of idle connections. If the database has + * a concept of per-connection state, such state can be reliably observed + * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the + * returned [Tx] is bound to a single connection. Once [Tx.Commit] or + * [Tx.Rollback] is called on the transaction, that transaction's + * connection is returned to [DB]'s idle connection pool. The pool size + * can be controlled with [DB.SetMaxIdleConns]. + */ + interface DB { + } + interface DB { /** - * This operation is not supported by directory buckets. - * - * Bucket lifecycle configuration now supports specifying a lifecycle rule using - * an object key name prefix, one or more object tags, object size, or any - * combination of these. Accordingly, this section describes the latest API. The - * previous version of the API supported filtering based only on an object key name - * prefix, which is supported for backward compatibility. For the related API - * description, see [GetBucketLifecycle]. Accordingly, this section describes the latest API. The - * response describes the new filter element that you can use to specify a filter - * to select a subset of objects to which the rule applies. If you are using a - * previous version of the lifecycle configuration, it still works. For the earlier - * action, - * - * Returns the lifecycle configuration information set on the bucket. For - * information about lifecycle configuration, see [Object Lifecycle Management]. - * - * To use this operation, you must have permission to perform the - * s3:GetLifecycleConfiguration action. The bucket owner has this permission, by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * GetBucketLifecycleConfiguration has the following special error: - * - * ``` - * - Error code: NoSuchLifecycleConfiguration - * - * - Description: The lifecycle configuration does not exist. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * ``` - * - * The following operations are related to GetBucketLifecycleConfiguration : - * - * [GetBucketLifecycle] - * - * [PutBucketLifecycle] - * - * [DeleteBucketLifecycle] - * - * [GetBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html - * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html + * PingContext verifies a connection to the database is still alive, + * establishing a connection if necessary. */ - getBucketLifecycleConfiguration(ctx: context.Context, params: GetBucketLifecycleConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketLifecycleConfigurationOutput) + pingContext(ctx: context.Context): void } - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import smithyio = io - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the Region the bucket resides in. You set the bucket's Region using the - * LocationConstraint request parameter in a CreateBucket request. For more - * information, see [CreateBucket]. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * We recommend that you use [HeadBucket] to return the Region that a bucket resides in. For - * backward compatibility, Amazon S3 continues to support GetBucketLocation. - * - * The following operations are related to GetBucketLocation : - * - * [GetObject] - * - * [CreateBucket] + * Ping verifies a connection to the database is still alive, + * establishing a connection if necessary. * - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [HeadBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html + * Ping uses [context.Background] internally; to specify the context, use + * [DB.PingContext]. */ - getBucketLocation(ctx: context.Context, params: GetBucketLocationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketLocationOutput) + ping(): void } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the logging status of a bucket and the permissions users have to view - * and modify that status. - * - * The following operations are related to GetBucketLogging : - * - * [CreateBucket] - * - * [PutBucketLogging] + * Close closes the database and prevents new queries from starting. + * Close then waits for all queries that have started processing on the server + * to finish. * - * [PutBucketLogging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * It is rare to Close a [DB], as the [DB] handle is meant to be + * long-lived and shared between many goroutines. */ - getBucketLogging(ctx: context.Context, params: GetBucketLoggingInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketLoggingOutput) + close(): void } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Gets a metrics configuration (specified by the metrics configuration ID) from - * the bucket. Note that this doesn't include the daily storage metrics. - * - * To use this operation, you must have permissions to perform the - * s3:GetMetricsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. - * - * The following operations are related to GetBucketMetricsConfiguration : - * - * [PutBucketMetricsConfiguration] - * - * [DeleteBucketMetricsConfiguration] + * SetMaxIdleConns sets the maximum number of connections in the idle + * connection pool. * - * [ListBucketMetricsConfigurations] + * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, + * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. * - * [Monitoring Metrics with Amazon CloudWatch] + * If n <= 0, no idle connections are retained. * - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html - * [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html - * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html - * [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * The default max idle connections is currently 2. This may change in + * a future release. */ - getBucketMetricsConfiguration(ctx: context.Context, params: GetBucketMetricsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketMetricsConfigurationOutput) + setMaxIdleConns(n: number): void } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the notification configuration of a bucket. - * - * If notifications are not enabled on the bucket, the action returns an empty - * NotificationConfiguration element. - * - * By default, you must be the bucket owner to read the notification configuration - * of a bucket. However, the bucket owner can use a bucket policy to grant - * permission to other users to read this configuration with the - * s3:GetBucketNotification permission. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * For more information about setting and reading the notification configuration - * on a bucket, see [Setting Up Notification of Bucket Events]. For more information about bucket policies, see [Using Bucket Policies]. - * - * The following action is related to GetBucketNotification : + * SetMaxOpenConns sets the maximum number of open connections to the database. * - * [PutBucketNotification] + * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than + * MaxIdleConns, then MaxIdleConns will be reduced to match the new + * MaxOpenConns limit. * - * [Using Bucket Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html - * [Setting Up Notification of Bucket Events]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * [PutBucketNotification]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html + * If n <= 0, then there is no limit on the number of open connections. + * The default is 0 (unlimited). */ - getBucketNotificationConfiguration(ctx: context.Context, params: GetBucketNotificationConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketNotificationConfigurationOutput) + setMaxOpenConns(n: number): void } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you - * must have the s3:GetBucketOwnershipControls permission. For more information - * about Amazon S3 permissions, see [Specifying permissions in a policy]. - * - * For information about Amazon S3 Object Ownership, see [Using Object Ownership]. - * - * The following operations are related to GetBucketOwnershipControls : - * - * # PutBucketOwnershipControls + * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. * - * # DeleteBucketOwnershipControls + * Expired connections may be closed lazily before reuse. * - * [Using Object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - * [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html + * If d <= 0, connections are not closed due to a connection's age. */ - getBucketOwnershipControls(ctx: context.Context, params: GetBucketOwnershipControlsInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketOwnershipControlsOutput) + setConnMaxLifetime(d: time.Duration): void } - interface Client { + interface DB { /** - * Returns the policy of a specified bucket. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Regional endpoint. These endpoints support path-style requests - * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * - * Permissions If you are using an identity other than the root user of the Amazon - * Web Services account that owns the bucket, the calling identity must both have - * the GetBucketPolicy permissions on the specified bucket and belong to the - * bucket owner's account in order to use this operation. - * - * If you don't have GetBucketPolicy permissions, Amazon S3 returns a 403 Access - * Denied error. If you have the correct permissions, but you're not using an - * identity that belongs to the bucket owner's account, Amazon S3 returns a 405 - * Method Not Allowed error. - * - * To ensure that bucket owners don't inadvertently lock themselves out of their - * own buckets, the root principal in a bucket owner's Amazon Web Services account - * can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API - * actions, even if their bucket policy explicitly denies the root principal's - * access. Bucket owner root principals can only be blocked from performing these - * API actions by VPC endpoint policies and Amazon Web Services Organizations - * policies. - * - * ``` - * - General purpose bucket permissions - The s3:GetBucketPolicy permission is - * required in a policy. For more information about general purpose buckets bucket - * policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation, you - * must have the s3express:GetBucketPolicy permission in an IAM identity-based - * policy instead of a bucket policy. Cross-account access to this API operation - * isn't supported. This operation can only be performed by the Amazon Web Services - * account that owns the resource. For more information about directory bucket - * policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. - * ``` - * - * Example bucket policies General purpose buckets example bucket policies - See [Bucket policy examples] - * in the Amazon S3 User Guide. - * - * Directory bucket example bucket policies - See [Example bucket policies for S3 Express One Zone] in the Amazon S3 User Guide. + * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . + * Expired connections may be closed lazily before reuse. * - * The following action is related to GetBucketPolicy : - * - * [GetObject] - * - * [Bucket policy examples]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html - * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * If d <= 0, connections are not closed due to a connection's idle time. */ - getBucketPolicy(ctx: context.Context, params: GetBucketPolicyInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketPolicyOutput) + setConnMaxIdleTime(d: time.Duration): void } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Retrieves the policy status for an Amazon S3 bucket, indicating whether the - * bucket is public. In order to use this operation, you must have the - * s3:GetBucketPolicyStatus permission. For more information about Amazon S3 - * permissions, see [Specifying Permissions in a Policy]. - * - * For more information about when Amazon S3 considers a bucket public, see [The Meaning of "Public"]. - * - * The following operations are related to GetBucketPolicyStatus : - * - * [Using Amazon S3 Block Public Access] - * - * [GetPublicAccessBlock] - * - * [PutPublicAccessBlock] - * - * [DeletePublicAccessBlock] - * - * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html - * [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html - * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html - * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html - * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + * Stats returns database statistics. */ - getBucketPolicyStatus(ctx: context.Context, params: GetBucketPolicyStatusInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketPolicyStatusOutput) + stats(): DBStats } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the replication configuration of a bucket. - * - * It can take a while to propagate the put or delete a replication configuration - * to all Amazon S3 systems. Therefore, a get request soon after put or delete can - * return a wrong result. - * - * For information about replication configuration, see [Replication] in the Amazon S3 User - * Guide. - * - * This action requires permissions for the s3:GetReplicationConfiguration action. - * For more information about permissions, see [Using Bucket Policies and User Policies]. - * - * If you include the Filter element in a replication configuration, you must also - * include the DeleteMarkerReplication and Priority elements. The response also - * returns those elements. - * - * For information about GetBucketReplication errors, see [List of replication-related error codes] - * - * The following operations are related to GetBucketReplication : - * - * [PutBucketReplication] - * - * [DeleteBucketReplication] + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. * - * [PutBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html - * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html - * [List of replication-related error codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList - * [DeleteBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. */ - getBucketReplication(ctx: context.Context, params: GetBucketReplicationInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketReplicationOutput) + prepareContext(ctx: context.Context, query: string): (Stmt) } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the request payment configuration of a bucket. To use this version of - * the operation, you must be the bucket owner. For more information, see [Requester Pays Buckets]. - * - * The following operations are related to GetBucketRequestPayment : - * - * [ListObjects] + * Prepare creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. * - * [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html - * [Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html + * Prepare uses [context.Background] internally; to specify the context, use + * [DB.PrepareContext]. */ - getBucketRequestPayment(ctx: context.Context, params: GetBucketRequestPaymentInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketRequestPaymentOutput) + prepare(query: string): (Stmt) } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the tag set associated with the bucket. - * - * To use this operation, you must have permission to perform the - * s3:GetBucketTagging action. By default, the bucket owner has this permission and - * can grant this permission to others. - * - * GetBucketTagging has the following special error: - * - * ``` - * - Error code: NoSuchTagSet - * - * - Description: There is no tag set associated with the bucket. - * ``` - * - * The following operations are related to GetBucketTagging : - * - * [PutBucketTagging] - * - * [DeleteBucketTagging] - * - * [PutBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html - * [DeleteBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. */ - getBucketTagging(ctx: context.Context, params: GetBucketTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketTaggingOutput) + execContext(ctx: context.Context, query: string, ...args: any[]): Result } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the versioning state of a bucket. - * - * To retrieve the versioning state of a bucket, you must be the bucket owner. - * - * This implementation also returns the MFA Delete status of the versioning state. - * If the MFA Delete status is enabled , the bucket owner must use an - * authentication device to change the versioning state of the bucket. + * Exec executes a query without returning any rows. + * The args are for any placeholder parameters in the query. * - * The following operations are related to GetBucketVersioning : + * Exec uses [context.Background] internally; to specify the context, use + * [DB.ExecContext]. + */ + exec(query: string, ...args: any[]): Result + } + interface DB { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface DB { + /** + * Query executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. * - * [GetObject] + * Query uses [context.Background] internally; to specify the context, use + * [DB.QueryContext]. + */ + query(query: string, ...args: any[]): (Rows) + } + interface DB { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface DB { + /** + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. * - * [PutObject] + * QueryRow uses [context.Background] internally; to specify the context, use + * [DB.QueryRowContext]. + */ + queryRow(query: string, ...args: any[]): (Row) + } + interface DB { + /** + * BeginTx starts a transaction. * - * [DeleteObject] + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. * - * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. */ - getBucketVersioning(ctx: context.Context, params: GetBucketVersioningInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketVersioningOutput) + beginTx(ctx: context.Context, opts: TxOptions): (Tx) } - interface Client { + interface DB { /** - * This operation is not supported by directory buckets. - * - * Returns the website configuration for a bucket. To host website on Amazon S3, - * you can configure a bucket as website by adding a website configuration. For - * more information about hosting websites, see [Hosting Websites on Amazon S3]. + * Begin starts a transaction. The default isolation level is dependent on + * the driver. * - * This GET action requires the S3:GetBucketWebsite permission. By default, only - * the bucket owner can read the bucket website configuration. However, bucket - * owners can allow other users to read the website configuration by writing a - * bucket policy granting them the S3:GetBucketWebsite permission. + * Begin uses [context.Background] internally; to specify the context, use + * [DB.BeginTx]. + */ + begin(): (Tx) + } + interface DB { + /** + * Driver returns the database's underlying driver. + */ + driver(): any + } + interface DB { + /** + * Conn returns a single connection by either opening a new connection + * or returning an existing connection from the connection pool. Conn will + * block until either a connection is returned or ctx is canceled. + * Queries run on the same Conn will be run in the same database session. * - * The following operations are related to GetBucketWebsite : + * Every Conn must be returned to the database pool after use by + * calling [Conn.Close]. + */ + conn(ctx: context.Context): (Conn) + } + /** + * Tx is an in-progress database transaction. + * + * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. + * + * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the + * transaction fail with [ErrTxDone]. + * + * The statements prepared for a transaction by calling + * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed + * by the call to [Tx.Commit] or [Tx.Rollback]. + */ + interface Tx { + } + interface Tx { + /** + * Commit commits the transaction. + */ + commit(): void + } + interface Tx { + /** + * Rollback aborts the transaction. + */ + rollback(): void + } + interface Tx { + /** + * PrepareContext creates a prepared statement for use within a transaction. * - * [DeleteBucketWebsite] + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. * - * [PutBucketWebsite] + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. * - * [PutBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html - * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html - * [DeleteBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html + * The provided context will be used for the preparation of the context, not + * for the execution of the returned statement. The returned statement + * will run in the transaction context. */ - getBucketWebsite(ctx: context.Context, params: GetBucketWebsiteInput, ...optFns: ((_arg0: Options) => void)[]): (GetBucketWebsiteOutput) + prepareContext(ctx: context.Context, query: string): (Stmt) } - interface Client { + interface Tx { /** - * Retrieves an object from Amazon S3. - * - * In the GetObject request, specify the full key name for the object. - * - * General purpose buckets - Both the virtual-hosted-style requests and the - * path-style requests are supported. For a virtual hosted-style request example, - * if you have the object photos/2006/February/sample.jpg , specify the object key - * name as /photos/2006/February/sample.jpg . For a path-style request example, if - * you have the object photos/2006/February/sample.jpg in the bucket named - * examplebucket , specify the object key name as - * /examplebucket/photos/2006/February/sample.jpg . For more information about - * request types, see [HTTP Host Header Bucket Specification]in the Amazon S3 User Guide. - * - * Directory buckets - Only virtual-hosted-style requests are supported. For a - * virtual hosted-style request example, if you have the object - * photos/2006/February/sample.jpg in the bucket named - * examplebucket--use1-az5--x-s3 , specify the object key name as - * /photos/2006/February/sample.jpg . Also, when you make requests to this API - * operation, your requests are sent to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Permissions - * ``` - * - General purpose bucket permissions - You must have the required permissions - * in a policy. To use GetObject , you must have the READ access to the object - * (or version). If you grant READ access to the anonymous user, the GetObject - * operation returns the object without using an authorization header. For more - * information, see [Specifying permissions in a policy]in the Amazon S3 User Guide. - * ``` - * - * If you include a versionId in your request header, you must have the + * Prepare creates a prepared statement for use within a transaction. * - * ``` - * s3:GetObjectVersion permission to access a specific version of an object. The - * s3:GetObject permission is not required in this scenario. - * ``` + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. * - * If you request the current version of an object without a specific versionId in + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. * - * ``` - * the request header, only the s3:GetObject permission is required. The - * s3:GetObjectVersion permission is not required in this scenario. - * ``` + * Prepare uses [context.Background] internally; to specify the context, use + * [Tx.PrepareContext]. + */ + prepare(query: string): (Stmt) + } + interface Tx { + /** + * StmtContext returns a transaction-specific prepared statement from + * an existing statement. * - * If the object that you request doesn’t exist, the error that Amazon S3 returns + * Example: * * ``` - * depends on whether you also have the s3:ListBucket permission. - * - * - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an - * HTTP status code 404 Not Found error. - * - * - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP - * status code 403 Access Denied error. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) * ``` * - * If the object is encrypted using SSE-KMS, you must also have the + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + */ + stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) + } + interface Tx { + /** + * Stmt returns a transaction-specific prepared statement from + * an existing statement. * - * Storage classes If the object you are retrieving is stored in the S3 Glacier - * Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the - * S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep - * Archive Access tier, before you can retrieve the object you must first restore a - * copy using [RestoreObject]. Otherwise, this operation returns an InvalidObjectState error. For - * information about restoring archived objects, see [Restoring Archived Objects]in the Amazon S3 User Guide. - * - * Directory buckets - For directory buckets, only the S3 Express One Zone storage - * class is supported to store newly created objects. Unsupported storage class - * values won't write a destination object and will respond with the HTTP status - * code 400 Bad Request . - * - * Encryption Encryption request headers, like x-amz-server-side-encryption , - * should not be sent for the GetObject requests, if your object uses server-side - * encryption with Amazon S3 managed encryption keys (SSE-S3), server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer - * server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you - * include the header in your GetObject requests for the object that uses these - * types of keys, you’ll get an HTTP 400 Bad Request error. - * - * Directory buckets - For directory buckets, there are only two supported options - * for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more - * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. - * - * Overriding response header values through the request There are times when you - * want to override certain response header values of a GetObject response. For - * example, you might override the Content-Disposition response header value - * through your GetObject request. - * - * You can override values for a set of response headers. These modified response - * header values are included only in a successful response, that is, when the HTTP - * status code 200 OK is returned. The headers you can override using the - * following query parameters in the request are a subset of the headers that - * Amazon S3 accepts when you create an object. - * - * The response headers that you can override for the GetObject response are - * Cache-Control , Content-Disposition , Content-Encoding , Content-Language , - * Content-Type , and Expires . - * - * To override values for a set of response headers in the GetObject response, you - * can use the following query parameters in the request. + * Example: * * ``` - * - response-cache-control - * - * - response-content-disposition - * - * - response-content-encoding - * - * - response-content-language - * - * - response-content-type - * - * - response-expires + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) * ``` * - * When you use these parameters, you must sign the request by using either an - * Authorization header or a presigned URL. These parameters cannot be used with an - * unsigned (anonymous) request. - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to GetObject : - * - * [ListBuckets] - * - * [GetObjectAcl] - * - * [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html - * [HTTP Host Header Bucket Specification]: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket - * [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html - * [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html - * [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. * - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * Stmt uses [context.Background] internally; to specify the context, use + * [Tx.StmtContext]. */ - getObject(ctx: context.Context, params: GetObjectInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectOutput) + stmt(stmt: Stmt): (Stmt) } - interface Client { + interface Tx { /** - * This operation is not supported by directory buckets. - * - * Returns the access control list (ACL) of an object. To use this operation, you - * must have s3:GetObjectAcl permissions or READ_ACP access to the object. For - * more information, see [Mapping of ACL permissions and access policy permissions]in the Amazon S3 User Guide - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * By default, GET returns ACL information about the current version of an object. - * To return ACL information about a different version, use the versionId - * subresource. - * - * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, - * requests to read ACLs are still supported and return the - * bucket-owner-full-control ACL with the owner being the account that created the - * bucket. For more information, see [Controlling object ownership and disabling ACLs]in the Amazon S3 User Guide. - * - * The following operations are related to GetObjectAcl : - * - * [GetObject] - * - * [GetObjectAttributes] - * - * [DeleteObject] - * - * [PutObject] - * - * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html - * [Mapping of ACL permissions and access policy permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [Controlling object ownership and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html + * ExecContext executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. */ - getObjectAcl(ctx: context.Context, params: GetObjectAclInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectAclOutput) + execContext(ctx: context.Context, query: string, ...args: any[]): Result } - interface Client { + interface Tx { /** - * Retrieves all the metadata from an object without returning the object itself. - * This operation is useful if you're interested only in an object's metadata. - * - * GetObjectAttributes combines the functionality of HeadObject and ListParts . All - * of the data returned with each of those individual calls can be returned with a - * single call to GetObjectAttributes . - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Zonal endpoint. These endpoints support virtual-hosted-style - * requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - To use GetObjectAttributes , you must - * have READ access to the object. The permissions that you need to use this - * operation depend on whether the bucket is versioned. If the bucket is versioned, - * you need both the s3:GetObjectVersion and s3:GetObjectVersionAttributes - * permissions for this operation. If the bucket is not versioned, you need the - * s3:GetObject and s3:GetObjectAttributes permissions. For more information, see [Specifying Permissions in a Policy] - * in the Amazon S3 User Guide. If the object that you request does not exist, the - * error Amazon S3 returns depends on whether you also have the s3:ListBucket - * permission. - * - * - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an - * HTTP status code 404 Not Found ("no such key") error. - * - * - If you don't have the s3:ListBucket permission, Amazon S3 returns an HTTP - * status code 403 Forbidden ("access denied") error. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * If the object is encrypted with SSE-KMS, you must also have the - * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` - * - * Encryption Encryption request headers, like x-amz-server-side-encryption , - * should not be sent for HEAD requests if your object uses server-side encryption - * with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side - * encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side - * encryption with Amazon S3 managed encryption keys (SSE-S3). The - * x-amz-server-side-encryption header is used when you PUT an object to S3 and - * want to specify the encryption method. If you include this header in a GET - * request for an object that uses these types of keys, you’ll get an HTTP 400 Bad - * Request error. It's because the encryption method can't be changed when you - * retrieve the object. - * - * If you encrypt an object by using server-side encryption with customer-provided - * encryption keys (SSE-C) when you store the object in Amazon S3, then when you - * retrieve the metadata from the object, you must use the following headers to - * provide the encryption key for the server to be able to retrieve the object's - * metadata. The headers are: - * - * ``` - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. - * - * Directory bucket permissions - For directory buckets, there are only two - * supported options for server-side encryption: server-side encryption with Amazon - * S3 managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys - * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses - * the desired encryption configuration and you don't override the bucket default - * encryption in your CreateSession requests or PUT object requests. Then, new - * objects are automatically encrypted with the desired encryption settings. For - * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about - * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. - * - * Versioning Directory buckets - S3 Versioning isn't enabled and supported for - * directory buckets. For this API operation, only the null value of the version - * ID is supported by directory buckets. You can only specify null to the versionId - * query parameter in the request. - * - * Conditional request headers Consider the following when using request headers: - * - * ``` - * - If both of the If-Match and If-Unmodified-Since headers are present in the - * request as follows, then Amazon S3 returns the HTTP status code 200 OK and the - * data requested: - * - * - If-Match condition evaluates to true . - * - * - If-Unmodified-Since condition evaluates to false . - * ``` - * - * For more information about conditional requests, see [RFC 7232]. - * - * ``` - * - If both of the If-None-Match and If-Modified-Since headers are present in - * the request as follows, then Amazon S3 returns the HTTP status code 304 Not - * Modified : - * - * - If-None-Match condition evaluates to false . - * - * - If-Modified-Since condition evaluates to true . - * ``` - * - * For more information about conditional requests, see [RFC 7232]. - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following actions are related to GetObjectAttributes : - * - * [GetObject] - * - * [GetObjectAcl] - * - * [GetObjectLegalHold] - * - * [GetObjectLockConfiguration] - * - * [GetObjectRetention] - * - * [GetObjectTagging] - * - * [HeadObject] - * - * [ListParts] + * Exec executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. * - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [GetObjectLegalHold]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - * [HeadObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html - * [GetObjectLockConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html - * [GetObjectRetention]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * Exec uses [context.Background] internally; to specify the context, use + * [Tx.ExecContext]. */ - getObjectAttributes(ctx: context.Context, params: GetObjectAttributesInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectAttributesOutput) + exec(query: string, ...args: any[]): Result } - interface Client { + interface Tx { /** - * This operation is not supported by directory buckets. - * - * Gets an object's current legal hold status. For more information, see [Locking Objects]. - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * The following action is related to GetObjectLegalHold : - * - * [GetObjectAttributes] - * - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + * QueryContext executes a query that returns rows, typically a SELECT. */ - getObjectLegalHold(ctx: context.Context, params: GetObjectLegalHoldInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectLegalHoldOutput) + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) } - interface Client { + interface Tx { /** - * This operation is not supported by directory buckets. - * - * Gets the Object Lock configuration for a bucket. The rule specified in the - * Object Lock configuration will be applied by default to every new object placed - * in the specified bucket. For more information, see [Locking Objects]. - * - * The following action is related to GetObjectLockConfiguration : - * - * [GetObjectAttributes] + * Query executes a query that returns rows, typically a SELECT. * - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + * Query uses [context.Background] internally; to specify the context, use + * [Tx.QueryContext]. */ - getObjectLockConfiguration(ctx: context.Context, params: GetObjectLockConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectLockConfigurationOutput) + query(query: string, ...args: any[]): (Rows) } - interface Client { + interface Tx { /** - * This operation is not supported by directory buckets. - * - * Retrieves an object's retention settings. For more information, see [Locking Objects]. - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * The following action is related to GetObjectRetention : - * - * [GetObjectAttributes] - * - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - getObjectRetention(ctx: context.Context, params: GetObjectRetentionInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectRetentionOutput) + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) } - interface Client { + interface Tx { /** - * This operation is not supported by directory buckets. - * - * Returns the tag-set of an object. You send the GET request against the tagging - * subresource associated with the object. - * - * To use this operation, you must have permission to perform the - * s3:GetObjectTagging action. By default, the GET action returns information about - * current version of an object. For a versioned bucket, you can have multiple - * versions of an object in your bucket. To retrieve tags of any other version, use - * the versionId query parameter. You also need permission for the - * s3:GetObjectVersionTagging action. - * - * By default, the bucket owner has this permission and can grant this permission - * to others. - * - * For information about the Amazon S3 object tagging feature, see [Object Tagging]. - * - * The following actions are related to GetObjectTagging : - * - * [DeleteObjectTagging] - * - * [GetObjectAttributes] - * - * [PutObjectTagging] + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. * - * [DeleteObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html - * [PutObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html + * QueryRow uses [context.Background] internally; to specify the context, use + * [Tx.QueryRowContext]. */ - getObjectTagging(ctx: context.Context, params: GetObjectTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectTaggingOutput) + queryRow(query: string, ...args: any[]): (Row) } - interface Client { + /** + * Stmt is a prepared statement. + * A Stmt is safe for concurrent use by multiple goroutines. + * + * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single + * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will + * become unusable and all operations will return an error. + * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the + * [DB]. When the Stmt needs to execute on a new underlying connection, it will + * prepare itself on the new connection automatically. + */ + interface Stmt { + } + interface Stmt { /** - * This operation is not supported by directory buckets. - * - * Returns torrent files from a bucket. BitTorrent can save you bandwidth when - * you're distributing large files. - * - * You can get torrent only for objects that are less than 5 GB in size, and that - * are not encrypted using server-side encryption with a customer-provided - * encryption key. - * - * To use GET, you must have READ access to the object. - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * The following action is related to GetObjectTorrent : - * - * [GetObject] - * - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * ExecContext executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. */ - getObjectTorrent(ctx: context.Context, params: GetObjectTorrentInput, ...optFns: ((_arg0: Options) => void)[]): (GetObjectTorrentOutput) + execContext(ctx: context.Context, ...args: any[]): Result } - interface Client { + interface Stmt { /** - * This operation is not supported by directory buckets. - * - * Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To use - * this operation, you must have the s3:GetBucketPublicAccessBlock permission. For - * more information about Amazon S3 permissions, see [Specifying Permissions in a Policy]. - * - * When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or an - * object, it checks the PublicAccessBlock configuration for both the bucket (or - * the bucket that contains the object) and the bucket owner's account. If the - * PublicAccessBlock settings are different between the bucket and the account, - * Amazon S3 uses the most restrictive combination of the bucket-level and - * account-level settings. - * - * For more information about when Amazon S3 considers a bucket or an object - * public, see [The Meaning of "Public"]. - * - * The following operations are related to GetPublicAccessBlock : - * - * [Using Amazon S3 Block Public Access] - * - * [PutPublicAccessBlock] - * - * [GetPublicAccessBlock] - * - * [DeletePublicAccessBlock] + * Exec executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. * - * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html - * [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html - * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html - * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html - * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + * Exec uses [context.Background] internally; to specify the context, use + * [Stmt.ExecContext]. */ - getPublicAccessBlock(ctx: context.Context, params: GetPublicAccessBlockInput, ...optFns: ((_arg0: Options) => void)[]): (GetPublicAccessBlockOutput) + exec(...args: any[]): Result } - // @ts-ignore - import smithytime = time - // @ts-ignore - import smithywaiter = waiter - interface Client { + interface Stmt { /** - * You can use this operation to determine if a bucket exists and if you have - * permission to access it. The action returns a 200 OK if the bucket exists and - * you have permission to access it. - * - * If the bucket does not exist or you do not have permission to access it, the - * HEAD request returns a generic 400 Bad Request , 403 Forbidden or 404 Not Found - * code. A message body is not included, so you cannot determine the exception - * beyond these HTTP response codes. - * - * Authentication and authorization General purpose buckets - Request to public - * buckets that grant the s3:ListBucket permission publicly do not need to be - * signed. All other HeadBucket requests must be authenticated and signed by using - * IAM credentials (access key ID and secret access key for the IAM identities). - * All headers with the x-amz- prefix, including x-amz-copy-source , must be - * signed. For more information, see [REST Authentication]. - * - * Directory buckets - You must use IAM credentials to authenticate and authorize - * your access to the HeadBucket API operation, instead of using the temporary - * security credentials through the CreateSession API operation. - * - * Amazon Web Services CLI or SDKs handles authentication and authorization on - * your behalf. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - To use this operation, you must have - * permissions to perform the s3:ListBucket action. The bucket owner has this - * permission by default and can grant this permission to others. For more - * information about permissions, see [Managing access permissions to your Amazon S3 resources]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - You must have the s3express:CreateSession - * permission in the Action element of a policy. By default, the session is in - * the ReadWrite mode. If you want to restrict the access, you can explicitly set - * the s3express:SessionMode condition key to ReadOnly on the bucket. - * ``` - * - * For more information about example bucket policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 - * - * ``` - * User Guide. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * You must make requests for this API operation to the Zonal endpoint. These - * endpoints support virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests - * are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User Guide. - * - * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html - * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Managing access permissions to your Amazon S3 resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * QueryContext executes a prepared query statement with the given arguments + * and returns the query results as a [*Rows]. */ - headBucket(ctx: context.Context, params: HeadBucketInput, ...optFns: ((_arg0: Options) => void)[]): (HeadBucketOutput) + queryContext(ctx: context.Context, ...args: any[]): (Rows) } - interface Client { + interface Stmt { /** - * The HEAD operation retrieves metadata from an object without returning the - * object itself. This operation is useful if you're interested only in an object's - * metadata. - * - * A HEAD request has the same options as a GET operation on an object. The - * response is identical to the GET response except that there is no response - * body. Because of this, if the HEAD request generates an error, it returns a - * generic code, such as 400 Bad Request , 403 Forbidden , 404 Not Found , 405 - * Method Not Allowed , 412 Precondition Failed , or 304 Not Modified . It's not - * possible to retrieve the exact exception of these error codes. - * - * Request headers are limited to 8 KB in size. For more information, see [Common Request Headers]. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - To use HEAD , you must have the - * s3:GetObject permission. You need the relevant read object (or version) - * permission for this operation. For more information, see [Actions, resources, and condition keys for Amazon S3]in the Amazon S3 - * User Guide. For more information about the permissions to S3 API operations by - * S3 resource types, see Required permissions for Amazon S3 API operationsin the Amazon S3 User Guide. - * ``` - * - * If the object you request doesn't exist, the error that Amazon S3 returns - * - * ``` - * depends on whether you also have the s3:ListBucket permission. - * - * - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an - * HTTP status code 404 Not Found error. - * - * - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP - * status code 403 Forbidden error. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * If you enable x-amz-checksum-mode in the request and the object is encrypted - * - * ``` - * with Amazon Web Services Key Management Service (Amazon Web Services KMS), you - * must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM - * identity-based policies and KMS key policies for the KMS key to retrieve the - * checksum of the object. - * ``` - * - * Encryption Encryption request headers, like x-amz-server-side-encryption , - * should not be sent for HEAD requests if your object uses server-side encryption - * with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side - * encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side - * encryption with Amazon S3 managed encryption keys (SSE-S3). The - * x-amz-server-side-encryption header is used when you PUT an object to S3 and - * want to specify the encryption method. If you include this header in a HEAD - * request for an object that uses these types of keys, you’ll get an HTTP 400 Bad - * Request error. It's because the encryption method can't be changed when you - * retrieve the object. - * - * If you encrypt an object by using server-side encryption with customer-provided - * encryption keys (SSE-C) when you store the object in Amazon S3, then when you - * retrieve the metadata from the object, you must use the following headers to - * provide the encryption key for the server to be able to retrieve the object's - * metadata. The headers are: - * - * ``` - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. - * - * Directory bucket - For directory buckets, there are only two supported options - * for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more - * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. - * - * Versioning - * - * ``` - * - If the current version of the object is a delete marker, Amazon S3 behaves - * as if the object was deleted and includes x-amz-delete-marker: true in the - * response. - * - * - If the specified version is a delete marker, the response returns a 405 - * Method Not Allowed error and the Last-Modified: timestamp response header. - * - * - Directory buckets - Delete marker is not supported by directory buckets. - * - * - Directory buckets - S3 Versioning isn't enabled and supported for directory - * buckets. For this API operation, only the null value of the version ID is - * supported by directory buckets. You can only specify null to the versionId - * query parameter in the request. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * For directory buckets, you must make requests for this API operation to the - * Zonal endpoint. These endpoints support virtual-hosted-style requests in the - * format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon - * S3 User Guide. - * - * The following actions are related to HeadObject : - * - * [GetObject] - * - * [GetObjectAttributes] - * - * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [Actions, resources, and condition keys for Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [Common Request Headers]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html + * Query executes a prepared query statement with the given arguments + * and returns the query results as a *Rows. * - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * Query uses [context.Background] internally; to specify the context, use + * [Stmt.QueryContext]. */ - headObject(ctx: context.Context, params: HeadObjectInput, ...optFns: ((_arg0: Options) => void)[]): (HeadObjectOutput) + query(...args: any[]): (Rows) } - interface Client { + interface Stmt { /** - * This operation is not supported by directory buckets. - * - * Lists the analytics configurations for the bucket. You can have up to 1,000 - * analytics configurations per bucket. - * - * This action supports list pagination and does not return more than 100 - * configurations at a time. You should always check the IsTruncated element in - * the response. If there are no more configurations to list, IsTruncated is set - * to false. If there are more configurations to list, IsTruncated is set to true, - * and there will be a value in NextContinuationToken . You use the - * NextContinuationToken value to continue the pagination of the list by passing - * the value in continuation-token in the request to GET the next page. - * - * To use this operation, you must have permissions to perform the - * s3:GetAnalyticsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis]. - * - * The following operations are related to ListBucketAnalyticsConfigurations : - * - * [GetBucketAnalyticsConfiguration] - * - * [DeleteBucketAnalyticsConfiguration] - * - * [PutBucketAnalyticsConfiguration] - * - * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html - * [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html - * [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * QueryRowContext executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - listBucketAnalyticsConfigurations(ctx: context.Context, params: ListBucketAnalyticsConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketAnalyticsConfigurationsOutput) + queryRowContext(ctx: context.Context, ...args: any[]): (Row) } - interface Client { + interface Stmt { /** - * This operation is not supported by directory buckets. - * - * Lists the S3 Intelligent-Tiering configuration from the specified bucket. - * - * The S3 Intelligent-Tiering storage class is designed to optimize storage costs - * by automatically moving data to the most cost-effective storage access tier, - * without performance impact or operational overhead. S3 Intelligent-Tiering - * delivers automatic cost savings in three low latency and high throughput access - * tiers. To get the lowest storage cost on data that can be accessed in minutes to - * hours, you can choose to activate additional archiving capabilities. - * - * The S3 Intelligent-Tiering storage class is the ideal storage class for data - * with unknown, changing, or unpredictable access patterns, independent of object - * size or retention period. If the size of an object is less than 128 KB, it is - * not monitored and not eligible for auto-tiering. Smaller objects can be stored, - * but they are always charged at the Frequent Access tier rates in the S3 - * Intelligent-Tiering storage class. - * - * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. - * - * Operations related to ListBucketIntelligentTieringConfigurations include: - * - * [DeleteBucketIntelligentTieringConfiguration] + * QueryRow executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. * - * [PutBucketIntelligentTieringConfiguration] + * Example usage: * - * [GetBucketIntelligentTieringConfiguration] + * ``` + * var name string + * err := nameByUseridStmt.QueryRow(id).Scan(&name) + * ``` * - * [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html - * [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access - * [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html + * QueryRow uses [context.Background] internally; to specify the context, use + * [Stmt.QueryRowContext]. */ - listBucketIntelligentTieringConfigurations(ctx: context.Context, params: ListBucketIntelligentTieringConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketIntelligentTieringConfigurationsOutput) + queryRow(...args: any[]): (Row) } - interface Client { + interface Stmt { /** - * This operation is not supported by directory buckets. - * - * Returns a list of inventory configurations for the bucket. You can have up to - * 1,000 analytics configurations per bucket. - * - * This action supports list pagination and does not return more than 100 - * configurations at a time. Always check the IsTruncated element in the response. - * If there are no more configurations to list, IsTruncated is set to false. If - * there are more configurations to list, IsTruncated is set to true, and there is - * a value in NextContinuationToken . You use the NextContinuationToken value to - * continue the pagination of the list by passing the value in continuation-token - * in the request to GET the next page. - * - * To use this operation, you must have permissions to perform the - * s3:GetInventoryConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory] - * - * The following operations are related to ListBucketInventoryConfigurations : - * - * [GetBucketInventoryConfiguration] - * - * [DeleteBucketInventoryConfiguration] - * - * [PutBucketInventoryConfiguration] - * - * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html - * [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html + * Close closes the statement. */ - listBucketInventoryConfigurations(ctx: context.Context, params: ListBucketInventoryConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketInventoryConfigurationsOutput) + close(): void } - interface Client { - /** - * This operation is not supported by directory buckets. - * - * Lists the metrics configurations for the bucket. The metrics configurations are - * only for the request metrics of the bucket and do not provide information on - * daily storage metrics. You can have up to 1,000 configurations per bucket. - * - * This action supports list pagination and does not return more than 100 - * configurations at a time. Always check the IsTruncated element in the response. - * If there are no more configurations to list, IsTruncated is set to false. If - * there are more configurations to list, IsTruncated is set to true, and there is - * a value in NextContinuationToken . You use the NextContinuationToken value to - * continue the pagination of the list by passing the value in continuation-token - * in the request to GET the next page. - * - * To use this operation, you must have permissions to perform the - * s3:GetMetricsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For more information about metrics configurations and CloudWatch request - * metrics, see [Monitoring Metrics with Amazon CloudWatch]. - * - * The following operations are related to ListBucketMetricsConfigurations : - * - * [PutBucketMetricsConfiguration] - * - * [GetBucketMetricsConfiguration] - * - * [DeleteBucketMetricsConfiguration] - * - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html - * [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html - * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html - * [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - */ - listBucketMetricsConfigurations(ctx: context.Context, params: ListBucketMetricsConfigurationsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketMetricsConfigurationsOutput) + /** + * Rows is the result of a query. Its cursor starts before the first row + * of the result set. Use [Rows.Next] to advance from row to row. + */ + interface Rows { } - interface Client { + interface Rows { /** - * This operation is not supported by directory buckets. - * - * Returns a list of all buckets owned by the authenticated sender of the request. - * To use this operation, you must have the s3:ListAllMyBuckets permission. - * - * For information about Amazon S3 buckets, see [Creating, configuring, and working with Amazon S3 buckets]. + * Next prepares the next result row for reading with the [Rows.Scan] method. It + * returns true on success, or false if there is no next result row or an error + * happened while preparing it. [Rows.Err] should be consulted to distinguish between + * the two cases. * - * [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html + * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. */ - listBuckets(ctx: context.Context, params: ListBucketsInput, ...optFns: ((_arg0: Options) => void)[]): (ListBucketsOutput) + next(): boolean } - interface Client { + interface Rows { /** - * Returns a list of all Amazon S3 directory buckets owned by the authenticated - * sender of the request. For more information about directory buckets, see [Directory buckets]in the - * Amazon S3 User Guide. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Regional endpoint. These endpoints support path-style requests - * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * - * Permissions You must have the s3express:ListAllMyDirectoryBuckets permission in - * an IAM identity-based policy instead of a bucket policy. Cross-account access to - * this API operation isn't supported. This operation can only be performed by the - * Amazon Web Services account that owns the resource. For more information about - * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . + * NextResultSet prepares the next result set for reading. It reports whether + * there is further result sets, or false if there is no further result set + * or if there is an error advancing to it. The [Rows.Err] method should be consulted + * to distinguish between the two cases. * - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * After calling NextResultSet, the [Rows.Next] method should always be called before + * scanning. If there are further result sets they may not have rows in the result + * set. */ - listDirectoryBuckets(ctx: context.Context, params: ListDirectoryBucketsInput, ...optFns: ((_arg0: Options) => void)[]): (ListDirectoryBucketsOutput) + nextResultSet(): boolean } - interface Client { + interface Rows { /** - * This operation lists in-progress multipart uploads in a bucket. An in-progress - * multipart upload is a multipart upload that has been initiated by the - * CreateMultipartUpload request, but has not yet been completed or aborted. - * - * Directory buckets - If multipart uploads in a directory bucket are in progress, - * you can't delete the bucket until all the in-progress multipart uploads are - * aborted or completed. To delete these in-progress multipart uploads, use the - * ListMultipartUploads operation to list the in-progress multipart uploads in the - * bucket and use the AbortMultupartUpload operation to abort all the in-progress - * multipart uploads. - * - * The ListMultipartUploads operation returns a maximum of 1,000 multipart uploads - * in the response. The limit of 1,000 multipart uploads is also the default value. - * You can further limit the number of uploads in a response by specifying the - * max-uploads request parameter. If there are more than 1,000 multipart uploads - * that satisfy your ListMultipartUploads request, the response returns an - * IsTruncated element with the value of true , a NextKeyMarker element, and a - * NextUploadIdMarker element. To list the remaining multipart uploads, you need to - * make subsequent ListMultipartUploads requests. In these requests, include two - * query parameters: key-marker and upload-id-marker . Set the value of key-marker - * to the NextKeyMarker value from the previous response. Similarly, set the value - * of upload-id-marker to the NextUploadIdMarker value from the previous response. - * - * Directory buckets - The upload-id-marker element and the NextUploadIdMarker - * element aren't supported by directory buckets. To list the additional multipart - * uploads, you only need to set the value of key-marker to the NextKeyMarker - * value from the previous response. - * - * For more information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Zonal endpoint. These endpoints support virtual-hosted-style - * requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - For information about permissions - * required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * Sorting of multipart uploads in response - * - * ``` - * - General purpose bucket - In the ListMultipartUploads response, the multipart - * uploads are sorted based on two criteria: - * - * - Key-based sorting - Multipart uploads are initially sorted in ascending - * order based on their object keys. - * - * - Time-based sorting - For uploads that share the same object key, they are - * further sorted in ascending order based on the upload initiation time. Among - * uploads with the same key, the one that was initiated first will appear before - * the ones that were initiated later. - * - * - Directory bucket - In the ListMultipartUploads response, the multipart - * uploads aren't sorted lexicographically based on the object keys. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to ListMultipartUploads : - * - * [CreateMultipartUpload] - * - * [UploadPart] - * - * [CompleteMultipartUpload] - * - * [ListParts] - * - * [AbortMultipartUpload] - * - * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html + * Err returns the error, if any, that was encountered during iteration. + * Err may be called after an explicit or implicit [Rows.Close]. */ - listMultipartUploads(ctx: context.Context, params: ListMultipartUploadsInput, ...optFns: ((_arg0: Options) => void)[]): (ListMultipartUploadsOutput) + err(): void } - interface Client { + interface Rows { /** - * This operation is not supported by directory buckets. - * - * Returns metadata about all versions of the objects in a bucket. You can also - * use request parameters as selection criteria to return metadata about a subset - * of all the object versions. - * - * To use this operation, you must have permission to perform the - * s3:ListBucketVersions action. Be aware of the name difference. - * - * A 200 OK response can contain valid or invalid XML. Make sure to design your - * application to parse the contents of the response and handle it appropriately. - * - * To use this operation, you must have READ access to the bucket. - * - * The following operations are related to ListObjectVersions : - * - * [ListObjectsV2] - * - * [GetObject] - * - * [PutObject] - * - * [DeleteObject] - * - * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [ListObjectsV2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html + * Columns returns the column names. + * Columns returns an error if the rows are closed. */ - listObjectVersions(ctx: context.Context, params: ListObjectVersionsInput, ...optFns: ((_arg0: Options) => void)[]): (ListObjectVersionsOutput) + columns(): Array } - interface Client { + interface Rows { /** - * This operation is not supported by directory buckets. - * - * Returns some or all (up to 1,000) of the objects in a bucket. You can use the - * request parameters as selection criteria to return a subset of the objects in a - * bucket. A 200 OK response can contain valid or invalid XML. Be sure to design - * your application to parse the contents of the response and handle it - * appropriately. - * - * This action has been revised. We recommend that you use the newer version, [ListObjectsV2], - * when developing applications. For backward compatibility, Amazon S3 continues to - * support ListObjects . - * - * The following operations are related to ListObjects : - * - * [ListObjectsV2] - * - * [GetObject] - * - * [PutObject] - * - * [CreateBucket] - * - * [ListBuckets] - * - * [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [ListObjectsV2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html + * ColumnTypes returns column information such as column type, length, + * and nullable. Some information may not be available from some drivers. */ - listObjects(ctx: context.Context, params: ListObjectsInput, ...optFns: ((_arg0: Options) => void)[]): (ListObjectsOutput) + columnTypes(): Array<(ColumnType | undefined)> } - interface Client { + interface Rows { /** - * Returns some or all (up to 1,000) of the objects in a bucket with each request. - * You can use the request parameters as selection criteria to return a subset of - * the objects in a bucket. A 200 OK response can contain valid or invalid XML. - * Make sure to design your application to parse the contents of the response and - * handle it appropriately. - * - * For more information about listing objects, see [Listing object keys programmatically] in the Amazon S3 User Guide. - * To get a list of your buckets, see [ListBuckets]. - * - * ``` - * - General purpose bucket - For general purpose buckets, ListObjectsV2 doesn't - * return prefixes that are related only to in-progress multipart uploads. - * - * - Directory buckets - For directory buckets, ListObjectsV2 response includes - * the prefixes that are related only to in-progress multipart uploads. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * ``` + * Scan copies the columns in the current row into the values pointed + * at by dest. The number of values in dest must be the same as the + * number of columns in [Rows]. * - * Permissions + * Scan converts columns read from the database into the following + * common Go types and special types provided by the sql package: * * ``` - * - General purpose bucket permissions - To use this operation, you must have - * READ access to the bucket. You must have permission to perform the - * s3:ListBucket action. The bucket owner has this permission by default and can - * grant this permission to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] - * and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . + * *string + * *[]byte + * *int, *int8, *int16, *int32, *int64 + * *uint, *uint8, *uint16, *uint32, *uint64 + * *bool + * *float32, *float64 + * *interface{} + * *RawBytes + * *Rows (cursor value) + * any type implementing Scanner (see Scanner docs) * ``` * - * Sorting order of returned objects - * - * ``` - * - General purpose bucket - For general purpose buckets, ListObjectsV2 returns - * objects in lexicographical order based on their key names. + * In the most simple case, if the type of the value from the source + * column is an integer, bool or string type T and dest is of type *T, + * Scan simply assigns the value through the pointer. * - * - Directory bucket - For directory buckets, ListObjectsV2 does not return - * objects in lexicographical order. - * ``` + * Scan also converts between string and numeric types, as long as no + * information would be lost. While Scan stringifies all numbers + * scanned from numeric database columns into *string, scans into + * numeric types are checked for overflow. For example, a float64 with + * value 300 or a string with value "300" can scan into a uint16, but + * not into a uint8, though float64(255) or "255" can scan into a + * uint8. One exception is that scans of some float64 numbers to + * strings may lose information when stringifying. In general, scan + * floating point columns into *float64. * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . + * If a dest argument has type *[]byte, Scan saves in that argument a + * copy of the corresponding data. The copy is owned by the caller and + * can be modified and held indefinitely. The copy can be avoided by + * using an argument of type [*RawBytes] instead; see the documentation + * for [RawBytes] for restrictions on its use. * - * This section describes the latest revision of this action. We recommend that - * you use this revised API operation for application development. For backward - * compatibility, Amazon S3 continues to support the prior version of this API - * operation, [ListObjects]. + * If an argument has type *interface{}, Scan copies the value + * provided by the underlying driver without conversion. When scanning + * from a source value of type []byte to *interface{}, a copy of the + * slice is made and the caller owns the result. * - * The following operations are related to ListObjectsV2 : + * Source values of type [time.Time] may be scanned into values of type + * *time.Time, *interface{}, *string, or *[]byte. When converting to + * the latter two, [time.RFC3339Nano] is used. * - * [GetObject] + * Source values of type bool may be scanned into types *bool, + * *interface{}, *string, *[]byte, or [*RawBytes]. * - * [PutObject] + * For scanning into *bool, the source may be true, false, 1, 0, or + * string inputs parseable by [strconv.ParseBool]. * - * [CreateBucket] + * Scan can also convert a cursor returned from a query, such as + * "select cursor(select * from my_table) from dual", into a + * [*Rows] value that can itself be scanned from. The parent + * select query will close any cursor [*Rows] if the parent [*Rows] is closed. * - * [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Listing object keys programmatically]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * If any of the first arguments implementing [Scanner] returns an error, + * that error will be wrapped in the returned error. */ - listObjectsV2(ctx: context.Context, params: ListObjectsV2Input, ...optFns: ((_arg0: Options) => void)[]): (ListObjectsV2Output) + scan(...dest: any[]): void } - interface Client { + interface Rows { /** - * Lists the parts that have been uploaded for a specific multipart upload. - * - * To use this operation, you must provide the upload ID in the request. You - * obtain this uploadID by sending the initiate multipart upload request through [CreateMultipartUpload]. - * - * The ListParts request returns a maximum of 1,000 uploaded parts. The limit of - * 1,000 parts is also the default value. You can restrict the number of parts in a - * response by specifying the max-parts request parameter. If your multipart - * upload consists of more than 1,000 parts, the response returns an IsTruncated - * field with the value of true , and a NextPartNumberMarker element. To list - * remaining uploaded parts, in subsequent ListParts requests, include the - * part-number-marker query string parameter and set its value to the - * NextPartNumberMarker field value from the previous response. - * - * For more information on multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Zonal endpoint. These endpoints support virtual-hosted-style - * requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Permissions - * ``` - * - General purpose bucket permissions - For information about permissions - * required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. - * ``` - * - * If the upload was created using server-side encryption with Key Management - * - * ``` - * Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon - * Web Services KMS keys (DSSE-KMS), you must have permission to the kms:Decrypt - * action for the ListParts request to succeed. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to ListParts : - * - * [CreateMultipartUpload] - * - * [UploadPart] - * - * [CompleteMultipartUpload] - * - * [AbortMultipartUpload] - * - * [GetObjectAttributes] - * - * [ListMultipartUploads] - * - * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html - * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html - * [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html - * - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html + * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called + * and returns false and there are no further result sets, + * the [Rows] are closed automatically and it will suffice to check the + * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. */ - listParts(ctx: context.Context, params: ListPartsInput, ...optFns: ((_arg0: Options) => void)[]): (ListPartsOutput) + close(): void } - interface Client { + /** + * A Result summarizes an executed SQL command. + */ + interface Result { + [key:string]: any; /** - * This operation is not supported by directory buckets. - * - * Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer - * Acceleration is a bucket-level feature that enables you to perform faster data - * transfers to Amazon S3. - * - * To use this operation, you must have permission to perform the - * s3:PutAccelerateConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * The Transfer Acceleration state of a bucket can be set to one of the following - * two values: - * - * ``` - * - Enabled – Enables accelerated data transfers to the bucket. - * - * - Suspended – Disables accelerated data transfers to the bucket. - * ``` - * - * The [GetBucketAccelerateConfiguration] action returns the transfer acceleration state of a bucket. - * - * After setting the Transfer Acceleration state of a bucket to Enabled, it might - * take up to thirty minutes before the data transfer rates to the bucket increase. - * - * The name of the bucket used for Transfer Acceleration must be DNS-compliant and - * must not contain periods ("."). - * - * For more information about transfer acceleration, see [Transfer Acceleration]. - * - * The following operations are related to PutBucketAccelerateConfiguration : - * - * [GetBucketAccelerateConfiguration] - * - * [CreateBucket] - * - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html - * [GetBucketAccelerateConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * LastInsertId returns the integer generated by the database + * in response to a command. Typically this will be from an + * "auto increment" column when inserting a new row. Not all + * databases support this feature, and the syntax of such + * statements varies. + */ + lastInsertId(): number + /** + * RowsAffected returns the number of rows affected by an + * update, insert, or delete. Not every database or database + * driver may support this. */ - putBucketAccelerateConfiguration(ctx: context.Context, params: PutBucketAccelerateConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketAccelerateConfigurationOutput) + rowsAffected(): number } - interface Client { +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + /** + * Settings defines common app configuration options. + */ + interface Settings { + meta: MetaConfig + logs: LogsConfig + smtp: SmtpConfig + s3: S3Config + backups: BackupsConfig + adminAuthToken: TokenConfig + adminPasswordResetToken: TokenConfig + adminFileToken: TokenConfig + recordAuthToken: TokenConfig + recordPasswordResetToken: TokenConfig + recordEmailChangeToken: TokenConfig + recordVerificationToken: TokenConfig + recordFileToken: TokenConfig /** - * This operation is not supported by directory buckets. - * - * Sets the permissions on an existing bucket using access control lists (ACL). - * For more information, see [Using ACLs]. To set the ACL of a bucket, you must have the - * WRITE_ACP permission. - * - * You can use one of the following two ways to set a bucket's permissions: - * - * ``` - * - Specify the ACL in the request body - * - * - Specify permissions using request headers - * ``` - * - * You cannot specify access permission using both the body and the request - * headers. - * - * Depending on your application needs, you may choose to set the ACL on a bucket - * using either the request body or the headers. For example, if you have an - * existing application that updates a bucket ACL using the request body, then you - * can continue to use that approach. - * - * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, - * ACLs are disabled and no longer affect permissions. You must use policies to - * grant access to your bucket and the objects in it. Requests to set ACLs or - * update ACLs fail and return the AccessControlListNotSupported error code. - * Requests to read ACLs are still supported. For more information, see [Controlling object ownership]in the - * Amazon S3 User Guide. - * - * Permissions You can set access permissions by using one of the following - * methods: - * - * ``` - * - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports a - * set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined - * set of grantees and permissions. Specify the canned ACL name as the value of - * x-amz-acl . If you use this header, you cannot use other access - * control-specific headers in your request. For more information, see [Canned ACL]. - * - * - Specify access permissions explicitly with the x-amz-grant-read , - * x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control - * headers. When using these headers, you specify explicit access permissions and - * grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the - * permission. If you use these ACL-specific headers, you cannot use the - * x-amz-acl header to set a canned ACL. These parameters map to the set of - * permissions that Amazon S3 supports in an ACL. For more information, see [Access Control List (ACL) Overview]. - * ``` - * - * You specify each grantee as a type=value pair, where the type is one of the - * - * ``` - * following: - * - * - id – if the value specified is the canonical user ID of an Amazon Web - * Services account - * - * - uri – if you are granting permissions to a predefined group - * - * - emailAddress – if the value specified is the email address of an Amazon Web - * Services account - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * - * ``` - * Amazon Web Services General Reference. - * ``` - * - * For example, the following x-amz-grant-write header grants create, overwrite, - * - * ``` - * and delete objects permission to LogDelivery group predefined by Amazon S3 and - * two Amazon Web Services accounts identified by their email addresses. - * ``` - * - * x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", - * - * ``` - * id="111122223333", id="555566667777" - * ``` - * - * You can use either a canned ACL or specify access permissions explicitly. You - * cannot do both. - * - * Grantee Values You can specify the person (grantee) to whom you're assigning - * access rights (using request elements) in the following ways: - * - * ``` - * - By the person's ID: - * ``` - * - * <>ID<><>GranteesEmail<> - * - * DisplayName is optional and ignored in the request - * - * ``` - * - By URI: - * ``` - * - * <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> - * - * ``` - * - By Email address: - * ``` - * - * <>Grantees@email.com<>& - * - * The grantee is resolved to the CanonicalUser and, in a response to a GET Object - * - * ``` - * acl request, appears as the CanonicalUser. - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * - * ``` - * Amazon Web Services General Reference. - * ``` - * - * The following operations are related to PutBucketAcl : - * - * [CreateBucket] - * - * [DeleteBucket] - * - * [GetObjectAcl] - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - * [Controlling object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html - * [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html - * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL - * [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * Deprecated: Will be removed in v0.9+ */ - putBucketAcl(ctx: context.Context, params: PutBucketAclInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketAclOutput) + emailAuth: EmailAuthConfig + googleAuth: AuthProviderConfig + facebookAuth: AuthProviderConfig + githubAuth: AuthProviderConfig + gitlabAuth: AuthProviderConfig + discordAuth: AuthProviderConfig + twitterAuth: AuthProviderConfig + microsoftAuth: AuthProviderConfig + spotifyAuth: AuthProviderConfig + kakaoAuth: AuthProviderConfig + twitchAuth: AuthProviderConfig + stravaAuth: AuthProviderConfig + giteeAuth: AuthProviderConfig + livechatAuth: AuthProviderConfig + giteaAuth: AuthProviderConfig + oidcAuth: AuthProviderConfig + oidc2Auth: AuthProviderConfig + oidc3Auth: AuthProviderConfig + appleAuth: AuthProviderConfig + instagramAuth: AuthProviderConfig + vkAuth: AuthProviderConfig + yandexAuth: AuthProviderConfig + patreonAuth: AuthProviderConfig + mailcowAuth: AuthProviderConfig + bitbucketAuth: AuthProviderConfig + planningcenterAuth: AuthProviderConfig } - interface Client { + interface Settings { /** - * This operation is not supported by directory buckets. - * - * Sets an analytics configuration for the bucket (specified by the analytics - * configuration ID). You can have up to 1,000 analytics configurations per bucket. - * - * You can choose to have storage class analysis export analysis reports sent to a - * comma-separated values (CSV) flat file. See the DataExport request element. - * Reports are updated daily and are based on the object filters that you - * configure. When selecting data export, you specify a destination bucket and an - * optional destination prefix where the file is written. You can export the data - * to a destination bucket in a different account. However, the destination bucket - * must be in the same Region as the bucket that you are making the PUT analytics - * configuration to. For more information, see [Amazon S3 Analytics – Storage Class Analysis]. - * - * You must create a bucket policy on the destination bucket where the exported - * file is written to grant permissions to Amazon S3 to write objects to the - * bucket. For an example policy, see [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]. - * - * To use this operation, you must have permissions to perform the - * s3:PutAnalyticsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * PutBucketAnalyticsConfiguration has the following special errors: - * - * ``` - * - HTTP Error: HTTP 400 Bad Request - * - * - Code: InvalidArgument - * - * - Cause: Invalid argument. - * - * - HTTP Error: HTTP 400 Bad Request - * - * - Code: TooManyConfigurations - * - * - Cause: You are attempting to create a new configuration but have already - * reached the 1,000-configuration limit. - * - * - HTTP Error: HTTP 403 Forbidden - * - * - Code: AccessDenied - * - * - Cause: You are not the owner of the specified bucket, or you do not have - * the s3:PutAnalyticsConfiguration bucket permission to set the configuration on - * the bucket. - * ``` - * - * The following operations are related to PutBucketAnalyticsConfiguration : - * - * [GetBucketAnalyticsConfiguration] - * - * [DeleteBucketAnalyticsConfiguration] - * - * [ListBucketAnalyticsConfigurations] - * - * [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html - * [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 - * [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html - * [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * Validate makes Settings validatable by implementing [validation.Validatable] interface. */ - putBucketAnalyticsConfiguration(ctx: context.Context, params: PutBucketAnalyticsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketAnalyticsConfigurationOutput) + validate(): void } - interface Client { + interface Settings { /** - * This operation is not supported by directory buckets. - * - * Sets the cors configuration for your bucket. If the configuration exists, - * Amazon S3 replaces it. - * - * To use this operation, you must be allowed to perform the s3:PutBucketCORS - * action. By default, the bucket owner has this permission and can grant it to - * others. - * - * You set this configuration on a bucket so that the bucket can service - * cross-origin requests. For example, you might want to enable a request whose - * origin is http://www.example.com to access your Amazon S3 bucket at - * my.example.bucket.com by using the browser's XMLHttpRequest capability. - * - * To enable cross-origin resource sharing (CORS) on a bucket, you add the cors - * subresource to the bucket. The cors subresource is an XML document in which you - * configure rules that identify origins and the HTTP methods that can be executed - * on your bucket. The document is limited to 64 KB in size. - * - * When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS - * request) against a bucket, it evaluates the cors configuration on the bucket - * and uses the first CORSRule rule that matches the incoming browser request to - * enable a cross-origin request. For a rule to match, the following conditions - * must be met: - * - * ``` - * - The request's Origin header must match AllowedOrigin elements. - * - * - The request method (for example, GET, PUT, HEAD, and so on) or the - * Access-Control-Request-Method header in case of a pre-flight OPTIONS request - * must be one of the AllowedMethod elements. - * - * - Every header specified in the Access-Control-Request-Headers request header - * of a pre-flight request must match an AllowedHeader element. - * ``` - * - * For more information about CORS, go to [Enabling Cross-Origin Resource Sharing] in the Amazon S3 User Guide. - * - * The following operations are related to PutBucketCors : - * - * [GetBucketCors] - * - * [DeleteBucketCors] - * - * [RESTOPTIONSobject] - * - * [GetBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html - * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html - * [RESTOPTIONSobject]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html - * [DeleteBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html + * Merge merges `other` settings into the current one. */ - putBucketCors(ctx: context.Context, params: PutBucketCorsInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketCorsOutput) + merge(other: Settings): void } - interface Client { + interface Settings { /** - * This operation configures default encryption and Amazon S3 Bucket Keys for an - * existing bucket. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Regional endpoint. These endpoints support path-style requests - * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * - * By default, all buckets have a default encryption configuration that uses - * server-side encryption with Amazon S3 managed keys (SSE-S3). - * - * ``` - * - General purpose buckets - * - * - You can optionally configure default encryption for a bucket by using - * server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or - * dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). - * If you specify default encryption by using SSE-KMS, you can also configure [Amazon S3 Bucket Keys]. - * For information about the bucket default encryption feature, see [Amazon S3 Bucket Default Encryption]in the - * Amazon S3 User Guide. - * - * - If you use PutBucketEncryption to set your [default bucket encryption]to SSE-KMS, you should verify - * that your KMS key ID is correct. Amazon S3 doesn't validate the KMS key ID - * provided in PutBucketEncryption requests. - * - * - Directory buckets - You can optionally configure default encryption for a - * bucket by using server-side encryption with Key Management Service (KMS) keys - * (SSE-KMS). - * - * - We recommend that the bucket's default encryption uses the desired - * encryption configuration and you don't override the bucket default encryption in - * your CreateSession requests or PUT object requests. Then, new objects are - * automatically encrypted with the desired encryption settings. For more - * information about the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads] - * . - * - * - Your SSE-KMS configuration can only support 1 [customer managed key]per directory bucket for the - * lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * - S3 Bucket Keys are always enabled for GET and PUT operations in a directory - * bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy - * SSE-KMS encrypted objects from general purpose buckets to directory buckets, - * from directory buckets to general purpose buckets, or between directory buckets, - * through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a call to KMS every time a - * copy request is made for a KMS-encrypted object. - * - * - When you specify an [KMS customer managed key]for encryption in your directory bucket, only use the - * key ID or key ARN. The key alias format of the KMS key isn't supported. - * - * - For directory buckets, if you use PutBucketEncryption to set your [default bucket encryption]to - * SSE-KMS, Amazon S3 validates the KMS key ID provided in PutBucketEncryption - * requests. - * ``` - * - * If you're specifying a customer managed KMS key, we recommend using a fully - * qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the - * key within the requester’s account. This behavior can result in data that's - * encrypted with a KMS key that belongs to the requester, and not the bucket - * owner. - * - * Also, this action requires Amazon Web Services Signature Version 4. For more - * information, see [Authenticating Requests (Amazon Web Services Signature Version 4)]. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - The s3:PutEncryptionConfiguration - * permission is required in a policy. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation, you - * must have the s3express:PutEncryptionConfiguration permission in an IAM - * identity-based policy instead of a bucket policy. Cross-account access to this - * API operation isn't supported. This operation can only be performed by the - * Amazon Web Services account that owns the resource. For more information about - * directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. - * ``` - * - * To set a directory bucket default encryption with SSE-KMS, you must also have - * - * ``` - * the kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based - * policies and KMS key policies for the target KMS key. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * The following operations are related to PutBucketEncryption : - * - * [GetBucketEncryption] - * - * [DeleteBucketEncryption] - * - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - * [Authenticating Requests (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html - * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html - * [GetBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html - * [DeleteBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [default bucket encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html - * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job - * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + * Clone creates a new deep copy of the current settings. */ - putBucketEncryption(ctx: context.Context, params: PutBucketEncryptionInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketEncryptionOutput) + clone(): (Settings) } - interface Client { + interface Settings { /** - * This operation is not supported by directory buckets. - * - * Puts a S3 Intelligent-Tiering configuration to the specified bucket. You can - * have up to 1,000 S3 Intelligent-Tiering configurations per bucket. - * - * The S3 Intelligent-Tiering storage class is designed to optimize storage costs - * by automatically moving data to the most cost-effective storage access tier, - * without performance impact or operational overhead. S3 Intelligent-Tiering - * delivers automatic cost savings in three low latency and high throughput access - * tiers. To get the lowest storage cost on data that can be accessed in minutes to - * hours, you can choose to activate additional archiving capabilities. - * - * The S3 Intelligent-Tiering storage class is the ideal storage class for data - * with unknown, changing, or unpredictable access patterns, independent of object - * size or retention period. If the size of an object is less than 128 KB, it is - * not monitored and not eligible for auto-tiering. Smaller objects can be stored, - * but they are always charged at the Frequent Access tier rates in the S3 - * Intelligent-Tiering storage class. - * - * For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. - * - * Operations related to PutBucketIntelligentTieringConfiguration include: - * - * [DeleteBucketIntelligentTieringConfiguration] - * - * [GetBucketIntelligentTieringConfiguration] - * - * [ListBucketIntelligentTieringConfigurations] - * - * You only need S3 Intelligent-Tiering enabled on a bucket if you want to - * automatically move objects stored in the S3 Intelligent-Tiering storage class to - * the Archive Access or Deep Archive Access tier. - * - * PutBucketIntelligentTieringConfiguration has the following special errors: - * - * HTTP 400 Bad Request Error Code: InvalidArgument - * - * Cause: Invalid Argument - * - * HTTP 400 Bad Request Error Code: TooManyConfigurations - * - * Cause: You are attempting to create a new configuration but have already - * reached the 1,000-configuration limit. - * - * HTTP 403 Forbidden Error Cause: You are not the owner of the specified bucket, - * or you do not have the s3:PutIntelligentTieringConfiguration bucket permission - * to set the configuration on the bucket. - * - * [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html - * [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access - * [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html + * RedactClone creates a new deep copy of the current settings, + * while replacing the secret values with `******`. */ - putBucketIntelligentTieringConfiguration(ctx: context.Context, params: PutBucketIntelligentTieringConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketIntelligentTieringConfigurationOutput) + redactClone(): (Settings) } - interface Client { + interface Settings { /** - * This operation is not supported by directory buckets. - * - * This implementation of the PUT action adds an inventory configuration - * (identified by the inventory ID) to the bucket. You can have up to 1,000 - * inventory configurations per bucket. - * - * Amazon S3 inventory generates inventories of the objects in the bucket on a - * daily or weekly basis, and the results are published to a flat file. The bucket - * that is inventoried is called the source bucket, and the bucket where the - * inventory flat file is stored is called the destination bucket. The destination - * bucket must be in the same Amazon Web Services Region as the source bucket. - * - * When you configure an inventory for a source bucket, you specify the - * destination bucket where you want the inventory to be stored, and whether to - * generate the inventory daily or weekly. You can also configure what object - * metadata to include and whether to inventory all object versions or only current - * versions. For more information, see [Amazon S3 Inventory]in the Amazon S3 User Guide. - * - * You must create a bucket policy on the destination bucket to grant permissions - * to Amazon S3 to write objects to the bucket in the defined location. For an - * example policy, see [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]. - * - * Permissions To use this operation, you must have permission to perform the - * s3:PutInventoryConfiguration action. The bucket owner has this permission by - * default and can grant this permission to others. - * - * The s3:PutInventoryConfiguration permission allows a user to create an [S3 Inventory] report - * that includes all object metadata fields available and to specify the - * destination bucket to store the inventory. A user with read access to objects in - * the destination bucket can also access all object metadata fields that are - * available in the inventory report. - * - * To restrict access to an inventory report, see [Restricting access to an Amazon S3 Inventory report] in the Amazon S3 User Guide. - * For more information about the metadata fields available in S3 Inventory, see [Amazon S3 Inventory lists] - * in the Amazon S3 User Guide. For more information about permissions, see [Permissions related to bucket subresource operations]and [Identity and access management in Amazon S3] - * in the Amazon S3 User Guide. - * - * PutBucketInventoryConfiguration has the following special errors: - * - * HTTP 400 Bad Request Error Code: InvalidArgument - * - * Cause: Invalid Argument - * - * HTTP 400 Bad Request Error Code: TooManyConfigurations - * - * Cause: You are attempting to create a new configuration but have already - * reached the 1,000-configuration limit. - * - * HTTP 403 Forbidden Error Cause: You are not the owner of the specified bucket, - * or you do not have the s3:PutInventoryConfiguration bucket permission to set - * the configuration on the bucket. - * - * The following operations are related to PutBucketInventoryConfiguration : - * - * [GetBucketInventoryConfiguration] - * - * [DeleteBucketInventoryConfiguration] - * - * [ListBucketInventoryConfigurations] - * - * [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 - * [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html - * [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html - * [S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html - * [Permissions related to bucket subresource operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html - * [Identity and access management in Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Restricting access to an Amazon S3 Inventory report]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-10 - * [Amazon S3 Inventory lists]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html#storage-inventory-contents - * [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html + * NamedAuthProviderConfigs returns a map with all registered OAuth2 + * provider configurations (indexed by their name identifier). */ - putBucketInventoryConfiguration(ctx: context.Context, params: PutBucketInventoryConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketInventoryConfigurationOutput) + namedAuthProviderConfigs(): _TygojaDict } - interface Client { +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation + /** + * Schema defines a dynamic db schema as a slice of `SchemaField`s. + */ + interface Schema { + } + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Creates a new lifecycle configuration for the bucket or replaces an existing - * lifecycle configuration. Keep in mind that this will overwrite an existing - * lifecycle configuration, so if you want to retain any configuration details, - * they must be included in the new lifecycle configuration. For information about - * lifecycle configuration, see [Managing your storage lifecycle]. - * - * Rules You specify the lifecycle configuration in your request body. The - * lifecycle configuration is specified as XML consisting of one or more rules. An - * Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not - * adjustable. - * - * Bucket lifecycle configuration supports specifying a lifecycle rule using an - * object key name prefix, one or more object tags, object size, or any combination - * of these. Accordingly, this section describes the latest API. The previous - * version of the API supported filtering based only on an object key name prefix, - * which is supported for backward compatibility. For the related API description, - * see [PutBucketLifecycle]. - * - * A lifecycle rule consists of the following: - * - * ``` - * - A filter identifying a subset of objects to which the rule applies. The - * filter can be based on a key name prefix, object tags, object size, or any - * combination of these. - * - * - A status indicating whether the rule is in effect. - * - * - One or more lifecycle transition and expiration actions that you want - * Amazon S3 to perform on the objects identified by the filter. If the state of - * your bucket is versioning-enabled or versioning-suspended, you can have many - * versions of the same object (one current version and zero or more noncurrent - * versions). Amazon S3 provides predefined actions that you can specify for - * current and noncurrent object versions. - * ``` - * - * For more information, see [Object Lifecycle Management] and [Lifecycle Configuration Elements]. - * - * Permissions By default, all Amazon S3 resources are private, including buckets, - * objects, and related subresources (for example, lifecycle configuration and - * website configuration). Only the resource owner (that is, the Amazon Web - * Services account that created it) can access the resource. The resource owner - * can optionally grant access permissions to others by writing an access policy. - * For this operation, a user must get the s3:PutLifecycleConfiguration permission. - * - * You can also explicitly deny permissions. An explicit deny also supersedes any - * other permissions. If you want to block users or accounts from removing or - * deleting objects from your bucket, you must deny them permissions for the - * following actions: - * - * ``` - * - s3:DeleteObject - * - * - s3:DeleteObjectVersion - * - * - s3:PutLifecycleConfiguration - * ``` - * - * For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. - * - * The following operations are related to PutBucketLifecycleConfiguration : - * - * [Examples of Lifecycle Configuration] - * - * [GetBucketLifecycleConfiguration] - * - * [DeleteBucketLifecycle] - * - * [Examples of Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html - * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html - * [Lifecycle Configuration Elements]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html - * [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html - * [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html - * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html + * Fields returns the registered schema fields. */ - putBucketLifecycleConfiguration(ctx: context.Context, params: PutBucketLifecycleConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketLifecycleConfigurationOutput) + fields(): Array<(SchemaField | undefined)> } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Set the logging parameters for a bucket and to specify permissions for who can - * view and modify the logging parameters. All logs are saved to buckets in the - * same Amazon Web Services Region as the source bucket. To set the logging status - * of a bucket, you must be the bucket owner. - * - * The bucket owner is automatically granted FULL_CONTROL to all logs. You use the - * Grantee request element to grant access to other people. The Permissions - * request element specifies the kind of access the grantee has to the logs. - * - * If the target bucket for log delivery uses the bucket owner enforced setting - * for S3 Object Ownership, you can't use the Grantee request element to grant - * access to others. Permissions can only be granted using policies. For more - * information, see [Permissions for server access log delivery]in the Amazon S3 User Guide. - * - * Grantee Values You can specify the person (grantee) to whom you're assigning - * access rights (by using request elements) in the following ways: - * - * ``` - * - By the person's ID: - * ``` - * - * <>ID<><>GranteesEmail<> - * - * DisplayName is optional and ignored in the request. - * - * ``` - * - By Email address: - * ``` - * - * <>Grantees@email.com<> - * - * The grantee is resolved to the CanonicalUser and, in a response to a - * - * ``` - * GETObjectAcl request, appears as the CanonicalUser. - * - * - By URI: - * ``` - * - * <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> - * - * To enable logging, you use LoggingEnabled and its children request elements. To - * disable logging, you use an empty BucketLoggingStatus request element: - * - * For more information about server access logging, see [Server Access Logging] in the Amazon S3 User - * Guide. - * - * For more information about creating a bucket, see [CreateBucket]. For more information about - * returning the logging status of a bucket, see [GetBucketLogging]. - * - * The following operations are related to PutBucketLogging : - * - * [PutObject] - * - * [DeleteBucket] - * - * [CreateBucket] - * - * [GetBucketLogging] - * - * [Permissions for server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general - * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html - * [GetBucketLogging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [Server Access Logging]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html + * InitFieldsOptions calls `InitOptions()` for all schema fields. */ - putBucketLogging(ctx: context.Context, params: PutBucketLoggingInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketLoggingOutput) + initFieldsOptions(): void } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Sets a metrics configuration (specified by the metrics configuration ID) for - * the bucket. You can have up to 1,000 metrics configurations per bucket. If - * you're updating an existing metrics configuration, note that this is a full - * replacement of the existing metrics configuration. If you don't include the - * elements you want to keep, they are erased. - * - * To use this operation, you must have permissions to perform the - * s3:PutMetricsConfiguration action. The bucket owner has this permission by - * default. The bucket owner can grant this permission to others. For more - * information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. - * - * The following operations are related to PutBucketMetricsConfiguration : - * - * [DeleteBucketMetricsConfiguration] - * - * [GetBucketMetricsConfiguration] - * - * [ListBucketMetricsConfigurations] - * - * PutBucketMetricsConfiguration has the following special error: - * - * ``` - * - Error code: TooManyConfigurations - * - * - Description: You are attempting to create a new configuration but have - * already reached the 1,000-configuration limit. - * - * - HTTP Status Code: HTTP 400 Bad Request - * ``` - * - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html - * [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html - * [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html - * [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * Clone creates a deep clone of the current schema. */ - putBucketMetricsConfiguration(ctx: context.Context, params: PutBucketMetricsConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketMetricsConfigurationOutput) + clone(): (Schema) } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Enables notifications of specified events for a bucket. For more information - * about event notifications, see [Configuring Event Notifications]. - * - * Using this API, you can replace an existing notification configuration. The - * configuration is an XML file that defines the event types that you want Amazon - * S3 to publish and the destination where you want Amazon S3 to publish an event - * notification when it detects an event of the specified type. - * - * By default, your bucket has no event notifications configured. That is, the - * notification configuration will be an empty NotificationConfiguration . - * - * This action replaces the existing notification configuration with the - * configuration you include in the request body. - * - * After Amazon S3 receives this request, it first verifies that any Amazon Simple - * Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon SQS) - * destination exists, and that the bucket owner has permission to publish to it by - * sending a test notification. In the case of Lambda destinations, Amazon S3 - * verifies that the Lambda function permissions grant Amazon S3 permission to - * invoke the function from the Amazon S3 bucket. For more information, see [Configuring Notifications for Amazon S3 Events]. - * - * You can disable notifications by adding the empty NotificationConfiguration - * element. - * - * For more information about the number of event notification configurations that - * you can create per bucket, see [Amazon S3 service quotas]in Amazon Web Services General Reference. - * - * By default, only the bucket owner can configure notifications on a bucket. - * However, bucket owners can use a bucket policy to grant permission to other - * users to set this configuration with the required s3:PutBucketNotification - * permission. - * - * The PUT notification is an atomic operation. For example, suppose your - * notification configuration includes SNS topic, SQS queue, and Lambda function - * configurations. When you send a PUT request with this configuration, Amazon S3 - * sends test messages to your SNS topic. If the message fails, the entire PUT - * action will fail, and Amazon S3 will not add the configuration to your bucket. - * - * If the configuration in the request body includes only one TopicConfiguration - * specifying only the s3:ReducedRedundancyLostObject event type, the response - * will also include the x-amz-sns-test-message-id header containing the message - * ID of the test notification sent to the topic. - * - * The following action is related to PutBucketNotificationConfiguration : - * - * [GetBucketNotificationConfiguration] - * - * [Configuring Notifications for Amazon S3 Events]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - * [Amazon S3 service quotas]: https://docs.aws.amazon.com/general/latest/gr/s3.html#limits_s3 - * [GetBucketNotificationConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html - * [Configuring Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html + * AsMap returns a map with all registered schema field. + * The returned map is indexed with each field name. */ - putBucketNotificationConfiguration(ctx: context.Context, params: PutBucketNotificationConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketNotificationConfigurationOutput) + asMap(): _TygojaDict } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this - * operation, you must have the s3:PutBucketOwnershipControls permission. For more - * information about Amazon S3 permissions, see [Specifying permissions in a policy]. - * - * For information about Amazon S3 Object Ownership, see [Using object ownership]. - * - * The following operations are related to PutBucketOwnershipControls : - * - * # GetBucketOwnershipControls - * - * # DeleteBucketOwnershipControls - * - * [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-with-s3-actions.html - * [Using object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/about-object-ownership.html + * GetFieldById returns a single field by its id. */ - putBucketOwnershipControls(ctx: context.Context, params: PutBucketOwnershipControlsInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketOwnershipControlsOutput) + getFieldById(id: string): (SchemaField) } - interface Client { + interface Schema { /** - * Applies an Amazon S3 bucket policy to an Amazon S3 bucket. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Regional endpoint. These endpoints support path-style requests - * in the format https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints]in - * the Amazon S3 User Guide. - * - * Permissions If you are using an identity other than the root user of the Amazon - * Web Services account that owns the bucket, the calling identity must both have - * the PutBucketPolicy permissions on the specified bucket and belong to the - * bucket owner's account in order to use this operation. - * - * If you don't have PutBucketPolicy permissions, Amazon S3 returns a 403 Access - * Denied error. If you have the correct permissions, but you're not using an - * identity that belongs to the bucket owner's account, Amazon S3 returns a 405 - * Method Not Allowed error. - * - * To ensure that bucket owners don't inadvertently lock themselves out of their - * own buckets, the root principal in a bucket owner's Amazon Web Services account - * can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API - * actions, even if their bucket policy explicitly denies the root principal's - * access. Bucket owner root principals can only be blocked from performing these - * API actions by VPC endpoint policies and Amazon Web Services Organizations - * policies. - * - * ``` - * - General purpose bucket permissions - The s3:PutBucketPolicy permission is - * required in a policy. For more information about general purpose buckets bucket - * policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation, you - * must have the s3express:PutBucketPolicy permission in an IAM identity-based - * policy instead of a bucket policy. Cross-account access to this API operation - * isn't supported. This operation can only be performed by the Amazon Web Services - * account that owns the resource. For more information about directory bucket - * policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. - * ``` - * - * Example bucket policies General purpose buckets example bucket policies - See [Bucket policy examples] - * in the Amazon S3 User Guide. - * - * Directory bucket example bucket policies - See [Example bucket policies for S3 Express One Zone] in the Amazon S3 User Guide. - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * s3express-control.region.amazonaws.com . - * - * The following operations are related to PutBucketPolicy : - * - * [CreateBucket] - * - * [DeleteBucket] - * - * [Bucket policy examples]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html - * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html - * [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html + * GetFieldByName returns a single field by its name. */ - putBucketPolicy(ctx: context.Context, params: PutBucketPolicyInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketPolicyOutput) + getFieldByName(name: string): (SchemaField) } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Creates a replication configuration or replaces an existing one. For more - * information, see [Replication]in the Amazon S3 User Guide. - * - * Specify the replication configuration in the request body. In the replication - * configuration, you provide the name of the destination bucket or buckets where - * you want Amazon S3 to replicate objects, the IAM role that Amazon S3 can assume - * to replicate objects on your behalf, and other relevant information. You can - * invoke this request for a specific Amazon Web Services Region by using the [aws:RequestedRegion] - * aws:RequestedRegion condition key. - * - * A replication configuration must include at least one rule, and can contain a - * maximum of 1,000. Each rule identifies a subset of objects to replicate by - * filtering the objects in the source bucket. To choose additional subsets of - * objects to replicate, add a rule for each subset. - * - * To specify a subset of the objects in the source bucket to apply a replication - * rule to, add the Filter element as a child of the Rule element. You can filter - * objects based on an object key prefix, one or more object tags, or both. When - * you add the Filter element in the configuration, you must also add the following - * elements: DeleteMarkerReplication , Status , and Priority . - * - * If you are using an earlier version of the replication configuration, Amazon S3 - * handles replication of delete markers differently. For more information, see [Backward Compatibility]. - * - * For information about enabling versioning on a bucket, see [Using Versioning]. - * - * Handling Replication of Encrypted Objects By default, Amazon S3 doesn't - * replicate objects that are stored at rest using server-side encryption with KMS - * keys. To replicate Amazon Web Services KMS-encrypted objects, add the following: - * SourceSelectionCriteria , SseKmsEncryptedObjects , Status , - * EncryptionConfiguration , and ReplicaKmsKeyID . For information about - * replication configuration, see [Replicating Objects Created with SSE Using KMS keys]. - * - * For information on PutBucketReplication errors, see [List of replication-related error codes] - * - * Permissions To create a PutBucketReplication request, you must have - * s3:PutReplicationConfiguration permissions for the bucket. - * - * By default, a resource owner, in this case the Amazon Web Services account that - * created the bucket, can perform this operation. The resource owner can also - * grant others permissions to perform the operation. For more information about - * permissions, see [Specifying Permissions in a Policy]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * To perform this operation, the user or role performing the action must have the [iam:PassRole] - * permission. - * - * The following operations are related to PutBucketReplication : - * - * [GetBucketReplication] - * - * [DeleteBucketReplication] + * RemoveField removes a single schema field by its id. * - * [iam:PassRole]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html - * [GetBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html - * [aws:RequestedRegion]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requestedregion - * [Replicating Objects Created with SSE Using KMS keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html - * [Using Versioning]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html - * [List of replication-related error codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList - * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations - * [DeleteBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html + * This method does nothing if field with `id` doesn't exist. */ - putBucketReplication(ctx: context.Context, params: PutBucketReplicationInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketReplicationOutput) + removeField(id: string): void } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Sets the request payment configuration for a bucket. By default, the bucket - * owner pays for downloads from the bucket. This configuration parameter enables - * the bucket owner (only) to specify that the person requesting the download will - * be charged for the download. For more information, see [Requester Pays Buckets]. - * - * The following operations are related to PutBucketRequestPayment : - * - * [CreateBucket] + * AddField registers the provided newField to the current schema. * - * [GetBucketRequestPayment] + * If field with `newField.Id` already exist, the existing field is + * replaced with the new one. * - * [GetBucketRequestPayment]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html - * [Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html + * Otherwise the new field is appended to the other schema fields. */ - putBucketRequestPayment(ctx: context.Context, params: PutBucketRequestPaymentInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketRequestPaymentOutput) + addField(newField: SchemaField): void } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Sets the tags for a bucket. - * - * Use tags to organize your Amazon Web Services bill to reflect your own cost - * structure. To do this, sign up to get your Amazon Web Services account bill with - * tag key values included. Then, to see the cost of combined resources, organize - * your billing information according to resources with the same tag key values. - * For example, you can tag several resources with a specific application name, and - * then organize your billing information to see the total cost of that application - * across several services. For more information, see [Cost Allocation and Tagging]and [Using Cost Allocation in Amazon S3 Bucket Tags]. - * - * When this operation sets the tags for a bucket, it will overwrite any current - * tags the bucket already has. You cannot use this operation to add tags to an - * existing list of tags. - * - * To use this operation, you must have permissions to perform the - * s3:PutBucketTagging action. The bucket owner has this permission by default and - * can grant this permission to others. For more information about permissions, see - * [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. - * - * PutBucketTagging has the following special errors. For more Amazon S3 errors - * see, [Error Responses]. - * - * ``` - * - InvalidTag - The tag provided was not a valid tag. This error can occur if - * the tag did not pass input validation. For more information, see [Using Cost Allocation in Amazon S3 Bucket Tags]. - * - * - MalformedXML - The XML provided does not match the schema. - * - * - OperationAborted - A conflicting conditional action is currently in progress - * against this resource. Please try again. - * - * - InternalError - The service was unable to apply the provided tag to the - * bucket. - * ``` - * - * The following operations are related to PutBucketTagging : - * - * [GetBucketTagging] - * - * [DeleteBucketTagging] + * Validate makes Schema validatable by implementing [validation.Validatable] interface. * - * [Error Responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html - * [GetBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html - * [Cost Allocation and Tagging]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [DeleteBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html - * [Using Cost Allocation in Amazon S3 Bucket Tags]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html + * Internally calls each individual field's validator and additionally + * checks for invalid renamed fields and field name duplications. */ - putBucketTagging(ctx: context.Context, params: PutBucketTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketTaggingOutput) + validate(): void } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * When you enable versioning on a bucket for the first time, it might take a - * short amount of time for the change to be fully propagated. We recommend that - * you wait for 15 minutes after enabling versioning before issuing write - * operations ( PUT or DELETE ) on objects in the bucket. - * - * Sets the versioning state of an existing bucket. - * - * You can set the versioning state with one of the following values: - * - * Enabled—Enables versioning for the objects in the bucket. All objects added to - * the bucket receive a unique version ID. - * - * Suspended—Disables versioning for the objects in the bucket. All objects added - * to the bucket receive the version ID null. - * - * If the versioning state has never been set on a bucket, it has no versioning - * state; a [GetBucketVersioning]request does not return a versioning state value. - * - * In order to enable MFA Delete, you must be the bucket owner. If you are the - * bucket owner and want to enable MFA Delete in the bucket versioning - * configuration, you must include the x-amz-mfa request header and the Status and - * the MfaDelete request elements in a request to set the versioning state of the - * bucket. - * - * If you have an object expiration lifecycle configuration in your non-versioned - * bucket and you want to maintain the same permanent delete behavior when you - * enable versioning, you must add a noncurrent expiration policy. The noncurrent - * expiration lifecycle configuration will manage the deletes of the noncurrent - * object versions in the version-enabled bucket. (A version-enabled bucket - * maintains one current and zero or more noncurrent object versions.) For more - * information, see [Lifecycle and Versioning]. - * - * The following operations are related to PutBucketVersioning : - * - * [CreateBucket] - * - * [DeleteBucket] - * - * [GetBucketVersioning] - * - * [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html - * [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html - * [Lifecycle and Versioning]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config - * [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html + * MarshalJSON implements the [json.Marshaler] interface. */ - putBucketVersioning(ctx: context.Context, params: PutBucketVersioningInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketVersioningOutput) + marshalJSON(): string|Array } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Sets the configuration of the website that is specified in the website - * subresource. To configure a bucket as a website, you can add this subresource on - * the bucket with website configuration information such as the file name of the - * index document and any redirect rules. For more information, see [Hosting Websites on Amazon S3]. - * - * This PUT action requires the S3:PutBucketWebsite permission. By default, only - * the bucket owner can configure the website attached to a bucket; however, bucket - * owners can allow other users to set the website configuration by writing a - * bucket policy that grants them the S3:PutBucketWebsite permission. - * - * To redirect all website requests sent to the bucket's website endpoint, you add - * a website configuration with the following elements. Because all requests are - * sent to another website, you don't need to provide index document name for the - * bucket. - * - * ``` - * - WebsiteConfiguration - * - * - RedirectAllRequestsTo - * - * - HostName - * - * - Protocol - * ``` - * - * If you want granular control over redirects, you can use the following elements - * to add routing rules that describe conditions for redirecting requests and - * information about the redirect destination. In this case, the website - * configuration must provide an index document for the bucket, because some - * requests might not be redirected. - * - * ``` - * - WebsiteConfiguration - * - * - IndexDocument - * - * - Suffix - * - * - ErrorDocument - * - * - Key - * - * - RoutingRules - * - * - RoutingRule - * - * - Condition - * - * - HttpErrorCodeReturnedEquals - * - * - KeyPrefixEquals - * - * - Redirect - * - * - Protocol - * - * - HostName - * - * - ReplaceKeyPrefixWith - * - * - ReplaceKeyWith - * - * - HttpRedirectCode - * ``` - * - * Amazon S3 has a limitation of 50 routing rules per website configuration. If - * you require more than 50 routing rules, you can use object redirect. For more - * information, see [Configuring an Object Redirect]in the Amazon S3 User Guide. - * - * The maximum request length is limited to 128 KB. + * UnmarshalJSON implements the [json.Unmarshaler] interface. * - * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html - * [Configuring an Object Redirect]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html + * On success, all schema field options are auto initialized. */ - putBucketWebsite(ctx: context.Context, params: PutBucketWebsiteInput, ...optFns: ((_arg0: Options) => void)[]): (PutBucketWebsiteOutput) + unmarshalJSON(data: string|Array): void } - interface Client { + interface Schema { /** - * Adds an object to a bucket. - * - * ``` - * - Amazon S3 never adds partial objects; if you receive a success response, - * Amazon S3 added the entire object to the bucket. You cannot use PutObject to - * only update a single piece of metadata for an existing object. You must put the - * entire object with updated metadata if you want to update some values. - * - * - If your bucket uses the bucket owner enforced setting for Object Ownership, - * ACLs are disabled and no longer affect permissions. All objects written to the - * bucket by any account will be owned by the bucket owner. - * - * - Directory buckets - For directory buckets, you must make requests for this - * API operation to the Zonal endpoint. These endpoints support - * virtual-hosted-style requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . - * Path-style requests are not supported. For more information, see [Regional and Zonal endpoints]in the - * Amazon S3 User Guide. - * ``` - * - * Amazon S3 is a distributed system. If it receives multiple write requests for - * the same object simultaneously, it overwrites all but the last object written. - * However, Amazon S3 provides features that can modify this behavior: - * - * ``` - * - S3 Object Lock - To prevent objects from being deleted or overwritten, you - * can use [Amazon S3 Object Lock]in the Amazon S3 User Guide. - * ``` - * - * This functionality is not supported for directory buckets. - * - * ``` - * - S3 Versioning - When you enable versioning for a bucket, if Amazon S3 - * receives multiple write requests for the same object simultaneously, it stores - * all versions of the objects. For each write request that is made to the same - * object, Amazon S3 automatically generates a unique version ID of that object - * being stored in Amazon S3. You can retrieve, replace, or delete any version of - * the object. For more information about versioning, see [Adding Objects to Versioning-Enabled Buckets]in the Amazon S3 User - * Guide. For information about returning the versioning state of a bucket, see [GetBucketVersioning] - * . - * ``` - * - * This functionality is not supported for directory buckets. - * - * Permissions - * - * ``` - * - General purpose bucket permissions - The following permissions are required - * in your policies when your PutObject request includes specific headers. - * - * - s3:PutObject - To successfully complete the PutObject request, you must - * always have the s3:PutObject permission on a bucket to add an object to it. - * - * - s3:PutObjectAcl - To successfully change the objects ACL of your PutObject - * request, you must have the s3:PutObjectAcl . - * - * - s3:PutObjectTagging - To successfully set the tag-set with your PutObject - * request, you must have the s3:PutObjectTagging . - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * If the object is encrypted with SSE-KMS, you must also have the - * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` - * - * Data integrity with Content-MD5 - * - * ``` - * - General purpose bucket - To ensure that data is not corrupted traversing - * the network, use the Content-MD5 header. When you use this header, Amazon S3 - * checks the object against the provided MD5 value and, if they do not match, - * Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 - * digest, you can calculate the MD5 while putting the object to Amazon S3 and - * compare the returned ETag to the calculated MD5 value. - * - * - Directory bucket - This functionality is not supported for directory - * buckets. - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * For more information about related Amazon S3 APIs, see the following: - * - * [CopyObject] - * - * [DeleteObject] - * - * [Amazon S3 Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html - * [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Adding Objects to Versioning-Enabled Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html + * Value implements the [driver.Valuer] interface. */ - putObject(ctx: context.Context, params: PutObjectInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectOutput) + value(): any } - interface Client { + interface Schema { /** - * This operation is not supported by directory buckets. - * - * Uses the acl subresource to set the access control list (ACL) permissions for a - * new or existing object in an S3 bucket. You must have the WRITE_ACP permission - * to set the ACL of an object. For more information, see [What permissions can I grant?]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * Depending on your application needs, you can choose to set the ACL on an object - * using either the request body or the headers. For example, if you have an - * existing application that updates a bucket ACL using the request body, you can - * continue to use that approach. For more information, see [Access Control List (ACL) Overview]in the Amazon S3 User - * Guide. - * - * If your bucket uses the bucket owner enforced setting for S3 Object Ownership, - * ACLs are disabled and no longer affect permissions. You must use policies to - * grant access to your bucket and the objects in it. Requests to set ACLs or - * update ACLs fail and return the AccessControlListNotSupported error code. - * Requests to read ACLs are still supported. For more information, see [Controlling object ownership]in the - * Amazon S3 User Guide. - * - * Permissions You can set access permissions using one of the following methods: - * - * ``` - * - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports a - * set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined - * set of grantees and permissions. Specify the canned ACL name as the value of - * x-amz-ac l. If you use this header, you cannot use other access - * control-specific headers in your request. For more information, see [Canned ACL]. - * - * - Specify access permissions explicitly with the x-amz-grant-read , - * x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control - * headers. When using these headers, you specify explicit access permissions and - * grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the - * permission. If you use these ACL-specific headers, you cannot use x-amz-acl - * header to set a canned ACL. These parameters map to the set of permissions that - * Amazon S3 supports in an ACL. For more information, see [Access Control List (ACL) Overview]. - * ``` - * - * You specify each grantee as a type=value pair, where the type is one of the - * - * ``` - * following: - * - * - id – if the value specified is the canonical user ID of an Amazon Web - * Services account - * - * - uri – if you are granting permissions to a predefined group - * - * - emailAddress – if the value specified is the email address of an Amazon Web - * Services account - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * - * ``` - * Amazon Web Services General Reference. - * ``` - * - * For example, the following x-amz-grant-read header grants list objects - * - * ``` - * permission to the two Amazon Web Services accounts identified by their email - * addresses. - * ``` - * - * x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" - * - * You can use either a canned ACL or specify access permissions explicitly. You - * cannot do both. - * - * Grantee Values You can specify the person (grantee) to whom you're assigning - * access rights (using request elements) in the following ways: - * - * ``` - * - By the person's ID: - * ``` - * - * <>ID<><>GranteesEmail<> - * - * DisplayName is optional and ignored in the request. - * - * ``` - * - By URI: - * ``` - * - * <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> - * - * ``` - * - By Email address: - * ``` - * - * <>Grantees@email.com<>lt;/Grantee> - * - * The grantee is resolved to the CanonicalUser and, in a response to a GET Object - * - * ``` - * acl request, appears as the CanonicalUser. - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * - * ``` - * Amazon Web Services General Reference. - * ``` - * - * Versioning The ACL of an object is set at the object version level. By default, - * PUT sets the ACL of the current version of an object. To set the ACL of a - * different version, use the versionId subresource. - * - * The following operations are related to PutObjectAcl : - * - * [CopyObject] - * - * [GetObject] - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - * [Controlling object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [What permissions can I grant?]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current Schema instance. */ - putObjectAcl(ctx: context.Context, params: PutObjectAclInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectAclOutput) + scan(value: any): void } - interface Client { +} + +/** + * Package models implements all PocketBase DB models and DTOs. + */ +namespace models { + type _subtoHHr = BaseModel + interface Admin extends _subtoHHr { + avatar: number + email: string + tokenKey: string + passwordHash: string + lastResetSentAt: types.DateTime + } + interface Admin { /** - * This operation is not supported by directory buckets. - * - * Applies a legal hold configuration to the specified object. For more - * information, see [Locking Objects]. - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + * TableName returns the Admin model SQL table name. */ - putObjectLegalHold(ctx: context.Context, params: PutObjectLegalHoldInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectLegalHoldOutput) + tableName(): string } - interface Client { + interface Admin { /** - * This operation is not supported by directory buckets. - * - * Places an Object Lock configuration on the specified bucket. The rule specified - * in the Object Lock configuration will be applied by default to every new object - * placed in the specified bucket. For more information, see [Locking Objects]. - * - * ``` - * - The DefaultRetention settings require both a mode and a period. - * - * - The DefaultRetention period can be either Days or Years but you must select - * one. You cannot specify Days and Years at the same time. - * - * - You can enable Object Lock for new or existing buckets. For more - * information, see [Configuring Object Lock]. - * ``` - * - * [Configuring Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html - * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + * ValidatePassword validates a plain password against the model's password. */ - putObjectLockConfiguration(ctx: context.Context, params: PutObjectLockConfigurationInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectLockConfigurationOutput) + validatePassword(password: string): boolean } - interface Client { + interface Admin { /** - * This operation is not supported by directory buckets. - * - * Places an Object Retention configuration on an object. For more information, - * see [Locking Objects]. Users or accounts require the s3:PutObjectRetention permission in order - * to place an Object Retention configuration on objects. Bypassing a Governance - * Retention configuration requires the s3:BypassGovernanceRetention permission. - * - * This functionality is not supported for Amazon S3 on Outposts. + * SetPassword sets cryptographically secure string to `model.Password`. * - * [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html + * Additionally this method also resets the LastResetSentAt and the TokenKey fields. */ - putObjectRetention(ctx: context.Context, params: PutObjectRetentionInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectRetentionOutput) + setPassword(password: string): void } - interface Client { + interface Admin { /** - * This operation is not supported by directory buckets. - * - * Sets the supplied tag-set to an object that already exists in a bucket. A tag - * is a key-value pair. For more information, see [Object Tagging]. - * - * You can associate tags with an object by sending a PUT request against the - * tagging subresource that is associated with the object. You can retrieve tags by - * sending a GET request. For more information, see [GetObjectTagging]. - * - * For tagging-related restrictions related to characters and encodings, see [Tag Restrictions]. - * Note that Amazon S3 limits the maximum number of tags to 10 tags per object. - * - * To use this operation, you must have permission to perform the - * s3:PutObjectTagging action. By default, the bucket owner has this permission and - * can grant this permission to others. - * - * To put tags of any other version, use the versionId query parameter. You also - * need permission for the s3:PutObjectVersionTagging action. - * - * PutObjectTagging has the following special errors. For more Amazon S3 errors - * see, [Error Responses]. - * - * ``` - * - InvalidTag - The tag provided was not a valid tag. This error can occur if - * the tag did not pass input validation. For more information, see [Object Tagging]. - * - * - MalformedXML - The XML provided does not match the schema. - * - * - OperationAborted - A conflicting conditional action is currently in progress - * against this resource. Please try again. - * - * - InternalError - The service was unable to apply the provided tag to the - * object. - * ``` - * - * The following operations are related to PutObjectTagging : - * - * [GetObjectTagging] - * - * [DeleteObjectTagging] - * - * [Error Responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html - * [DeleteObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html - * [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html - * [Tag Restrictions]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html - * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html + * RefreshTokenKey generates and sets new random token key. */ - putObjectTagging(ctx: context.Context, params: PutObjectTaggingInput, ...optFns: ((_arg0: Options) => void)[]): (PutObjectTaggingOutput) + refreshTokenKey(): void } - interface Client { + // @ts-ignore + import validation = ozzo_validation + type _subeuljo = BaseModel + interface Collection extends _subeuljo { + name: string + type: string + system: boolean + schema: schema.Schema + indexes: types.JsonArray /** - * This operation is not supported by directory buckets. - * - * Creates or modifies the PublicAccessBlock configuration for an Amazon S3 - * bucket. To use this operation, you must have the s3:PutBucketPublicAccessBlock - * permission. For more information about Amazon S3 permissions, see [Specifying Permissions in a Policy]. - * - * When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or an - * object, it checks the PublicAccessBlock configuration for both the bucket (or - * the bucket that contains the object) and the bucket owner's account. If the - * PublicAccessBlock configurations are different between the bucket and the - * account, Amazon S3 uses the most restrictive combination of the bucket-level and - * account-level settings. - * - * For more information about when Amazon S3 considers a bucket or an object - * public, see [The Meaning of "Public"]. - * - * The following operations are related to PutPublicAccessBlock : - * - * [GetPublicAccessBlock] - * - * [DeletePublicAccessBlock] - * - * [GetBucketPolicyStatus] - * - * [Using Amazon S3 Block Public Access] - * - * [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html - * [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html - * [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html - * [GetBucketPolicyStatus]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html - * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + * rules */ - putPublicAccessBlock(ctx: context.Context, params: PutPublicAccessBlockInput, ...optFns: ((_arg0: Options) => void)[]): (PutPublicAccessBlockOutput) + listRule?: string + viewRule?: string + createRule?: string + updateRule?: string + deleteRule?: string + options: types.JsonMap } - interface Client { + interface Collection { /** - * This operation is not supported by directory buckets. - * - * The SELECT job type for the RestoreObject operation is no longer available to - * new customers. Existing customers of Amazon S3 Select can continue to use the - * feature as usual. [Learn more] - * - * # Restores an archived copy of an object back into Amazon S3 - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * This action performs the following types of requests: - * - * ``` - * - restore an archive - Restore an archived object - * ``` - * - * For more information about the S3 structure in the request body, see the - * following: - * - * [PutObject] - * - * [Managing Access with ACLs] - * ``` - * - in the Amazon S3 User Guide - * ``` - * - * [Protecting Data Using Server-Side Encryption] - * ``` - * - in the Amazon S3 User Guide - * ``` - * - * Permissions To use this operation, you must have permissions to perform the - * s3:RestoreObject action. The bucket owner has this permission by default and can - * grant this permission to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] - * and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. - * - * Restoring objects Objects that you archive to the S3 Glacier Flexible Retrieval - * Flexible Retrieval or S3 Glacier Deep Archive storage class, and S3 - * Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep Archive tiers, are - * not accessible in real time. For objects in the S3 Glacier Flexible Retrieval - * Flexible Retrieval or S3 Glacier Deep Archive storage classes, you must first - * initiate a restore request, and then wait until a temporary copy of the object - * is available. If you want a permanent copy of the object, create a copy of it in - * the Amazon S3 Standard storage class in your S3 bucket. To access an archived - * object, you must restore the object for the duration (number of days) that you - * specify. For objects in the Archive Access or Deep Archive Access tiers of S3 - * Intelligent-Tiering, you must first initiate a restore request, and then wait - * until the object is moved into the Frequent Access tier. - * - * To restore a specific object version, you can provide a version ID. If you - * don't provide a version ID, Amazon S3 restores the current version. - * - * When restoring an archived object, you can specify one of the following data - * access tier options in the Tier element of the request body: - * - * ``` - * - Expedited - Expedited retrievals allow you to quickly access your data - * stored in the S3 Glacier Flexible Retrieval Flexible Retrieval storage class or - * S3 Intelligent-Tiering Archive tier when occasional urgent requests for - * restoring archives are required. For all but the largest archived objects (250 - * MB+), data accessed using Expedited retrievals is typically made available - * within 1–5 minutes. Provisioned capacity ensures that retrieval capacity for - * Expedited retrievals is available when you need it. Expedited retrievals and - * provisioned capacity are not available for objects stored in the S3 Glacier Deep - * Archive storage class or S3 Intelligent-Tiering Deep Archive tier. - * - * - Standard - Standard retrievals allow you to access any of your archived - * objects within several hours. This is the default option for retrieval requests - * that do not specify the retrieval option. Standard retrievals typically finish - * within 3–5 hours for objects stored in the S3 Glacier Flexible Retrieval - * Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. They - * typically finish within 12 hours for objects stored in the S3 Glacier Deep - * Archive storage class or S3 Intelligent-Tiering Deep Archive tier. Standard - * retrievals are free for objects stored in S3 Intelligent-Tiering. - * - * - Bulk - Bulk retrievals free for objects stored in the S3 Glacier Flexible - * Retrieval and S3 Intelligent-Tiering storage classes, enabling you to retrieve - * large amounts, even petabytes, of data at no cost. Bulk retrievals typically - * finish within 5–12 hours for objects stored in the S3 Glacier Flexible Retrieval - * Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. Bulk - * retrievals are also the lowest-cost retrieval option when restoring objects from - * S3 Glacier Deep Archive. They typically finish within 48 hours for objects - * stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering - * Deep Archive tier. - * ``` - * - * For more information about archive retrieval options and provisioned capacity - * for Expedited data access, see [Restoring Archived Objects] in the Amazon S3 User Guide. - * - * You can use Amazon S3 restore speed upgrade to change the restore speed to a - * faster speed while it is in progress. For more information, see [Upgrading the speed of an in-progress restore]in the Amazon - * S3 User Guide. - * - * To get the status of object restoration, you can send a HEAD request. - * Operations return the x-amz-restore header, which provides information about - * the restoration status, in the response. You can use Amazon S3 event - * notifications to notify you when a restore is initiated or completed. For more - * information, see [Configuring Amazon S3 Event Notifications]in the Amazon S3 User Guide. - * - * After restoring an archived object, you can update the restoration period by - * reissuing the request with a new period. Amazon S3 updates the restoration - * period relative to the current time and charges only for the request-there are - * no data transfer charges. You cannot update the restoration period when Amazon - * S3 is actively processing your current restore request for the object. - * - * If your bucket has a lifecycle configuration with a rule that includes an - * expiration action, the object expiration overrides the life span that you - * specify in a restore request. For example, if you restore an object copy for 10 - * days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the - * object in 3 days. For more information about lifecycle configuration, see [PutBucketLifecycleConfiguration]and [Object Lifecycle Management] - * in Amazon S3 User Guide. - * - * Responses A successful action returns either the 200 OK or 202 Accepted status - * code. - * - * ``` - * - If the object is not previously restored, then Amazon S3 returns 202 - * Accepted in the response. - * - * - If the object is previously restored, Amazon S3 returns 200 OK in the - * response. - * - * - Special errors: - * - * - Code: RestoreAlreadyInProgress - * - * - Cause: Object restore is already in progress. - * - * - HTTP Status Code: 409 Conflict - * - * - SOAP Fault Code Prefix: Client - * - * - Code: GlacierExpeditedRetrievalNotAvailable - * - * - Cause: expedited retrievals are currently not available. Try again later. - * (Returned if there is insufficient capacity to process the Expedited request. - * This error applies only to Expedited retrievals and not to S3 Standard or Bulk - * retrievals.) - * - * - HTTP Status Code: 503 - * - * - SOAP Fault Code Prefix: N/A - * ``` - * - * The following operations are related to RestoreObject : - * - * [PutBucketLifecycleConfiguration] - * - * [GetBucketNotificationConfiguration] - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html - * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html - * [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources - * [Configuring Amazon S3 Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - * [Managing Access with ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html - * [Protecting Data Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html - * [GetBucketNotificationConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html - * [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html - * [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html - * [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html - * [Upgrading the speed of an in-progress restore]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html + * TableName returns the Collection model SQL table name. */ - restoreObject(ctx: context.Context, params: RestoreObjectInput, ...optFns: ((_arg0: Options) => void)[]): (RestoreObjectOutput) + tableName(): string } - // @ts-ignore - import smithysync = sync - interface Client { + interface Collection { /** - * This operation is not supported by directory buckets. - * - * The SelectObjectContent operation is no longer available to new customers. - * Existing customers of Amazon S3 Select can continue to use the operation as - * usual. [Learn more] - * - * This action filters the contents of an Amazon S3 object based on a simple - * structured query language (SQL) statement. In the request, along with the SQL - * expression, you must also specify a data serialization format (JSON, CSV, or - * Apache Parquet) of the object. Amazon S3 uses this format to parse object data - * into records, and returns only records that match the specified SQL expression. - * You must also specify the data serialization format for the response. - * - * This functionality is not supported for Amazon S3 on Outposts. - * - * For more information about Amazon S3 Select, see [Selecting Content from Objects] and [SELECT Command] in the Amazon S3 User - * Guide. - * - * Permissions You must have the s3:GetObject permission for this operation. - * Amazon S3 Select does not support anonymous access. For more information about - * permissions, see [Specifying Permissions in a Policy]in the Amazon S3 User Guide. - * - * Object Data Formats You can use Amazon S3 Select to query objects that have the - * following format properties: - * - * ``` - * - CSV, JSON, and Parquet - Objects must be in CSV, JSON, or Parquet format. - * - * - UTF-8 - UTF-8 is the only encoding type Amazon S3 Select supports. - * - * - GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP or BZIP2. - * GZIP and BZIP2 are the only compression formats that Amazon S3 Select supports - * for CSV and JSON files. Amazon S3 Select supports columnar compression for - * Parquet using GZIP or Snappy. Amazon S3 Select does not support whole-object - * compression for Parquet objects. - * - * - Server-side encryption - Amazon S3 Select supports querying objects that - * are protected with server-side encryption. - * ``` - * - * For objects that are encrypted with customer-provided encryption keys (SSE-C), - * - * ``` - * you must use HTTPS, and you must use the headers that are documented in the [GetObject]. - * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)]in the Amazon S3 User Guide. - * ``` - * - * For objects that are encrypted with Amazon S3 managed keys (SSE-S3) and Amazon - * - * ``` - * Web Services KMS keys (SSE-KMS), server-side encryption is handled - * transparently, so you don't need to specify anything. For more information about - * server-side encryption, including SSE-S3 and SSE-KMS, see [Protecting Data Using Server-Side Encryption]in the Amazon S3 - * User Guide. - * ``` - * - * Working with the Response Body Given the response size is unknown, Amazon S3 - * Select streams the response as a series of messages and includes a - * Transfer-Encoding header with chunked as its value in the response. For more - * information, see [Appendix: SelectObjectContent Response]. - * - * GetObject Support The SelectObjectContent action does not support the following - * GetObject functionality. For more information, see [GetObject]. - * - * ``` - * - Range : Although you can specify a scan range for an Amazon S3 Select - * request (see [SelectObjectContentRequest - ScanRange]in the request parameters), you cannot specify the range of - * bytes of an object to return. - * - * - The GLACIER , DEEP_ARCHIVE , and REDUCED_REDUNDANCY storage classes, or the - * ARCHIVE_ACCESS and DEEP_ARCHIVE_ACCESS access tiers of the INTELLIGENT_TIERING - * storage class: You cannot query objects in the GLACIER , DEEP_ARCHIVE , or - * REDUCED_REDUNDANCY storage classes, nor objects in the ARCHIVE_ACCESS or - * DEEP_ARCHIVE_ACCESS access tiers of the INTELLIGENT_TIERING storage class. For - * more information about storage classes, see [Using Amazon S3 storage classes]in the Amazon S3 User Guide. - * ``` - * - * Special Errors For a list of special errors for this operation, see [List of SELECT Object Content Error Codes] - * - * The following operations are related to SelectObjectContent : - * - * [GetObject] - * - * [GetBucketLifecycleConfiguration] - * - * [PutBucketLifecycleConfiguration] - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [Selecting Content from Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html - * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html - * [List of SELECT Object Content Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList - * [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html - * [Using Amazon S3 storage classes]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html - * [SELECT Command]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-glacier-select-sql-reference-select.html - * [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html - * [Appendix: SelectObjectContent Response]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html - * [SelectObjectContentRequest - ScanRange]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - * - * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - * [Protecting Data Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html + * BaseFilesPath returns the storage dir path used by the collection. */ - selectObjectContent(ctx: context.Context, params: SelectObjectContentInput, ...optFns: ((_arg0: Options) => void)[]): (SelectObjectContentOutput) + baseFilesPath(): string } - interface Client { + interface Collection { /** - * Uploads a part in a multipart upload. - * - * In this operation, you provide new data as a part of an object in your request. - * However, you have an option to specify your existing Amazon S3 object as a data - * source for the part you are uploading. To upload a part from an existing object, - * you use the [UploadPartCopy]operation. - * - * You must initiate a multipart upload (see [CreateMultipartUpload]) before you can upload any part. In - * response to your initiate request, Amazon S3 returns an upload ID, a unique - * identifier that you must include in your upload part request. - * - * Part numbers can be any number from 1 to 10,000, inclusive. A part number - * uniquely identifies a part and also defines its position within the object being - * created. If you upload a new part using the same part number that was used with - * a previous part, the previously uploaded part is overwritten. - * - * For information about maximum and minimum part sizes and other multipart upload - * specifications, see [Multipart upload limits]in the Amazon S3 User Guide. - * - * After you initiate multipart upload and upload one or more parts, you must - * either complete or abort multipart upload in order to stop getting charged for - * storage of the uploaded parts. Only after you either complete or abort multipart - * upload, Amazon S3 frees up the parts storage and stops charging you for the - * parts storage. - * - * For more information on multipart uploads, go to [Multipart Upload Overview] in the Amazon S3 User Guide . - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Zonal endpoint. These endpoints support virtual-hosted-style - * requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Permissions - * ``` - * - General purpose bucket permissions - To perform a multipart upload with - * encryption using an Key Management Service key, the requester must have - * permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. The - * requester must also have permissions for the kms:GenerateDataKey action for - * the CreateMultipartUpload API. Then, the requester needs permissions for the - * kms:Decrypt action on the UploadPart and UploadPartCopy APIs. - * ``` - * - * These permissions are required because Amazon S3 must decrypt and read data - * - * ``` - * from the encrypted file parts before it completes the multipart upload. For more - * information about KMS permissions, see [Protecting data using server-side encryption with KMS]in the Amazon S3 User Guide. For - * information about the permissions required to use the multipart upload API, see [Multipart upload and permissions] - * and [Multipart upload API and permissions]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - To grant access to this API operation on a - * directory bucket, we recommend that you use the [CreateSession]CreateSession API operation - * for session-based authorization. Specifically, you grant the - * s3express:CreateSession permission to the directory bucket in a bucket policy - * or an IAM identity-based policy. Then, you make the CreateSession API call on - * the bucket to obtain a session token. With the session token in your request - * header, you can make API requests to this operation. After the session token - * expires, you make another CreateSession API call to generate a new session - * token for use. Amazon Web Services CLI or SDKs create session and refresh the - * session token automatically to avoid service interruptions when a session - * expires. For more information about authorization, see [CreateSession]CreateSession . - * ``` - * - * If the object is encrypted with SSE-KMS, you must also have the - * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` - * - * Data integrity General purpose bucket - To ensure that data is not corrupted - * traversing the network, specify the Content-MD5 header in the upload part - * request. Amazon S3 checks the part data against the provided MD5 value. If they - * do not match, Amazon S3 returns an error. If the upload request is signed with - * Signature Version 4, then Amazon Web Services S3 uses the x-amz-content-sha256 - * header as a checksum instead of Content-MD5 . For more information see [Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)]. - * - * Directory buckets - MD5 is not supported by directory buckets. You can use - * checksum algorithms to check object integrity. - * - * Encryption - * ``` - * - General purpose bucket - Server-side encryption is for data encryption at - * rest. Amazon S3 encrypts your data as it writes it to disks in its data centers - * and decrypts it when you access it. You have mutually exclusive options to - * protect data using server-side encryption in Amazon S3, depending on how you - * choose to manage the encryption keys. Specifically, the encryption key options - * are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and - * Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side - * encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally - * tell Amazon S3 to encrypt data at rest using server-side encryption with other - * key options. The option you use depends on whether you want to use KMS keys - * (SSE-KMS) or provide your own encryption key (SSE-C). - * ``` - * - * Server-side encryption is supported by the S3 Multipart Upload operations. - * - * ``` - * Unless you are using a customer-provided encryption key (SSE-C), you don't need - * to specify the encryption parameters in each UploadPart request. Instead, you - * only need to specify the server-side encryption parameters in the initial - * Initiate Multipart request. For more information, see [CreateMultipartUpload]. - * ``` - * - * If you request server-side encryption using a customer-provided encryption key - * - * ``` - * (SSE-C) in your initiate multipart upload request, you must provide identical - * encryption information in each part upload using the following request headers. - * - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information, see [Using Server-Side Encryption]in the Amazon S3 User Guide. - * - * ``` - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: server-side encryption with Amazon S3 - * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys - * (SSE-KMS) ( aws:kms ). - * ``` - * - * Special errors - * - * ``` - * - Error Code: NoSuchUpload - * - * - Description: The specified multipart upload does not exist. The upload ID - * might be invalid, or the multipart upload might have been aborted or completed. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to UploadPart : - * - * [CreateMultipartUpload] - * - * [CompleteMultipartUpload] - * - * [AbortMultipartUpload] - * - * [ListParts] - * - * [ListMultipartUploads] - * - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html - * [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html - * [Multipart upload limits]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html - * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html - * - * [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html - * [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html - * [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions + * IsBase checks if the current collection has "base" type. */ - uploadPart(ctx: context.Context, params: UploadPartInput, ...optFns: ((_arg0: Options) => void)[]): (UploadPartOutput) + isBase(): boolean } - interface Client { + interface Collection { /** - * Uploads a part by copying data from an existing object as data source. To - * specify the data source, you add the request header x-amz-copy-source in your - * request. To specify a byte range, you add the request header - * x-amz-copy-source-range in your request. - * - * For information about maximum and minimum part sizes and other multipart upload - * specifications, see [Multipart upload limits]in the Amazon S3 User Guide. - * - * Instead of copying data from an existing object as part data, you might use the [UploadPart] - * action to upload new data as a part of an object in your request. - * - * You must initiate a multipart upload before you can upload any part. In - * response to your initiate request, Amazon S3 returns the upload ID, a unique - * identifier that you must include in your upload part request. - * - * For conceptual information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User - * Guide. For information about copying objects using a single atomic action vs. a - * multipart upload, see [Operations on Objects]in the Amazon S3 User Guide. - * - * Directory buckets - For directory buckets, you must make requests for this API - * operation to the Zonal endpoint. These endpoints support virtual-hosted-style - * requests in the format - * https://bucket_name.s3express-az_id.region.amazonaws.com/key-name . Path-style - * requests are not supported. For more information, see [Regional and Zonal endpoints]in the Amazon S3 User - * Guide. - * - * Authentication and authorization All UploadPartCopy requests must be - * authenticated and signed by using IAM credentials (access key ID and secret - * access key for the IAM identities). All headers with the x-amz- prefix, - * including x-amz-copy-source , must be signed. For more information, see [REST Authentication]. - * - * Directory buckets - You must use IAM credentials to authenticate and authorize - * your access to the UploadPartCopy API operation, instead of using the temporary - * security credentials through the CreateSession API operation. - * - * Amazon Web Services CLI or SDKs handles authentication and authorization on - * your behalf. - * - * Permissions You must have READ access to the source object and WRITE access to - * the destination bucket. - * - * ``` - * - General purpose bucket permissions - You must have the permissions in a - * policy based on the bucket types of your source bucket and destination bucket in - * an UploadPartCopy operation. - * - * - If the source object is in a general purpose bucket, you must have the - * s3:GetObject permission to read the source object that is being copied. - * - * - If the destination bucket is a general purpose bucket, you must have the - * s3:PutObject permission to write the object copy to the destination bucket. - * - * - To perform a multipart upload with encryption using an Key Management - * Service key, the requester must have permission to the kms:Decrypt and - * kms:GenerateDataKey actions on the key. The requester must also have - * permissions for the kms:GenerateDataKey action for the CreateMultipartUpload - * API. Then, the requester needs permissions for the kms:Decrypt action on the - * UploadPart and UploadPartCopy APIs. These permissions are required because - * Amazon S3 must decrypt and read data from the encrypted file parts before it - * completes the multipart upload. For more information about KMS permissions, see [Protecting data using server-side encryption with KMS] - * in the Amazon S3 User Guide. For information about the permissions required to - * use the multipart upload API, see [Multipart upload and permissions]and [Multipart upload API and permissions]in the Amazon S3 User Guide. - * - * - Directory bucket permissions - You must have permissions in a bucket policy - * or an IAM identity-based policy based on the source and destination bucket types - * in an UploadPartCopy operation. - * - * - If the source object that you want to copy is in a directory bucket, you - * must have the s3express:CreateSession permission in the Action element of a - * policy to read the object. By default, the session is in the ReadWrite mode. - * If you want to restrict the access, you can explicitly set the - * s3express:SessionMode condition key to ReadOnly on the copy source bucket. - * - * - If the copy destination is a directory bucket, you must have the - * s3express:CreateSession permission in the Action element of a policy to write - * the object to the destination. The s3express:SessionMode condition key cannot - * be set to ReadOnly on the copy destination. - * ``` - * - * If the object is encrypted with SSE-KMS, you must also have the - * - * ``` - * kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies - * and KMS key policies for the KMS key. - * ``` - * - * For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. - * - * Encryption - * ``` - * - General purpose buckets - - * ``` - * - * For information about using server-side encryption with customer-provided - * - * ``` - * encryption keys with the UploadPartCopy operation, see [CopyObject]and [UploadPart]. - * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: server-side encryption with Amazon S3 - * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys - * (SSE-KMS) ( aws:kms ). For more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. - * ``` - * - * For directory buckets, when you perform a CreateMultipartUpload operation and an - * - * ``` - * UploadPartCopy operation, - * ``` - * - * the request headers you provide in the CreateMultipartUpload request must match - * - * ``` - * the default encryption configuration of the destination bucket. - * ``` - * - * S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from - * - * ``` - * general purpose buckets - * ``` - * - * to directory buckets, from directory buckets to general purpose buckets, or - * - * ``` - * between directory buckets, through [UploadPartCopy]. In this case, Amazon S3 makes a call to - * KMS every time a copy request is made for a KMS-encrypted object. - * ``` - * - * Special errors - * - * ``` - * - Error Code: NoSuchUpload - * - * - Description: The specified multipart upload does not exist. The upload ID - * might be invalid, or the multipart upload might have been aborted or completed. - * - * - HTTP Status Code: 404 Not Found - * - * - Error Code: InvalidRequest - * - * - Description: The specified copy source is not supported as a byte-range - * copy source. - * - * - HTTP Status Code: 400 Bad Request - * ``` - * - * HTTP Host header syntax Directory buckets - The HTTP Host header syntax is - * Bucket_name.s3express-az_id.region.amazonaws.com . - * - * The following operations are related to UploadPartCopy : - * - * [CreateMultipartUpload] - * - * [UploadPart] - * - * [CompleteMultipartUpload] - * - * [AbortMultipartUpload] - * - * [ListParts] - * - * [ListMultipartUploads] - * - * [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html - * [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html - * [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html - * [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html - * [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html - * [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions - * [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html - * [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html - * [Multipart upload limits]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html - * [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html - * [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html - * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - * [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html - * [Operations on Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html - * [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html - * - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + * IsAuth checks if the current collection has "auth" type. */ - uploadPartCopy(ctx: context.Context, params: UploadPartCopyInput, ...optFns: ((_arg0: Options) => void)[]): (UploadPartCopyOutput) - } - interface Client { - /** - * This operation is not supported by directory buckets. - * - * Passes transformed objects to a GetObject operation when using Object Lambda - * access points. For information about Object Lambda access points, see [Transforming objects with Object Lambda access points]in the - * Amazon S3 User Guide. - * - * This operation supports metadata that can be returned by [GetObject], in addition to - * RequestRoute , RequestToken , StatusCode , ErrorCode , and ErrorMessage . The - * GetObject response metadata is supported so that the WriteGetObjectResponse - * caller, typically an Lambda function, can provide the same metadata when it - * internally invokes GetObject . When WriteGetObjectResponse is called by a - * customer-owned Lambda function, the metadata returned to the end user GetObject - * call might differ from what Amazon S3 would normally return. - * - * You can include any number of metadata headers. When including a metadata - * header, it should be prefaced with x-amz-meta . For example, - * x-amz-meta-my-custom-header: MyCustomValue . The primary use case for this is to - * forward GetObject metadata. - * - * Amazon Web Services provides some prebuilt Lambda functions that you can use - * with S3 Object Lambda to detect and redact personally identifiable information - * (PII) and decompress S3 objects. These Lambda functions are available in the - * Amazon Web Services Serverless Application Repository, and can be selected - * through the Amazon Web Services Management Console when you create your Object - * Lambda access point. - * - * Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, a - * natural language processing (NLP) service using machine learning to find - * insights and relationships in text. It automatically detects personally - * identifiable information (PII) such as names, addresses, dates, credit card - * numbers, and social security numbers from documents in your Amazon S3 bucket. - * - * Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a - * natural language processing (NLP) service using machine learning to find - * insights and relationships in text. It automatically redacts personally - * identifiable information (PII) such as names, addresses, dates, credit card - * numbers, and social security numbers from documents in your Amazon S3 bucket. - * - * Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, is - * equipped to decompress objects stored in S3 in one of six compressed file - * formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. - * - * For information on how to view and use these functions, see [Using Amazon Web Services built Lambda functions] in the Amazon S3 - * User Guide. - * - * [Transforming objects with Object Lambda access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html - * [Using Amazon Web Services built Lambda functions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-examples.html - * [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html - */ - writeGetObjectResponse(ctx: context.Context, params: WriteGetObjectResponseInput, ...optFns: ((_arg0: Options) => void)[]): (WriteGetObjectResponseOutput) + isAuth(): boolean } - // @ts-ignore - import internalcontext = context - // @ts-ignore - import awsxml = xml - // @ts-ignore - import internalendpoints = endpoints - // @ts-ignore - import smithyendpoints = endpoints - // @ts-ignore - import v4 = signer -} - -/** - * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html - * - * See README.md for more info. - */ -namespace jwt { - /** - * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. - * This is the default claims type if you don't supply one - */ - interface MapClaims extends _TygojaDict{} - interface MapClaims { + interface Collection { /** - * VerifyAudience Compares the aud claim against cmp. - * If required is false, this method will return true if the value matches or is unset + * IsView checks if the current collection has "view" type. */ - verifyAudience(cmp: string, req: boolean): boolean + isView(): boolean } - interface MapClaims { + interface Collection { /** - * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). - * If req is false, it will return true, if exp is unset. + * MarshalJSON implements the [json.Marshaler] interface. */ - verifyExpiresAt(cmp: number, req: boolean): boolean + marshalJSON(): string|Array } - interface MapClaims { + interface Collection { /** - * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). - * If req is false, it will return true, if iat is unset. + * BaseOptions decodes the current collection options and returns them + * as new [CollectionBaseOptions] instance. */ - verifyIssuedAt(cmp: number, req: boolean): boolean + baseOptions(): CollectionBaseOptions } - interface MapClaims { + interface Collection { /** - * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). - * If req is false, it will return true, if nbf is unset. + * AuthOptions decodes the current collection options and returns them + * as new [CollectionAuthOptions] instance. */ - verifyNotBefore(cmp: number, req: boolean): boolean + authOptions(): CollectionAuthOptions } - interface MapClaims { + interface Collection { /** - * VerifyIssuer compares the iss claim against cmp. - * If required is false, this method will return true if the value matches or is unset + * ViewOptions decodes the current collection options and returns them + * as new [CollectionViewOptions] instance. */ - verifyIssuer(cmp: string, req: boolean): boolean + viewOptions(): CollectionViewOptions } - interface MapClaims { + interface Collection { /** - * Valid validates time based claims "exp, iat, nbf". - * There is no accounting for clock skew. - * As well, if any of the above claims are not in the token, it will still - * be considered a valid claim. + * NormalizeOptions updates the current collection options with a + * new normalized state based on the collection type. */ - valid(): void - } -} - -/** - * Package gcerrors provides support for getting error codes from - * errors returned by Go CDK APIs. - */ -namespace gcerrors { - /** - * An ErrorCode describes the error's category. Programs should act upon an error's - * code, not its message. - */ - interface ErrorCode extends gcerr.ErrorCode{} -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Reader reads bytes from a blob. - * It implements io.ReadSeekCloser, and must be closed after - * reads are finished. - */ - interface Reader { + normalizeOptions(): void } - interface Reader { + interface Collection { /** - * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + * DecodeOptions decodes the current collection options into the + * provided "result" (must be a pointer). */ - read(p: string|Array): number + decodeOptions(result: any): void } - interface Reader { + interface Collection { /** - * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + * SetOptions normalizes and unmarshals the specified options into m.Options. */ - seek(offset: number, whence: number): number + setOptions(typedOptions: any): void } - interface Reader { + type _subtGzgn = BaseModel + interface ExternalAuth extends _subtGzgn { + collectionId: string + recordId: string + provider: string + providerId: string + } + interface ExternalAuth { + tableName(): string + } + type _subsrBRs = BaseModel + interface Record extends _subsrBRs { + } + interface Record { /** - * Close implements io.Closer (https://golang.org/pkg/io/#Closer). + * TableName returns the table name associated to the current Record model. */ - close(): void + tableName(): string } - interface Reader { + interface Record { /** - * ContentType returns the MIME type of the blob. + * Collection returns the Collection model associated to the current Record model. */ - contentType(): string + collection(): (Collection) } - interface Reader { + interface Record { /** - * ModTime returns the time the blob was last modified. + * OriginalCopy returns a copy of the current record model populated + * with its ORIGINAL data state (aka. the initially loaded) and + * everything else reset to the defaults. */ - modTime(): time.Time + originalCopy(): (Record) } - interface Reader { + interface Record { /** - * Size returns the size of the blob content in bytes. + * CleanCopy returns a copy of the current record model populated only + * with its LATEST data state and everything else reset to the defaults. */ - size(): number + cleanCopy(): (Record) } - interface Reader { + interface Record { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * Expand returns a shallow copy of the current Record model expand data. */ - as(i: { - }): boolean + expand(): _TygojaDict } - interface Reader { + interface Record { /** - * WriteTo reads from r and writes to w until there's no more data or - * an error occurs. - * The return value is the number of bytes written to w. - * - * It implements the io.WriterTo interface. + * SetExpand shallow copies the provided data to the current Record model's expand. */ - writeTo(w: io.Writer): number + setExpand(expand: _TygojaDict): void } - /** - * Attributes contains attributes about a blob. - */ - interface Attributes { - /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - */ - cacheControl: string - /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition - */ - contentDisposition: string - /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - */ - contentEncoding: string - /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language - */ - contentLanguage: string - /** - * ContentType is the MIME type of the blob. It will not be empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type - */ - contentType: string - /** - * Metadata holds key/value pairs associated with the blob. - * Keys are guaranteed to be in lowercase, even if the backend service - * has case-sensitive keys (although note that Metadata written via - * this package will always be lowercased). If there are duplicate - * case-insensitive keys (e.g., "foo" and "FOO"), only one value - * will be kept, and it is undefined which one. - */ - metadata: _TygojaDict - /** - * CreateTime is the time the blob was created, if available. If not available, - * CreateTime will be the zero time. - */ - createTime: time.Time - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time + interface Record { /** - * Size is the size of the blob's content in bytes. + * MergeExpand merges recursively the provided expand data into + * the current model's expand (if any). + * + * Note that if an expanded prop with the same key is a slice (old or new expand) + * then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). + * Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew). */ - size: number + mergeExpand(expand: _TygojaDict): void + } + interface Record { /** - * MD5 is an MD5 hash of the blob contents or nil if not available. + * SchemaData returns a shallow copy ONLY of the defined record schema fields data. */ - md5: string|Array + schemaData(): _TygojaDict + } + interface Record { /** - * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + * UnknownData returns a shallow copy ONLY of the unknown record fields data, + * aka. fields that are neither one of the base and special system ones, + * nor defined by the collection schema. */ - eTag: string + unknownData(): _TygojaDict } - interface Attributes { + interface Record { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * IgnoreEmailVisibility toggles the flag to ignore the auth record email visibility check. */ - as(i: { - }): boolean + ignoreEmailVisibility(state: boolean): void } - /** - * ListObject represents a single blob returned from List. - */ - interface ListObject { + interface Record { /** - * Key is the key for this blob. + * WithUnknownData toggles the export/serialization of unknown data fields + * (false by default). */ - key: string + withUnknownData(state: boolean): void + } + interface Record { /** - * ModTime is the time the blob was last modified. + * Set sets the provided key-value data pair for the current Record model. + * + * If the record collection has field with name matching the provided "key", + * the value will be further normalized according to the field rules. */ - modTime: time.Time + set(key: string, value: any): void + } + interface Record { /** - * Size is the size of the blob's content in bytes. + * Get returns a normalized single record model data value for "key". */ - size: number + get(key: string): any + } + interface Record { /** - * MD5 is an MD5 hash of the blob contents or nil if not available. + * GetBool returns the data value for "key" as a bool. */ - md5: string|Array + getBool(key: string): boolean + } + interface Record { /** - * IsDir indicates that this result represents a "directory" in the - * hierarchical namespace, ending in ListOptions.Delimiter. Key can be - * passed as ListOptions.Prefix to list items in the "directory". - * Fields other than Key and IsDir will not be set if IsDir is true. + * GetString returns the data value for "key" as a string. */ - isDir: boolean + getString(key: string): string } - interface ListObject { + interface Record { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * GetInt returns the data value for "key" as an int. */ - as(i: { - }): boolean - } - /** - * Bucket provides an easy and portable way to interact with blobs - * within a "bucket", including read, write, and list operations. - * To create a Bucket, use constructors found in driver subpackages. - */ - interface Bucket { + getInt(key: string): number } - interface Bucket { + interface Record { /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * GetFloat returns the data value for "key" as a float64. */ - as(i: { - }): boolean + getFloat(key: string): number } - interface Bucket { + interface Record { /** - * ErrorAs converts err to driver-specific types. - * ErrorAs panics if i is nil or not a pointer. - * ErrorAs returns false if err == nil. - * See https://gocloud.dev/concepts/as/ for background information. + * GetTime returns the data value for "key" as a [time.Time] instance. */ - errorAs(err: Error, i: { - }): boolean + getTime(key: string): time.Time } - interface Bucket { + interface Record { /** - * ReadAll is a shortcut for creating a Reader via NewReader with nil - * ReaderOptions, and reading the entire blob. - * - * Using Download may be more efficient. + * GetDateTime returns the data value for "key" as a DateTime instance. */ - readAll(ctx: context.Context, key: string): string|Array + getDateTime(key: string): types.DateTime } - interface Bucket { + interface Record { /** - * Download writes the content of a blob into an io.Writer w. + * GetStringSlice returns the data value for "key" as a slice of unique strings. */ - download(ctx: context.Context, key: string, w: io.Writer, opts: ReaderOptions): void + getStringSlice(key: string): Array } - interface Bucket { + interface Record { /** - * List returns a ListIterator that can be used to iterate over blobs in a - * bucket, in lexicographical order of UTF-8 encoded keys. The underlying - * implementation fetches results in pages. + * ExpandedOne retrieves a single relation Record from the already + * loaded expand data of the current model. * - * A nil ListOptions is treated the same as the zero value. + * If the requested expand relation is multiple, this method returns + * only first available Record from the expanded relation. * - * List is not guaranteed to include all recently-written blobs; - * some services are only eventually consistent. + * Returns nil if there is no such expand relation loaded. */ - list(opts: ListOptions): (ListIterator) + expandedOne(relField: string): (Record) } - interface Bucket { + interface Record { /** - * ListPage returns a page of ListObject results for blobs in a bucket, in lexicographical - * order of UTF-8 encoded keys. - * - * To fetch the first page, pass FirstPageToken as the pageToken. For subsequent pages, pass - * the pageToken returned from a previous call to ListPage. - * It is not possible to "skip ahead" pages. - * - * Each call will return pageSize results, unless there are not enough blobs to fill the - * page, in which case it will return fewer results (possibly 0). - * - * If there are no more blobs available, ListPage will return an empty pageToken. Note that - * this may happen regardless of the number of returned results -- the last page might have - * 0 results (i.e., if the last item was deleted), pageSize results, or anything in between. + * ExpandedAll retrieves a slice of relation Records from the already + * loaded expand data of the current model. * - * Calling ListPage with an empty pageToken will immediately return io.EOF. When looping - * over pages, callers can either check for an empty pageToken, or they can make one more - * call and check for io.EOF. + * If the requested expand relation is single, this method normalizes + * the return result and will wrap the single model as a slice. * - * The underlying implementation fetches results in pages, but one call to ListPage may - * require multiple page fetches (and therefore, multiple calls to the BeforeList callback). + * Returns nil slice if there is no such expand relation loaded. + */ + expandedAll(relField: string): Array<(Record | undefined)> + } + interface Record { + /** + * Retrieves the "key" json field value and unmarshals it into "result". * - * A nil ListOptions is treated the same as the zero value. + * Example * - * ListPage is not guaranteed to include all recently-written blobs; - * some services are only eventually consistent. + * ``` + * result := struct { + * FirstName string `json:"first_name"` + * }{} + * err := m.UnmarshalJSONField("my_field_name", &result) + * ``` */ - listPage(ctx: context.Context, pageToken: string|Array, pageSize: number, opts: ListOptions): [Array<(ListObject | undefined)>, string|Array] + unmarshalJSONField(key: string, result: any): void } - interface Bucket { + interface Record { /** - * IsAccessible returns true if the bucket is accessible, false otherwise. - * It is a shortcut for calling ListPage and checking if it returns an error - * with code gcerrors.NotFound. + * BaseFilesPath returns the storage dir path used by the record. */ - isAccessible(ctx: context.Context): boolean + baseFilesPath(): string } - interface Bucket { + interface Record { /** - * Exists returns true if a blob exists at key, false if it does not exist, or - * an error. - * It is a shortcut for calling Attributes and checking if it returns an error - * with code gcerrors.NotFound. + * FindFileFieldByFile returns the first file type field for which + * any of the record's data contains the provided filename. */ - exists(ctx: context.Context, key: string): boolean + findFileFieldByFile(filename: string): (schema.SchemaField) } - interface Bucket { + interface Record { /** - * Attributes returns attributes for the blob stored at key. - * - * If the blob does not exist, Attributes returns an error for which - * gcerrors.Code will return gcerrors.NotFound. + * Load bulk loads the provided data into the current Record model. */ - attributes(ctx: context.Context, key: string): (Attributes) + load(data: _TygojaDict): void } - interface Bucket { + interface Record { /** - * NewReader is a shortcut for NewRangeReader with offset=0 and length=-1. + * ColumnValueMap implements [ColumnValueMapper] interface. */ - newReader(ctx: context.Context, key: string, opts: ReaderOptions): (Reader) + columnValueMap(): _TygojaDict } - interface Bucket { + interface Record { /** - * NewRangeReader returns a Reader to read content from the blob stored at key. - * It reads at most length bytes starting at offset (>= 0). - * If length is negative, it will read till the end of the blob. - * - * For the purposes of Seek, the returned Reader will start at offset and - * end at the minimum of the actual end of the blob or (if length > 0) offset + length. - * - * Note that ctx is used for all reads performed during the lifetime of the reader. - * - * If the blob does not exist, NewRangeReader returns an error for which - * gcerrors.Code will return gcerrors.NotFound. Exists is a lighter-weight way - * to check for existence. - * - * A nil ReaderOptions is treated the same as the zero value. + * PublicExport exports only the record fields that are safe to be public. * - * The caller must call Close on the returned Reader when done reading. + * For auth records, to force the export of the email field you need to set + * `m.IgnoreEmailVisibility(true)`. */ - newRangeReader(ctx: context.Context, key: string, offset: number, length: number, opts: ReaderOptions): (Reader) + publicExport(): _TygojaDict } - interface Bucket { + interface Record { /** - * WriteAll is a shortcut for creating a Writer via NewWriter and writing p. - * - * If opts.ContentMD5 is not set, WriteAll will compute the MD5 of p and use it - * as the ContentMD5 option for the Writer it creates. + * MarshalJSON implements the [json.Marshaler] interface. * - * Using Upload may be more efficient. + * Only the data exported by `PublicExport()` will be serialized. */ - writeAll(ctx: context.Context, key: string, p: string|Array, opts: WriterOptions): void + marshalJSON(): string|Array } - interface Bucket { + interface Record { /** - * Upload reads from an io.Reader r and writes into a blob. - * - * opts.ContentType is required. + * UnmarshalJSON implements the [json.Unmarshaler] interface. */ - upload(ctx: context.Context, key: string, r: io.Reader, opts: WriterOptions): void + unmarshalJSON(data: string|Array): void } - interface Bucket { + interface Record { /** - * NewWriter returns a Writer that writes to the blob stored at key. - * A nil WriterOptions is treated the same as the zero value. + * ReplaceModifers returns a new map with applied modifier + * values based on the current record and the specified data. * - * If a blob with this key already exists, it will be replaced. - * The blob being written is not guaranteed to be readable until Close - * has been called; until then, any previous blob will still be readable. - * Even after Close is called, newly written blobs are not guaranteed to be - * returned from List; some services are only eventually consistent. + * The resolved modifier keys will be removed. * - * The returned Writer will store ctx for later use in Write and/or Close. - * To abort a write, cancel ctx; otherwise, it must remain open until - * Close is called. + * Multiple modifiers will be applied one after another, + * while reusing the previous base key value result (eg. 1; -5; +2 => -2). + * + * Example usage: * - * The caller must call Close on the returned Writer, even if the write is - * aborted. + * ``` + * newData := record.ReplaceModifers(data) + * // record: {"field": 10} + * // data: {"field+": 5} + * // newData: {"field": 15} + * ``` + */ + replaceModifers(data: _TygojaDict): _TygojaDict + } + interface Record { + /** + * Username returns the "username" auth record data value. */ - newWriter(ctx: context.Context, key: string, opts: WriterOptions): (Writer) + username(): string } - interface Bucket { + interface Record { /** - * Copy the blob stored at srcKey to dstKey. - * A nil CopyOptions is treated the same as the zero value. + * SetUsername sets the "username" auth record data value. * - * If the source blob does not exist, Copy returns an error for which - * gcerrors.Code will return gcerrors.NotFound. + * This method doesn't check whether the provided value is a valid username. * - * If the destination blob already exists, it is overwritten. + * Returns an error if the record is not from an auth collection. */ - copy(ctx: context.Context, dstKey: string, srcKey: string, opts: CopyOptions): void + setUsername(username: string): void } - interface Bucket { + interface Record { /** - * Delete deletes the blob stored at key. - * - * If the blob does not exist, Delete returns an error for which - * gcerrors.Code will return gcerrors.NotFound. + * Email returns the "email" auth record data value. */ - delete(ctx: context.Context, key: string): void + email(): string } - interface Bucket { + interface Record { /** - * SignedURL returns a URL that can be used to GET (default), PUT or DELETE - * the blob for the duration specified in opts.Expiry. - * - * A nil SignedURLOptions is treated the same as the zero value. + * SetEmail sets the "email" auth record data value. * - * It is valid to call SignedURL for a key that does not exist. + * This method doesn't check whether the provided value is a valid email. * - * If the driver does not support this functionality, SignedURL - * will return an error for which gcerrors.Code will return gcerrors.Unimplemented. + * Returns an error if the record is not from an auth collection. */ - signedURL(ctx: context.Context, key: string, opts: SignedURLOptions): string + setEmail(email: string): void } - interface Bucket { + interface Record { /** - * Close releases any resources used for the bucket. + * Verified returns the "emailVisibility" auth record data value. */ - close(): void + emailVisibility(): boolean } - interface Bucket { + interface Record { /** - * SetIOFSCallback sets a callback that is used during Open and calls on the objects - * returned from Open. + * SetEmailVisibility sets the "emailVisibility" auth record data value. * - * fn should return a context.Context and *ReaderOptions that can be used in - * calls to List and NewReader on b. It may be called more than once. + * Returns an error if the record is not from an auth collection. */ - setIOFSCallback(fn: () => [context.Context, (ReaderOptions)]): void + setEmailVisibility(visible: boolean): void } - interface Bucket { + interface Record { /** - * Open implements fs.FS.Open (https://pkg.go.dev/io/fs#FS). - * - * SetIOFSCallback must be called prior to calling this function. + * Verified returns the "verified" auth record data value. */ - open(path: string): fs.File + verified(): boolean } - interface Bucket { + interface Record { /** - * Sub implements fs.SubFS.Sub. + * SetVerified sets the "verified" auth record data value. * - * SetIOFSCallback must be called prior to calling this function. + * Returns an error if the record is not from an auth collection. */ - sub(dir: string): fs.FS + setVerified(verified: boolean): void } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonArray defines a slice that is safe for json and db read/write. - */ - interface JsonArray extends Array{} - interface JsonArray { + interface Record { /** - * MarshalJSON implements the [json.Marshaler] interface. + * TokenKey returns the "tokenKey" auth record data value. */ - marshalJSON(): string|Array + tokenKey(): string } - interface JsonArray { + interface Record { /** - * Value implements the [driver.Valuer] interface. + * SetTokenKey sets the "tokenKey" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - value(): any + setTokenKey(key: string): void } - interface JsonArray { + interface Record { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonArray[T] instance. + * RefreshTokenKey generates and sets new random auth record "tokenKey". + * + * Returns an error if the record is not from an auth collection. */ - scan(value: any): void + refreshTokenKey(): void } - /** - * JsonMap defines a map that is safe for json and db read/write. - */ - interface JsonMap extends _TygojaDict{} - interface JsonMap { + interface Record { /** - * MarshalJSON implements the [json.Marshaler] interface. + * LastResetSentAt returns the "lastResentSentAt" auth record data value. */ - marshalJSON(): string|Array + lastResetSentAt(): types.DateTime } - interface JsonMap { + interface Record { /** - * Get retrieves a single value from the current JsonMap. + * SetLastResetSentAt sets the "lastResentSentAt" auth record data value. * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + * Returns an error if the record is not from an auth collection. */ - get(key: string): any + setLastResetSentAt(dateTime: types.DateTime): void } - interface JsonMap { + interface Record { /** - * Set sets a single value in the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + * LastVerificationSentAt returns the "lastVerificationSentAt" auth record data value. */ - set(key: string, value: any): void + lastVerificationSentAt(): types.DateTime } - interface JsonMap { + interface Record { /** - * Value implements the [driver.Valuer] interface. + * SetLastVerificationSentAt sets an "lastVerificationSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. */ - value(): any + setLastVerificationSentAt(dateTime: types.DateTime): void } - interface JsonMap { + interface Record { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current `JsonMap` instance. + * LastLoginAlertSentAt returns the "lastLoginAlertSentAt" auth record data value. */ - scan(value: any): void + lastLoginAlertSentAt(): types.DateTime } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * Schema defines a dynamic db schema as a slice of `SchemaField`s. - */ - interface Schema { + interface Record { + /** + * SetLastLoginAlertSentAt sets an "lastLoginAlertSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. + */ + setLastLoginAlertSentAt(dateTime: types.DateTime): void } - interface Schema { + interface Record { /** - * Fields returns the registered schema fields. + * PasswordHash returns the "passwordHash" auth record data value. */ - fields(): Array<(SchemaField | undefined)> + passwordHash(): string } - interface Schema { + interface Record { /** - * InitFieldsOptions calls `InitOptions()` for all schema fields. + * ValidatePassword validates a plain password against the auth record password. + * + * Returns false if the password is incorrect or record is not from an auth collection. */ - initFieldsOptions(): void + validatePassword(password: string): boolean } - interface Schema { + interface Record { /** - * Clone creates a deep clone of the current schema. + * SetPassword sets cryptographically secure string to the auth record "password" field. + * This method also resets the "lastResetSentAt" and the "tokenKey" fields. + * + * Returns an error if the record is not from an auth collection or + * an empty password is provided. */ - clone(): (Schema) + setPassword(password: string): void } - interface Schema { + /** + * RequestInfo defines a HTTP request data struct, usually used + * as part of the `@request.*` filter resolver. + */ + interface RequestInfo { + context: string + query: _TygojaDict + data: _TygojaDict + headers: _TygojaDict + authRecord?: Record + admin?: Admin + method: string + } + interface RequestInfo { /** - * AsMap returns a map with all registered schema field. - * The returned map is indexed with each field name. + * HasModifierDataKeys loosely checks if the current struct has any modifier Data keys. */ - asMap(): _TygojaDict + hasModifierDataKeys(): boolean } - interface Schema { +} + +/** + * Package daos handles common PocketBase DB model manipulations. + * + * Think of daos as DB repository and service layer in one. + */ +namespace daos { + interface Dao { /** - * GetFieldById returns a single field by its id. + * AdminQuery returns a new Admin select query. */ - getFieldById(id: string): (SchemaField) + adminQuery(): (dbx.SelectQuery) } - interface Schema { + interface Dao { /** - * GetFieldByName returns a single field by its name. + * FindAdminById finds the admin with the provided id. */ - getFieldByName(name: string): (SchemaField) + findAdminById(id: string): (models.Admin) } - interface Schema { + interface Dao { /** - * RemoveField removes a single schema field by its id. - * - * This method does nothing if field with `id` doesn't exist. + * FindAdminByEmail finds the admin with the provided email address. */ - removeField(id: string): void + findAdminByEmail(email: string): (models.Admin) } - interface Schema { + interface Dao { /** - * AddField registers the provided newField to the current schema. - * - * If field with `newField.Id` already exist, the existing field is - * replaced with the new one. + * FindAdminByToken finds the admin associated with the provided JWT. * - * Otherwise the new field is appended to the other schema fields. + * Returns an error if the JWT is invalid or expired. */ - addField(newField: SchemaField): void + findAdminByToken(token: string, baseTokenKey: string): (models.Admin) } - interface Schema { + interface Dao { /** - * Validate makes Schema validatable by implementing [validation.Validatable] interface. - * - * Internally calls each individual field's validator and additionally - * checks for invalid renamed fields and field name duplications. + * TotalAdmins returns the number of existing admin records. */ - validate(): void + totalAdmins(): number } - interface Schema { + interface Dao { /** - * MarshalJSON implements the [json.Marshaler] interface. + * IsAdminEmailUnique checks if the provided email address is not + * already in use by other admins. */ - marshalJSON(): string|Array + isAdminEmailUnique(email: string, ...excludeIds: string[]): boolean } - interface Schema { + interface Dao { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * DeleteAdmin deletes the provided Admin model. * - * On success, all schema field options are auto initialized. + * Returns an error if there is only 1 admin. */ - unmarshalJSON(data: string|Array): void + deleteAdmin(admin: models.Admin): void } - interface Schema { + interface Dao { /** - * Value implements the [driver.Valuer] interface. + * SaveAdmin upserts the provided Admin model. */ - value(): any + saveAdmin(admin: models.Admin): void } - interface Schema { + /** + * Dao handles various db operations. + * + * You can think of Dao as a repository and service layer in one. + */ + interface Dao { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current Schema instance. + * MaxLockRetries specifies the default max "database is locked" auto retry attempts. */ - scan(value: any): void - } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - type _subqleDw = BaseModel - interface Admin extends _subqleDw { - avatar: number - email: string - tokenKey: string - passwordHash: string - lastResetSentAt: types.DateTime - } - interface Admin { + maxLockRetries: number /** - * TableName returns the Admin model SQL table name. + * ModelQueryTimeout is the default max duration of a running ModelQuery(). + * + * This field has no effect if an explicit query context is already specified. */ - tableName(): string - } - interface Admin { + modelQueryTimeout: time.Duration /** - * ValidatePassword validates a plain password against the model's password. + * write hooks */ - validatePassword(password: string): boolean + beforeCreateFunc: (eventDao: Dao, m: models.Model, action: () => void) => void + afterCreateFunc: (eventDao: Dao, m: models.Model) => void + beforeUpdateFunc: (eventDao: Dao, m: models.Model, action: () => void) => void + afterUpdateFunc: (eventDao: Dao, m: models.Model) => void + beforeDeleteFunc: (eventDao: Dao, m: models.Model, action: () => void) => void + afterDeleteFunc: (eventDao: Dao, m: models.Model) => void } - interface Admin { + interface Dao { /** - * SetPassword sets cryptographically secure string to `model.Password`. + * DB returns the default dao db builder (*dbx.DB or *dbx.TX). * - * Additionally this method also resets the LastResetSentAt and the TokenKey fields. + * Currently the default db builder is dao.concurrentDB but that may change in the future. */ - setPassword(password: string): void + db(): dbx.Builder } - interface Admin { + interface Dao { /** - * RefreshTokenKey generates and sets new random token key. + * ConcurrentDB returns the dao concurrent (aka. multiple open connections) + * db builder (*dbx.DB or *dbx.TX). + * + * In a transaction the concurrentDB and nonconcurrentDB refer to the same *dbx.TX instance. */ - refreshTokenKey(): void + concurrentDB(): dbx.Builder } - // @ts-ignore - import validation = ozzo_validation - type _subEjuzK = BaseModel - interface Collection extends _subEjuzK { - name: string - type: string - system: boolean - schema: schema.Schema - indexes: types.JsonArray + interface Dao { /** - * rules + * NonconcurrentDB returns the dao nonconcurrent (aka. single open connection) + * db builder (*dbx.DB or *dbx.TX). + * + * In a transaction the concurrentDB and nonconcurrentDB refer to the same *dbx.TX instance. */ - listRule?: string - viewRule?: string - createRule?: string - updateRule?: string - deleteRule?: string - options: types.JsonMap + nonconcurrentDB(): dbx.Builder } - interface Collection { + interface Dao { /** - * TableName returns the Collection model SQL table name. + * Clone returns a new Dao with the same configuration options as the current one. */ - tableName(): string + clone(): (Dao) } - interface Collection { + interface Dao { /** - * BaseFilesPath returns the storage dir path used by the collection. + * WithoutHooks returns a new Dao with the same configuration options + * as the current one, but without create/update/delete hooks. */ - baseFilesPath(): string + withoutHooks(): (Dao) } - interface Collection { + interface Dao { /** - * IsBase checks if the current collection has "base" type. + * ModelQuery creates a new preconfigured select query with preset + * SELECT, FROM and other common fields based on the provided model. */ - isBase(): boolean + modelQuery(m: models.Model): (dbx.SelectQuery) } - interface Collection { + interface Dao { /** - * IsAuth checks if the current collection has "auth" type. + * FindById finds a single db record with the specified id and + * scans the result into m. */ - isAuth(): boolean + findById(m: models.Model, id: string): void } - interface Collection { + interface Dao { /** - * IsView checks if the current collection has "view" type. + * RunInTransaction wraps fn into a transaction. + * + * It is safe to nest RunInTransaction calls as long as you use the txDao. */ - isView(): boolean + runInTransaction(fn: (txDao: Dao) => void): void } - interface Collection { + interface Dao { /** - * MarshalJSON implements the [json.Marshaler] interface. + * Delete deletes the provided model. */ - marshalJSON(): string|Array + delete(m: models.Model): void } - interface Collection { + interface Dao { /** - * BaseOptions decodes the current collection options and returns them - * as new [CollectionBaseOptions] instance. + * Save persists the provided model in the database. + * + * If m.IsNew() is true, the method will perform a create, otherwise an update. + * To explicitly mark a model for update you can use m.MarkAsNotNew(). */ - baseOptions(): CollectionBaseOptions + save(m: models.Model): void } - interface Collection { + interface Dao { /** - * AuthOptions decodes the current collection options and returns them - * as new [CollectionAuthOptions] instance. + * CollectionQuery returns a new Collection select query. */ - authOptions(): CollectionAuthOptions + collectionQuery(): (dbx.SelectQuery) } - interface Collection { + interface Dao { /** - * ViewOptions decodes the current collection options and returns them - * as new [CollectionViewOptions] instance. + * FindCollectionsByType finds all collections by the given type. */ - viewOptions(): CollectionViewOptions + findCollectionsByType(collectionType: string): Array<(models.Collection | undefined)> } - interface Collection { + interface Dao { /** - * NormalizeOptions updates the current collection options with a - * new normalized state based on the collection type. + * FindCollectionByNameOrId finds a single collection by its name (case insensitive) or id. */ - normalizeOptions(): void + findCollectionByNameOrId(nameOrId: string): (models.Collection) } - interface Collection { + interface Dao { /** - * DecodeOptions decodes the current collection options into the - * provided "result" (must be a pointer). + * IsCollectionNameUnique checks that there is no existing collection + * with the provided name (case insensitive!). + * + * Note: case insensitive check because the name is used also as a table name for the records. */ - decodeOptions(result: any): void + isCollectionNameUnique(name: string, ...excludeIds: string[]): boolean } - interface Collection { + interface Dao { /** - * SetOptions normalizes and unmarshals the specified options into m.Options. + * FindCollectionReferences returns information for all + * relation schema fields referencing the provided collection. + * + * If the provided collection has reference to itself then it will be + * also included in the result. To exclude it, pass the collection id + * as the excludeId argument. */ - setOptions(typedOptions: any): void - } - type _subbugzZ = BaseModel - interface ExternalAuth extends _subbugzZ { - collectionId: string - recordId: string - provider: string - providerId: string - } - interface ExternalAuth { - tableName(): string - } - type _subZiwqQ = BaseModel - interface Record extends _subZiwqQ { + findCollectionReferences(collection: models.Collection, ...excludeIds: string[]): _TygojaDict } - interface Record { + interface Dao { /** - * TableName returns the table name associated to the current Record model. + * DeleteCollection deletes the provided Collection model. + * This method automatically deletes the related collection records table. + * + * NB! The collection cannot be deleted, if: + * - is system collection (aka. collection.System is true) + * - is referenced as part of a relation field in another collection */ - tableName(): string + deleteCollection(collection: models.Collection): void } - interface Record { + interface Dao { /** - * Collection returns the Collection model associated to the current Record model. + * SaveCollection persists the provided Collection model and updates + * its related records table schema. + * + * If collection.IsNew() is true, the method will perform a create, otherwise an update. + * To explicitly mark a collection for update you can use collection.MarkAsNotNew(). */ - collection(): (Collection) + saveCollection(collection: models.Collection): void } - interface Record { + interface Dao { /** - * OriginalCopy returns a copy of the current record model populated - * with its ORIGINAL data state (aka. the initially loaded) and - * everything else reset to the defaults. + * ImportCollections imports the provided collections list within a single transaction. + * + * NB1! If deleteMissing is set, all local collections and schema fields, that are not present + * in the imported configuration, WILL BE DELETED (including their related records data). + * + * NB2! This method doesn't perform validations on the imported collections data! + * If you need validations, use [forms.CollectionsImport]. */ - originalCopy(): (Record) + importCollections(importedCollections: Array<(models.Collection | undefined)>, deleteMissing: boolean, afterSync: (txDao: Dao, mappedImported: _TygojaDict, mappedExisting: _TygojaDict) => void): void } - interface Record { + interface Dao { /** - * CleanCopy returns a copy of the current record model populated only - * with its LATEST data state and everything else reset to the defaults. + * ExternalAuthQuery returns a new ExternalAuth select query. */ - cleanCopy(): (Record) + externalAuthQuery(): (dbx.SelectQuery) } - interface Record { + interface Dao { /** - * Expand returns a shallow copy of the current Record model expand data. + * FindAllExternalAuthsByRecord returns all ExternalAuth models + * linked to the provided auth record. */ - expand(): _TygojaDict + findAllExternalAuthsByRecord(authRecord: models.Record): Array<(models.ExternalAuth | undefined)> } - interface Record { + interface Dao { /** - * SetExpand shallow copies the provided data to the current Record model's expand. + * FindExternalAuthByRecordAndProvider returns the first available + * ExternalAuth model for the specified record data and provider. */ - setExpand(expand: _TygojaDict): void + findExternalAuthByRecordAndProvider(authRecord: models.Record, provider: string): (models.ExternalAuth) } - interface Record { + interface Dao { /** - * MergeExpand merges recursively the provided expand data into - * the current model's expand (if any). - * - * Note that if an expanded prop with the same key is a slice (old or new expand) - * then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). - * Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew). + * FindFirstExternalAuthByExpr returns the first available + * ExternalAuth model that satisfies the non-nil expression. */ - mergeExpand(expand: _TygojaDict): void + findFirstExternalAuthByExpr(expr: dbx.Expression): (models.ExternalAuth) } - interface Record { + interface Dao { /** - * SchemaData returns a shallow copy ONLY of the defined record schema fields data. + * SaveExternalAuth upserts the provided ExternalAuth model. */ - schemaData(): _TygojaDict + saveExternalAuth(model: models.ExternalAuth): void } - interface Record { + interface Dao { /** - * UnknownData returns a shallow copy ONLY of the unknown record fields data, - * aka. fields that are neither one of the base and special system ones, - * nor defined by the collection schema. + * DeleteExternalAuth deletes the provided ExternalAuth model. */ - unknownData(): _TygojaDict + deleteExternalAuth(model: models.ExternalAuth): void } - interface Record { + interface Dao { /** - * IgnoreEmailVisibility toggles the flag to ignore the auth record email visibility check. + * LogQuery returns a new Log select query. */ - ignoreEmailVisibility(state: boolean): void + logQuery(): (dbx.SelectQuery) } - interface Record { + interface Dao { /** - * WithUnknownData toggles the export/serialization of unknown data fields - * (false by default). + * FindLogById finds a single Log entry by its id. */ - withUnknownData(state: boolean): void + findLogById(id: string): (models.Log) } - interface Record { + interface Dao { /** - * Set sets the provided key-value data pair for the current Record model. - * - * If the record collection has field with name matching the provided "key", - * the value will be further normalized according to the field rules. + * LogsStats returns hourly grouped requests logs statistics. */ - set(key: string, value: any): void + logsStats(expr: dbx.Expression): Array<(LogsStatsItem | undefined)> } - interface Record { + interface Dao { /** - * Get returns a normalized single record model data value for "key". + * DeleteOldLogs delete all requests that are created before createdBefore. */ - get(key: string): any + deleteOldLogs(createdBefore: time.Time): void } - interface Record { + interface Dao { /** - * GetBool returns the data value for "key" as a bool. + * SaveLog upserts the provided Log model. */ - getBool(key: string): boolean + saveLog(log: models.Log): void } - interface Record { + interface Dao { /** - * GetString returns the data value for "key" as a string. + * ParamQuery returns a new Param select query. */ - getString(key: string): string + paramQuery(): (dbx.SelectQuery) } - interface Record { + interface Dao { /** - * GetInt returns the data value for "key" as an int. + * FindParamByKey finds the first Param model with the provided key. */ - getInt(key: string): number + findParamByKey(key: string): (models.Param) } - interface Record { + interface Dao { /** - * GetFloat returns the data value for "key" as a float64. + * SaveParam creates or updates a Param model by the provided key-value pair. + * The value argument will be encoded as json string. + * + * If `optEncryptionKey` is provided it will encrypt the value before storing it. */ - getFloat(key: string): number + saveParam(key: string, value: any, ...optEncryptionKey: string[]): void } - interface Record { + interface Dao { /** - * GetTime returns the data value for "key" as a [time.Time] instance. + * DeleteParam deletes the provided Param model. */ - getTime(key: string): time.Time + deleteParam(param: models.Param): void } - interface Record { + interface Dao { /** - * GetDateTime returns the data value for "key" as a DateTime instance. + * RecordQuery returns a new Record select query from a collection model, id or name. + * + * In case a collection id or name is provided and that collection doesn't + * actually exists, the generated query will be created with a cancelled context + * and will fail once an executor (Row(), One(), All(), etc.) is called. */ - getDateTime(key: string): types.DateTime + recordQuery(collectionModelOrIdentifier: any): (dbx.SelectQuery) } - interface Record { + interface Dao { /** - * GetStringSlice returns the data value for "key" as a slice of unique strings. + * FindRecordById finds the Record model by its id. */ - getStringSlice(key: string): Array + findRecordById(collectionNameOrId: string, recordId: string, ...optFilters: ((q: dbx.SelectQuery) => void)[]): (models.Record) } - interface Record { + interface Dao { /** - * ExpandedOne retrieves a single relation Record from the already - * loaded expand data of the current model. - * - * If the requested expand relation is multiple, this method returns - * only first available Record from the expanded relation. - * - * Returns nil if there is no such expand relation loaded. + * FindRecordsByIds finds all Record models by the provided ids. + * If no records are found, returns an empty slice. */ - expandedOne(relField: string): (Record) + findRecordsByIds(collectionNameOrId: string, recordIds: Array, ...optFilters: ((q: dbx.SelectQuery) => void)[]): Array<(models.Record | undefined)> } - interface Record { + interface Dao { /** - * ExpandedAll retrieves a slice of relation Records from the already - * loaded expand data of the current model. + * FindRecordsByExpr finds all records by the specified db expression. * - * If the requested expand relation is single, this method normalizes - * the return result and will wrap the single model as a slice. + * Returns all collection records if no expressions are provided. * - * Returns nil slice if there is no such expand relation loaded. - */ - expandedAll(relField: string): Array<(Record | undefined)> - } - interface Record { - /** - * Retrieves the "key" json field value and unmarshals it into "result". + * Returns an empty slice if no records are found. * - * Example + * Example: * * ``` - * result := struct { - * FirstName string `json:"first_name"` - * }{} - * err := m.UnmarshalJSONField("my_field_name", &result) + * expr1 := dbx.HashExp{"email": "test@example.com"} + * expr2 := dbx.NewExp("LOWER(username) = {:username}", dbx.Params{"username": "test"}) + * dao.FindRecordsByExpr("example", expr1, expr2) * ``` */ - unmarshalJSONField(key: string, result: any): void + findRecordsByExpr(collectionNameOrId: string, ...exprs: dbx.Expression[]): Array<(models.Record | undefined)> } - interface Record { + interface Dao { /** - * BaseFilesPath returns the storage dir path used by the record. + * FindFirstRecordByData returns the first found record matching + * the provided key-value pair. */ - baseFilesPath(): string + findFirstRecordByData(collectionNameOrId: string, key: string, value: any): (models.Record) } - interface Record { + interface Dao { /** - * FindFileFieldByFile returns the first file type field for which - * any of the record's data contains the provided filename. + * FindRecordsByFilter returns limit number of records matching the + * provided string filter. + * + * NB! Use the last "params" argument to bind untrusted user variables! + * + * The sort argument is optional and can be empty string OR the same format + * used in the web APIs, eg. "-created,title". + * + * If the limit argument is <= 0, no limit is applied to the query and + * all matching records are returned. + * + * Example: + * + * ``` + * dao.FindRecordsByFilter( + * "posts", + * "title ~ {:title} && visible = {:visible}", + * "-created", + * 10, + * 0, + * dbx.Params{"title": "lorem ipsum", "visible": true} + * ) + * ``` */ - findFileFieldByFile(filename: string): (schema.SchemaField) + findRecordsByFilter(collectionNameOrId: string, filter: string, sort: string, limit: number, offset: number, ...params: dbx.Params[]): Array<(models.Record | undefined)> } - interface Record { + interface Dao { /** - * Load bulk loads the provided data into the current Record model. + * FindFirstRecordByFilter returns the first available record matching the provided filter. + * + * NB! Use the last params argument to bind untrusted user variables! + * + * Example: + * + * ``` + * dao.FindFirstRecordByFilter("posts", "slug={:slug} && status='public'", dbx.Params{"slug": "test"}) + * ``` */ - load(data: _TygojaDict): void + findFirstRecordByFilter(collectionNameOrId: string, filter: string, ...params: dbx.Params[]): (models.Record) } - interface Record { + interface Dao { /** - * ColumnValueMap implements [ColumnValueMapper] interface. + * IsRecordValueUnique checks if the provided key-value pair is a unique Record value. + * + * For correctness, if the collection is "auth" and the key is "username", + * the unique check will be case insensitive. + * + * NB! Array values (eg. from multiple select fields) are matched + * as a serialized json strings (eg. `["a","b"]`), so the value uniqueness + * depends on the elements order. Or in other words the following values + * are considered different: `[]string{"a","b"}` and `[]string{"b","a"}` */ - columnValueMap(): _TygojaDict + isRecordValueUnique(collectionNameOrId: string, key: string, value: any, ...excludeIds: string[]): boolean } - interface Record { + interface Dao { /** - * PublicExport exports only the record fields that are safe to be public. + * FindAuthRecordByToken finds the auth record associated with the provided JWT. * - * For auth records, to force the export of the email field you need to set - * `m.IgnoreEmailVisibility(true)`. + * Returns an error if the JWT is invalid, expired or not associated to an auth collection record. */ - publicExport(): _TygojaDict + findAuthRecordByToken(token: string, baseTokenKey: string): (models.Record) } - interface Record { + interface Dao { /** - * MarshalJSON implements the [json.Marshaler] interface. + * FindAuthRecordByEmail finds the auth record associated with the provided email. * - * Only the data exported by `PublicExport()` will be serialized. + * Returns an error if it is not an auth collection or the record is not found. */ - marshalJSON(): string|Array + findAuthRecordByEmail(collectionNameOrId: string, email: string): (models.Record) } - interface Record { + interface Dao { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * FindAuthRecordByUsername finds the auth record associated with the provided username (case insensitive). + * + * Returns an error if it is not an auth collection or the record is not found. */ - unmarshalJSON(data: string|Array): void + findAuthRecordByUsername(collectionNameOrId: string, username: string): (models.Record) } - interface Record { + interface Dao { /** - * ReplaceModifers returns a new map with applied modifier - * values based on the current record and the specified data. + * SuggestUniqueAuthRecordUsername checks if the provided username is unique + * and return a new "unique" username with appended random numeric part + * (eg. "existingName" -> "existingName583"). * - * The resolved modifier keys will be removed. + * The same username will be returned if the provided string is already unique. + */ + suggestUniqueAuthRecordUsername(collectionNameOrId: string, baseUsername: string, ...excludeIds: string[]): string + } + interface Dao { + /** + * CanAccessRecord checks if a record is allowed to be accessed by the + * specified requestInfo and accessRule. * - * Multiple modifiers will be applied one after another, - * while reusing the previous base key value result (eg. 1; -5; +2 => -2). + * Rule and db checks are ignored in case requestInfo.Admin is set. * - * Example usage: + * The returned error indicate that something unexpected happened during + * the check (eg. invalid rule or db error). + * + * The method always return false on invalid access rule or db error. + * + * Example: * * ``` - * newData := record.ReplaceModifers(data) - * // record: {"field": 10} - * // data: {"field+": 5} - * // newData: {"field": 15} + * requestInfo := apis.RequestInfo(c /* echo.Context *\/) + * record, _ := dao.FindRecordById("example", "RECORD_ID") + * rule := types.Pointer("@request.auth.id != '' || status = 'public'") + * // ... or use one of the record collection's rule, eg. record.Collection().ViewRule + * + * if ok, _ := dao.CanAccessRecord(record, requestInfo, rule); ok { ... } * ``` */ - replaceModifers(data: _TygojaDict): _TygojaDict + canAccessRecord(record: models.Record, requestInfo: models.RequestInfo, accessRule: string): boolean } - interface Record { + interface Dao { /** - * Username returns the "username" auth record data value. + * SaveRecord persists the provided Record model in the database. + * + * If record.IsNew() is true, the method will perform a create, otherwise an update. + * To explicitly mark a record for update you can use record.MarkAsNotNew(). */ - username(): string + saveRecord(record: models.Record): void } - interface Record { + interface Dao { /** - * SetUsername sets the "username" auth record data value. + * DeleteRecord deletes the provided Record model. * - * This method doesn't check whether the provided value is a valid username. + * This method will also cascade the delete operation to all linked + * relational records (delete or unset, depending on the rel settings). * - * Returns an error if the record is not from an auth collection. - */ - setUsername(username: string): void - } - interface Record { - /** - * Email returns the "email" auth record data value. + * The delete operation may fail if the record is part of a required + * reference in another record (aka. cannot be deleted or unset). */ - email(): string + deleteRecord(record: models.Record): void } - interface Record { + interface Dao { /** - * SetEmail sets the "email" auth record data value. + * ExpandRecord expands the relations of a single Record model. * - * This method doesn't check whether the provided value is a valid email. + * If optFetchFunc is not set, then a default function will be used + * that returns all relation records. * - * Returns an error if the record is not from an auth collection. + * Returns a map with the failed expand parameters and their errors. */ - setEmail(email: string): void + expandRecord(record: models.Record, expands: Array, optFetchFunc: ExpandFetchFunc): _TygojaDict } - interface Record { + interface Dao { /** - * Verified returns the "emailVisibility" auth record data value. + * ExpandRecords expands the relations of the provided Record models list. + * + * If optFetchFunc is not set, then a default function will be used + * that returns all relation records. + * + * Returns a map with the failed expand parameters and their errors. */ - emailVisibility(): boolean + expandRecords(records: Array<(models.Record | undefined)>, expands: Array, optFetchFunc: ExpandFetchFunc): _TygojaDict } - interface Record { + // @ts-ignore + import validation = ozzo_validation + interface Dao { /** - * SetEmailVisibility sets the "emailVisibility" auth record data value. + * SyncRecordTableSchema compares the two provided collections + * and applies the necessary related record table changes. * - * Returns an error if the record is not from an auth collection. + * If `oldCollection` is null, then only `newCollection` is used to create the record table. */ - setEmailVisibility(visible: boolean): void + syncRecordTableSchema(newCollection: models.Collection, oldCollection: models.Collection): void } - interface Record { + interface Dao { /** - * Verified returns the "verified" auth record data value. + * FindSettings returns and decode the serialized app settings param value. + * + * The method will first try to decode the param value without decryption. + * If it fails and optEncryptionKey is set, it will try again by first + * decrypting the value and then decode it again. + * + * Returns an error if it fails to decode the stored serialized param value. */ - verified(): boolean + findSettings(...optEncryptionKey: string[]): (settings.Settings) } - interface Record { + interface Dao { /** - * SetVerified sets the "verified" auth record data value. + * SaveSettings persists the specified settings configuration. * - * Returns an error if the record is not from an auth collection. + * If optEncryptionKey is set, then the stored serialized value will be encrypted with it. */ - setVerified(verified: boolean): void + saveSettings(newSettings: settings.Settings, ...optEncryptionKey: string[]): void } - interface Record { + interface Dao { /** - * TokenKey returns the "tokenKey" auth record data value. + * HasTable checks if a table (or view) with the provided name exists (case insensitive). */ - tokenKey(): string + hasTable(tableName: string): boolean } - interface Record { + interface Dao { /** - * SetTokenKey sets the "tokenKey" auth record data value. - * - * Returns an error if the record is not from an auth collection. + * TableColumns returns all column names of a single table by its name. */ - setTokenKey(key: string): void + tableColumns(tableName: string): Array } - interface Record { + interface Dao { /** - * RefreshTokenKey generates and sets new random auth record "tokenKey". - * - * Returns an error if the record is not from an auth collection. + * TableInfo returns the `table_info` pragma result for the specified table. */ - refreshTokenKey(): void + tableInfo(tableName: string): Array<(models.TableInfoRow | undefined)> } - interface Record { + interface Dao { /** - * LastResetSentAt returns the "lastResentSentAt" auth record data value. + * TableIndexes returns a name grouped map with all non empty index of the specified table. + * + * Note: This method doesn't return an error on nonexisting table. */ - lastResetSentAt(): types.DateTime + tableIndexes(tableName: string): _TygojaDict } - interface Record { + interface Dao { /** - * SetLastResetSentAt sets the "lastResentSentAt" auth record data value. + * DeleteTable drops the specified table. * - * Returns an error if the record is not from an auth collection. + * This method is a no-op if a table with the provided name doesn't exist. + * + * Be aware that this method is vulnerable to SQL injection and the + * "tableName" argument must come only from trusted input! */ - setLastResetSentAt(dateTime: types.DateTime): void + deleteTable(tableName: string): void } - interface Record { + interface Dao { /** - * LastVerificationSentAt returns the "lastVerificationSentAt" auth record data value. + * Vacuum executes VACUUM on the current dao.DB() instance in order to + * reclaim unused db disk space. */ - lastVerificationSentAt(): types.DateTime + vacuum(): void } - interface Record { + interface Dao { /** - * SetLastVerificationSentAt sets an "lastVerificationSentAt" auth record data value. + * DeleteView drops the specified view name. * - * Returns an error if the record is not from an auth collection. + * This method is a no-op if a view with the provided name doesn't exist. + * + * Be aware that this method is vulnerable to SQL injection and the + * "name" argument must come only from trusted input! */ - setLastVerificationSentAt(dateTime: types.DateTime): void + deleteView(name: string): void } - interface Record { + interface Dao { /** - * LastLoginAlertSentAt returns the "lastLoginAlertSentAt" auth record data value. + * SaveView creates (or updates already existing) persistent SQL view. + * + * Be aware that this method is vulnerable to SQL injection and the + * "selectQuery" argument must come only from trusted input! */ - lastLoginAlertSentAt(): types.DateTime + saveView(name: string, selectQuery: string): void } - interface Record { + interface Dao { /** - * SetLastLoginAlertSentAt sets an "lastLoginAlertSentAt" auth record data value. + * CreateViewSchema creates a new view schema from the provided select query. * - * Returns an error if the record is not from an auth collection. + * There are some caveats: + * - The select query must have an "id" column. + * - Wildcard ("*") columns are not supported to avoid accidentally leaking sensitive data. */ - setLastLoginAlertSentAt(dateTime: types.DateTime): void + createViewSchema(selectQuery: string): schema.Schema } - interface Record { + interface Dao { /** - * PasswordHash returns the "passwordHash" auth record data value. + * FindRecordByViewFile returns the original models.Record of the + * provided view collection file. */ - passwordHash(): string + findRecordByViewFile(viewCollectionNameOrId: string, fileFieldName: string, filename: string): (models.Record) } - interface Record { +} + +namespace migrate { + /** + * MigrationsList defines a list with migration definitions + */ + interface MigrationsList { + } + interface MigrationsList { /** - * ValidatePassword validates a plain password against the auth record password. - * - * Returns false if the password is incorrect or record is not from an auth collection. + * Item returns a single migration from the list by its index. */ - validatePassword(password: string): boolean + item(index: number): (Migration) } - interface Record { + interface MigrationsList { /** - * SetPassword sets cryptographically secure string to the auth record "password" field. - * This method also resets the "lastResetSentAt" and the "tokenKey" fields. - * - * Returns an error if the record is not from an auth collection or - * an empty password is provided. + * Items returns the internal migrations list slice. */ - setPassword(password: string): void - } - /** - * RequestInfo defines a HTTP request data struct, usually used - * as part of the `@request.*` filter resolver. - */ - interface RequestInfo { - context: string - query: _TygojaDict - data: _TygojaDict - headers: _TygojaDict - authRecord?: Record - admin?: Admin - method: string + items(): Array<(Migration | undefined)> } - interface RequestInfo { + interface MigrationsList { /** - * HasModifierDataKeys loosely checks if the current struct has any modifier Data keys. + * Register adds new migration definition to the list. + * + * If `optFilename` is not provided, it will try to get the name from its .go file. + * + * The list will be sorted automatically based on the migrations file name. */ - hasModifierDataKeys(): boolean + register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void } } -namespace auth { - /** - * AuthUser defines a standardized oauth2 user data structure. - */ - interface AuthUser { - id: string - name: string - username: string - email: string - avatarUrl: string - accessToken: string - refreshToken: string - expiry: types.DateTime - rawUser: _TygojaDict - } - /** - * Provider defines a common interface for an OAuth2 client. - */ - interface Provider { - [key:string]: any; +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface Command { /** - * Context returns the context associated with the provider (if any). + * GenBashCompletion generates bash completion file and writes to the passed writer. */ - context(): context.Context + genBashCompletion(w: io.Writer): void + } + interface Command { /** - * SetContext assigns the specified context to the current provider. + * GenBashCompletionFile generates bash completion file. */ - setContext(ctx: context.Context): void + genBashCompletionFile(filename: string): void + } + interface Command { /** - * PKCE indicates whether the provider can use the PKCE flow. + * GenBashCompletionFileV2 generates Bash completion version 2. */ - pkce(): boolean + genBashCompletionFileV2(filename: string, includeDesc: boolean): void + } + interface Command { /** - * SetPKCE toggles the state whether the provider can use the PKCE flow or not. + * GenBashCompletionV2 generates Bash completion file version 2 + * and writes it to the passed writer. */ - setPKCE(enable: boolean): void + genBashCompletionV2(w: io.Writer, includeDesc: boolean): void + } + // @ts-ignore + import flag = pflag + /** + * Command is just that, a command for your application. + * E.g. 'go run ...' - 'run' is the command. Cobra requires + * you to define the usage and description as part of your command + * definition to ensure usability. + */ + interface Command { /** - * DisplayName usually returns provider name as it is officially written - * and it could be used directly in the UI. + * Use is the one-line usage message. + * Recommended syntax is as follows: + * ``` + * [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. + * ... indicates that you can specify multiple values for the previous argument. + * | indicates mutually exclusive information. You can use the argument to the left of the separator or the + * argument to the right of the separator. You cannot use both arguments in a single use of the command. + * { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are + * optional, they are enclosed in brackets ([ ]). + * ``` + * Example: add [-F file | -D dir]... [-f format] profile */ - displayName(): string + use: string /** - * SetDisplayName sets the provider's display name. + * Aliases is an array of aliases that can be used instead of the first word in Use. */ - setDisplayName(displayName: string): void + aliases: Array /** - * Scopes returns the provider access permissions that will be requested. + * SuggestFor is an array of command names for which this command will be suggested - + * similar to aliases but only suggests. */ - scopes(): Array + suggestFor: Array /** - * SetScopes sets the provider access permissions that will be requested later. + * Short is the short description shown in the 'help' output. */ - setScopes(scopes: Array): void + short: string /** - * ClientId returns the provider client's app ID. + * The group id under which this subcommand is grouped in the 'help' output of its parent. */ - clientId(): string + groupID: string /** - * SetClientId sets the provider client's ID. + * Long is the long message shown in the 'help ' output. */ - setClientId(clientId: string): void + long: string /** - * ClientSecret returns the provider client's app secret. + * Example is examples of how to use the command. */ - clientSecret(): string + example: string /** - * SetClientSecret sets the provider client's app secret. + * ValidArgs is list of all valid non-flag arguments that are accepted in shell completions */ - setClientSecret(secret: string): void + validArgs: Array /** - * RedirectUrl returns the end address to redirect the user - * going through the OAuth flow. + * ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. + * It is a dynamic version of using ValidArgs. + * Only one of ValidArgs and ValidArgsFunction can be used for a command. */ - redirectUrl(): string + validArgsFunction: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective] /** - * SetRedirectUrl sets the provider's RedirectUrl. + * Expected arguments */ - setRedirectUrl(url: string): void + args: PositionalArgs /** - * AuthUrl returns the provider's authorization service url. + * ArgAliases is List of aliases for ValidArgs. + * These are not suggested to the user in the shell completion, + * but accepted if entered manually. */ - authUrl(): string + argAliases: Array /** - * SetAuthUrl sets the provider's AuthUrl. + * BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. + * For portability with other shells, it is recommended to instead use ValidArgsFunction */ - setAuthUrl(url: string): void + bashCompletionFunction: string /** - * TokenUrl returns the provider's token exchange service url. + * Deprecated defines, if this command is deprecated and should print this string when used. */ - tokenUrl(): string + deprecated: string /** - * SetTokenUrl sets the provider's TokenUrl. + * Annotations are key/value pairs that can be used by applications to identify or + * group commands or set special options. */ - setTokenUrl(url: string): void + annotations: _TygojaDict /** - * UserApiUrl returns the provider's user info api url. + * Version defines the version for this command. If this value is non-empty and the command does not + * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + * will print content of the "Version" variable. A shorthand "v" flag will also be added if the + * command does not define one. */ - userApiUrl(): string + version: string /** - * SetUserApiUrl sets the provider's UserApiUrl. + * The *Run functions are executed in the following order: + * ``` + * * PersistentPreRun() + * * PreRun() + * * Run() + * * PostRun() + * * PersistentPostRun() + * ``` + * All functions get the same args, the arguments after the command name. + * The *PreRun and *PostRun functions will only be executed if the Run function of the current + * command has been declared. + * + * PersistentPreRun: children of this command will inherit and execute. */ - setUserApiUrl(url: string): void + persistentPreRun: (cmd: Command, args: Array) => void /** - * Client returns an http client using the provided token. + * PersistentPreRunE: PersistentPreRun but returns an error. */ - client(token: oauth2.Token): (any) + persistentPreRunE: (cmd: Command, args: Array) => void /** - * BuildAuthUrl returns a URL to the provider's consent page - * that asks for permissions for the required scopes explicitly. + * PreRun: children of this command will not inherit. */ - buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string + preRun: (cmd: Command, args: Array) => void /** - * FetchToken converts an authorization code to token. + * PreRunE: PreRun but returns an error. */ - fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) + preRunE: (cmd: Command, args: Array) => void /** - * FetchRawUserData requests and marshalizes into `result` the - * the OAuth user api response. + * Run: Typically the actual work function. Most commands will only implement this. */ - fetchRawUserData(token: oauth2.Token): string|Array + run: (cmd: Command, args: Array) => void /** - * FetchAuthUser is similar to FetchRawUserData, but normalizes and - * marshalizes the user api response into a standardized AuthUser struct. + * RunE: Run but returns an error. */ - fetchAuthUser(token: oauth2.Token): (AuthUser) - } -} - -/** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: - * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) - * - * // Routes - * e.GET("/", hello) - * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` - * - * Learn more at https://echo.labstack.com - */ -namespace echo { - /** - * Context represents the context of the current HTTP request. It holds request and - * response objects, path, path parameters, data and registered handler. - */ - interface Context { - [key:string]: any; + runE: (cmd: Command, args: Array) => void /** - * Request returns `*http.Request`. + * PostRun: run after the Run command. */ - request(): (http.Request) + postRun: (cmd: Command, args: Array) => void /** - * SetRequest sets `*http.Request`. + * PostRunE: PostRun but returns an error. */ - setRequest(r: http.Request): void + postRunE: (cmd: Command, args: Array) => void /** - * SetResponse sets `*Response`. + * PersistentPostRun: children of this command will inherit and execute after PostRun. */ - setResponse(r: Response): void + persistentPostRun: (cmd: Command, args: Array) => void /** - * Response returns `*Response`. + * PersistentPostRunE: PersistentPostRun but returns an error. */ - response(): (Response) + persistentPostRunE: (cmd: Command, args: Array) => void /** - * IsTLS returns true if HTTP connection is TLS otherwise false. + * FParseErrWhitelist flag parse errors to be ignored */ - isTLS(): boolean + fParseErrWhitelist: FParseErrWhitelist /** - * IsWebSocket returns true if HTTP connection is WebSocket otherwise false. + * CompletionOptions is a set of options to control the handling of shell completion */ - isWebSocket(): boolean + completionOptions: CompletionOptions /** - * Scheme returns the HTTP protocol scheme, `http` or `https`. + * TraverseChildren parses flags on all parents before executing child command. */ - scheme(): string + traverseChildren: boolean /** - * RealIP returns the client's network address based on `X-Forwarded-For` - * or `X-Real-IP` request header. - * The behavior can be configured using `Echo#IPExtractor`. + * Hidden defines, if this command is hidden and should NOT show up in the list of available commands. */ - realIP(): string + hidden: boolean /** - * RouteInfo returns current request route information. Method, Path, Name and params if they exist for matched route. - * In case of 404 (route not found) and 405 (method not allowed) RouteInfo returns generic struct for these cases. + * SilenceErrors is an option to quiet errors down stream. */ - routeInfo(): RouteInfo + silenceErrors: boolean /** - * Path returns the registered path for the handler. + * SilenceUsage is an option to silence usage when an error occurs. */ - path(): string + silenceUsage: boolean /** - * PathParam returns path parameter by name. + * DisableFlagParsing disables the flag parsing. + * If this is true all flags will be passed to the command as arguments. */ - pathParam(name: string): string + disableFlagParsing: boolean /** - * PathParamDefault returns the path parameter or default value for the provided name. - * - * Notes for DefaultRouter implementation: - * Path parameter could be empty for cases like that: - * * route `/release-:version/bin` and request URL is `/release-/bin` - * * route `/api/:version/image.jpg` and request URL is `/api//image.jpg` - * but not when path parameter is last part of route path - * * route `/download/file.:ext` will not match request `/download/file.` + * DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + * will be printed by generating docs for this command. */ - pathParamDefault(name: string, defaultValue: string): string + disableAutoGenTag: boolean /** - * PathParams returns path parameter values. + * DisableFlagsInUseLine will disable the addition of [flags] to the usage + * line of a command when printing help or generating docs */ - pathParams(): PathParams + disableFlagsInUseLine: boolean /** - * SetPathParams sets path parameters for current request. + * DisableSuggestions disables the suggestions based on Levenshtein distance + * that go along with 'unknown command' messages. */ - setPathParams(params: PathParams): void + disableSuggestions: boolean /** - * QueryParam returns the query param for the provided name. + * SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + * Must be > 0. */ - queryParam(name: string): string + suggestionsMinimumDistance: number + } + interface Command { /** - * QueryParamDefault returns the query param or default value for the provided name. + * Context returns underlying command context. If command was executed + * with ExecuteContext or the context was set with SetContext, the + * previously set context will be returned. Otherwise, nil is returned. + * + * Notice that a call to Execute and ExecuteC will replace a nil context of + * a command with a context.Background, so a background context will be + * returned by Context after one of these functions has been called. */ - queryParamDefault(name: string, defaultValue: string): string + context(): context.Context + } + interface Command { /** - * QueryParams returns the query parameters as `url.Values`. + * SetContext sets context for the command. This context will be overwritten by + * Command.ExecuteContext or Command.ExecuteContextC. */ - queryParams(): url.Values + setContext(ctx: context.Context): void + } + interface Command { /** - * QueryString returns the URL query string. + * SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden + * particularly useful when testing. */ - queryString(): string + setArgs(a: Array): void + } + interface Command { /** - * FormValue returns the form field value for the provided name. + * SetOutput sets the destination for usage and error messages. + * If output is nil, os.Stderr is used. + * Deprecated: Use SetOut and/or SetErr instead */ - formValue(name: string): string + setOutput(output: io.Writer): void + } + interface Command { /** - * FormValueDefault returns the form field value or default value for the provided name. + * SetOut sets the destination for usage messages. + * If newOut is nil, os.Stdout is used. */ - formValueDefault(name: string, defaultValue: string): string + setOut(newOut: io.Writer): void + } + interface Command { /** - * FormValues returns the form field values as `url.Values`. + * SetErr sets the destination for error messages. + * If newErr is nil, os.Stderr is used. */ - formValues(): url.Values + setErr(newErr: io.Writer): void + } + interface Command { /** - * FormFile returns the multipart form file for the provided name. + * SetIn sets the source for input data + * If newIn is nil, os.Stdin is used. */ - formFile(name: string): (multipart.FileHeader) + setIn(newIn: io.Reader): void + } + interface Command { /** - * MultipartForm returns the multipart form. + * SetUsageFunc sets usage function. Usage can be defined by application. */ - multipartForm(): (multipart.Form) + setUsageFunc(f: (_arg0: Command) => void): void + } + interface Command { /** - * Cookie returns the named cookie provided in the request. + * SetUsageTemplate sets usage template. Can be defined by Application. */ - cookie(name: string): (http.Cookie) + setUsageTemplate(s: string): void + } + interface Command { /** - * SetCookie adds a `Set-Cookie` header in HTTP response. + * SetFlagErrorFunc sets a function to generate an error when flag parsing + * fails. */ - setCookie(cookie: http.Cookie): void + setFlagErrorFunc(f: (_arg0: Command, _arg1: Error) => void): void + } + interface Command { /** - * Cookies returns the HTTP cookies sent with the request. + * SetHelpFunc sets help function. Can be defined by Application. */ - cookies(): Array<(http.Cookie | undefined)> + setHelpFunc(f: (_arg0: Command, _arg1: Array) => void): void + } + interface Command { /** - * Get retrieves data from the context. + * SetHelpCommand sets help command. */ - get(key: string): { + setHelpCommand(cmd: Command): void } + interface Command { /** - * Set saves data in the context. + * SetHelpCommandGroupID sets the group id of the help command. */ - set(key: string, val: { - }): void + setHelpCommandGroupID(groupID: string): void + } + interface Command { /** - * Bind binds path params, query params and the request body into provided type `i`. The default binder - * binds body based on Content-Type header. + * SetCompletionCommandGroupID sets the group id of the completion command. */ - bind(i: { - }): void + setCompletionCommandGroupID(groupID: string): void + } + interface Command { /** - * Validate validates provided `i`. It is usually called after `Context#Bind()`. - * Validator must be registered using `Echo#Validator`. + * SetHelpTemplate sets help template to be used. Application can use it to set custom template. */ - validate(i: { - }): void + setHelpTemplate(s: string): void + } + interface Command { /** - * Render renders a template with data and sends a text/html response with status - * code. Renderer must be registered using `Echo.Renderer`. + * SetVersionTemplate sets version template to be used. Application can use it to set custom template. */ - render(code: number, name: string, data: { - }): void + setVersionTemplate(s: string): void + } + interface Command { /** - * HTML sends an HTTP response with status code. + * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. */ - html(code: number, html: string): void + setErrPrefix(s: string): void + } + interface Command { /** - * HTMLBlob sends an HTTP blob response with status code. + * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. + * The user should not have a cyclic dependency on commands. */ - htmlBlob(code: number, b: string|Array): void + setGlobalNormalizationFunc(n: (f: any, name: string) => any): void + } + interface Command { /** - * String sends a string response with status code. + * OutOrStdout returns output to stdout. */ - string(code: number, s: string): void + outOrStdout(): io.Writer + } + interface Command { /** - * JSON sends a JSON response with status code. + * OutOrStderr returns output to stderr */ - json(code: number, i: { - }): void + outOrStderr(): io.Writer + } + interface Command { /** - * JSONPretty sends a pretty-print JSON with status code. + * ErrOrStderr returns output to stderr */ - jsonPretty(code: number, i: { - }, indent: string): void + errOrStderr(): io.Writer + } + interface Command { /** - * JSONBlob sends a JSON blob response with status code. + * InOrStdin returns input to stdin */ - jsonBlob(code: number, b: string|Array): void + inOrStdin(): io.Reader + } + interface Command { /** - * JSONP sends a JSONP response with status code. It uses `callback` to construct - * the JSONP payload. + * UsageFunc returns either the function set by SetUsageFunc for this command + * or a parent, or it returns a default usage function. */ - jsonp(code: number, callback: string, i: { - }): void + usageFunc(): (_arg0: Command) => void + } + interface Command { /** - * JSONPBlob sends a JSONP blob response with status code. It uses `callback` - * to construct the JSONP payload. + * Usage puts out the usage for the command. + * Used when a user provides invalid input. + * Can be defined by user by overriding UsageFunc. */ - jsonpBlob(code: number, callback: string, b: string|Array): void + usage(): void + } + interface Command { /** - * XML sends an XML response with status code. + * HelpFunc returns either the function set by SetHelpFunc for this command + * or a parent, or it returns a function with default help behavior. */ - xml(code: number, i: { - }): void + helpFunc(): (_arg0: Command, _arg1: Array) => void + } + interface Command { /** - * XMLPretty sends a pretty-print XML with status code. + * Help puts out the help for the command. + * Used when a user calls help [command]. + * Can be defined by user by overriding HelpFunc. */ - xmlPretty(code: number, i: { - }, indent: string): void + help(): void + } + interface Command { /** - * XMLBlob sends an XML blob response with status code. + * UsageString returns usage string. */ - xmlBlob(code: number, b: string|Array): void + usageString(): string + } + interface Command { /** - * Blob sends a blob response with status code and content type. + * FlagErrorFunc returns either the function set by SetFlagErrorFunc for this + * command or a parent, or it returns a function which returns the original + * error. */ - blob(code: number, contentType: string, b: string|Array): void + flagErrorFunc(): (_arg0: Command, _arg1: Error) => void + } + interface Command { /** - * Stream sends a streaming response with status code and content type. + * UsagePadding return padding for the usage. */ - stream(code: number, contentType: string, r: io.Reader): void + usagePadding(): number + } + interface Command { /** - * File sends a response with the content of the file. + * CommandPathPadding return padding for the command path. */ - file(file: string): void + commandPathPadding(): number + } + interface Command { /** - * FileFS sends a response with the content of the file from given filesystem. + * NamePadding returns padding for the name. */ - fileFS(file: string, filesystem: fs.FS): void + namePadding(): number + } + interface Command { /** - * Attachment sends a response as attachment, prompting client to save the - * file. + * UsageTemplate returns usage template for the command. */ - attachment(file: string, name: string): void + usageTemplate(): string + } + interface Command { /** - * Inline sends a response as inline, opening the file in the browser. + * HelpTemplate return help template for the command. */ - inline(file: string, name: string): void + helpTemplate(): string + } + interface Command { /** - * NoContent sends a response with no body and a status code. + * VersionTemplate return version template for the command. */ - noContent(code: number): void + versionTemplate(): string + } + interface Command { /** - * Redirect redirects the request to a provided URL with status code. + * ErrPrefix return error message prefix for the command */ - redirect(code: number, url: string): void + errPrefix(): string + } + interface Command { /** - * Error invokes the registered global HTTP error handler. Generally used by middleware. - * A side-effect of calling global error handler is that now Response has been committed (sent to the client) and - * middlewares up in chain can not change Response status code or Response body anymore. - * - * Avoid using this method in handlers as no middleware will be able to effectively handle errors after that. - * Instead of calling this method in handler return your error and let it be handled by middlewares or global error handler. + * Find the target command given the args and command tree + * Meant to be run on the highest node. Only searches down. */ - error(err: Error): void + find(args: Array): [(Command), Array] + } + interface Command { /** - * Echo returns the `Echo` instance. - * - * WARNING: Remember that Echo public fields and methods are coroutine safe ONLY when you are NOT mutating them - * anywhere in your code after Echo server has started. + * Traverse the command tree to find the command, and parse args for + * each parent. */ - echo(): (Echo) + traverse(args: Array): [(Command), Array] } - // @ts-ignore - import stdContext = context - /** - * Echo is the top-level framework instance. - * - * Goroutine safety: Do not mutate Echo instance fields after server has started. Accessing these - * fields from handlers/middlewares and changing field values at the same time leads to data-races. - * Same rule applies to adding new routes after server has been started - Adding a route is not Goroutine safe action. - */ - interface Echo { + interface Command { /** - * NewContextFunc allows using custom context implementations, instead of default *echo.context + * SuggestionsFor provides suggestions for the typedName. */ - newContextFunc: (e: Echo, pathParamAllocSize: number) => ServableContext - debug: boolean - httpErrorHandler: HTTPErrorHandler - binder: Binder - jsonSerializer: JSONSerializer - validator: Validator - renderer: Renderer - logger: Logger - ipExtractor: IPExtractor + suggestionsFor(typedName: string): Array + } + interface Command { /** - * Filesystem is file system used by Static and File handlers to access files. - * Defaults to os.DirFS(".") - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. + * VisitParents visits all parents of the command and invokes fn on each parent. */ - filesystem: fs.FS + visitParents(fn: (_arg0: Command) => void): void + } + interface Command { /** - * OnAddRoute is called when Echo adds new route to specific host router. Handler is called for every router - * and before route is added to the host router. + * Root finds root command. */ - onAddRoute: (host: string, route: Routable) => void + root(): (Command) } - /** - * HandlerFunc defines a function to serve HTTP requests. - */ - interface HandlerFunc {(c: Context): void } - /** - * MiddlewareFunc defines a function to process middleware. - */ - interface MiddlewareFunc {(next: HandlerFunc): HandlerFunc } - interface Echo { + interface Command { /** - * NewContext returns a new Context instance. - * - * Note: both request and response can be left to nil as Echo.ServeHTTP will call c.Reset(req,resp) anyway - * these arguments are useful when creating context for tests and cases like that. + * ArgsLenAtDash will return the length of c.Flags().Args at the moment + * when a -- was found during args parsing. */ - newContext(r: http.Request, w: http.ResponseWriter): Context + argsLenAtDash(): number } - interface Echo { + interface Command { /** - * Router returns the default router. + * ExecuteContext is the same as Execute(), but sets the ctx on the command. + * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs + * functions. */ - router(): Router + executeContext(ctx: context.Context): void } - interface Echo { + interface Command { /** - * Routers returns the new map of host => router. + * Execute uses the args (os.Args[1:] by default) + * and run through the command tree finding appropriate matches + * for commands and then corresponding flags. */ - routers(): _TygojaDict + execute(): void } - interface Echo { + interface Command { /** - * RouterFor returns Router for given host. When host is left empty the default router is returned. + * ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. + * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs + * functions. */ - routerFor(host: string): [Router, boolean] + executeContextC(ctx: context.Context): (Command) } - interface Echo { + interface Command { /** - * ResetRouterCreator resets callback for creating new router instances. - * Note: current (default) router is immediately replaced with router created with creator func and vhost routers are cleared. + * ExecuteC executes the command. */ - resetRouterCreator(creator: (e: Echo) => Router): void + executeC(): (Command) } - interface Echo { + interface Command { + validateArgs(args: Array): void + } + interface Command { /** - * Pre adds middleware to the chain which is run before router tries to find matching route. - * Meaning middleware is executed even for 404 (not found) cases. + * ValidateRequiredFlags validates all required flags are present and returns an error otherwise */ - pre(...middleware: MiddlewareFunc[]): void + validateRequiredFlags(): void } - interface Echo { + interface Command { /** - * Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed. + * InitDefaultHelpFlag adds default help flag to c. + * It is called automatically by executing the c or by calling help and usage. + * If c already has help flag, it will do nothing. */ - use(...middleware: MiddlewareFunc[]): void + initDefaultHelpFlag(): void } - interface Echo { + interface Command { /** - * CONNECT registers a new CONNECT route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * InitDefaultVersionFlag adds default version flag to c. + * It is called automatically by executing the c. + * If c already has a version flag, it will do nothing. + * If c.Version is empty, it will do nothing. */ - connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + initDefaultVersionFlag(): void } - interface Echo { + interface Command { /** - * DELETE registers a new DELETE route for a path with matching handler in the router - * with optional route-level middleware. Panics on error. + * InitDefaultHelpCmd adds default help command to c. + * It is called automatically by executing the c or by calling help and usage. + * If c already has help command or c has no subcommands, it will do nothing. */ - delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + initDefaultHelpCmd(): void } - interface Echo { + interface Command { /** - * GET registers a new GET route for a path with matching handler in the router - * with optional route-level middleware. Panics on error. + * ResetCommands delete parent, subcommand and help command from c. */ - get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + resetCommands(): void } - interface Echo { + interface Command { /** - * HEAD registers a new HEAD route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Commands returns a sorted slice of child commands. */ - head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + commands(): Array<(Command | undefined)> } - interface Echo { + interface Command { /** - * OPTIONS registers a new OPTIONS route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * AddCommand adds one or more commands to this parent command. */ - options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + addCommand(...cmds: (Command | undefined)[]): void } - interface Echo { + interface Command { /** - * PATCH registers a new PATCH route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Groups returns a slice of child command groups. */ - patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + groups(): Array<(Group | undefined)> } - interface Echo { + interface Command { /** - * POST registers a new POST route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * AllChildCommandsHaveGroup returns if all subcommands are assigned to a group */ - post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + allChildCommandsHaveGroup(): boolean } - interface Echo { + interface Command { /** - * PUT registers a new PUT route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * ContainsGroup return if groupID exists in the list of command groups. */ - put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + containsGroup(groupID: string): boolean } - interface Echo { + interface Command { /** - * TRACE registers a new TRACE route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * AddGroup adds one or more command groups to this parent command. */ - trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + addGroup(...groups: (Group | undefined)[]): void } - interface Echo { + interface Command { /** - * RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) - * for current request URL. - * Path supports static and named/any parameters just like other http method is defined. Generally path is ended with - * wildcard/match-any character (`/*`, `/download/*` etc). - * - * Example: `e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` + * RemoveCommand removes one or more commands from a parent command. */ - routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + removeCommand(...cmds: (Command | undefined)[]): void } - interface Echo { + interface Command { /** - * Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler - * in the router with optional route-level middleware. - * - * Note: this method only adds specific set of supported HTTP methods as handler and is not true - * "catch-any-arbitrary-method" way of matching requests. + * Print is a convenience method to Print to the defined output, fallback to Stderr if not set. */ - any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + print(...i: { + }[]): void } - interface Echo { + interface Command { /** - * Match registers a new route for multiple HTTP methods and path with matching - * handler in the router with optional route-level middleware. Panics on error. + * Println is a convenience method to Println to the defined output, fallback to Stderr if not set. */ - match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes + println(...i: { + }[]): void } - interface Echo { + interface Command { /** - * Static registers a new route with path prefix to serve static files from the provided root directory. + * Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. */ - static(pathPrefix: string, fsRoot: string): RouteInfo + printf(format: string, ...i: { + }[]): void } - interface Echo { + interface Command { /** - * StaticFS registers a new route with path prefix to serve static files from the provided file system. - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. + * PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. */ - staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo + printErr(...i: { + }[]): void } - interface Echo { + interface Command { /** - * FileFS registers a new route with path to serve file from the provided file system. + * PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. */ - fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo + printErrln(...i: { + }[]): void } - interface Echo { + interface Command { /** - * File registers a new route with path to serve a static file with optional route-level middleware. Panics on error. + * PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. */ - file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo + printErrf(format: string, ...i: { + }[]): void } - interface Echo { + interface Command { /** - * AddRoute registers a new Route with default host Router + * CommandPath returns the full path to this command. */ - addRoute(route: Routable): RouteInfo + commandPath(): string } - interface Echo { + interface Command { /** - * Add registers a new route for an HTTP method and path with matching handler - * in the router with optional route-level middleware. + * UseLine puts out the full usage for a given command (including parents). */ - add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo + useLine(): string } - interface Echo { + interface Command { /** - * Host creates a new router group for the provided host and optional host-level middleware. + * DebugFlags used to determine which flags have been assigned to which commands + * and which persist. */ - host(name: string, ...m: MiddlewareFunc[]): (Group) + debugFlags(): void } - interface Echo { + interface Command { /** - * Group creates a new router group with prefix and optional group-level middleware. + * Name returns the command's name: the first word in the use line. */ - group(prefix: string, ...m: MiddlewareFunc[]): (Group) + name(): string } - interface Echo { + interface Command { /** - * AcquireContext returns an empty `Context` instance from the pool. - * You must return the context by calling `ReleaseContext()`. + * HasAlias determines if a given string is an alias of the command. */ - acquireContext(): Context + hasAlias(s: string): boolean } - interface Echo { + interface Command { /** - * ReleaseContext returns the `Context` instance back to the pool. - * You must call it after `AcquireContext()`. + * CalledAs returns the command name or alias that was used to invoke + * this command or an empty string if the command has not been called. */ - releaseContext(c: Context): void + calledAs(): string } - interface Echo { + interface Command { /** - * ServeHTTP implements `http.Handler` interface, which serves HTTP requests. + * NameAndAliases returns a list of the command name and all aliases */ - serveHTTP(w: http.ResponseWriter, r: http.Request): void + nameAndAliases(): string } - interface Echo { + interface Command { /** - * Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by - * sending os.Interrupt signal with `ctrl+c`. - * - * Note: this method is created for use in examples/demos and is deliberately simple without providing configuration - * options. - * - * In need of customization use: - * - * ``` - * sc := echo.StartConfig{Address: ":8080"} - * if err := sc.Start(e); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * ``` - * - * // or standard library `http.Server` - * - * ``` - * s := http.Server{Addr: ":8080", Handler: e} - * if err := s.ListenAndServe(); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * ``` + * HasExample determines if the command has example. */ - start(address: string): void + hasExample(): boolean } -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - /** - * Settings defines common app configuration options. - */ - interface Settings { - meta: MetaConfig - logs: LogsConfig - smtp: SmtpConfig - s3: S3Config - backups: BackupsConfig - adminAuthToken: TokenConfig - adminPasswordResetToken: TokenConfig - adminFileToken: TokenConfig - recordAuthToken: TokenConfig - recordPasswordResetToken: TokenConfig - recordEmailChangeToken: TokenConfig - recordVerificationToken: TokenConfig - recordFileToken: TokenConfig + interface Command { /** - * Deprecated: Will be removed in v0.9+ + * Runnable determines if the command is itself runnable. */ - emailAuth: EmailAuthConfig - googleAuth: AuthProviderConfig - facebookAuth: AuthProviderConfig - githubAuth: AuthProviderConfig - gitlabAuth: AuthProviderConfig - discordAuth: AuthProviderConfig - twitterAuth: AuthProviderConfig - microsoftAuth: AuthProviderConfig - spotifyAuth: AuthProviderConfig - kakaoAuth: AuthProviderConfig - twitchAuth: AuthProviderConfig - stravaAuth: AuthProviderConfig - giteeAuth: AuthProviderConfig - livechatAuth: AuthProviderConfig - giteaAuth: AuthProviderConfig - oidcAuth: AuthProviderConfig - oidc2Auth: AuthProviderConfig - oidc3Auth: AuthProviderConfig - appleAuth: AuthProviderConfig - instagramAuth: AuthProviderConfig - vkAuth: AuthProviderConfig - yandexAuth: AuthProviderConfig - patreonAuth: AuthProviderConfig - mailcowAuth: AuthProviderConfig - bitbucketAuth: AuthProviderConfig - planningcenterAuth: AuthProviderConfig + runnable(): boolean } - interface Settings { + interface Command { /** - * Validate makes Settings validatable by implementing [validation.Validatable] interface. + * HasSubCommands determines if the command has children commands. */ - validate(): void + hasSubCommands(): boolean } - interface Settings { + interface Command { /** - * Merge merges `other` settings into the current one. + * IsAvailableCommand determines if a command is available as a non-help command + * (this includes all non deprecated/hidden commands). */ - merge(other: Settings): void + isAvailableCommand(): boolean } - interface Settings { + interface Command { /** - * Clone creates a new deep copy of the current settings. + * IsAdditionalHelpTopicCommand determines if a command is an additional + * help topic command; additional help topic command is determined by the + * fact that it is NOT runnable/hidden/deprecated, and has no sub commands that + * are runnable/hidden/deprecated. + * Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. */ - clone(): (Settings) + isAdditionalHelpTopicCommand(): boolean } - interface Settings { + interface Command { /** - * RedactClone creates a new deep copy of the current settings, - * while replacing the secret values with `******`. + * HasHelpSubCommands determines if a command has any available 'help' sub commands + * that need to be shown in the usage/help default template under 'additional help + * topics'. */ - redactClone(): (Settings) + hasHelpSubCommands(): boolean } - interface Settings { + interface Command { /** - * NamedAuthProviderConfigs returns a map with all registered OAuth2 - * provider configurations (indexed by their name identifier). + * HasAvailableSubCommands determines if a command has available sub commands that + * need to be shown in the usage/help default template under 'available commands'. */ - namedAuthProviderConfigs(): _TygojaDict + hasAvailableSubCommands(): boolean } -} - -/** - * Package daos handles common PocketBase DB model manipulations. - * - * Think of daos as DB repository and service layer in one. - */ -namespace daos { - interface Dao { + interface Command { /** - * AdminQuery returns a new Admin select query. + * HasParent determines if the command is a child command. */ - adminQuery(): (dbx.SelectQuery) + hasParent(): boolean } - interface Dao { + interface Command { /** - * FindAdminById finds the admin with the provided id. + * GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. */ - findAdminById(id: string): (models.Admin) + globalNormalizationFunc(): (f: any, name: string) => any } - interface Dao { + interface Command { /** - * FindAdminByEmail finds the admin with the provided email address. + * Flags returns the complete FlagSet that applies + * to this command (local and persistent declared here and by all parents). */ - findAdminByEmail(email: string): (models.Admin) + flags(): (any) } - interface Dao { + interface Command { /** - * FindAdminByToken finds the admin associated with the provided JWT. - * - * Returns an error if the JWT is invalid or expired. + * LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - findAdminByToken(token: string, baseTokenKey: string): (models.Admin) + localNonPersistentFlags(): (any) } - interface Dao { + interface Command { /** - * TotalAdmins returns the number of existing admin records. + * LocalFlags returns the local FlagSet specifically set in the current command. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - totalAdmins(): number + localFlags(): (any) } - interface Dao { + interface Command { /** - * IsAdminEmailUnique checks if the provided email address is not - * already in use by other admins. + * InheritedFlags returns all flags which were inherited from parent commands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - isAdminEmailUnique(email: string, ...excludeIds: string[]): boolean + inheritedFlags(): (any) } - interface Dao { + interface Command { /** - * DeleteAdmin deletes the provided Admin model. - * - * Returns an error if there is only 1 admin. + * NonInheritedFlags returns all flags which were not inherited from parent commands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - deleteAdmin(admin: models.Admin): void + nonInheritedFlags(): (any) } - interface Dao { + interface Command { /** - * SaveAdmin upserts the provided Admin model. + * PersistentFlags returns the persistent FlagSet specifically set in the current command. */ - saveAdmin(admin: models.Admin): void + persistentFlags(): (any) } - /** - * Dao handles various db operations. - * - * You can think of Dao as a repository and service layer in one. - */ - interface Dao { + interface Command { /** - * MaxLockRetries specifies the default max "database is locked" auto retry attempts. + * ResetFlags deletes all flags from command. */ - maxLockRetries: number + resetFlags(): void + } + interface Command { /** - * ModelQueryTimeout is the default max duration of a running ModelQuery(). - * - * This field has no effect if an explicit query context is already specified. + * HasFlags checks if the command contains any flags (local plus persistent from the entire structure). */ - modelQueryTimeout: time.Duration + hasFlags(): boolean + } + interface Command { /** - * write hooks + * HasPersistentFlags checks if the command contains persistent flags. */ - beforeCreateFunc: (eventDao: Dao, m: models.Model, action: () => void) => void - afterCreateFunc: (eventDao: Dao, m: models.Model) => void - beforeUpdateFunc: (eventDao: Dao, m: models.Model, action: () => void) => void - afterUpdateFunc: (eventDao: Dao, m: models.Model) => void - beforeDeleteFunc: (eventDao: Dao, m: models.Model, action: () => void) => void - afterDeleteFunc: (eventDao: Dao, m: models.Model) => void + hasPersistentFlags(): boolean } - interface Dao { + interface Command { /** - * DB returns the default dao db builder (*dbx.DB or *dbx.TX). - * - * Currently the default db builder is dao.concurrentDB but that may change in the future. + * HasLocalFlags checks if the command has flags specifically declared locally. */ - db(): dbx.Builder + hasLocalFlags(): boolean } - interface Dao { + interface Command { /** - * ConcurrentDB returns the dao concurrent (aka. multiple open connections) - * db builder (*dbx.DB or *dbx.TX). - * - * In a transaction the concurrentDB and nonconcurrentDB refer to the same *dbx.TX instance. + * HasInheritedFlags checks if the command has flags inherited from its parent command. */ - concurrentDB(): dbx.Builder + hasInheritedFlags(): boolean } - interface Dao { + interface Command { /** - * NonconcurrentDB returns the dao nonconcurrent (aka. single open connection) - * db builder (*dbx.DB or *dbx.TX). - * - * In a transaction the concurrentDB and nonconcurrentDB refer to the same *dbx.TX instance. + * HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire + * structure) which are not hidden or deprecated. */ - nonconcurrentDB(): dbx.Builder + hasAvailableFlags(): boolean } - interface Dao { + interface Command { /** - * Clone returns a new Dao with the same configuration options as the current one. + * HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. */ - clone(): (Dao) + hasAvailablePersistentFlags(): boolean } - interface Dao { + interface Command { /** - * WithoutHooks returns a new Dao with the same configuration options - * as the current one, but without create/update/delete hooks. + * HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden + * or deprecated. */ - withoutHooks(): (Dao) + hasAvailableLocalFlags(): boolean } - interface Dao { + interface Command { /** - * ModelQuery creates a new preconfigured select query with preset - * SELECT, FROM and other common fields based on the provided model. + * HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are + * not hidden or deprecated. */ - modelQuery(m: models.Model): (dbx.SelectQuery) + hasAvailableInheritedFlags(): boolean } - interface Dao { + interface Command { /** - * FindById finds a single db record with the specified id and - * scans the result into m. + * Flag climbs up the command tree looking for matching flag. */ - findById(m: models.Model, id: string): void + flag(name: string): (any) } - interface Dao { + interface Command { /** - * RunInTransaction wraps fn into a transaction. - * - * It is safe to nest RunInTransaction calls as long as you use the txDao. + * ParseFlags parses persistent flag tree and local flags. */ - runInTransaction(fn: (txDao: Dao) => void): void + parseFlags(args: Array): void } - interface Dao { + interface Command { /** - * Delete deletes the provided model. + * Parent returns a commands parent command. */ - delete(m: models.Model): void + parent(): (Command) } - interface Dao { + interface Command { /** - * Save persists the provided model in the database. - * - * If m.IsNew() is true, the method will perform a create, otherwise an update. - * To explicitly mark a model for update you can use m.MarkAsNotNew(). + * RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. */ - save(m: models.Model): void + registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void } - interface Dao { + interface Command { /** - * CollectionQuery returns a new Collection select query. + * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. */ - collectionQuery(): (dbx.SelectQuery) + getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] } - interface Dao { + interface Command { /** - * FindCollectionsByType finds all collections by the given type. + * InitDefaultCompletionCmd adds a default 'completion' command to c. + * This function will do nothing if any of the following is true: + * 1- the feature has been explicitly disabled by the program, + * 2- c has no subcommands (to avoid creating one), + * 3- c already has a 'completion' command provided by the program. */ - findCollectionsByType(collectionType: string): Array<(models.Collection | undefined)> + initDefaultCompletionCmd(): void } - interface Dao { + interface Command { /** - * FindCollectionByNameOrId finds a single collection by its name (case insensitive) or id. + * GenFishCompletion generates fish completion file and writes to the passed writer. */ - findCollectionByNameOrId(nameOrId: string): (models.Collection) + genFishCompletion(w: io.Writer, includeDesc: boolean): void } - interface Dao { + interface Command { /** - * IsCollectionNameUnique checks that there is no existing collection - * with the provided name (case insensitive!). - * - * Note: case insensitive check because the name is used also as a table name for the records. + * GenFishCompletionFile generates fish completion file. */ - isCollectionNameUnique(name: string, ...excludeIds: string[]): boolean + genFishCompletionFile(filename: string, includeDesc: boolean): void } - interface Dao { + interface Command { /** - * FindCollectionReferences returns information for all - * relation schema fields referencing the provided collection. - * - * If the provided collection has reference to itself then it will be - * also included in the result. To exclude it, pass the collection id - * as the excludeId argument. + * MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors + * if the command is invoked with a subset (but not all) of the given flags. */ - findCollectionReferences(collection: models.Collection, ...excludeIds: string[]): _TygojaDict + markFlagsRequiredTogether(...flagNames: string[]): void } - interface Dao { + interface Command { /** - * DeleteCollection deletes the provided Collection model. - * This method automatically deletes the related collection records table. - * - * NB! The collection cannot be deleted, if: - * - is system collection (aka. collection.System is true) - * - is referenced as part of a relation field in another collection + * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors + * if the command is invoked without at least one flag from the given set of flags. */ - deleteCollection(collection: models.Collection): void + markFlagsOneRequired(...flagNames: string[]): void } - interface Dao { + interface Command { /** - * SaveCollection persists the provided Collection model and updates - * its related records table schema. - * - * If collection.IsNew() is true, the method will perform a create, otherwise an update. - * To explicitly mark a collection for update you can use collection.MarkAsNotNew(). + * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors + * if the command is invoked with more than one flag from the given set of flags. */ - saveCollection(collection: models.Collection): void + markFlagsMutuallyExclusive(...flagNames: string[]): void } - interface Dao { + interface Command { /** - * ImportCollections imports the provided collections list within a single transaction. - * - * NB1! If deleteMissing is set, all local collections and schema fields, that are not present - * in the imported configuration, WILL BE DELETED (including their related records data). - * - * NB2! This method doesn't perform validations on the imported collections data! - * If you need validations, use [forms.CollectionsImport]. + * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the + * first error encountered. */ - importCollections(importedCollections: Array<(models.Collection | undefined)>, deleteMissing: boolean, afterSync: (txDao: Dao, mappedImported: _TygojaDict, mappedExisting: _TygojaDict) => void): void + validateFlagGroups(): void } - interface Dao { + interface Command { /** - * ExternalAuthQuery returns a new ExternalAuth select query. + * GenPowerShellCompletionFile generates powershell completion file without descriptions. */ - externalAuthQuery(): (dbx.SelectQuery) + genPowerShellCompletionFile(filename: string): void } - interface Dao { + interface Command { /** - * FindAllExternalAuthsByRecord returns all ExternalAuth models - * linked to the provided auth record. + * GenPowerShellCompletion generates powershell completion file without descriptions + * and writes it to the passed writer. */ - findAllExternalAuthsByRecord(authRecord: models.Record): Array<(models.ExternalAuth | undefined)> + genPowerShellCompletion(w: io.Writer): void } - interface Dao { + interface Command { /** - * FindExternalAuthByRecordAndProvider returns the first available - * ExternalAuth model for the specified record data and provider. + * GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. */ - findExternalAuthByRecordAndProvider(authRecord: models.Record, provider: string): (models.ExternalAuth) + genPowerShellCompletionFileWithDesc(filename: string): void } - interface Dao { + interface Command { /** - * FindFirstExternalAuthByExpr returns the first available - * ExternalAuth model that satisfies the non-nil expression. + * GenPowerShellCompletionWithDesc generates powershell completion file with descriptions + * and writes it to the passed writer. */ - findFirstExternalAuthByExpr(expr: dbx.Expression): (models.ExternalAuth) + genPowerShellCompletionWithDesc(w: io.Writer): void } - interface Dao { + interface Command { /** - * SaveExternalAuth upserts the provided ExternalAuth model. + * MarkFlagRequired instructs the various shell completion implementations to + * prioritize the named flag when performing completion, + * and causes your command to report an error if invoked without the flag. */ - saveExternalAuth(model: models.ExternalAuth): void + markFlagRequired(name: string): void } - interface Dao { + interface Command { /** - * DeleteExternalAuth deletes the provided ExternalAuth model. + * MarkPersistentFlagRequired instructs the various shell completion implementations to + * prioritize the named persistent flag when performing completion, + * and causes your command to report an error if invoked without the flag. */ - deleteExternalAuth(model: models.ExternalAuth): void + markPersistentFlagRequired(name: string): void } - interface Dao { + interface Command { /** - * LogQuery returns a new Log select query. + * MarkFlagFilename instructs the various shell completion implementations to + * limit completions for the named flag to the specified file extensions. */ - logQuery(): (dbx.SelectQuery) + markFlagFilename(name: string, ...extensions: string[]): void } - interface Dao { + interface Command { /** - * FindLogById finds a single Log entry by its id. + * MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. + * The bash completion script will call the bash function f for the flag. + * + * This will only work for bash completion. + * It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows + * to register a Go function which will work across all shells. */ - findLogById(id: string): (models.Log) + markFlagCustom(name: string, f: string): void } - interface Dao { + interface Command { /** - * LogsStats returns hourly grouped requests logs statistics. + * MarkPersistentFlagFilename instructs the various shell completion + * implementations to limit completions for the named persistent flag to the + * specified file extensions. */ - logsStats(expr: dbx.Expression): Array<(LogsStatsItem | undefined)> + markPersistentFlagFilename(name: string, ...extensions: string[]): void } - interface Dao { + interface Command { /** - * DeleteOldLogs delete all requests that are created before createdBefore. + * MarkFlagDirname instructs the various shell completion implementations to + * limit completions for the named flag to directory names. */ - deleteOldLogs(createdBefore: time.Time): void + markFlagDirname(name: string): void } - interface Dao { + interface Command { /** - * SaveLog upserts the provided Log model. + * MarkPersistentFlagDirname instructs the various shell completion + * implementations to limit completions for the named persistent flag to + * directory names. */ - saveLog(log: models.Log): void + markPersistentFlagDirname(name: string): void } - interface Dao { + interface Command { /** - * ParamQuery returns a new Param select query. + * GenZshCompletionFile generates zsh completion file including descriptions. */ - paramQuery(): (dbx.SelectQuery) + genZshCompletionFile(filename: string): void } - interface Dao { + interface Command { /** - * FindParamByKey finds the first Param model with the provided key. + * GenZshCompletion generates zsh completion file including descriptions + * and writes it to the passed writer. */ - findParamByKey(key: string): (models.Param) + genZshCompletion(w: io.Writer): void } - interface Dao { + interface Command { /** - * SaveParam creates or updates a Param model by the provided key-value pair. - * The value argument will be encoded as json string. - * - * If `optEncryptionKey` is provided it will encrypt the value before storing it. + * GenZshCompletionFileNoDesc generates zsh completion file without descriptions. */ - saveParam(key: string, value: any, ...optEncryptionKey: string[]): void + genZshCompletionFileNoDesc(filename: string): void } - interface Dao { + interface Command { /** - * DeleteParam deletes the provided Param model. + * GenZshCompletionNoDesc generates zsh completion file without descriptions + * and writes it to the passed writer. */ - deleteParam(param: models.Param): void + genZshCompletionNoDesc(w: io.Writer): void } - interface Dao { + interface Command { /** - * RecordQuery returns a new Record select query from a collection model, id or name. + * MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was + * not consistent with Bash completion. It has therefore been disabled. + * Instead, when no other completion is specified, file completion is done by + * default for every argument. One can disable file completion on a per-argument + * basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. + * To achieve file extension filtering, one can use ValidArgsFunction and + * ShellCompDirectiveFilterFileExt. * - * In case a collection id or name is provided and that collection doesn't - * actually exists, the generated query will be created with a cancelled context - * and will fail once an executor (Row(), One(), All(), etc.) is called. + * Deprecated */ - recordQuery(collectionModelOrIdentifier: any): (dbx.SelectQuery) + markZshCompPositionalArgumentFile(argPosition: number, ...patterns: string[]): void } - interface Dao { + interface Command { /** - * FindRecordById finds the Record model by its id. + * MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore + * been disabled. + * To achieve the same behavior across all shells, one can use + * ValidArgs (for the first argument only) or ValidArgsFunction for + * any argument (can include the first one also). + * + * Deprecated */ - findRecordById(collectionNameOrId: string, recordId: string, ...optFilters: ((q: dbx.SelectQuery) => void)[]): (models.Record) + markZshCompPositionalArgumentWords(argPosition: number, ...words: string[]): void } - interface Dao { +} + +/** + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. + */ +namespace core { + /** + * App defines the main PocketBase app interface. + */ + interface App { + [key:string]: any; /** - * FindRecordsByIds finds all Record models by the provided ids. - * If no records are found, returns an empty slice. + * Deprecated: + * This method may get removed in the near future. + * It is recommended to access the app db instance from app.Dao().DB() or + * if you want more flexibility - app.Dao().ConcurrentDB() and app.Dao().NonconcurrentDB(). + * + * DB returns the default app database instance. */ - findRecordsByIds(collectionNameOrId: string, recordIds: Array, ...optFilters: ((q: dbx.SelectQuery) => void)[]): Array<(models.Record | undefined)> - } - interface Dao { + db(): (dbx.DB) /** - * FindRecordsByExpr finds all records by the specified db expression. - * - * Returns all collection records if no expressions are provided. + * Dao returns the default app Dao instance. * - * Returns an empty slice if no records are found. + * This Dao could operate only on the tables and models + * associated with the default app database. For example, + * trying to access the request logs table will result in error. + */ + dao(): (daos.Dao) + /** + * Deprecated: + * This method may get removed in the near future. + * It is recommended to access the logs db instance from app.LogsDao().DB() or + * if you want more flexibility - app.LogsDao().ConcurrentDB() and app.LogsDao().NonconcurrentDB(). * - * Example: + * LogsDB returns the app logs database instance. + */ + logsDB(): (dbx.DB) + /** + * LogsDao returns the app logs Dao instance. * - * ``` - * expr1 := dbx.HashExp{"email": "test@example.com"} - * expr2 := dbx.NewExp("LOWER(username) = {:username}", dbx.Params{"username": "test"}) - * dao.FindRecordsByExpr("example", expr1, expr2) - * ``` + * This Dao could operate only on the tables and models + * associated with the logs database. For example, trying to access + * the users table from LogsDao will result in error. */ - findRecordsByExpr(collectionNameOrId: string, ...exprs: dbx.Expression[]): Array<(models.Record | undefined)> - } - interface Dao { + logsDao(): (daos.Dao) /** - * FindFirstRecordByData returns the first found record matching - * the provided key-value pair. + * Logger returns the active app logger. */ - findFirstRecordByData(collectionNameOrId: string, key: string, value: any): (models.Record) - } - interface Dao { + logger(): (slog.Logger) /** - * FindRecordsByFilter returns limit number of records matching the - * provided string filter. - * - * NB! Use the last "params" argument to bind untrusted user variables! - * - * The sort argument is optional and can be empty string OR the same format - * used in the web APIs, eg. "-created,title". - * - * If the limit argument is <= 0, no limit is applied to the query and - * all matching records are returned. - * - * Example: - * - * ``` - * dao.FindRecordsByFilter( - * "posts", - * "title ~ {:title} && visible = {:visible}", - * "-created", - * 10, - * 0, - * dbx.Params{"title": "lorem ipsum", "visible": true} - * ) - * ``` + * DataDir returns the app data directory path. */ - findRecordsByFilter(collectionNameOrId: string, filter: string, sort: string, limit: number, offset: number, ...params: dbx.Params[]): Array<(models.Record | undefined)> - } - interface Dao { + dataDir(): string /** - * FindFirstRecordByFilter returns the first available record matching the provided filter. - * - * NB! Use the last params argument to bind untrusted user variables! - * - * Example: - * - * ``` - * dao.FindFirstRecordByFilter("posts", "slug={:slug} && status='public'", dbx.Params{"slug": "test"}) - * ``` + * EncryptionEnv returns the name of the app secret env key + * (used for settings encryption). */ - findFirstRecordByFilter(collectionNameOrId: string, filter: string, ...params: dbx.Params[]): (models.Record) - } - interface Dao { + encryptionEnv(): string /** - * IsRecordValueUnique checks if the provided key-value pair is a unique Record value. - * - * For correctness, if the collection is "auth" and the key is "username", - * the unique check will be case insensitive. - * - * NB! Array values (eg. from multiple select fields) are matched - * as a serialized json strings (eg. `["a","b"]`), so the value uniqueness - * depends on the elements order. Or in other words the following values - * are considered different: `[]string{"a","b"}` and `[]string{"b","a"}` + * IsDev returns whether the app is in dev mode. */ - isRecordValueUnique(collectionNameOrId: string, key: string, value: any, ...excludeIds: string[]): boolean - } - interface Dao { + isDev(): boolean /** - * FindAuthRecordByToken finds the auth record associated with the provided JWT. - * - * Returns an error if the JWT is invalid, expired or not associated to an auth collection record. + * Settings returns the loaded app settings. */ - findAuthRecordByToken(token: string, baseTokenKey: string): (models.Record) - } - interface Dao { + settings(): (settings.Settings) /** - * FindAuthRecordByEmail finds the auth record associated with the provided email. - * - * Returns an error if it is not an auth collection or the record is not found. + * Deprecated: Use app.Store() instead. */ - findAuthRecordByEmail(collectionNameOrId: string, email: string): (models.Record) - } - interface Dao { + cache(): (store.Store) /** - * FindAuthRecordByUsername finds the auth record associated with the provided username (case insensitive). - * - * Returns an error if it is not an auth collection or the record is not found. + * Store returns the app runtime store. */ - findAuthRecordByUsername(collectionNameOrId: string, username: string): (models.Record) - } - interface Dao { + store(): (store.Store) /** - * SuggestUniqueAuthRecordUsername checks if the provided username is unique - * and return a new "unique" username with appended random numeric part - * (eg. "existingName" -> "existingName583"). - * - * The same username will be returned if the provided string is already unique. + * SubscriptionsBroker returns the app realtime subscriptions broker instance. */ - suggestUniqueAuthRecordUsername(collectionNameOrId: string, baseUsername: string, ...excludeIds: string[]): string - } - interface Dao { + subscriptionsBroker(): (subscriptions.Broker) /** - * CanAccessRecord checks if a record is allowed to be accessed by the - * specified requestInfo and accessRule. - * - * Rule and db checks are ignored in case requestInfo.Admin is set. - * - * The returned error indicate that something unexpected happened during - * the check (eg. invalid rule or db error). - * - * The method always return false on invalid access rule or db error. - * - * Example: - * - * ``` - * requestInfo := apis.RequestInfo(c /* echo.Context *\/) - * record, _ := dao.FindRecordById("example", "RECORD_ID") - * rule := types.Pointer("@request.auth.id != '' || status = 'public'") - * // ... or use one of the record collection's rule, eg. record.Collection().ViewRule - * - * if ok, _ := dao.CanAccessRecord(record, requestInfo, rule); ok { ... } - * ``` + * NewMailClient creates and returns a configured app mail client. */ - canAccessRecord(record: models.Record, requestInfo: models.RequestInfo, accessRule: string): boolean - } - interface Dao { + newMailClient(): mailer.Mailer /** - * SaveRecord persists the provided Record model in the database. + * NewFilesystem creates and returns a configured filesystem.System instance + * for managing regular app files (eg. collection uploads). * - * If record.IsNew() is true, the method will perform a create, otherwise an update. - * To explicitly mark a record for update you can use record.MarkAsNotNew(). + * NB! Make sure to call Close() on the returned result + * after you are done working with it. */ - saveRecord(record: models.Record): void - } - interface Dao { + newFilesystem(): (filesystem.System) /** - * DeleteRecord deletes the provided Record model. - * - * This method will also cascade the delete operation to all linked - * relational records (delete or unset, depending on the rel settings). + * NewBackupsFilesystem creates and returns a configured filesystem.System instance + * for managing app backups. * - * The delete operation may fail if the record is part of a required - * reference in another record (aka. cannot be deleted or unset). - */ - deleteRecord(record: models.Record): void - } - interface Dao { - /** - * ExpandRecord expands the relations of a single Record model. - * - * If optFetchFunc is not set, then a default function will be used - * that returns all relation records. - * - * Returns a map with the failed expand parameters and their errors. - */ - expandRecord(record: models.Record, expands: Array, optFetchFunc: ExpandFetchFunc): _TygojaDict - } - interface Dao { - /** - * ExpandRecords expands the relations of the provided Record models list. - * - * If optFetchFunc is not set, then a default function will be used - * that returns all relation records. - * - * Returns a map with the failed expand parameters and their errors. - */ - expandRecords(records: Array<(models.Record | undefined)>, expands: Array, optFetchFunc: ExpandFetchFunc): _TygojaDict - } - // @ts-ignore - import validation = ozzo_validation - interface Dao { - /** - * SyncRecordTableSchema compares the two provided collections - * and applies the necessary related record table changes. - * - * If `oldCollection` is null, then only `newCollection` is used to create the record table. - */ - syncRecordTableSchema(newCollection: models.Collection, oldCollection: models.Collection): void - } - interface Dao { - /** - * FindSettings returns and decode the serialized app settings param value. - * - * The method will first try to decode the param value without decryption. - * If it fails and optEncryptionKey is set, it will try again by first - * decrypting the value and then decode it again. - * - * Returns an error if it fails to decode the stored serialized param value. - */ - findSettings(...optEncryptionKey: string[]): (settings.Settings) - } - interface Dao { - /** - * SaveSettings persists the specified settings configuration. - * - * If optEncryptionKey is set, then the stored serialized value will be encrypted with it. - */ - saveSettings(newSettings: settings.Settings, ...optEncryptionKey: string[]): void - } - interface Dao { - /** - * HasTable checks if a table (or view) with the provided name exists (case insensitive). - */ - hasTable(tableName: string): boolean - } - interface Dao { - /** - * TableColumns returns all column names of a single table by its name. - */ - tableColumns(tableName: string): Array - } - interface Dao { - /** - * TableInfo returns the `table_info` pragma result for the specified table. - */ - tableInfo(tableName: string): Array<(models.TableInfoRow | undefined)> - } - interface Dao { - /** - * TableIndexes returns a name grouped map with all non empty index of the specified table. - * - * Note: This method doesn't return an error on nonexisting table. - */ - tableIndexes(tableName: string): _TygojaDict - } - interface Dao { - /** - * DeleteTable drops the specified table. - * - * This method is a no-op if a table with the provided name doesn't exist. - * - * Be aware that this method is vulnerable to SQL injection and the - * "tableName" argument must come only from trusted input! - */ - deleteTable(tableName: string): void - } - interface Dao { - /** - * Vacuum executes VACUUM on the current dao.DB() instance in order to - * reclaim unused db disk space. - */ - vacuum(): void - } - interface Dao { - /** - * DeleteView drops the specified view name. - * - * This method is a no-op if a view with the provided name doesn't exist. - * - * Be aware that this method is vulnerable to SQL injection and the - * "name" argument must come only from trusted input! - */ - deleteView(name: string): void - } - interface Dao { - /** - * SaveView creates (or updates already existing) persistent SQL view. - * - * Be aware that this method is vulnerable to SQL injection and the - * "selectQuery" argument must come only from trusted input! - */ - saveView(name: string, selectQuery: string): void - } - interface Dao { - /** - * CreateViewSchema creates a new view schema from the provided select query. - * - * There are some caveats: - * - The select query must have an "id" column. - * - Wildcard ("*") columns are not supported to avoid accidentally leaking sensitive data. - */ - createViewSchema(selectQuery: string): schema.Schema - } - interface Dao { - /** - * FindRecordByViewFile returns the original models.Record of the - * provided view collection file. - */ - findRecordByViewFile(viewCollectionNameOrId: string, fileFieldName: string, filename: string): (models.Record) - } -} - -/** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. - */ -namespace core { - /** - * App defines the main PocketBase app interface. - */ - interface App { - [key:string]: any; - /** - * Deprecated: - * This method may get removed in the near future. - * It is recommended to access the app db instance from app.Dao().DB() or - * if you want more flexibility - app.Dao().ConcurrentDB() and app.Dao().NonconcurrentDB(). - * - * DB returns the default app database instance. - */ - db(): (dbx.DB) - /** - * Dao returns the default app Dao instance. - * - * This Dao could operate only on the tables and models - * associated with the default app database. For example, - * trying to access the request logs table will result in error. - */ - dao(): (daos.Dao) - /** - * Deprecated: - * This method may get removed in the near future. - * It is recommended to access the logs db instance from app.LogsDao().DB() or - * if you want more flexibility - app.LogsDao().ConcurrentDB() and app.LogsDao().NonconcurrentDB(). - * - * LogsDB returns the app logs database instance. - */ - logsDB(): (dbx.DB) - /** - * LogsDao returns the app logs Dao instance. - * - * This Dao could operate only on the tables and models - * associated with the logs database. For example, trying to access - * the users table from LogsDao will result in error. - */ - logsDao(): (daos.Dao) - /** - * Logger returns the active app logger. - */ - logger(): (slog.Logger) - /** - * DataDir returns the app data directory path. - */ - dataDir(): string - /** - * EncryptionEnv returns the name of the app secret env key - * (used for settings encryption). - */ - encryptionEnv(): string - /** - * IsDev returns whether the app is in dev mode. - */ - isDev(): boolean - /** - * Settings returns the loaded app settings. - */ - settings(): (settings.Settings) - /** - * Deprecated: Use app.Store() instead. - */ - cache(): (store.Store) - /** - * Store returns the app runtime store. - */ - store(): (store.Store) - /** - * SubscriptionsBroker returns the app realtime subscriptions broker instance. - */ - subscriptionsBroker(): (subscriptions.Broker) - /** - * NewMailClient creates and returns a configured app mail client. - */ - newMailClient(): mailer.Mailer - /** - * NewFilesystem creates and returns a configured filesystem.System instance - * for managing regular app files (eg. collection uploads). - * - * NB! Make sure to call Close() on the returned result - * after you are done working with it. - */ - newFilesystem(): (filesystem.System) - /** - * NewBackupsFilesystem creates and returns a configured filesystem.System instance - * for managing app backups. - * - * NB! Make sure to call Close() on the returned result - * after you are done working with it. + * NB! Make sure to call Close() on the returned result + * after you are done working with it. */ newBackupsFilesystem(): (filesystem.System) /** @@ -20457,21039 +14674,2791 @@ namespace core { } /** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. */ -namespace cobra { - interface Command { - /** - * GenBashCompletion generates bash completion file and writes to the passed writer. - */ - genBashCompletion(w: io.Writer): void +namespace io { + /** + * ReadCloser is the interface that groups the basic Read and Close methods. + */ + interface ReadCloser { + [key:string]: any; } - interface Command { - /** - * GenBashCompletionFile generates bash completion file. - */ - genBashCompletionFile(filename: string): void + /** + * WriteCloser is the interface that groups the basic Write and Close methods. + */ + interface WriteCloser { + [key:string]: any; } - interface Command { - /** - * GenBashCompletionFileV2 generates Bash completion version 2. - */ - genBashCompletionFileV2(filename: string, includeDesc: boolean): void +} + +/** + * Package syscall contains an interface to the low-level operating system + * primitives. The details vary depending on the underlying system, and + * by default, godoc will display the syscall documentation for the current + * system. If you want godoc to display syscall documentation for another + * system, set $GOOS and $GOARCH to the desired system. For example, if + * you want to view documentation for freebsd/arm on linux/amd64, set $GOOS + * to freebsd and $GOARCH to arm. + * The primary use of syscall is inside other packages that provide a more + * portable interface to the system, such as "os", "time" and "net". Use + * those packages rather than this one if you can. + * For details of the functions and data types in this package consult + * the manuals for the appropriate operating system. + * These calls return err == nil to indicate success; otherwise + * err is an operating system error describing the failure. + * On most systems, that error has type [Errno]. + * + * NOTE: Most of the functions, types, and constants defined in + * this package are also available in the [golang.org/x/sys] package. + * That package has more system call support than this one, + * and most new code should prefer that package where possible. + * See https://golang.org/s/go1.4-syscall for more information. + */ +namespace syscall { + /** + * SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in Linux. + * See user_namespaces(7). + * + * Note that User Namespaces are not available on a number of popular Linux + * versions (due to security issues), or are available but subject to AppArmor + * restrictions like in Ubuntu 24.04. + */ + interface SysProcIDMap { + containerID: number // Container ID. + hostID: number // Host ID. + size: number // Size. } - interface Command { - /** - * GenBashCompletionV2 generates Bash completion file version 2 - * and writes it to the passed writer. - */ - genBashCompletionV2(w: io.Writer, includeDesc: boolean): void + // @ts-ignore + import errorspkg = errors + /** + * Credential holds user and group identities to be assumed + * by a child process started by [StartProcess]. + */ + interface Credential { + uid: number // User ID. + gid: number // Group ID. + groups: Array // Supplementary group IDs. + noSetGroups: boolean // If true, don't set supplementary groups } // @ts-ignore - import flag = pflag + import runtimesyscall = syscall /** - * Command is just that, a command for your application. - * E.g. 'go run ...' - 'run' is the command. Cobra requires - * you to define the usage and description as part of your command - * definition to ensure usability. + * A Signal is a number describing a process signal. + * It implements the [os.Signal] interface. */ - interface Command { - /** - * Use is the one-line usage message. - * Recommended syntax is as follows: - * ``` - * [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. - * ... indicates that you can specify multiple values for the previous argument. - * | indicates mutually exclusive information. You can use the argument to the left of the separator or the - * argument to the right of the separator. You cannot use both arguments in a single use of the command. - * { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are - * optional, they are enclosed in brackets ([ ]). - * ``` - * Example: add [-F file | -D dir]... [-f format] profile - */ - use: string - /** - * Aliases is an array of aliases that can be used instead of the first word in Use. - */ - aliases: Array - /** - * SuggestFor is an array of command names for which this command will be suggested - - * similar to aliases but only suggests. - */ - suggestFor: Array - /** - * Short is the short description shown in the 'help' output. - */ - short: string - /** - * The group id under which this subcommand is grouped in the 'help' output of its parent. - */ - groupID: string - /** - * Long is the long message shown in the 'help ' output. - */ - long: string - /** - * Example is examples of how to use the command. - */ - example: string + interface Signal extends Number{} + interface Signal { + signal(): void + } + interface Signal { + string(): string + } +} + +/** + * Package time provides functionality for measuring and displaying time. + * + * The calendrical calculations always assume a Gregorian calendar, with + * no leap seconds. + * + * # Monotonic Clocks + * + * Operating systems provide both a “wall clock,” which is subject to + * changes for clock synchronization, and a “monotonic clock,” which is + * not. The general rule is that the wall clock is for telling time and + * the monotonic clock is for measuring time. Rather than split the API, + * in this package the Time returned by [time.Now] contains both a wall + * clock reading and a monotonic clock reading; later time-telling + * operations use the wall clock reading, but later time-measuring + * operations, specifically comparisons and subtractions, use the + * monotonic clock reading. + * + * For example, this code always computes a positive elapsed time of + * approximately 20 milliseconds, even if the wall clock is changed during + * the operation being timed: + * + * ``` + * start := time.Now() + * ... operation that takes 20 milliseconds ... + * t := time.Now() + * elapsed := t.Sub(start) + * ``` + * + * Other idioms, such as [time.Since](start), [time.Until](deadline), and + * time.Now().Before(deadline), are similarly robust against wall clock + * resets. + * + * The rest of this section gives the precise details of how operations + * use monotonic clocks, but understanding those details is not required + * to use this package. + * + * The Time returned by time.Now contains a monotonic clock reading. + * If Time t has a monotonic clock reading, t.Add adds the same duration to + * both the wall clock and monotonic clock readings to compute the result. + * Because t.AddDate(y, m, d), t.Round(d), and t.Truncate(d) are wall time + * computations, they always strip any monotonic clock reading from their results. + * Because t.In, t.Local, and t.UTC are used for their effect on the interpretation + * of the wall time, they also strip any monotonic clock reading from their results. + * The canonical way to strip a monotonic clock reading is to use t = t.Round(0). + * + * If Times t and u both contain monotonic clock readings, the operations + * t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out + * using the monotonic clock readings alone, ignoring the wall clock + * readings. If either t or u contains no monotonic clock reading, these + * operations fall back to using the wall clock readings. + * + * On some systems the monotonic clock will stop if the computer goes to sleep. + * On such a system, t.Sub(u) may not accurately reflect the actual + * time that passed between t and u. The same applies to other functions and + * methods that subtract times, such as [Since], [Until], [Before], [After], + * [Add], [Sub], [Equal] and [Compare]. In some cases, you may need to strip + * the monotonic clock to get accurate results. + * + * Because the monotonic clock reading has no meaning outside + * the current process, the serialized forms generated by t.GobEncode, + * t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic + * clock reading, and t.Format provides no format for it. Similarly, the + * constructors [time.Date], [time.Parse], [time.ParseInLocation], and [time.Unix], + * as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. + * t.UnmarshalJSON, and t.UnmarshalText always create times with + * no monotonic clock reading. + * + * The monotonic clock reading exists only in [Time] values. It is not + * a part of [Duration] values or the Unix times returned by t.Unix and + * friends. + * + * Note that the Go == operator compares not just the time instant but + * also the [Location] and the monotonic clock reading. See the + * documentation for the Time type for a discussion of equality + * testing for Time values. + * + * For debugging, the result of t.String does include the monotonic + * clock reading if present. If t != u because of different monotonic clock readings, + * that difference will be visible when printing t.String() and u.String(). + * + * # Timer Resolution + * + * [Timer] resolution varies depending on the Go runtime, the operating system + * and the underlying hardware. + * On Unix, the resolution is ~1ms. + * On Windows version 1803 and newer, the resolution is ~0.5ms. + * On older Windows versions, the default resolution is ~16ms, but + * a higher resolution may be requested using [golang.org/x/sys/windows.TimeBeginPeriod]. + */ +namespace time { + /** + * A Month specifies a month of the year (January = 1, ...). + */ + interface Month extends Number{} + interface Month { /** - * ValidArgs is list of all valid non-flag arguments that are accepted in shell completions + * String returns the English name of the month ("January", "February", ...). */ - validArgs: Array + string(): string + } + /** + * A Weekday specifies a day of the week (Sunday = 0, ...). + */ + interface Weekday extends Number{} + interface Weekday { /** - * ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. - * It is a dynamic version of using ValidArgs. - * Only one of ValidArgs and ValidArgsFunction can be used for a command. + * String returns the English name of the day ("Sunday", "Monday", ...). */ - validArgsFunction: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective] + string(): string + } + /** + * A Location maps time instants to the zone in use at that time. + * Typically, the Location represents the collection of time offsets + * in use in a geographical area. For many Locations the time offset varies + * depending on whether daylight savings time is in use at the time instant. + * + * Location is used to provide a time zone in a printed Time value and for + * calculations involving intervals that may cross daylight savings time + * boundaries. + */ + interface Location { + } + interface Location { /** - * Expected arguments + * String returns a descriptive name for the time zone information, + * corresponding to the name argument to [LoadLocation] or [FixedZone]. */ - args: PositionalArgs + string(): string + } +} + +/** + * Package context defines the Context type, which carries deadlines, + * cancellation signals, and other request-scoped values across API boundaries + * and between processes. + * + * Incoming requests to a server should create a [Context], and outgoing + * calls to servers should accept a Context. The chain of function + * calls between them must propagate the Context, optionally replacing + * it with a derived Context created using [WithCancel], [WithDeadline], + * [WithTimeout], or [WithValue]. When a Context is canceled, all + * Contexts derived from it are also canceled. + * + * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a + * Context (the parent) and return a derived Context (the child) and a + * [CancelFunc]. Calling the CancelFunc cancels the child and its + * children, removes the parent's reference to the child, and stops + * any associated timers. Failing to call the CancelFunc leaks the + * child and its children until the parent is canceled or the timer + * fires. The go vet tool checks that CancelFuncs are used on all + * control-flow paths. + * + * The [WithCancelCause] function returns a [CancelCauseFunc], which + * takes an error and records it as the cancellation cause. Calling + * [Cause] on the canceled context or any of its children retrieves + * the cause. If no cause is specified, Cause(ctx) returns the same + * value as ctx.Err(). + * + * Programs that use Contexts should follow these rules to keep interfaces + * consistent across packages and enable static analysis tools to check context + * propagation: + * + * Do not store Contexts inside a struct type; instead, pass a Context + * explicitly to each function that needs it. The Context should be the first + * parameter, typically named ctx: + * + * ``` + * func DoSomething(ctx context.Context, arg Arg) error { + * // ... use ctx ... + * } + * ``` + * + * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] + * if you are unsure about which Context to use. + * + * Use context Values only for request-scoped data that transits processes and + * APIs, not for passing optional parameters to functions. + * + * The same Context may be passed to functions running in different goroutines; + * Contexts are safe for simultaneous use by multiple goroutines. + * + * See https://blog.golang.org/context for example code for a server that uses + * Contexts. + */ +namespace context { +} + +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + * + * See the [testing/fstest] package for support with testing + * implementations of file systems. + */ +namespace fs { +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { + /** + * Conn is a generic stream-oriented network connection. + * + * Multiple goroutines may invoke methods on a Conn simultaneously. + */ + interface Conn { + [key:string]: any; /** - * ArgAliases is List of aliases for ValidArgs. - * These are not suggested to the user in the shell completion, - * but accepted if entered manually. + * Read reads data from the connection. + * Read can be made to time out and return an error after a fixed + * time limit; see SetDeadline and SetReadDeadline. */ - argAliases: Array + read(b: string|Array): number /** - * BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. - * For portability with other shells, it is recommended to instead use ValidArgsFunction + * Write writes data to the connection. + * Write can be made to time out and return an error after a fixed + * time limit; see SetDeadline and SetWriteDeadline. */ - bashCompletionFunction: string + write(b: string|Array): number /** - * Deprecated defines, if this command is deprecated and should print this string when used. + * Close closes the connection. + * Any blocked Read or Write operations will be unblocked and return errors. */ - deprecated: string + close(): void /** - * Annotations are key/value pairs that can be used by applications to identify or - * group commands or set special options. + * LocalAddr returns the local network address, if known. */ - annotations: _TygojaDict + localAddr(): Addr /** - * Version defines the version for this command. If this value is non-empty and the command does not - * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, - * will print content of the "Version" variable. A shorthand "v" flag will also be added if the - * command does not define one. + * RemoteAddr returns the remote network address, if known. */ - version: string + remoteAddr(): Addr /** - * The *Run functions are executed in the following order: - * ``` - * * PersistentPreRun() - * * PreRun() - * * Run() - * * PostRun() - * * PersistentPostRun() - * ``` - * All functions get the same args, the arguments after the command name. - * The *PreRun and *PostRun functions will only be executed if the Run function of the current - * command has been declared. + * SetDeadline sets the read and write deadlines associated + * with the connection. It is equivalent to calling both + * SetReadDeadline and SetWriteDeadline. * - * PersistentPreRun: children of this command will inherit and execute. - */ - persistentPreRun: (cmd: Command, args: Array) => void - /** - * PersistentPreRunE: PersistentPreRun but returns an error. + * A deadline is an absolute time after which I/O operations + * fail instead of blocking. The deadline applies to all future + * and pending I/O, not just the immediately following call to + * Read or Write. After a deadline has been exceeded, the + * connection can be refreshed by setting a deadline in the future. + * + * If the deadline is exceeded a call to Read or Write or to other + * I/O methods will return an error that wraps os.ErrDeadlineExceeded. + * This can be tested using errors.Is(err, os.ErrDeadlineExceeded). + * The error's Timeout method will return true, but note that there + * are other possible errors for which the Timeout method will + * return true even if the deadline has not been exceeded. + * + * An idle timeout can be implemented by repeatedly extending + * the deadline after successful Read or Write calls. + * + * A zero value for t means I/O operations will not time out. */ - persistentPreRunE: (cmd: Command, args: Array) => void + setDeadline(t: time.Time): void /** - * PreRun: children of this command will not inherit. + * SetReadDeadline sets the deadline for future Read calls + * and any currently-blocked Read call. + * A zero value for t means Read will not time out. */ - preRun: (cmd: Command, args: Array) => void + setReadDeadline(t: time.Time): void /** - * PreRunE: PreRun but returns an error. + * SetWriteDeadline sets the deadline for future Write calls + * and any currently-blocked Write call. + * Even if write times out, it may return n > 0, indicating that + * some of the data was successfully written. + * A zero value for t means Write will not time out. */ - preRunE: (cmd: Command, args: Array) => void - /** - * Run: Typically the actual work function. Most commands will only implement this. - */ - run: (cmd: Command, args: Array) => void + setWriteDeadline(t: time.Time): void + } + /** + * A Listener is a generic network listener for stream-oriented protocols. + * + * Multiple goroutines may invoke methods on a Listener simultaneously. + */ + interface Listener { + [key:string]: any; /** - * RunE: Run but returns an error. + * Accept waits for and returns the next connection to the listener. */ - runE: (cmd: Command, args: Array) => void + accept(): Conn /** - * PostRun: run after the Run command. + * Close closes the listener. + * Any blocked Accept operations will be unblocked and return errors. */ - postRun: (cmd: Command, args: Array) => void + close(): void /** - * PostRunE: PostRun but returns an error. + * Addr returns the listener's network address. */ - postRunE: (cmd: Command, args: Array) => void + addr(): Addr + } +} + +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { + /** + * A URL represents a parsed URL (technically, a URI reference). + * + * The general form represented is: + * + * ``` + * [scheme:][//[userinfo@]host][/]path[?query][#fragment] + * ``` + * + * URLs that do not start with a slash after the scheme are interpreted as: + * + * ``` + * scheme:opaque[?query][#fragment] + * ``` + * + * The Host field contains the host and port subcomponents of the URL. + * When the port is present, it is separated from the host with a colon. + * When the host is an IPv6 address, it must be enclosed in square brackets: + * "[fe80::1]:80". The [net.JoinHostPort] function combines a host and port + * into a string suitable for the Host field, adding square brackets to + * the host when necessary. + * + * Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. + * A consequence is that it is impossible to tell which slashes in the Path were + * slashes in the raw URL and which were %2f. This distinction is rarely important, + * but when it is, the code should use the [URL.EscapedPath] method, which preserves + * the original encoding of Path. + * + * The RawPath field is an optional field which is only set when the default + * encoding of Path is different from the escaped path. See the EscapedPath method + * for more details. + * + * URL's String method uses the EscapedPath method to obtain the path. + */ + interface URL { + scheme: string + opaque: string // encoded opaque data + user?: Userinfo // username and password information + host: string // host or host:port (see Hostname and Port methods) + path: string // path (relative paths may omit leading slash) + rawPath: string // encoded path hint (see EscapedPath method) + omitHost: boolean // do not emit empty host (authority) + forceQuery: boolean // append a query ('?') even if RawQuery is empty + rawQuery: string // encoded query values, without '?' + fragment: string // fragment for references, without '#' + rawFragment: string // encoded fragment hint (see EscapedFragment method) + } + interface URL { /** - * PersistentPostRun: children of this command will inherit and execute after PostRun. + * EscapedPath returns the escaped form of u.Path. + * In general there are multiple possible escaped forms of any path. + * EscapedPath returns u.RawPath when it is a valid escaping of u.Path. + * Otherwise EscapedPath ignores u.RawPath and computes an escaped + * form on its own. + * The [URL.String] and [URL.RequestURI] methods use EscapedPath to construct + * their results. + * In general, code should call EscapedPath instead of + * reading u.RawPath directly. */ - persistentPostRun: (cmd: Command, args: Array) => void + escapedPath(): string + } + interface URL { /** - * PersistentPostRunE: PersistentPostRun but returns an error. + * EscapedFragment returns the escaped form of u.Fragment. + * In general there are multiple possible escaped forms of any fragment. + * EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. + * Otherwise EscapedFragment ignores u.RawFragment and computes an escaped + * form on its own. + * The [URL.String] method uses EscapedFragment to construct its result. + * In general, code should call EscapedFragment instead of + * reading u.RawFragment directly. */ - persistentPostRunE: (cmd: Command, args: Array) => void + escapedFragment(): string + } + interface URL { /** - * FParseErrWhitelist flag parse errors to be ignored + * String reassembles the [URL] into a valid URL string. + * The general form of the result is one of: + * + * ``` + * scheme:opaque?query#fragment + * scheme://userinfo@host/path?query#fragment + * ``` + * + * If u.Opaque is non-empty, String uses the first form; + * otherwise it uses the second form. + * Any non-ASCII characters in host are escaped. + * To obtain the path, String uses u.EscapedPath(). + * + * In the second form, the following rules apply: + * ``` + * - if u.Scheme is empty, scheme: is omitted. + * - if u.User is nil, userinfo@ is omitted. + * - if u.Host is empty, host/ is omitted. + * - if u.Scheme and u.Host are empty and u.User is nil, + * the entire scheme://userinfo@host/ is omitted. + * - if u.Host is non-empty and u.Path begins with a /, + * the form host/path does not add its own /. + * - if u.RawQuery is empty, ?query is omitted. + * - if u.Fragment is empty, #fragment is omitted. + * ``` */ - fParseErrWhitelist: FParseErrWhitelist + string(): string + } + interface URL { /** - * CompletionOptions is a set of options to control the handling of shell completion + * Redacted is like [URL.String] but replaces any password with "xxxxx". + * Only the password in u.User is redacted. */ - completionOptions: CompletionOptions + redacted(): string + } + /** + * Values maps a string key to a list of values. + * It is typically used for query parameters and form values. + * Unlike in the http.Header map, the keys in a Values map + * are case-sensitive. + */ + interface Values extends _TygojaDict{} + interface Values { /** - * TraverseChildren parses flags on all parents before executing child command. + * Get gets the first value associated with the given key. + * If there are no values associated with the key, Get returns + * the empty string. To access multiple values, use the map + * directly. */ - traverseChildren: boolean + get(key: string): string + } + interface Values { /** - * Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + * Set sets the key to value. It replaces any existing + * values. */ - hidden: boolean + set(key: string, value: string): void + } + interface Values { /** - * SilenceErrors is an option to quiet errors down stream. + * Add adds the value to key. It appends to any existing + * values associated with key. */ - silenceErrors: boolean + add(key: string, value: string): void + } + interface Values { /** - * SilenceUsage is an option to silence usage when an error occurs. + * Del deletes the values associated with key. */ - silenceUsage: boolean + del(key: string): void + } + interface Values { /** - * DisableFlagParsing disables the flag parsing. - * If this is true all flags will be passed to the command as arguments. + * Has checks whether a given key is set. */ - disableFlagParsing: boolean + has(key: string): boolean + } + interface Values { /** - * DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - * will be printed by generating docs for this command. + * Encode encodes the values into “URL encoded” form + * ("bar=baz&foo=quux") sorted by key. */ - disableAutoGenTag: boolean + encode(): string + } + interface URL { /** - * DisableFlagsInUseLine will disable the addition of [flags] to the usage - * line of a command when printing help or generating docs + * IsAbs reports whether the [URL] is absolute. + * Absolute means that it has a non-empty scheme. */ - disableFlagsInUseLine: boolean + isAbs(): boolean + } + interface URL { /** - * DisableSuggestions disables the suggestions based on Levenshtein distance - * that go along with 'unknown command' messages. + * Parse parses a [URL] in the context of the receiver. The provided URL + * may be relative or absolute. Parse returns nil, err on parse + * failure, otherwise its return value is the same as [URL.ResolveReference]. */ - disableSuggestions: boolean + parse(ref: string): (URL) + } + interface URL { /** - * SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - * Must be > 0. + * ResolveReference resolves a URI reference to an absolute URI from + * an absolute base URI u, per RFC 3986 Section 5.2. The URI reference + * may be relative or absolute. ResolveReference always returns a new + * [URL] instance, even if the returned URL is identical to either the + * base or reference. If ref is an absolute URL, then ResolveReference + * ignores base and returns a copy of ref. */ - suggestionsMinimumDistance: number + resolveReference(ref: URL): (URL) } - interface Command { + interface URL { /** - * Context returns underlying command context. If command was executed - * with ExecuteContext or the context was set with SetContext, the - * previously set context will be returned. Otherwise, nil is returned. - * - * Notice that a call to Execute and ExecuteC will replace a nil context of - * a command with a context.Background, so a background context will be - * returned by Context after one of these functions has been called. + * Query parses RawQuery and returns the corresponding values. + * It silently discards malformed value pairs. + * To check errors use [ParseQuery]. */ - context(): context.Context + query(): Values } - interface Command { + interface URL { /** - * SetContext sets context for the command. This context will be overwritten by - * Command.ExecuteContext or Command.ExecuteContextC. + * RequestURI returns the encoded path?query or opaque?query + * string that would be used in an HTTP request for u. */ - setContext(ctx: context.Context): void + requestURI(): string } - interface Command { + interface URL { /** - * SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden - * particularly useful when testing. + * Hostname returns u.Host, stripping any valid port number if present. + * + * If the result is enclosed in square brackets, as literal IPv6 addresses are, + * the square brackets are removed from the result. */ - setArgs(a: Array): void + hostname(): string } - interface Command { - /** - * SetOutput sets the destination for usage and error messages. - * If output is nil, os.Stderr is used. - * Deprecated: Use SetOut and/or SetErr instead - */ - setOutput(output: io.Writer): void - } - interface Command { - /** - * SetOut sets the destination for usage messages. - * If newOut is nil, os.Stdout is used. - */ - setOut(newOut: io.Writer): void - } - interface Command { - /** - * SetErr sets the destination for error messages. - * If newErr is nil, os.Stderr is used. - */ - setErr(newErr: io.Writer): void - } - interface Command { - /** - * SetIn sets the source for input data - * If newIn is nil, os.Stdin is used. - */ - setIn(newIn: io.Reader): void - } - interface Command { - /** - * SetUsageFunc sets usage function. Usage can be defined by application. - */ - setUsageFunc(f: (_arg0: Command) => void): void - } - interface Command { - /** - * SetUsageTemplate sets usage template. Can be defined by Application. - */ - setUsageTemplate(s: string): void - } - interface Command { + interface URL { /** - * SetFlagErrorFunc sets a function to generate an error when flag parsing - * fails. + * Port returns the port part of u.Host, without the leading colon. + * + * If u.Host doesn't contain a valid numeric port, Port returns an empty string. */ - setFlagErrorFunc(f: (_arg0: Command, _arg1: Error) => void): void + port(): string } - interface Command { - /** - * SetHelpFunc sets help function. Can be defined by Application. - */ - setHelpFunc(f: (_arg0: Command, _arg1: Array) => void): void + interface URL { + marshalBinary(): string|Array } - interface Command { - /** - * SetHelpCommand sets help command. - */ - setHelpCommand(cmd: Command): void + interface URL { + unmarshalBinary(text: string|Array): void } - interface Command { + interface URL { /** - * SetHelpCommandGroupID sets the group id of the help command. + * JoinPath returns a new [URL] with the provided path elements joined to + * any existing path and the resulting path cleaned of any ./ or ../ elements. + * Any sequences of multiple / characters will be reduced to a single /. */ - setHelpCommandGroupID(groupID: string): void + joinPath(...elem: string[]): (URL) } - interface Command { +} + +/** + * Package textproto implements generic support for text-based request/response + * protocols in the style of HTTP, NNTP, and SMTP. + * + * The package provides: + * + * [Error], which represents a numeric error response from + * a server. + * + * [Pipeline], to manage pipelined requests and responses + * in a client. + * + * [Reader], to read numeric response code lines, + * key: value headers, lines wrapped with leading spaces + * on continuation lines, and whole text blocks ending + * with a dot on a line by itself. + * + * [Writer], to write dot-encoded text blocks. + * + * [Conn], a convenient packaging of [Reader], [Writer], and [Pipeline] for use + * with a single network connection. + */ +namespace textproto { + /** + * A MIMEHeader represents a MIME-style header mapping + * keys to sets of values. + */ + interface MIMEHeader extends _TygojaDict{} + interface MIMEHeader { /** - * SetCompletionCommandGroupID sets the group id of the completion command. + * Add adds the key, value pair to the header. + * It appends to any existing values associated with key. */ - setCompletionCommandGroupID(groupID: string): void + add(key: string, value: string): void } - interface Command { + interface MIMEHeader { /** - * SetHelpTemplate sets help template to be used. Application can use it to set custom template. + * Set sets the header entries associated with key to + * the single element value. It replaces any existing + * values associated with key. */ - setHelpTemplate(s: string): void + set(key: string, value: string): void } - interface Command { + interface MIMEHeader { /** - * SetVersionTemplate sets version template to be used. Application can use it to set custom template. + * Get gets the first value associated with the given key. + * It is case insensitive; [CanonicalMIMEHeaderKey] is used + * to canonicalize the provided key. + * If there are no values associated with the key, Get returns "". + * To use non-canonical keys, access the map directly. */ - setVersionTemplate(s: string): void + get(key: string): string } - interface Command { + interface MIMEHeader { /** - * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. + * Values returns all values associated with the given key. + * It is case insensitive; [CanonicalMIMEHeaderKey] is + * used to canonicalize the provided key. To use non-canonical + * keys, access the map directly. + * The returned slice is not a copy. */ - setErrPrefix(s: string): void + values(key: string): Array } - interface Command { + interface MIMEHeader { /** - * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. - * The user should not have a cyclic dependency on commands. + * Del deletes the values associated with key. */ - setGlobalNormalizationFunc(n: (f: any, name: string) => any): void + del(key: string): void } - interface Command { +} + +/** + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. + */ +namespace multipart { + interface Reader { /** - * OutOrStdout returns output to stdout. + * ReadForm parses an entire multipart message whose parts have + * a Content-Disposition of "form-data". + * It stores up to maxMemory bytes + 10MB (reserved for non-file parts) + * in memory. File parts which can't be stored in memory will be stored on + * disk in temporary files. + * It returns [ErrMessageTooLarge] if all non-file parts can't be stored in + * memory. */ - outOrStdout(): io.Writer + readForm(maxMemory: number): (Form) } - interface Command { - /** - * OutOrStderr returns output to stderr - */ - outOrStderr(): io.Writer + /** + * Form is a parsed multipart form. + * Its File parts are stored either in memory or on disk, + * and are accessible via the [*FileHeader]'s Open method. + * Its Value parts are stored as strings. + * Both are keyed by field name. + */ + interface Form { + value: _TygojaDict + file: _TygojaDict } - interface Command { + interface Form { /** - * ErrOrStderr returns output to stderr + * RemoveAll removes any temporary files associated with a [Form]. */ - errOrStderr(): io.Writer + removeAll(): void } - interface Command { - /** - * InOrStdin returns input to stdin - */ - inOrStdin(): io.Reader + /** + * File is an interface to access the file part of a multipart message. + * Its contents may be either stored in memory or on disk. + * If stored on disk, the File's underlying concrete type will be an *os.File. + */ + interface File { + [key:string]: any; } - interface Command { - /** - * UsageFunc returns either the function set by SetUsageFunc for this command - * or a parent, or it returns a default usage function. - */ - usageFunc(): (_arg0: Command) => void + /** + * Reader is an iterator over parts in a MIME multipart body. + * Reader's underlying parser consumes its input as needed. Seeking + * isn't supported. + */ + interface Reader { } - interface Command { + interface Reader { /** - * Usage puts out the usage for the command. - * Used when a user provides invalid input. - * Can be defined by user by overriding UsageFunc. + * NextPart returns the next part in the multipart or an error. + * When there are no more parts, the error [io.EOF] is returned. + * + * As a special case, if the "Content-Transfer-Encoding" header + * has a value of "quoted-printable", that header is instead + * hidden and the body is transparently decoded during Read calls. */ - usage(): void + nextPart(): (Part) } - interface Command { + interface Reader { /** - * HelpFunc returns either the function set by SetHelpFunc for this command - * or a parent, or it returns a function with default help behavior. + * NextRawPart returns the next part in the multipart or an error. + * When there are no more parts, the error [io.EOF] is returned. + * + * Unlike [Reader.NextPart], it does not have special handling for + * "Content-Transfer-Encoding: quoted-printable". */ - helpFunc(): (_arg0: Command, _arg1: Array) => void + nextRawPart(): (Part) } - interface Command { - /** - * Help puts out the help for the command. - * Used when a user calls help [command]. - * Can be defined by user by overriding HelpFunc. - */ - help(): void - } - interface Command { - /** - * UsageString returns usage string. - */ - usageString(): string - } - interface Command { +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + /** + * A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an + * HTTP response or the Cookie header of an HTTP request. + * + * See https://tools.ietf.org/html/rfc6265 for details. + */ + interface Cookie { + name: string + value: string + quoted: boolean // indicates whether the Value was originally quoted + path: string // optional + domain: string // optional + expires: time.Time // optional + rawExpires: string // for reading cookies only /** - * FlagErrorFunc returns either the function set by SetFlagErrorFunc for this - * command or a parent, or it returns a function which returns the original - * error. + * MaxAge=0 means no 'Max-Age' attribute specified. + * MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0' + * MaxAge>0 means Max-Age attribute present and given in seconds */ - flagErrorFunc(): (_arg0: Command, _arg1: Error) => void + maxAge: number + secure: boolean + httpOnly: boolean + sameSite: SameSite + partitioned: boolean + raw: string + unparsed: Array // Raw text of unparsed attribute-value pairs } - interface Command { + interface Cookie { /** - * UsagePadding return padding for the usage. + * String returns the serialization of the cookie for use in a [Cookie] + * header (if only Name and Value are set) or a Set-Cookie response + * header (if other fields are set). + * If c is nil or c.Name is invalid, the empty string is returned. */ - usagePadding(): number + string(): string } - interface Command { + interface Cookie { /** - * CommandPathPadding return padding for the command path. + * Valid reports whether the cookie is valid. */ - commandPathPadding(): number + valid(): void } - interface Command { + // @ts-ignore + import mathrand = rand + /** + * A Header represents the key-value pairs in an HTTP header. + * + * The keys should be in canonical form, as returned by + * [CanonicalHeaderKey]. + */ + interface Header extends _TygojaDict{} + interface Header { /** - * NamePadding returns padding for the name. + * Add adds the key, value pair to the header. + * It appends to any existing values associated with key. + * The key is case insensitive; it is canonicalized by + * [CanonicalHeaderKey]. */ - namePadding(): number + add(key: string, value: string): void } - interface Command { + interface Header { /** - * UsageTemplate returns usage template for the command. + * Set sets the header entries associated with key to the + * single element value. It replaces any existing values + * associated with key. The key is case insensitive; it is + * canonicalized by [textproto.CanonicalMIMEHeaderKey]. + * To use non-canonical keys, assign to the map directly. */ - usageTemplate(): string + set(key: string, value: string): void } - interface Command { + interface Header { /** - * HelpTemplate return help template for the command. + * Get gets the first value associated with the given key. If + * there are no values associated with the key, Get returns "". + * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is + * used to canonicalize the provided key. Get assumes that all + * keys are stored in canonical form. To use non-canonical keys, + * access the map directly. */ - helpTemplate(): string + get(key: string): string } - interface Command { + interface Header { /** - * VersionTemplate return version template for the command. + * Values returns all values associated with the given key. + * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is + * used to canonicalize the provided key. To use non-canonical + * keys, access the map directly. + * The returned slice is not a copy. */ - versionTemplate(): string + values(key: string): Array } - interface Command { + interface Header { /** - * ErrPrefix return error message prefix for the command + * Del deletes the values associated with key. + * The key is case insensitive; it is canonicalized by + * [CanonicalHeaderKey]. */ - errPrefix(): string + del(key: string): void } - interface Command { + interface Header { /** - * Find the target command given the args and command tree - * Meant to be run on the highest node. Only searches down. + * Write writes a header in wire format. */ - find(args: Array): [(Command), Array] + write(w: io.Writer): void } - interface Command { + interface Header { /** - * Traverse the command tree to find the command, and parse args for - * each parent. + * Clone returns a copy of h or nil if h is nil. */ - traverse(args: Array): [(Command), Array] + clone(): Header } - interface Command { + interface Header { /** - * SuggestionsFor provides suggestions for the typedName. + * WriteSubset writes a header in wire format. + * If exclude is not nil, keys where exclude[key] == true are not written. + * Keys are not canonicalized before checking the exclude map. */ - suggestionsFor(typedName: string): Array + writeSubset(w: io.Writer, exclude: _TygojaDict): void } - interface Command { - /** - * VisitParents visits all parents of the command and invokes fn on each parent. - */ - visitParents(fn: (_arg0: Command) => void): void - } - interface Command { + // @ts-ignore + import urlpkg = url + /** + * Response represents the response from an HTTP request. + * + * The [Client] and [Transport] return Responses from servers once + * the response headers have been received. The response body + * is streamed on demand as the Body field is read. + */ + interface Response { + status: string // e.g. "200 OK" + statusCode: number // e.g. 200 + proto: string // e.g. "HTTP/1.0" + protoMajor: number // e.g. 1 + protoMinor: number // e.g. 0 /** - * Root finds root command. + * Header maps header keys to values. If the response had multiple + * headers with the same key, they may be concatenated, with comma + * delimiters. (RFC 7230, section 3.2.2 requires that multiple headers + * be semantically equivalent to a comma-delimited sequence.) When + * Header values are duplicated by other fields in this struct (e.g., + * ContentLength, TransferEncoding, Trailer), the field values are + * authoritative. + * + * Keys in the map are canonicalized (see CanonicalHeaderKey). */ - root(): (Command) - } - interface Command { + header: Header /** - * ArgsLenAtDash will return the length of c.Flags().Args at the moment - * when a -- was found during args parsing. + * Body represents the response body. + * + * The response body is streamed on demand as the Body field + * is read. If the network connection fails or the server + * terminates the response, Body.Read calls return an error. + * + * The http Client and Transport guarantee that Body is always + * non-nil, even on responses without a body or responses with + * a zero-length body. It is the caller's responsibility to + * close Body. The default HTTP client's Transport may not + * reuse HTTP/1.x "keep-alive" TCP connections if the Body is + * not read to completion and closed. + * + * The Body is automatically dechunked if the server replied + * with a "chunked" Transfer-Encoding. + * + * As of Go 1.12, the Body will also implement io.Writer + * on a successful "101 Switching Protocols" response, + * as used by WebSockets and HTTP/2's "h2c" mode. */ - argsLenAtDash(): number - } - interface Command { + body: io.ReadCloser /** - * ExecuteContext is the same as Execute(), but sets the ctx on the command. - * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs - * functions. + * ContentLength records the length of the associated content. The + * value -1 indicates that the length is unknown. Unless Request.Method + * is "HEAD", values >= 0 indicate that the given number of bytes may + * be read from Body. */ - executeContext(ctx: context.Context): void - } - interface Command { + contentLength: number /** - * Execute uses the args (os.Args[1:] by default) - * and run through the command tree finding appropriate matches - * for commands and then corresponding flags. + * Contains transfer encodings from outer-most to inner-most. Value is + * nil, means that "identity" encoding is used. */ - execute(): void - } - interface Command { + transferEncoding: Array /** - * ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. - * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs - * functions. + * Close records whether the header directed that the connection be + * closed after reading Body. The value is advice for clients: neither + * ReadResponse nor Response.Write ever closes a connection. */ - executeContextC(ctx: context.Context): (Command) - } - interface Command { + close: boolean /** - * ExecuteC executes the command. + * Uncompressed reports whether the response was sent compressed but + * was decompressed by the http package. When true, reading from + * Body yields the uncompressed content instead of the compressed + * content actually set from the server, ContentLength is set to -1, + * and the "Content-Length" and "Content-Encoding" fields are deleted + * from the responseHeader. To get the original response from + * the server, set Transport.DisableCompression to true. */ - executeC(): (Command) - } - interface Command { - validateArgs(args: Array): void - } - interface Command { + uncompressed: boolean /** - * ValidateRequiredFlags validates all required flags are present and returns an error otherwise + * Trailer maps trailer keys to values in the same + * format as Header. + * + * The Trailer initially contains only nil values, one for + * each key specified in the server's "Trailer" header + * value. Those values are not added to Header. + * + * Trailer must not be accessed concurrently with Read calls + * on the Body. + * + * After Body.Read has returned io.EOF, Trailer will contain + * any trailer values sent by the server. */ - validateRequiredFlags(): void - } - interface Command { + trailer: Header /** - * InitDefaultHelpFlag adds default help flag to c. - * It is called automatically by executing the c or by calling help and usage. - * If c already has help flag, it will do nothing. + * Request is the request that was sent to obtain this Response. + * Request's Body is nil (having already been consumed). + * This is only populated for Client requests. */ - initDefaultHelpFlag(): void - } - interface Command { + request?: Request /** - * InitDefaultVersionFlag adds default version flag to c. - * It is called automatically by executing the c. - * If c already has a version flag, it will do nothing. - * If c.Version is empty, it will do nothing. + * TLS contains information about the TLS connection on which the + * response was received. It is nil for unencrypted responses. + * The pointer is shared between responses and should not be + * modified. */ - initDefaultVersionFlag(): void + tls?: any } - interface Command { + interface Response { /** - * InitDefaultHelpCmd adds default help command to c. - * It is called automatically by executing the c or by calling help and usage. - * If c already has help command or c has no subcommands, it will do nothing. + * Cookies parses and returns the cookies set in the Set-Cookie headers. */ - initDefaultHelpCmd(): void + cookies(): Array<(Cookie | undefined)> } - interface Command { + interface Response { /** - * ResetCommands delete parent, subcommand and help command from c. + * Location returns the URL of the response's "Location" header, + * if present. Relative redirects are resolved relative to + * [Response.Request]. [ErrNoLocation] is returned if no + * Location header is present. */ - resetCommands(): void + location(): (url.URL) } - interface Command { + interface Response { /** - * Commands returns a sorted slice of child commands. + * ProtoAtLeast reports whether the HTTP protocol used + * in the response is at least major.minor. */ - commands(): Array<(Command | undefined)> + protoAtLeast(major: number, minor: number): boolean } - interface Command { + interface Response { /** - * AddCommand adds one or more commands to this parent command. + * Write writes r to w in the HTTP/1.x server response format, + * including the status line, headers, body, and optional trailer. + * + * This method consults the following fields of the response r: + * + * ``` + * StatusCode + * ProtoMajor + * ProtoMinor + * Request.Method + * TransferEncoding + * Trailer + * Body + * ContentLength + * Header, values for non-canonical keys will have unpredictable behavior + * ``` + * + * The Response Body is closed after it is sent. */ - addCommand(...cmds: (Command | undefined)[]): void + write(w: io.Writer): void } - interface Command { - /** - * Groups returns a slice of child command groups. - */ - groups(): Array<(Group | undefined)> + /** + * A Handler responds to an HTTP request. + * + * [Handler.ServeHTTP] should write reply headers and data to the [ResponseWriter] + * and then return. Returning signals that the request is finished; it + * is not valid to use the [ResponseWriter] or read from the + * [Request.Body] after or concurrently with the completion of the + * ServeHTTP call. + * + * Depending on the HTTP client software, HTTP protocol version, and + * any intermediaries between the client and the Go server, it may not + * be possible to read from the [Request.Body] after writing to the + * [ResponseWriter]. Cautious handlers should read the [Request.Body] + * first, and then reply. + * + * Except for reading the body, handlers should not modify the + * provided Request. + * + * If ServeHTTP panics, the server (the caller of ServeHTTP) assumes + * that the effect of the panic was isolated to the active request. + * It recovers the panic, logs a stack trace to the server error log, + * and either closes the network connection or sends an HTTP/2 + * RST_STREAM, depending on the HTTP protocol. To abort a handler so + * the client sees an interrupted response but the server doesn't log + * an error, panic with the value [ErrAbortHandler]. + */ + interface Handler { + [key:string]: any; + serveHTTP(_arg0: ResponseWriter, _arg1: Request): void } - interface Command { - /** - * AllChildCommandsHaveGroup returns if all subcommands are assigned to a group - */ - allChildCommandsHaveGroup(): boolean + /** + * A ConnState represents the state of a client connection to a server. + * It's used by the optional [Server.ConnState] hook. + */ + interface ConnState extends Number{} + interface ConnState { + string(): string } - interface Command { - /** - * ContainsGroup return if groupID exists in the list of command groups. - */ - containsGroup(groupID: string): boolean +} + +/** + * Package oauth2 provides support for making + * OAuth2 authorized and authenticated HTTP requests, + * as specified in RFC 6749. + * It can additionally grant authorization with Bearer JWT. + */ +/** + * Copyright 2023 The Go Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ +namespace oauth2 { + /** + * An AuthCodeOption is passed to Config.AuthCodeURL. + */ + interface AuthCodeOption { + [key:string]: any; } - interface Command { + /** + * Token represents the credentials used to authorize + * the requests to access protected resources on the OAuth 2.0 + * provider's backend. + * + * Most users of this package should not access fields of Token + * directly. They're exported mostly for use by related packages + * implementing derivative OAuth2 flows. + */ + interface Token { /** - * AddGroup adds one or more command groups to this parent command. + * AccessToken is the token that authorizes and authenticates + * the requests. */ - addGroup(...groups: (Group | undefined)[]): void - } - interface Command { + accessToken: string /** - * RemoveCommand removes one or more commands from a parent command. + * TokenType is the type of token. + * The Type method returns either this or "Bearer", the default. */ - removeCommand(...cmds: (Command | undefined)[]): void - } - interface Command { + tokenType: string /** - * Print is a convenience method to Print to the defined output, fallback to Stderr if not set. + * RefreshToken is a token that's used by the application + * (as opposed to the user) to refresh the access token + * if it expires. */ - print(...i: { - }[]): void - } - interface Command { + refreshToken: string /** - * Println is a convenience method to Println to the defined output, fallback to Stderr if not set. + * Expiry is the optional expiration time of the access token. + * + * If zero, TokenSource implementations will reuse the same + * token forever and RefreshToken or equivalent + * mechanisms for that TokenSource will not be used. */ - println(...i: { - }[]): void - } - interface Command { + expiry: time.Time /** - * Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. + * ExpiresIn is the OAuth2 wire format "expires_in" field, + * which specifies how many seconds later the token expires, + * relative to an unknown time base approximately around "now". + * It is the application's responsibility to populate + * `Expiry` from `ExpiresIn` when required. */ - printf(format: string, ...i: { - }[]): void + expiresIn: number } - interface Command { + interface Token { /** - * PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. + * Type returns t.TokenType if non-empty, else "Bearer". */ - printErr(...i: { - }[]): void + type(): string } - interface Command { + interface Token { /** - * PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. + * SetAuthHeader sets the Authorization header to r using the access + * token in t. + * + * This method is unnecessary when using Transport or an HTTP Client + * returned by this package. */ - printErrln(...i: { - }[]): void + setAuthHeader(r: http.Request): void } - interface Command { + interface Token { /** - * PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. + * WithExtra returns a new Token that's a clone of t, but using the + * provided raw extra map. This is only intended for use by packages + * implementing derivative OAuth2 flows. */ - printErrf(format: string, ...i: { - }[]): void + withExtra(extra: { + }): (Token) } - interface Command { + interface Token { /** - * CommandPath returns the full path to this command. + * Extra returns an extra field. + * Extra fields are key-value pairs returned by the server as a + * part of the token retrieval response. */ - commandPath(): string + extra(key: string): { } - interface Command { - /** - * UseLine puts out the full usage for a given command (including parents). - */ - useLine(): string } - interface Command { + interface Token { /** - * DebugFlags used to determine which flags have been assigned to which commands - * and which persist. + * Valid reports whether t is non-nil, has an AccessToken, and is not expired. */ - debugFlags(): void + valid(): boolean } - interface Command { - /** - * Name returns the command's name: the first word in the use line. - */ - name(): string +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * DateTime represents a [time.Time] instance in UTC that is wrapped + * and serialized using the app default date layout. + */ + interface DateTime { } - interface Command { + interface DateTime { /** - * HasAlias determines if a given string is an alias of the command. + * Time returns the internal [time.Time] instance. */ - hasAlias(s: string): boolean + time(): time.Time } - interface Command { + interface DateTime { /** - * CalledAs returns the command name or alias that was used to invoke - * this command or an empty string if the command has not been called. + * IsZero checks whether the current DateTime instance has zero time value. */ - calledAs(): string + isZero(): boolean } - interface Command { + interface DateTime { /** - * NameAndAliases returns a list of the command name and all aliases + * String serializes the current DateTime instance into a formatted + * UTC date string. + * + * The zero value is serialized to an empty string. */ - nameAndAliases(): string + string(): string } - interface Command { + interface DateTime { /** - * HasExample determines if the command has example. + * MarshalJSON implements the [json.Marshaler] interface. */ - hasExample(): boolean + marshalJSON(): string|Array } - interface Command { + interface DateTime { /** - * Runnable determines if the command is itself runnable. + * UnmarshalJSON implements the [json.Unmarshaler] interface. */ - runnable(): boolean + unmarshalJSON(b: string|Array): void } - interface Command { + interface DateTime { /** - * HasSubCommands determines if the command has children commands. + * Value implements the [driver.Valuer] interface. */ - hasSubCommands(): boolean + value(): any } - interface Command { + interface DateTime { /** - * IsAvailableCommand determines if a command is available as a non-help command - * (this includes all non deprecated/hidden commands). + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current DateTime instance. */ - isAvailableCommand(): boolean + scan(value: any): void } - interface Command { - /** - * IsAdditionalHelpTopicCommand determines if a command is an additional - * help topic command; additional help topic command is determined by the - * fact that it is NOT runnable/hidden/deprecated, and has no sub commands that - * are runnable/hidden/deprecated. - * Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. - */ - isAdditionalHelpTopicCommand(): boolean +} + +namespace store { + /** + * Store defines a concurrent safe in memory key-value data store. + */ + interface Store { } - interface Command { + interface Store { /** - * HasHelpSubCommands determines if a command has any available 'help' sub commands - * that need to be shown in the usage/help default template under 'additional help - * topics'. + * Reset clears the store and replaces the store data with a + * shallow copy of the provided newData. */ - hasHelpSubCommands(): boolean + reset(newData: _TygojaDict): void } - interface Command { + interface Store { /** - * HasAvailableSubCommands determines if a command has available sub commands that - * need to be shown in the usage/help default template under 'available commands'. + * Length returns the current number of elements in the store. */ - hasAvailableSubCommands(): boolean + length(): number } - interface Command { + interface Store { /** - * HasParent determines if the command is a child command. + * RemoveAll removes all the existing store entries. */ - hasParent(): boolean + removeAll(): void } - interface Command { + interface Store { /** - * GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. + * Remove removes a single entry from the store. + * + * Remove does nothing if key doesn't exist in the store. */ - globalNormalizationFunc(): (f: any, name: string) => any + remove(key: string): void } - interface Command { + interface Store { /** - * Flags returns the complete FlagSet that applies - * to this command (local and persistent declared here and by all parents). + * Has checks if element with the specified key exist or not. */ - flags(): (any) + has(key: string): boolean } - interface Command { + interface Store { /** - * LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * Get returns a single element value from the store. + * + * If key is not set, the zero T value is returned. */ - localNonPersistentFlags(): (any) + get(key: string): T } - interface Command { + interface Store { /** - * LocalFlags returns the local FlagSet specifically set in the current command. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * GetAll returns a shallow copy of the current store data. */ - localFlags(): (any) + getAll(): _TygojaDict } - interface Command { + interface Store { /** - * InheritedFlags returns all flags which were inherited from parent commands. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * Set sets (or overwrite if already exist) a new value for key. */ - inheritedFlags(): (any) + set(key: string, value: T): void } - interface Command { + interface Store { /** - * NonInheritedFlags returns all flags which were not inherited from parent commands. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. + * + * This method is similar to Set() but **it will skip adding new elements** + * to the store if the store length has reached the specified limit. + * false is returned if maxAllowedElements limit is reached. */ - nonInheritedFlags(): (any) + setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean } - interface Command { - /** - * PersistentFlags returns the persistent FlagSet specifically set in the current command. +} + +namespace mailer { + /** + * Mailer defines a base mail client interface. + */ + interface Mailer { + [key:string]: any; + /** + * Send sends an email with the provided Message. */ - persistentFlags(): (any) + send(message: Message): void } - interface Command { +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + /** + * Binder is the interface that wraps the Bind method. + */ + interface Binder { + [key:string]: any; + bind(c: Context, i: { + }): void + } + /** + * ServableContext is interface that Echo context implementation must implement to be usable in middleware/handlers and + * be able to be routed by Router. + */ + interface ServableContext { + [key:string]: any; /** - * ResetFlags deletes all flags from command. + * Reset resets the context after request completes. It must be called along + * with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. + * See `Echo#ServeHTTP()` */ - resetFlags(): void + reset(r: http.Request, w: http.ResponseWriter): void } - interface Command { + // @ts-ignore + import stdContext = context + /** + * JSONSerializer is the interface that encodes and decodes JSON to and from interfaces. + */ + interface JSONSerializer { + [key:string]: any; + serialize(c: Context, i: { + }, indent: string): void + deserialize(c: Context, i: { + }): void + } + /** + * HTTPErrorHandler is a centralized HTTP error handler. + */ + interface HTTPErrorHandler {(c: Context, err: Error): void } + /** + * Validator is the interface that wraps the Validate function. + */ + interface Validator { + [key:string]: any; + validate(i: { + }): void + } + /** + * Renderer is the interface that wraps the Render function. + */ + interface Renderer { + [key:string]: any; + render(_arg0: io.Writer, _arg1: string, _arg2: { + }, _arg3: Context): void + } + /** + * Group is a set of sub-routes for a specified route. It can be used for inner + * routes that share a common middleware or functionality that should be separate + * from the parent echo instance while still inheriting from it. + */ + interface Group { + } + interface Group { /** - * HasFlags checks if the command contains any flags (local plus persistent from the entire structure). + * Use implements `Echo#Use()` for sub-routes within the Group. + * Group middlewares are not executed on request when there is no matching route found. */ - hasFlags(): boolean + use(...middleware: MiddlewareFunc[]): void } - interface Command { + interface Group { /** - * HasPersistentFlags checks if the command contains persistent flags. + * CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. Panics on error. */ - hasPersistentFlags(): boolean + connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * HasLocalFlags checks if the command has flags specifically declared locally. + * DELETE implements `Echo#DELETE()` for sub-routes within the Group. Panics on error. */ - hasLocalFlags(): boolean + delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * HasInheritedFlags checks if the command has flags inherited from its parent command. + * GET implements `Echo#GET()` for sub-routes within the Group. Panics on error. */ - hasInheritedFlags(): boolean + get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire - * structure) which are not hidden or deprecated. + * HEAD implements `Echo#HEAD()` for sub-routes within the Group. Panics on error. */ - hasAvailableFlags(): boolean + head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. + * OPTIONS implements `Echo#OPTIONS()` for sub-routes within the Group. Panics on error. */ - hasAvailablePersistentFlags(): boolean + options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden - * or deprecated. + * PATCH implements `Echo#PATCH()` for sub-routes within the Group. Panics on error. */ - hasAvailableLocalFlags(): boolean + patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are - * not hidden or deprecated. + * POST implements `Echo#POST()` for sub-routes within the Group. Panics on error. */ - hasAvailableInheritedFlags(): boolean + post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * Flag climbs up the command tree looking for matching flag. + * PUT implements `Echo#PUT()` for sub-routes within the Group. Panics on error. */ - flag(name: string): (any) + put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * ParseFlags parses persistent flag tree and local flags. + * TRACE implements `Echo#TRACE()` for sub-routes within the Group. Panics on error. */ - parseFlags(args: Array): void + trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * Parent returns a commands parent command. + * Any implements `Echo#Any()` for sub-routes within the Group. Panics on error. */ - parent(): (Command) + any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Command { + interface Group { /** - * RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. + * Match implements `Echo#Match()` for sub-routes within the Group. Panics on error. */ - registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void + match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Command { + interface Group { /** - * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. + * Group creates a new sub-group with prefix and optional sub-group-level middleware. + * Important! Group middlewares are only executed in case there was exact route match and not + * for 404 (not found) or 405 (method not allowed) cases. If this kind of behaviour is needed then add + * a catch-all route `/*` for the group which handler returns always 404 */ - getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] + group(prefix: string, ...middleware: MiddlewareFunc[]): (Group) } - interface Command { + interface Group { /** - * InitDefaultCompletionCmd adds a default 'completion' command to c. - * This function will do nothing if any of the following is true: - * 1- the feature has been explicitly disabled by the program, - * 2- c has no subcommands (to avoid creating one), - * 3- c already has a 'completion' command provided by the program. + * Static implements `Echo#Static()` for sub-routes within the Group. */ - initDefaultCompletionCmd(): void + static(pathPrefix: string, fsRoot: string): RouteInfo } - interface Command { + interface Group { /** - * GenFishCompletion generates fish completion file and writes to the passed writer. + * StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. + * + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - genFishCompletion(w: io.Writer, includeDesc: boolean): void + staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo } - interface Command { + interface Group { /** - * GenFishCompletionFile generates fish completion file. + * FileFS implements `Echo#FileFS()` for sub-routes within the Group. */ - genFishCompletionFile(filename: string, includeDesc: boolean): void + fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors - * if the command is invoked with a subset (but not all) of the given flags. + * File implements `Echo#File()` for sub-routes within the Group. Panics on error. */ - markFlagsRequiredTogether(...flagNames: string[]): void + file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors - * if the command is invoked without at least one flag from the given set of flags. + * RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group. + * + * Example: `g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` */ - markFlagsOneRequired(...flagNames: string[]): void + routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors - * if the command is invoked with more than one flag from the given set of flags. + * Add implements `Echo#Add()` for sub-routes within the Group. Panics on error. */ - markFlagsMutuallyExclusive(...flagNames: string[]): void + add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Command { + interface Group { /** - * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the - * first error encountered. + * AddRoute registers a new Routable with Router */ - validateFlagGroups(): void + addRoute(route: Routable): RouteInfo } - interface Command { + /** + * IPExtractor is a function to extract IP addr from http.Request. + * Set appropriate one to Echo#IPExtractor. + * See https://echo.labstack.com/guide/ip-address for more details. + */ + interface IPExtractor {(_arg0: http.Request): string } + /** + * Logger defines the logging interface that Echo uses internally in few places. + * For logging in handlers use your own logger instance (dependency injected or package/public variable) from logging framework of your choice. + */ + interface Logger { + [key:string]: any; /** - * GenPowerShellCompletionFile generates powershell completion file without descriptions. + * Write provides writer interface for http.Server `ErrorLog` and for logging startup messages. + * `http.Server.ErrorLog` logs errors from accepting connections, unexpected behavior from handlers, + * and underlying FileSystem errors. + * `logger` middleware will use this method to write its JSON payload. */ - genPowerShellCompletionFile(filename: string): void - } - interface Command { + write(p: string|Array): number /** - * GenPowerShellCompletion generates powershell completion file without descriptions - * and writes it to the passed writer. + * Error logs the error */ - genPowerShellCompletion(w: io.Writer): void + error(err: Error): void } - interface Command { + /** + * Response wraps an http.ResponseWriter and implements its interface to be used + * by an HTTP handler to construct an HTTP response. + * See: https://golang.org/pkg/net/http/#ResponseWriter + */ + interface Response { + writer: http.ResponseWriter + status: number + size: number + committed: boolean + } + interface Response { /** - * GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. + * Header returns the header map for the writer that will be sent by + * WriteHeader. Changing the header after a call to WriteHeader (or Write) has + * no effect unless the modified headers were declared as trailers by setting + * the "Trailer" header before the call to WriteHeader (see example) + * To suppress implicit response headers, set their value to nil. + * Example: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers */ - genPowerShellCompletionFileWithDesc(filename: string): void + header(): http.Header } - interface Command { + interface Response { /** - * GenPowerShellCompletionWithDesc generates powershell completion file with descriptions - * and writes it to the passed writer. + * Before registers a function which is called just before the response is written. */ - genPowerShellCompletionWithDesc(w: io.Writer): void + before(fn: () => void): void } - interface Command { + interface Response { /** - * MarkFlagRequired instructs the various shell completion implementations to - * prioritize the named flag when performing completion, - * and causes your command to report an error if invoked without the flag. + * After registers a function which is called just after the response is written. + * If the `Content-Length` is unknown, none of the after function is executed. */ - markFlagRequired(name: string): void + after(fn: () => void): void } - interface Command { + interface Response { /** - * MarkPersistentFlagRequired instructs the various shell completion implementations to - * prioritize the named persistent flag when performing completion, - * and causes your command to report an error if invoked without the flag. + * WriteHeader sends an HTTP response header with status code. If WriteHeader is + * not called explicitly, the first call to Write will trigger an implicit + * WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly + * used to send error codes. */ - markPersistentFlagRequired(name: string): void + writeHeader(code: number): void } - interface Command { + interface Response { /** - * MarkFlagFilename instructs the various shell completion implementations to - * limit completions for the named flag to the specified file extensions. + * Write writes the data to the connection as part of an HTTP reply. */ - markFlagFilename(name: string, ...extensions: string[]): void + write(b: string|Array): number } - interface Command { + interface Response { /** - * MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. - * The bash completion script will call the bash function f for the flag. - * - * This will only work for bash completion. - * It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows - * to register a Go function which will work across all shells. + * Flush implements the http.Flusher interface to allow an HTTP handler to flush + * buffered data to the client. + * See [http.Flusher](https://golang.org/pkg/net/http/#Flusher) */ - markFlagCustom(name: string, f: string): void + flush(): void } - interface Command { + interface Response { /** - * MarkPersistentFlagFilename instructs the various shell completion - * implementations to limit completions for the named persistent flag to the - * specified file extensions. + * Hijack implements the http.Hijacker interface to allow an HTTP handler to + * take over the connection. + * See [http.Hijacker](https://golang.org/pkg/net/http/#Hijacker) */ - markPersistentFlagFilename(name: string, ...extensions: string[]): void + hijack(): [net.Conn, (bufio.ReadWriter)] } - interface Command { + interface Response { /** - * MarkFlagDirname instructs the various shell completion implementations to - * limit completions for the named flag to directory names. + * Unwrap returns the original http.ResponseWriter. + * ResponseController can be used to access the original http.ResponseWriter. + * See [https://go.dev/blog/go1.20] */ - markFlagDirname(name: string): void + unwrap(): http.ResponseWriter } - interface Command { + interface Routes { /** - * MarkPersistentFlagDirname instructs the various shell completion - * implementations to limit completions for the named persistent flag to - * directory names. + * Reverse reverses route to URL string by replacing path parameters with given params values. */ - markPersistentFlagDirname(name: string): void + reverse(name: string, ...params: { + }[]): string } - interface Command { + interface Routes { /** - * GenZshCompletionFile generates zsh completion file including descriptions. + * FindByMethodPath searched for matching route info by method and path */ - genZshCompletionFile(filename: string): void + findByMethodPath(method: string, path: string): RouteInfo } - interface Command { + interface Routes { /** - * GenZshCompletion generates zsh completion file including descriptions - * and writes it to the passed writer. + * FilterByMethod searched for matching route info by method */ - genZshCompletion(w: io.Writer): void + filterByMethod(method: string): Routes } - interface Command { + interface Routes { /** - * GenZshCompletionFileNoDesc generates zsh completion file without descriptions. + * FilterByPath searched for matching route info by path */ - genZshCompletionFileNoDesc(filename: string): void + filterByPath(path: string): Routes } - interface Command { + interface Routes { /** - * GenZshCompletionNoDesc generates zsh completion file without descriptions - * and writes it to the passed writer. + * FilterByName searched for matching route info by name */ - genZshCompletionNoDesc(w: io.Writer): void + filterByName(name: string): Routes } - interface Command { + /** + * Router is interface for routing request contexts to registered routes. + * + * Contract between Echo/Context instance and the router: + * ``` + * - all routes must be added through methods on echo.Echo instance. + * Reason: Echo instance uses RouteInfo.Params() length to allocate slice for paths parameters (see `Echo.contextPathParamAllocSize`). + * - Router must populate Context during Router.Route call with: + * - RoutableContext.SetPath + * - RoutableContext.SetRawPathParams (IMPORTANT! with same slice pointer that c.RawPathParams() returns) + * - RoutableContext.SetRouteInfo + * And optionally can set additional information to Context with RoutableContext.Set + * ``` + */ + interface Router { + [key:string]: any; /** - * MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was - * not consistent with Bash completion. It has therefore been disabled. - * Instead, when no other completion is specified, file completion is done by - * default for every argument. One can disable file completion on a per-argument - * basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. - * To achieve file extension filtering, one can use ValidArgsFunction and - * ShellCompDirectiveFilterFileExt. - * - * Deprecated + * Add registers Routable with the Router and returns registered RouteInfo */ - markZshCompPositionalArgumentFile(argPosition: number, ...patterns: string[]): void - } - interface Command { + add(routable: Routable): RouteInfo /** - * MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore - * been disabled. - * To achieve the same behavior across all shells, one can use - * ValidArgs (for the first argument only) or ValidArgsFunction for - * any argument (can include the first one also). - * - * Deprecated + * Remove removes route from the Router */ - markZshCompPositionalArgumentWords(argPosition: number, ...words: string[]): void + remove(method: string, path: string): void + /** + * Routes returns information about all registered routes + */ + routes(): Routes + /** + * Route searches Router for matching route and applies it to the given context. In case when no matching method + * was not found (405) or no matching route exists for path (404), router will return its implementation of 405/404 + * handler function. + */ + route(c: RoutableContext): HandlerFunc } -} - -namespace migrate { /** - * MigrationsList defines a list with migration definitions + * Routable is interface for registering Route with Router. During route registration process the Router will + * convert Routable to RouteInfo with ToRouteInfo method. By creating custom implementation of Routable additional + * information about registered route can be stored in Routes (i.e. privileges used with route etc.) */ - interface MigrationsList { - } - interface MigrationsList { + interface Routable { + [key:string]: any; /** - * Item returns a single migration from the list by its index. + * ToRouteInfo converts Routable to RouteInfo + * + * This method is meant to be used by Router after it parses url for path parameters, to store information about + * route just added. */ - item(index: number): (Migration) - } - interface MigrationsList { + toRouteInfo(params: Array): RouteInfo /** - * Items returns the internal migrations list slice. + * ToRoute converts Routable to Route which Router uses to register the method handler for path. + * + * This method is meant to be used by Router to get fields (including handler and middleware functions) needed to + * add Route to Router. */ - items(): Array<(Migration | undefined)> - } - interface MigrationsList { + toRoute(): Route /** - * Register adds new migration definition to the list. - * - * If `optFilename` is not provided, it will try to get the name from its .go file. + * ForGroup recreates routable with added group prefix and group middlewares it is grouped to. * - * The list will be sorted automatically based on the migrations file name. + * Is necessary for Echo.Group to be able to add/register Routable with Router and having group prefix and group + * middlewares included in actually registered Route. */ - register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void + forGroup(pathPrefix: string, middlewares: Array): Routable } -} - -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { /** - * ReadCloser is the interface that groups the basic Read and Close methods. + * Routes is collection of RouteInfo instances with various helper methods. */ - interface ReadCloser { - [key:string]: any; - } + interface Routes extends Array{} /** - * WriteCloser is the interface that groups the basic Write and Close methods. + * RouteInfo describes registered route base fields. + * Method+Path pair uniquely identifies the Route. Name can have duplicates. */ - interface WriteCloser { + interface RouteInfo { [key:string]: any; + method(): string + path(): string + name(): string + params(): Array + /** + * Reverse reverses route to URL string by replacing path parameters with given params values. + */ + reverse(...params: { + }[]): string } -} - -/** - * Package syscall contains an interface to the low-level operating system - * primitives. The details vary depending on the underlying system, and - * by default, godoc will display the syscall documentation for the current - * system. If you want godoc to display syscall documentation for another - * system, set $GOOS and $GOARCH to the desired system. For example, if - * you want to view documentation for freebsd/arm on linux/amd64, set $GOOS - * to freebsd and $GOARCH to arm. - * The primary use of syscall is inside other packages that provide a more - * portable interface to the system, such as "os", "time" and "net". Use - * those packages rather than this one if you can. - * For details of the functions and data types in this package consult - * the manuals for the appropriate operating system. - * These calls return err == nil to indicate success; otherwise - * err is an operating system error describing the failure. - * On most systems, that error has type [Errno]. - * - * NOTE: Most of the functions, types, and constants defined in - * this package are also available in the [golang.org/x/sys] package. - * That package has more system call support than this one, - * and most new code should prefer that package where possible. - * See https://golang.org/s/go1.4-syscall for more information. - */ -namespace syscall { - /** - * SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in Linux. - * See user_namespaces(7). - * - * Note that User Namespaces are not available on a number of popular Linux - * versions (due to security issues), or are available but subject to AppArmor - * restrictions like in Ubuntu 24.04. - */ - interface SysProcIDMap { - containerID: number // Container ID. - hostID: number // Host ID. - size: number // Size. - } - // @ts-ignore - import errorspkg = errors - /** - * Credential holds user and group identities to be assumed - * by a child process started by [StartProcess]. - */ - interface Credential { - uid: number // User ID. - gid: number // Group ID. - groups: Array // Supplementary group IDs. - noSetGroups: boolean // If true, don't set supplementary groups - } - // @ts-ignore - import runtimesyscall = syscall /** - * A Signal is a number describing a process signal. - * It implements the [os.Signal] interface. + * PathParams is collections of PathParam instances with various helper methods */ - interface Signal extends Number{} - interface Signal { - signal(): void - } - interface Signal { - string(): string + interface PathParams extends Array{} + interface PathParams { + /** + * Get returns path parameter value for given name or default value. + */ + get(name: string, defaultValue: string): string } } /** - * Package time provides functionality for measuring and displaying time. - * - * The calendrical calculations always assume a Gregorian calendar, with - * no leap seconds. - * - * # Monotonic Clocks - * - * Operating systems provide both a “wall clock,” which is subject to - * changes for clock synchronization, and a “monotonic clock,” which is - * not. The general rule is that the wall clock is for telling time and - * the monotonic clock is for measuring time. Rather than split the API, - * in this package the Time returned by [time.Now] contains both a wall - * clock reading and a monotonic clock reading; later time-telling - * operations use the wall clock reading, but later time-measuring - * operations, specifically comparisons and subtractions, use the - * monotonic clock reading. - * - * For example, this code always computes a positive elapsed time of - * approximately 20 milliseconds, even if the wall clock is changed during - * the operation being timed: - * - * ``` - * start := time.Now() - * ... operation that takes 20 milliseconds ... - * t := time.Now() - * elapsed := t.Sub(start) - * ``` - * - * Other idioms, such as [time.Since](start), [time.Until](deadline), and - * time.Now().Before(deadline), are similarly robust against wall clock - * resets. - * - * The rest of this section gives the precise details of how operations - * use monotonic clocks, but understanding those details is not required - * to use this package. - * - * The Time returned by time.Now contains a monotonic clock reading. - * If Time t has a monotonic clock reading, t.Add adds the same duration to - * both the wall clock and monotonic clock readings to compute the result. - * Because t.AddDate(y, m, d), t.Round(d), and t.Truncate(d) are wall time - * computations, they always strip any monotonic clock reading from their results. - * Because t.In, t.Local, and t.UTC are used for their effect on the interpretation - * of the wall time, they also strip any monotonic clock reading from their results. - * The canonical way to strip a monotonic clock reading is to use t = t.Round(0). - * - * If Times t and u both contain monotonic clock readings, the operations - * t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out - * using the monotonic clock readings alone, ignoring the wall clock - * readings. If either t or u contains no monotonic clock reading, these - * operations fall back to using the wall clock readings. - * - * On some systems the monotonic clock will stop if the computer goes to sleep. - * On such a system, t.Sub(u) may not accurately reflect the actual - * time that passed between t and u. The same applies to other functions and - * methods that subtract times, such as [Since], [Until], [Before], [After], - * [Add], [Sub], [Equal] and [Compare]. In some cases, you may need to strip - * the monotonic clock to get accurate results. - * - * Because the monotonic clock reading has no meaning outside - * the current process, the serialized forms generated by t.GobEncode, - * t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic - * clock reading, and t.Format provides no format for it. Similarly, the - * constructors [time.Date], [time.Parse], [time.ParseInLocation], and [time.Unix], - * as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. - * t.UnmarshalJSON, and t.UnmarshalText always create times with - * no monotonic clock reading. - * - * The monotonic clock reading exists only in [Time] values. It is not - * a part of [Duration] values or the Unix times returned by t.Unix and - * friends. - * - * Note that the Go == operator compares not just the time instant but - * also the [Location] and the monotonic clock reading. See the - * documentation for the Time type for a discussion of equality - * testing for Time values. + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. * - * For debugging, the result of t.String does include the monotonic - * clock reading if present. If t != u because of different monotonic clock readings, - * that difference will be visible when printing t.String() and u.String(). + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. * - * # Timer Resolution + * Drivers that do not support context cancellation will not return until + * after the query is completed. * - * [Timer] resolution varies depending on the Go runtime, the operating system - * and the underlying hardware. - * On Unix, the resolution is ~1ms. - * On Windows version 1803 and newer, the resolution is ~0.5ms. - * On older Windows versions, the default resolution is ~16ms, but - * a higher resolution may be requested using [golang.org/x/sys/windows.TimeBeginPeriod]. + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. */ -namespace time { +namespace sql { /** - * A Month specifies a month of the year (January = 1, ...). + * IsolationLevel is the transaction isolation level used in [TxOptions]. */ - interface Month extends Number{} - interface Month { + interface IsolationLevel extends Number{} + interface IsolationLevel { /** - * String returns the English name of the month ("January", "February", ...). + * String returns the name of the transaction isolation level. */ string(): string } /** - * A Weekday specifies a day of the week (Sunday = 0, ...). + * DBStats contains database statistics. */ - interface Weekday extends Number{} - interface Weekday { + interface DBStats { + maxOpenConnections: number // Maximum number of open connections to the database. /** - * String returns the English name of the day ("Sunday", "Monday", ...). + * Pool Status */ - string(): string + openConnections: number // The number of established connections both in use and idle. + inUse: number // The number of connections currently in use. + idle: number // The number of idle connections. + /** + * Counters + */ + waitCount: number // The total number of connections waited for. + waitDuration: time.Duration // The total time blocked waiting for a new connection. + maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. + maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. + maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. } /** - * A Location maps time instants to the zone in use at that time. - * Typically, the Location represents the collection of time offsets - * in use in a geographical area. For many Locations the time offset varies - * depending on whether daylight savings time is in use at the time instant. + * Conn represents a single database connection rather than a pool of database + * connections. Prefer running queries from [DB] unless there is a specific + * need for a continuous single database connection. * - * Location is used to provide a time zone in a printed Time value and for - * calculations involving intervals that may cross daylight savings time - * boundaries. + * A Conn must call [Conn.Close] to return the connection to the database pool + * and may do so concurrently with a running query. + * + * After a call to [Conn.Close], all operations on the + * connection fail with [ErrConnDone]. */ - interface Location { + interface Conn { } - interface Location { + interface Conn { /** - * String returns a descriptive name for the time zone information, - * corresponding to the name argument to [LoadLocation] or [FixedZone]. + * PingContext verifies the connection to the database is still alive. */ - string(): string + pingContext(ctx: context.Context): void } -} - -/** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. - * - * See the [testing/fstest] package for support with testing - * implementations of file systems. - */ -namespace fs { -} - -/** - * Package context defines the Context type, which carries deadlines, - * cancellation signals, and other request-scoped values across API boundaries - * and between processes. - * - * Incoming requests to a server should create a [Context], and outgoing - * calls to servers should accept a Context. The chain of function - * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using [WithCancel], [WithDeadline], - * [WithTimeout], or [WithValue]. When a Context is canceled, all - * Contexts derived from it are also canceled. - * - * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a - * Context (the parent) and return a derived Context (the child) and a - * [CancelFunc]. Calling the CancelFunc cancels the child and its - * children, removes the parent's reference to the child, and stops - * any associated timers. Failing to call the CancelFunc leaks the - * child and its children until the parent is canceled or the timer - * fires. The go vet tool checks that CancelFuncs are used on all - * control-flow paths. - * - * The [WithCancelCause] function returns a [CancelCauseFunc], which - * takes an error and records it as the cancellation cause. Calling - * [Cause] on the canceled context or any of its children retrieves - * the cause. If no cause is specified, Cause(ctx) returns the same - * value as ctx.Err(). - * - * Programs that use Contexts should follow these rules to keep interfaces - * consistent across packages and enable static analysis tools to check context - * propagation: - * - * Do not store Contexts inside a struct type; instead, pass a Context - * explicitly to each function that needs it. The Context should be the first - * parameter, typically named ctx: - * - * ``` - * func DoSomething(ctx context.Context, arg Arg) error { - * // ... use ctx ... - * } - * ``` - * - * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] - * if you are unsure about which Context to use. - * - * Use context Values only for request-scoped data that transits processes and - * APIs, not for passing optional parameters to functions. - * - * The same Context may be passed to functions running in different goroutines; - * Contexts are safe for simultaneous use by multiple goroutines. - * - * See https://blog.golang.org/context for example code for a server that uses - * Contexts. - */ -namespace context { -} - -/** - * Package url parses URLs and implements query escaping. - */ -namespace url { - /** - * The Userinfo type is an immutable encapsulation of username and - * password details for a [URL]. An existing Userinfo value is guaranteed - * to have a username set (potentially empty, as allowed by RFC 2396), - * and optionally a password. - */ - interface Userinfo { + interface Conn { + /** + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + */ + execContext(ctx: context.Context, query: string, ...args: any[]): Result } - interface Userinfo { + interface Conn { /** - * Username returns the username. + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. */ - username(): string + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) } - interface Userinfo { + interface Conn { /** - * Password returns the password in case it is set, and whether it is set. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * the [*Row.Scan] method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - password(): [string, boolean] + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) } - interface Userinfo { + interface Conn { /** - * String returns the encoded userinfo information in the standard form - * of "username[:password]". + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. */ - string(): string + prepareContext(ctx: context.Context, query: string): (Stmt) } -} - -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS - * request consumes only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement. - * - * On all systems (except Plan 9), when the cgo resolver is being used - * this package applies a concurrent cgo lookup limit to prevent the system - * from running out of system threads. Currently, it is limited to 500 concurrent lookups. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * The Go resolver will send an EDNS0 additional header with a DNS request, - * to signal a willingness to accept a larger DNS packet size. - * This can reportedly cause sporadic failures with the DNS server run - * by some modems and routers. Setting GODEBUG=netedns0=0 will disable - * sending the additional header. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. - * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. - */ -namespace net { - /** - * Conn is a generic stream-oriented network connection. - * - * Multiple goroutines may invoke methods on a Conn simultaneously. - */ interface Conn { - [key:string]: any; /** - * Read reads data from the connection. - * Read can be made to time out and return an error after a fixed - * time limit; see SetDeadline and SetReadDeadline. + * Raw executes f exposing the underlying driver connection for the + * duration of f. The driverConn must not be used outside of f. + * + * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable + * until [Conn.Close] is called. */ - read(b: string|Array): number + raw(f: (driverConn: any) => void): void + } + interface Conn { /** - * Write writes data to the connection. - * Write can be made to time out and return an error after a fixed - * time limit; see SetDeadline and SetWriteDeadline. + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. + * + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. */ - write(b: string|Array): number + beginTx(ctx: context.Context, opts: TxOptions): (Tx) + } + interface Conn { /** - * Close closes the connection. - * Any blocked Read or Write operations will be unblocked and return errors. + * Close returns the connection to the connection pool. + * All operations after a Close will return with [ErrConnDone]. + * Close is safe to call concurrently with other operations and will + * block until all other operations finish. It may be useful to first + * cancel any used context and then call close directly after. */ close(): void + } + /** + * ColumnType contains the name and type of a column. + */ + interface ColumnType { + } + interface ColumnType { /** - * LocalAddr returns the local network address, if known. + * Name returns the name or alias of the column. */ - localAddr(): Addr + name(): string + } + interface ColumnType { /** - * RemoteAddr returns the remote network address, if known. + * Length returns the column type length for variable length column types such + * as text and binary field types. If the type length is unbounded the value will + * be [math.MaxInt64] (any database limits will still apply). + * If the column type is not variable length, such as an int, or if not supported + * by the driver ok is false. */ - remoteAddr(): Addr + length(): [number, boolean] + } + interface ColumnType { /** - * SetDeadline sets the read and write deadlines associated - * with the connection. It is equivalent to calling both - * SetReadDeadline and SetWriteDeadline. - * - * A deadline is an absolute time after which I/O operations - * fail instead of blocking. The deadline applies to all future - * and pending I/O, not just the immediately following call to - * Read or Write. After a deadline has been exceeded, the - * connection can be refreshed by setting a deadline in the future. - * - * If the deadline is exceeded a call to Read or Write or to other - * I/O methods will return an error that wraps os.ErrDeadlineExceeded. - * This can be tested using errors.Is(err, os.ErrDeadlineExceeded). - * The error's Timeout method will return true, but note that there - * are other possible errors for which the Timeout method will - * return true even if the deadline has not been exceeded. - * - * An idle timeout can be implemented by repeatedly extending - * the deadline after successful Read or Write calls. - * - * A zero value for t means I/O operations will not time out. + * DecimalSize returns the scale and precision of a decimal type. + * If not applicable or if not supported ok is false. */ - setDeadline(t: time.Time): void + decimalSize(): [number, number, boolean] + } + interface ColumnType { /** - * SetReadDeadline sets the deadline for future Read calls - * and any currently-blocked Read call. - * A zero value for t means Read will not time out. + * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. + * If a driver does not support this property ScanType will return + * the type of an empty interface. */ - setReadDeadline(t: time.Time): void + scanType(): any + } + interface ColumnType { /** - * SetWriteDeadline sets the deadline for future Write calls - * and any currently-blocked Write call. - * Even if write times out, it may return n > 0, indicating that - * some of the data was successfully written. - * A zero value for t means Write will not time out. + * Nullable reports whether the column may be null. + * If a driver does not support this property ok will be false. */ - setWriteDeadline(t: time.Time): void + nullable(): [boolean, boolean] } - /** - * A Listener is a generic network listener for stream-oriented protocols. - * - * Multiple goroutines may invoke methods on a Listener simultaneously. - */ - interface Listener { - [key:string]: any; + interface ColumnType { /** - * Accept waits for and returns the next connection to the listener. + * DatabaseTypeName returns the database system name of the column type. If an empty + * string is returned, then the driver type name is not supported. + * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers + * are not included. + * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". */ - accept(): Conn + databaseTypeName(): string + } + /** + * Row is the result of calling [DB.QueryRow] to select a single row. + */ + interface Row { + } + interface Row { /** - * Close closes the listener. - * Any blocked Accept operations will be unblocked and return errors. + * Scan copies the columns from the matched row into the values + * pointed at by dest. See the documentation on [Rows.Scan] for details. + * If more than one row matches the query, + * Scan uses the first row and discards the rest. If no row matches + * the query, Scan returns [ErrNoRows]. */ - close(): void + scan(...dest: any[]): void + } + interface Row { /** - * Addr returns the listener's network address. + * Err provides a way for wrapping packages to check for + * query errors without calling [Row.Scan]. + * Err returns the error, if any, that was encountered while running the query. + * If this error is not nil, this error will also be returned from [Row.Scan]. */ - addr(): Addr + err(): void } } -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * DateTime represents a [time.Time] instance in UTC that is wrapped - * and serialized using the app default date layout. - */ - interface DateTime { +namespace settings { + // @ts-ignore + import validation = ozzo_validation + interface TokenConfig { + secret: string + duration: number } - interface DateTime { + interface TokenConfig { /** - * Time returns the internal [time.Time] instance. + * Validate makes TokenConfig validatable by implementing [validation.Validatable] interface. */ - time(): time.Time + validate(): void } - interface DateTime { + interface SmtpConfig { + enabled: boolean + host: string + port: number + username: string + password: string /** - * IsZero checks whether the current DateTime instance has zero time value. + * SMTP AUTH - PLAIN (default) or LOGIN */ - isZero(): boolean - } - interface DateTime { + authMethod: string /** - * String serializes the current DateTime instance into a formatted - * UTC date string. + * Whether to enforce TLS encryption for the mail server connection. * - * The zero value is serialized to an empty string. + * When set to false StartTLS command is send, leaving the server + * to decide whether to upgrade the connection or not. */ - string(): string - } - interface DateTime { + tls: boolean /** - * MarshalJSON implements the [json.Marshaler] interface. + * LocalName is optional domain name or IP address used for the + * EHLO/HELO exchange (if not explicitly set, defaults to "localhost"). + * + * This is required only by some SMTP servers, such as Gmail SMTP-relay. */ - marshalJSON(): string|Array + localName: string } - interface DateTime { + interface SmtpConfig { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * Validate makes SmtpConfig validatable by implementing [validation.Validatable] interface. */ - unmarshalJSON(b: string|Array): void + validate(): void } - interface DateTime { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any + interface S3Config { + enabled: boolean + bucket: string + region: string + endpoint: string + accessKey: string + secret: string + forcePathStyle: boolean } - interface DateTime { + interface S3Config { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current DateTime instance. + * Validate makes S3Config validatable by implementing [validation.Validatable] interface. */ - scan(value: any): void + validate(): void } -} - -/** - * Package textproto implements generic support for text-based request/response - * protocols in the style of HTTP, NNTP, and SMTP. - * - * The package provides: - * - * [Error], which represents a numeric error response from - * a server. - * - * [Pipeline], to manage pipelined requests and responses - * in a client. - * - * [Reader], to read numeric response code lines, - * key: value headers, lines wrapped with leading spaces - * on continuation lines, and whole text blocks ending - * with a dot on a line by itself. - * - * [Writer], to write dot-encoded text blocks. - * - * [Conn], a convenient packaging of [Reader], [Writer], and [Pipeline] for use - * with a single network connection. - */ -namespace textproto { - /** - * A MIMEHeader represents a MIME-style header mapping - * keys to sets of values. - */ - interface MIMEHeader extends _TygojaDict{} - interface MIMEHeader { + interface BackupsConfig { /** - * Add adds the key, value pair to the header. - * It appends to any existing values associated with key. + * Cron is a cron expression to schedule auto backups, eg. "* * * * *". + * + * Leave it empty to disable the auto backups functionality. */ - add(key: string, value: string): void - } - interface MIMEHeader { + cron: string /** - * Set sets the header entries associated with key to - * the single element value. It replaces any existing - * values associated with key. + * CronMaxKeep is the max number of cron generated backups to + * keep before removing older entries. + * + * This field works only when the cron config has valid cron expression. */ - set(key: string, value: string): void - } - interface MIMEHeader { + cronMaxKeep: number /** - * Get gets the first value associated with the given key. - * It is case insensitive; [CanonicalMIMEHeaderKey] is used - * to canonicalize the provided key. - * If there are no values associated with the key, Get returns "". - * To use non-canonical keys, access the map directly. + * S3 is an optional S3 storage config specifying where to store the app backups. */ - get(key: string): string + s3: S3Config } - interface MIMEHeader { + interface BackupsConfig { /** - * Values returns all values associated with the given key. - * It is case insensitive; [CanonicalMIMEHeaderKey] is - * used to canonicalize the provided key. To use non-canonical - * keys, access the map directly. - * The returned slice is not a copy. + * Validate makes BackupsConfig validatable by implementing [validation.Validatable] interface. */ - values(key: string): Array + validate(): void } - interface MIMEHeader { + interface MetaConfig { + appName: string + appUrl: string + hideControls: boolean + senderName: string + senderAddress: string + verificationTemplate: EmailTemplate + resetPasswordTemplate: EmailTemplate + confirmEmailChangeTemplate: EmailTemplate + } + interface MetaConfig { /** - * Del deletes the values associated with key. + * Validate makes MetaConfig validatable by implementing [validation.Validatable] interface. */ - del(key: string): void + validate(): void } -} - -/** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits - * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. - * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. - * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. - */ -namespace multipart { - interface Reader { + interface LogsConfig { + maxDays: number + minLevel: number + logIp: boolean + } + interface LogsConfig { /** - * ReadForm parses an entire multipart message whose parts have - * a Content-Disposition of "form-data". - * It stores up to maxMemory bytes + 10MB (reserved for non-file parts) - * in memory. File parts which can't be stored in memory will be stored on - * disk in temporary files. - * It returns [ErrMessageTooLarge] if all non-file parts can't be stored in - * memory. + * Validate makes LogsConfig validatable by implementing [validation.Validatable] interface. */ - readForm(maxMemory: number): (Form) + validate(): void } - /** - * Form is a parsed multipart form. - * Its File parts are stored either in memory or on disk, - * and are accessible via the [*FileHeader]'s Open method. - * Its Value parts are stored as strings. - * Both are keyed by field name. - */ - interface Form { - value: _TygojaDict - file: _TygojaDict + interface AuthProviderConfig { + enabled: boolean + clientId: string + clientSecret: string + authUrl: string + tokenUrl: string + userApiUrl: string + displayName: string + pkce?: boolean } - interface Form { + interface AuthProviderConfig { /** - * RemoveAll removes any temporary files associated with a [Form]. + * Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface. */ - removeAll(): void + validate(): void + } + interface AuthProviderConfig { + /** + * SetupProvider loads the current AuthProviderConfig into the specified provider. + */ + setupProvider(provider: auth.Provider): void } /** - * File is an interface to access the file part of a multipart message. - * Its contents may be either stored in memory or on disk. - * If stored on disk, the File's underlying concrete type will be an *os.File. + * Deprecated: Will be removed in v0.9+ */ - interface File { - [key:string]: any; + interface EmailAuthConfig { + enabled: boolean + exceptDomains: Array + onlyDomains: Array + minPasswordLength: number } + interface EmailAuthConfig { + /** + * Deprecated: Will be removed in v0.9+ + */ + validate(): void + } +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation /** - * Reader is an iterator over parts in a MIME multipart body. - * Reader's underlying parser consumes its input as needed. Seeking - * isn't supported. + * SchemaField defines a single schema field structure. */ - interface Reader { + interface SchemaField { + system: boolean + id: string + name: string + type: string + required: boolean + /** + * Presentable indicates whether the field is suitable for + * visualization purposes (eg. in the Admin UI relation views). + */ + presentable: boolean + /** + * Deprecated: This field is no-op and will be removed in future versions. + * Please use the collection.Indexes field to define a unique constraint. + */ + unique: boolean + options: any } - interface Reader { + interface SchemaField { /** - * NextPart returns the next part in the multipart or an error. - * When there are no more parts, the error [io.EOF] is returned. + * ColDefinition returns the field db column type definition as string. + */ + colDefinition(): string + } + interface SchemaField { + /** + * String serializes and returns the current field as string. + */ + string(): string + } + interface SchemaField { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface SchemaField { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. * - * As a special case, if the "Content-Transfer-Encoding" header - * has a value of "quoted-printable", that header is instead - * hidden and the body is transparently decoded during Read calls. + * The schema field options are auto initialized on success. */ - nextPart(): (Part) + unmarshalJSON(data: string|Array): void } - interface Reader { + interface SchemaField { /** - * NextRawPart returns the next part in the multipart or an error. - * When there are no more parts, the error [io.EOF] is returned. + * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface SchemaField { + /** + * InitOptions initializes the current field options based on its type. * - * Unlike [Reader.NextPart], it does not have special handling for - * "Content-Transfer-Encoding: quoted-printable". + * Returns error on unknown field type. */ - nextRawPart(): (Part) + initOptions(): void + } + interface SchemaField { + /** + * PrepareValue returns normalized and properly formatted field value. + */ + prepareValue(value: any): any + } + interface SchemaField { + /** + * PrepareValueWithModifier returns normalized and properly formatted field value + * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). + */ + prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any } } /** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. + * Package models implements all PocketBase DB models and DTOs. */ -namespace http { +namespace models { /** - * A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an - * HTTP response or the Cookie header of an HTTP request. - * - * See https://tools.ietf.org/html/rfc6265 for details. + * Model defines an interface with common methods that all db models should have. */ - interface Cookie { - name: string - value: string - quoted: boolean // indicates whether the Value was originally quoted - path: string // optional - domain: string // optional - expires: time.Time // optional - rawExpires: string // for reading cookies only + interface Model { + [key:string]: any; + tableName(): string + isNew(): boolean + markAsNew(): void + markAsNotNew(): void + hasId(): boolean + getId(): string + setId(id: string): void + getCreated(): types.DateTime + getUpdated(): types.DateTime + refreshId(): void + refreshCreated(): void + refreshUpdated(): void + } + /** + * BaseModel defines common fields and methods used by all other models. + */ + interface BaseModel { + id: string + created: types.DateTime + updated: types.DateTime + } + interface BaseModel { /** - * MaxAge=0 means no 'Max-Age' attribute specified. - * MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0' - * MaxAge>0 means Max-Age attribute present and given in seconds + * HasId returns whether the model has a nonzero id. */ - maxAge: number - secure: boolean - httpOnly: boolean - sameSite: SameSite - partitioned: boolean - raw: string - unparsed: Array // Raw text of unparsed attribute-value pairs + hasId(): boolean } - interface Cookie { + interface BaseModel { /** - * String returns the serialization of the cookie for use in a [Cookie] - * header (if only Name and Value are set) or a Set-Cookie response - * header (if other fields are set). - * If c is nil or c.Name is invalid, the empty string is returned. + * GetId returns the model id. */ - string(): string + getId(): string } - interface Cookie { + interface BaseModel { /** - * Valid reports whether the cookie is valid. + * SetId sets the model id to the provided string value. */ - valid(): void + setId(id: string): void } - // @ts-ignore - import mathrand = rand - /** - * A Header represents the key-value pairs in an HTTP header. - * - * The keys should be in canonical form, as returned by - * [CanonicalHeaderKey]. - */ - interface Header extends _TygojaDict{} - interface Header { + interface BaseModel { /** - * Add adds the key, value pair to the header. - * It appends to any existing values associated with key. - * The key is case insensitive; it is canonicalized by - * [CanonicalHeaderKey]. + * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). */ - add(key: string, value: string): void + markAsNew(): void } - interface Header { + interface BaseModel { /** - * Set sets the header entries associated with key to the - * single element value. It replaces any existing values - * associated with key. The key is case insensitive; it is - * canonicalized by [textproto.CanonicalMIMEHeaderKey]. - * To use non-canonical keys, assign to the map directly. + * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) */ - set(key: string, value: string): void + markAsNotNew(): void } - interface Header { + interface BaseModel { /** - * Get gets the first value associated with the given key. If - * there are no values associated with the key, Get returns "". - * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is - * used to canonicalize the provided key. Get assumes that all - * keys are stored in canonical form. To use non-canonical keys, - * access the map directly. + * IsNew indicates what type of db query (insert or update) + * should be used with the model instance. */ - get(key: string): string + isNew(): boolean } - interface Header { + interface BaseModel { /** - * Values returns all values associated with the given key. - * It is case insensitive; [textproto.CanonicalMIMEHeaderKey] is - * used to canonicalize the provided key. To use non-canonical - * keys, access the map directly. - * The returned slice is not a copy. + * GetCreated returns the model Created datetime. */ - values(key: string): Array + getCreated(): types.DateTime } - interface Header { + interface BaseModel { /** - * Del deletes the values associated with key. - * The key is case insensitive; it is canonicalized by - * [CanonicalHeaderKey]. + * GetUpdated returns the model Updated datetime. */ - del(key: string): void + getUpdated(): types.DateTime } - interface Header { + interface BaseModel { /** - * Write writes a header in wire format. + * RefreshId generates and sets a new model id. + * + * The generated id is a cryptographically random 15 characters length string. */ - write(w: io.Writer): void + refreshId(): void } - interface Header { + interface BaseModel { /** - * Clone returns a copy of h or nil if h is nil. + * RefreshCreated updates the model Created field with the current datetime. */ - clone(): Header + refreshCreated(): void } - interface Header { + interface BaseModel { /** - * WriteSubset writes a header in wire format. - * If exclude is not nil, keys where exclude[key] == true are not written. - * Keys are not canonicalized before checking the exclude map. + * RefreshUpdated updates the model Updated field with the current datetime. */ - writeSubset(w: io.Writer, exclude: _TygojaDict): void + refreshUpdated(): void + } + interface BaseModel { + /** + * PostScan implements the [dbx.PostScanner] interface. + * + * It is executed right after the model was populated with the db row values. + */ + postScan(): void } // @ts-ignore - import urlpkg = url + import validation = ozzo_validation /** - * Response represents the response from an HTTP request. - * - * The [Client] and [Transport] return Responses from servers once - * the response headers have been received. The response body - * is streamed on demand as the Body field is read. + * CollectionBaseOptions defines the "base" Collection.Options fields. */ - interface Response { - status: string // e.g. "200 OK" - statusCode: number // e.g. 200 - proto: string // e.g. "HTTP/1.0" - protoMajor: number // e.g. 1 - protoMinor: number // e.g. 0 + interface CollectionBaseOptions { + } + interface CollectionBaseOptions { /** - * Header maps header keys to values. If the response had multiple - * headers with the same key, they may be concatenated, with comma - * delimiters. (RFC 7230, section 3.2.2 requires that multiple headers - * be semantically equivalent to a comma-delimited sequence.) When - * Header values are duplicated by other fields in this struct (e.g., - * ContentLength, TransferEncoding, Trailer), the field values are - * authoritative. - * - * Keys in the map are canonicalized (see CanonicalHeaderKey). + * Validate implements [validation.Validatable] interface. */ - header: Header + validate(): void + } + /** + * CollectionAuthOptions defines the "auth" Collection.Options fields. + */ + interface CollectionAuthOptions { + manageRule?: string + allowOAuth2Auth: boolean + allowUsernameAuth: boolean + allowEmailAuth: boolean + requireEmail: boolean + exceptEmailDomains: Array + onlyVerified: boolean + onlyEmailDomains: Array + minPasswordLength: number + } + interface CollectionAuthOptions { /** - * Body represents the response body. - * - * The response body is streamed on demand as the Body field - * is read. If the network connection fails or the server - * terminates the response, Body.Read calls return an error. - * - * The http Client and Transport guarantee that Body is always - * non-nil, even on responses without a body or responses with - * a zero-length body. It is the caller's responsibility to - * close Body. The default HTTP client's Transport may not - * reuse HTTP/1.x "keep-alive" TCP connections if the Body is - * not read to completion and closed. - * - * The Body is automatically dechunked if the server replied - * with a "chunked" Transfer-Encoding. - * - * As of Go 1.12, the Body will also implement io.Writer - * on a successful "101 Switching Protocols" response, - * as used by WebSockets and HTTP/2's "h2c" mode. + * Validate implements [validation.Validatable] interface. */ - body: io.ReadCloser - /** - * ContentLength records the length of the associated content. The - * value -1 indicates that the length is unknown. Unless Request.Method - * is "HEAD", values >= 0 indicate that the given number of bytes may - * be read from Body. - */ - contentLength: number - /** - * Contains transfer encodings from outer-most to inner-most. Value is - * nil, means that "identity" encoding is used. - */ - transferEncoding: Array - /** - * Close records whether the header directed that the connection be - * closed after reading Body. The value is advice for clients: neither - * ReadResponse nor Response.Write ever closes a connection. - */ - close: boolean - /** - * Uncompressed reports whether the response was sent compressed but - * was decompressed by the http package. When true, reading from - * Body yields the uncompressed content instead of the compressed - * content actually set from the server, ContentLength is set to -1, - * and the "Content-Length" and "Content-Encoding" fields are deleted - * from the responseHeader. To get the original response from - * the server, set Transport.DisableCompression to true. - */ - uncompressed: boolean - /** - * Trailer maps trailer keys to values in the same - * format as Header. - * - * The Trailer initially contains only nil values, one for - * each key specified in the server's "Trailer" header - * value. Those values are not added to Header. - * - * Trailer must not be accessed concurrently with Read calls - * on the Body. - * - * After Body.Read has returned io.EOF, Trailer will contain - * any trailer values sent by the server. - */ - trailer: Header - /** - * Request is the request that was sent to obtain this Response. - * Request's Body is nil (having already been consumed). - * This is only populated for Client requests. - */ - request?: Request - /** - * TLS contains information about the TLS connection on which the - * response was received. It is nil for unencrypted responses. - * The pointer is shared between responses and should not be - * modified. - */ - tls?: any + validate(): void } - interface Response { - /** - * Cookies parses and returns the cookies set in the Set-Cookie headers. - */ - cookies(): Array<(Cookie | undefined)> + /** + * CollectionViewOptions defines the "view" Collection.Options fields. + */ + interface CollectionViewOptions { + query: string } - interface Response { + interface CollectionViewOptions { /** - * Location returns the URL of the response's "Location" header, - * if present. Relative redirects are resolved relative to - * [Response.Request]. [ErrNoLocation] is returned if no - * Location header is present. + * Validate implements [validation.Validatable] interface. */ - location(): (url.URL) + validate(): void } - interface Response { - /** - * ProtoAtLeast reports whether the HTTP protocol used - * in the response is at least major.minor. - */ - protoAtLeast(major: number, minor: number): boolean + type _subWpQfF = BaseModel + interface Log extends _subWpQfF { + data: types.JsonMap + message: string + level: number } - interface Response { - /** - * Write writes r to w in the HTTP/1.x server response format, - * including the status line, headers, body, and optional trailer. - * - * This method consults the following fields of the response r: - * - * ``` - * StatusCode - * ProtoMajor - * ProtoMinor - * Request.Method - * TransferEncoding - * Trailer - * Body - * ContentLength - * Header, values for non-canonical keys will have unpredictable behavior - * ``` - * - * The Response Body is closed after it is sent. - */ - write(w: io.Writer): void + interface Log { + tableName(): string } - /** - * A Handler responds to an HTTP request. - * - * [Handler.ServeHTTP] should write reply headers and data to the [ResponseWriter] - * and then return. Returning signals that the request is finished; it - * is not valid to use the [ResponseWriter] or read from the - * [Request.Body] after or concurrently with the completion of the - * ServeHTTP call. - * - * Depending on the HTTP client software, HTTP protocol version, and - * any intermediaries between the client and the Go server, it may not - * be possible to read from the [Request.Body] after writing to the - * [ResponseWriter]. Cautious handlers should read the [Request.Body] - * first, and then reply. - * - * Except for reading the body, handlers should not modify the - * provided Request. - * - * If ServeHTTP panics, the server (the caller of ServeHTTP) assumes - * that the effect of the panic was isolated to the active request. - * It recovers the panic, logs a stack trace to the server error log, - * and either closes the network connection or sends an HTTP/2 - * RST_STREAM, depending on the HTTP protocol. To abort a handler so - * the client sees an interrupted response but the server doesn't log - * an error, panic with the value [ErrAbortHandler]. - */ - interface Handler { - [key:string]: any; - serveHTTP(_arg0: ResponseWriter, _arg1: Request): void + type _subuzORL = BaseModel + interface Param extends _subuzORL { + key: string + value: types.JsonRaw } - /** - * A ConnState represents the state of a client connection to a server. - * It's used by the optional [Server.ConnState] hook. - */ - interface ConnState extends Number{} - interface ConnState { - string(): string + interface Param { + tableName(): string + } + interface TableInfoRow { + /** + * the `db:"pk"` tag has special semantic so we cannot rename + * the original field without specifying a custom mapper + */ + pk: number + index: number + name: string + type: string + notNull: boolean + defaultValue: types.JsonRaw } } /** - * Package oauth2 provides support for making - * OAuth2 authorized and authenticated HTTP requests, - * as specified in RFC 6749. - * It can additionally grant authorization with Bearer JWT. - */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. + * Package daos handles common PocketBase DB model manipulations. + * + * Think of daos as DB repository and service layer in one. */ -namespace oauth2 { +namespace daos { + interface LogsStatsItem { + total: number + date: types.DateTime + } /** - * An AuthCodeOption is passed to Config.AuthCodeURL. + * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. */ - interface AuthCodeOption { - [key:string]: any; - } + interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } + // @ts-ignore + import validation = ozzo_validation +} + +namespace hook { /** - * Token represents the credentials used to authorize - * the requests to access protected resources on the OAuth 2.0 - * provider's backend. - * - * Most users of this package should not access fields of Token - * directly. They're exported mostly for use by related packages - * implementing derivative OAuth2 flows. + * Hook defines a concurrent safe structure for handling event hooks + * (aka. callbacks propagation). */ - interface Token { - /** - * AccessToken is the token that authorizes and authenticates - * the requests. - */ - accessToken: string - /** - * TokenType is the type of token. - * The Type method returns either this or "Bearer", the default. - */ - tokenType: string + interface Hook { + } + interface Hook { /** - * RefreshToken is a token that's used by the application - * (as opposed to the user) to refresh the access token - * if it expires. + * PreAdd registers a new handler to the hook by prepending it to the existing queue. + * + * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). */ - refreshToken: string + preAdd(fn: Handler): string + } + interface Hook { /** - * Expiry is the optional expiration time of the access token. + * Add registers a new handler to the hook by appending it to the existing queue. * - * If zero, TokenSource implementations will reuse the same - * token forever and RefreshToken or equivalent - * mechanisms for that TokenSource will not be used. + * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). */ - expiry: time.Time + add(fn: Handler): string + } + interface Hook { /** - * ExpiresIn is the OAuth2 wire format "expires_in" field, - * which specifies how many seconds later the token expires, - * relative to an unknown time base approximately around "now". - * It is the application's responsibility to populate - * `Expiry` from `ExpiresIn` when required. + * Remove removes a single hook handler by its id. */ - expiresIn: number + remove(id: string): void } - interface Token { + interface Hook { /** - * Type returns t.TokenType if non-empty, else "Bearer". + * RemoveAll removes all registered handlers. */ - type(): string + removeAll(): void } - interface Token { + interface Hook { /** - * SetAuthHeader sets the Authorization header to r using the access - * token in t. + * Trigger executes all registered hook handlers one by one + * with the specified `data` as an argument. * - * This method is unnecessary when using Transport or an HTTP Client - * returned by this package. - */ - setAuthHeader(r: http.Request): void - } - interface Token { - /** - * WithExtra returns a new Token that's a clone of t, but using the - * provided raw extra map. This is only intended for use by packages - * implementing derivative OAuth2 flows. - */ - withExtra(extra: { - }): (Token) - } - interface Token { - /** - * Extra returns an extra field. - * Extra fields are key-value pairs returned by the server as a - * part of the token retrieval response. - */ - extra(key: string): { - } - } - interface Token { - /** - * Valid reports whether t is non-nil, has an AccessToken, and is not expired. + * Optionally, this method allows also to register additional one off + * handlers that will be temporary appended to the handlers queue. + * + * The execution stops when: + * - hook.StopPropagation is returned in one of the handlers + * - any non-nil error is returned in one of the handlers */ - valid(): boolean + trigger(data: T, ...oneOffHandlers: Handler[]): void } -} - -namespace store { /** - * Store defines a concurrent safe in memory key-value data store. + * TaggedHook defines a proxy hook which register handlers that are triggered only + * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). */ - interface Store { - } - interface Store { - /** - * Reset clears the store and replaces the store data with a - * shallow copy of the provided newData. - */ - reset(newData: _TygojaDict): void - } - interface Store { - /** - * Length returns the current number of elements in the store. - */ - length(): number - } - interface Store { - /** - * RemoveAll removes all the existing store entries. - */ - removeAll(): void - } - interface Store { - /** - * Remove removes a single entry from the store. - * - * Remove does nothing if key doesn't exist in the store. - */ - remove(key: string): void + type _sublZLEH = mainHook + interface TaggedHook extends _sublZLEH { } - interface Store { + interface TaggedHook { /** - * Has checks if element with the specified key exist or not. + * CanTriggerOn checks if the current TaggedHook can be triggered with + * the provided event data tags. */ - has(key: string): boolean + canTriggerOn(tags: Array): boolean } - interface Store { + interface TaggedHook { /** - * Get returns a single element value from the store. + * PreAdd registers a new handler to the hook by prepending it to the existing queue. * - * If key is not set, the zero T value is returned. - */ - get(key: string): T - } - interface Store { - /** - * GetAll returns a shallow copy of the current store data. - */ - getAll(): _TygojaDict - } - interface Store { - /** - * Set sets (or overwrite if already exist) a new value for key. + * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. */ - set(key: string, value: T): void + preAdd(fn: Handler): string } - interface Store { + interface TaggedHook { /** - * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. + * Add registers a new handler to the hook by appending it to the existing queue. * - * This method is similar to Set() but **it will skip adding new elements** - * to the store if the store length has reached the specified limit. - * false is returned if maxAllowedElements limit is reached. - */ - setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean - } -} - -namespace mailer { - /** - * Mailer defines a base mail client interface. - */ - interface Mailer { - [key:string]: any; - /** - * Send sends an email with the provided Message. + * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. */ - send(message: Message): void + add(fn: Handler): string } } /** - * Package echo implements high performance, minimalist Go web framework. + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. * - * Example: + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, * * ``` - * package main + * slog.Info("hello", "count", 3) + * ``` * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. * - * func main() { - * // Echo instance - * e := echo.New() + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` * - * // Routes - * e.GET("/", hello) + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` - * - * Learn more at https://echo.labstack.com - */ -namespace echo { - /** - * Binder is the interface that wraps the Bind method. - */ - interface Binder { - [key:string]: any; - bind(c: Context, i: { - }): void - } - /** - * ServableContext is interface that Echo context implementation must implement to be usable in middleware/handlers and - * be able to be routed by Router. - */ - interface ServableContext { - [key:string]: any; - /** - * Reset resets the context after request completes. It must be called along - * with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. - * See `Echo#ServeHTTP()` - */ - reset(r: http.Request, w: http.ResponseWriter): void - } - // @ts-ignore - import stdContext = context - /** - * JSONSerializer is the interface that encodes and decodes JSON to and from interfaces. - */ - interface JSONSerializer { - [key:string]: any; - serialize(c: Context, i: { - }, indent: string): void - deserialize(c: Context, i: { - }): void - } - /** - * HTTPErrorHandler is a centralized HTTP error handler. - */ - interface HTTPErrorHandler {(c: Context, err: Error): void } - /** - * Validator is the interface that wraps the Validate function. - */ - interface Validator { - [key:string]: any; - validate(i: { - }): void - } - /** - * Renderer is the interface that wraps the Render function. - */ - interface Renderer { - [key:string]: any; - render(_arg0: io.Writer, _arg1: string, _arg2: { - }, _arg3: Context): void - } - /** - * Group is a set of sub-routes for a specified route. It can be used for inner - * routes that share a common middleware or functionality that should be separate - * from the parent echo instance while still inheriting from it. - */ - interface Group { - } - interface Group { - /** - * Use implements `Echo#Use()` for sub-routes within the Group. - * Group middlewares are not executed on request when there is no matching route found. - */ - use(...middleware: MiddlewareFunc[]): void - } - interface Group { - /** - * CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. Panics on error. - */ - connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * DELETE implements `Echo#DELETE()` for sub-routes within the Group. Panics on error. - */ - delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * GET implements `Echo#GET()` for sub-routes within the Group. Panics on error. - */ - get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * HEAD implements `Echo#HEAD()` for sub-routes within the Group. Panics on error. - */ - head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * OPTIONS implements `Echo#OPTIONS()` for sub-routes within the Group. Panics on error. - */ - options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * PATCH implements `Echo#PATCH()` for sub-routes within the Group. Panics on error. - */ - patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * POST implements `Echo#POST()` for sub-routes within the Group. Panics on error. - */ - post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * PUT implements `Echo#PUT()` for sub-routes within the Group. Panics on error. - */ - put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * TRACE implements `Echo#TRACE()` for sub-routes within the Group. Panics on error. - */ - trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * Any implements `Echo#Any()` for sub-routes within the Group. Panics on error. - */ - any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes - } - interface Group { - /** - * Match implements `Echo#Match()` for sub-routes within the Group. Panics on error. - */ - match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes - } - interface Group { - /** - * Group creates a new sub-group with prefix and optional sub-group-level middleware. - * Important! Group middlewares are only executed in case there was exact route match and not - * for 404 (not found) or 405 (method not allowed) cases. If this kind of behaviour is needed then add - * a catch-all route `/*` for the group which handler returns always 404 - */ - group(prefix: string, ...middleware: MiddlewareFunc[]): (Group) - } - interface Group { - /** - * Static implements `Echo#Static()` for sub-routes within the Group. - */ - static(pathPrefix: string, fsRoot: string): RouteInfo - } - interface Group { - /** - * StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. - * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. - */ - staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo - } - interface Group { - /** - * FileFS implements `Echo#FileFS()` for sub-routes within the Group. - */ - fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * File implements `Echo#File()` for sub-routes within the Group. Panics on error. - */ - file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group. - * - * Example: `g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` - */ - routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * Add implements `Echo#Add()` for sub-routes within the Group. Panics on error. - */ - add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo - } - interface Group { - /** - * AddRoute registers a new Routable with Router - */ - addRoute(route: Routable): RouteInfo - } - /** - * IPExtractor is a function to extract IP addr from http.Request. - * Set appropriate one to Echo#IPExtractor. - * See https://echo.labstack.com/guide/ip-address for more details. - */ - interface IPExtractor {(_arg0: http.Request): string } - /** - * Logger defines the logging interface that Echo uses internally in few places. - * For logging in handlers use your own logger instance (dependency injected or package/public variable) from logging framework of your choice. - */ - interface Logger { - [key:string]: any; - /** - * Write provides writer interface for http.Server `ErrorLog` and for logging startup messages. - * `http.Server.ErrorLog` logs errors from accepting connections, unexpected behavior from handlers, - * and underlying FileSystem errors. - * `logger` middleware will use this method to write its JSON payload. - */ - write(p: string|Array): number - /** - * Error logs the error - */ - error(err: Error): void - } - /** - * Response wraps an http.ResponseWriter and implements its interface to be used - * by an HTTP handler to construct an HTTP response. - * See: https://golang.org/pkg/net/http/#ResponseWriter - */ - interface Response { - writer: http.ResponseWriter - status: number - size: number - committed: boolean - } - interface Response { - /** - * Header returns the header map for the writer that will be sent by - * WriteHeader. Changing the header after a call to WriteHeader (or Write) has - * no effect unless the modified headers were declared as trailers by setting - * the "Trailer" header before the call to WriteHeader (see example) - * To suppress implicit response headers, set their value to nil. - * Example: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers - */ - header(): http.Header - } - interface Response { - /** - * Before registers a function which is called just before the response is written. - */ - before(fn: () => void): void - } - interface Response { - /** - * After registers a function which is called just after the response is written. - * If the `Content-Length` is unknown, none of the after function is executed. - */ - after(fn: () => void): void - } - interface Response { - /** - * WriteHeader sends an HTTP response header with status code. If WriteHeader is - * not called explicitly, the first call to Write will trigger an implicit - * WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly - * used to send error codes. - */ - writeHeader(code: number): void - } - interface Response { - /** - * Write writes the data to the connection as part of an HTTP reply. - */ - write(b: string|Array): number - } - interface Response { - /** - * Flush implements the http.Flusher interface to allow an HTTP handler to flush - * buffered data to the client. - * See [http.Flusher](https://golang.org/pkg/net/http/#Flusher) - */ - flush(): void - } - interface Response { - /** - * Hijack implements the http.Hijacker interface to allow an HTTP handler to - * take over the connection. - * See [http.Hijacker](https://golang.org/pkg/net/http/#Hijacker) - */ - hijack(): [net.Conn, (bufio.ReadWriter)] - } - interface Response { - /** - * Unwrap returns the original http.ResponseWriter. - * ResponseController can be used to access the original http.ResponseWriter. - * See [https://go.dev/blog/go1.20] - */ - unwrap(): http.ResponseWriter - } - interface Routes { - /** - * Reverse reverses route to URL string by replacing path parameters with given params values. - */ - reverse(name: string, ...params: { - }[]): string - } - interface Routes { - /** - * FindByMethodPath searched for matching route info by method and path - */ - findByMethodPath(method: string, path: string): RouteInfo - } - interface Routes { - /** - * FilterByMethod searched for matching route info by method - */ - filterByMethod(method: string): Routes - } - interface Routes { - /** - * FilterByPath searched for matching route info by path - */ - filterByPath(path: string): Routes - } - interface Routes { - /** - * FilterByName searched for matching route info by name - */ - filterByName(name: string): Routes - } - /** - * Router is interface for routing request contexts to registered routes. - * - * Contract between Echo/Context instance and the router: - * ``` - * - all routes must be added through methods on echo.Echo instance. - * Reason: Echo instance uses RouteInfo.Params() length to allocate slice for paths parameters (see `Echo.contextPathParamAllocSize`). - * - Router must populate Context during Router.Route call with: - * - RoutableContext.SetPath - * - RoutableContext.SetRawPathParams (IMPORTANT! with same slice pointer that c.RawPathParams() returns) - * - RoutableContext.SetRouteInfo - * And optionally can set additional information to Context with RoutableContext.Set - * ``` - */ - interface Router { - [key:string]: any; - /** - * Add registers Routable with the Router and returns registered RouteInfo - */ - add(routable: Routable): RouteInfo - /** - * Remove removes route from the Router - */ - remove(method: string, path: string): void - /** - * Routes returns information about all registered routes - */ - routes(): Routes - /** - * Route searches Router for matching route and applies it to the given context. In case when no matching method - * was not found (405) or no matching route exists for path (404), router will return its implementation of 405/404 - * handler function. - */ - route(c: RoutableContext): HandlerFunc - } - /** - * Routable is interface for registering Route with Router. During route registration process the Router will - * convert Routable to RouteInfo with ToRouteInfo method. By creating custom implementation of Routable additional - * information about registered route can be stored in Routes (i.e. privileges used with route etc.) - */ - interface Routable { - [key:string]: any; - /** - * ToRouteInfo converts Routable to RouteInfo - * - * This method is meant to be used by Router after it parses url for path parameters, to store information about - * route just added. - */ - toRouteInfo(params: Array): RouteInfo - /** - * ToRoute converts Routable to Route which Router uses to register the method handler for path. - * - * This method is meant to be used by Router to get fields (including handler and middleware functions) needed to - * add Route to Router. - */ - toRoute(): Route - /** - * ForGroup recreates routable with added group prefix and group middlewares it is grouped to. - * - * Is necessary for Echo.Group to be able to add/register Routable with Router and having group prefix and group - * middlewares included in actually registered Route. - */ - forGroup(pathPrefix: string, middlewares: Array): Routable - } - /** - * Routes is collection of RouteInfo instances with various helper methods. - */ - interface Routes extends Array{} - /** - * RouteInfo describes registered route base fields. - * Method+Path pair uniquely identifies the Route. Name can have duplicates. - */ - interface RouteInfo { - [key:string]: any; - method(): string - path(): string - name(): string - params(): Array - /** - * Reverse reverses route to URL string by replacing path parameters with given params values. - */ - reverse(...params: { - }[]): string - } - /** - * PathParams is collections of PathParam instances with various helper methods - */ - interface PathParams extends Array{} - interface PathParams { - /** - * Get returns path parameter value for given name or default value. - */ - get(name: string, defaultValue: string): string - } -} - -namespace logging { - /** - * Logger is an interface for logging entries at certain classifications. - */ - interface Logger { - [key:string]: any; - /** - * Logf is expected to support the standard fmt package "verbs". - */ - logf(classification: Classification, format: string, ...v: { - }[]): void - } -} - -/** - * Package middleware provides transport agnostic middleware for decorating SDK - * handlers. - * - * The Smithy middleware stack provides ordered behavior to be invoked on an - * underlying handler. The stack is separated into steps that are invoked in a - * static order. A step is a collection of middleware that are injected into a - * ordered list defined by the user. The user may add, insert, swap, and remove a - * step's middleware. When the stack is invoked the step middleware become static, - * and their order cannot be modified. - * - * A stack and its step middleware are **not** safe to modify concurrently. - * - * A stack will use the ordered list of middleware to decorate a underlying - * handler. A handler could be something like an HTTP Client that round trips an - * API operation over HTTP. - * - * Smithy Middleware Stack - * - * A Stack is a collection of middleware that wrap a handler. The stack can be - * broken down into discreet steps. Each step may contain zero or more middleware - * specific to that stack's step. - * - * A Stack Step is a predefined set of middleware that are invoked in a static - * order by the Stack. These steps represent fixed points in the middleware stack - * for organizing specific behavior, such as serialize and build. A Stack Step is - * composed of zero or more middleware that are specific to that step. A step may - * define its own set of input/output parameters the generic input/output - * parameters are cast from. A step calls its middleware recursively, before - * calling the next step in the stack returning the result or error of the step - * middleware decorating the underlying handler. - * - * * Initialize: Prepares the input, and sets any default parameters as needed, - * (e.g. idempotency token, and presigned URLs). - * - * * Serialize: Serializes the prepared input into a data structure that can be - * consumed by the target transport's message, (e.g. REST-JSON serialization). - * - * * Build: Adds additional metadata to the serialized transport message, (e.g. - * HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. - * - * * Finalize: Performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated to - * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request - * signing). - * - * * Deserialize: Reacts to the handler's response returned by the recipient of - * the request message. Deserializes the response into a structured type or - * error above stacks can react to. - * - * Adding Middleware to a Stack Step - * - * Middleware can be added to a step front or back, or relative, by name, to an - * existing middleware in that stack. If a middleware does not have a name, a - * unique name will be generated at the middleware and be added to the step. - * - * ``` - * // Create middleware stack - * stack := middleware.NewStack() - * - * // Add middleware to stack steps - * stack.Initialize.Add(paramValidationMiddleware, middleware.After) - * stack.Serialize.Add(marshalOperationFoo, middleware.After) - * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) - * - * // Invoke middleware on handler. - * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) - * ``` - */ -namespace middleware { - /** - * Stack provides protocol and transport agnostic set of middleware split into - * distinct steps. Steps have specific transitions between them, that are - * managed by the individual step. - * - * Steps are composed as middleware around the underlying handler in the - * following order: - * - * ``` - * Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler - * ``` - * - * Any middleware within the chain may choose to stop and return an error or - * response. Since the middleware decorate the handler like a call stack, each - * middleware will receive the result of the next middleware in the chain. - * Middleware that does not need to react to an input, or result must forward - * along the input down the chain, or return the result back up the chain. - * - * ``` - * Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler - * ``` - */ - interface Stack { - /** - * Initialize prepares the input, and sets any default parameters as - * needed, (e.g. idempotency token, and presigned URLs). - * - * Takes Input Parameters, and returns result or error. - * - * Receives result or error from Serialize step. - */ - initialize?: InitializeStep - /** - * Serialize serializes the prepared input into a data structure that can be consumed - * by the target transport's message, (e.g. REST-JSON serialization) - * - * Converts Input Parameters into a Request, and returns the result or error. - * - * Receives result or error from Build step. - */ - serialize?: SerializeStep - /** - * Build adds additional metadata to the serialized transport message - * (e.g. HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. - * - * Takes Request, and returns result or error. - * - * Receives result or error from Finalize step. - */ - build?: BuildStep - /** - * Finalize performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated - * to meet the expectations of the recipient (e.g. Retry and AWS SigV4 - * request signing) - * - * Takes Request, and returns result or error. - * - * Receives result or error from Deserialize step. - */ - finalize?: FinalizeStep - /** - * Deserialize reacts to the handler's response returned by the recipient of the request - * message. Deserializes the response into a structured type or error above - * stacks can react to. - * - * Should only forward Request to underlying handler. - * - * Takes Request, and returns result or error. - * - * Receives raw response, or error from underlying handler. - */ - deserialize?: DeserializeStep - } - interface Stack { - /** - * ID returns the unique ID for the stack as a middleware. - */ - id(): string - } - interface Stack { - /** - * HandleMiddleware invokes the middleware stack decorating the next handler. - * Each step of stack will be invoked in order before calling the next step. - * With the next handler call last. - * - * The input value must be the input parameters of the operation being - * performed. - * - * Will return the result of the operation, or error. - */ - handleMiddleware(ctx: context.Context, input: { - }, next: Handler): [{ - }, Metadata] - } - interface Stack { - /** - * List returns a list of all middleware in the stack by step. - */ - list(): Array - } - interface Stack { - string(): string - } -} - -/** - * Package bearer provides middleware and utilities for authenticating API - * operation calls with a Bearer Token. - */ -namespace bearer { - // @ts-ignore - import smithyhttp = http - /** - * TokenProvider provides interface for retrieving bearer tokens. - */ - interface TokenProvider { - [key:string]: any; - retrieveBearerToken(_arg0: context.Context): Token - } - // @ts-ignore - import smithycontext = context -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - /** - * AccountIDEndpointMode controls how a resolved AWS account ID is handled for endpoint routing. - */ - interface AccountIDEndpointMode extends String{} - // @ts-ignore - import smithybearer = bearer - /** - * HTTPClient provides the interface to provide custom HTTPClients. Generally - * *http.Client is sufficient for most use cases. The HTTPClient should not - * follow 301 or 302 redirects. - */ - interface HTTPClient { - [key:string]: any; - do(_arg0: http.Request): (http.Response) - } - // @ts-ignore - import sdkrand = rand - /** - * A CredentialsProvider is the interface for any component which will provide - * credentials Credentials. A CredentialsProvider is required to manage its own - * Expired state, and what to be expired means. - * - * A credentials provider implementation can be wrapped with a CredentialCache - * to cache the credential value retrieved. Without the cache the SDK will - * attempt to retrieve the credentials for every request. - */ - interface CredentialsProvider { - [key:string]: any; - /** - * Retrieve returns nil if it successfully retrieved the value. - * Error is returned if the value were not obtainable, or empty. - */ - retrieve(ctx: context.Context): Credentials - } - /** - * DefaultsMode is the SDK defaults mode setting. - */ - interface DefaultsMode extends String{} - interface DefaultsMode { - /** - * SetFromString sets the DefaultsMode value to one of the pre-defined constants that matches - * the provided string when compared using EqualFold. If the value does not match a known - * constant it will be set to as-is and the function will return false. As a special case, if the - * provided value is a zero-length string, the mode will be set to LegacyDefaultsMode. - */ - setFromString(v: string): boolean - } - /** - * EndpointResolver is an endpoint resolver that can be used to provide or - * override an endpoint for the given service and region. API clients will - * attempt to use the EndpointResolver first to resolve an endpoint if - * available. If the EndpointResolver returns an EndpointNotFoundError error, - * API clients will fallback to attempting to resolve the endpoint using its - * internal default endpoint resolver. - * - * Deprecated: The global endpoint resolution interface is deprecated. The API - * for endpoint resolution is now unique to each service and is set via the - * EndpointResolverV2 field on service client options. Setting a value for - * EndpointResolver on aws.Config or service client options will prevent you - * from using any endpoint-related service features released after the - * introduction of EndpointResolverV2. You may also encounter broken or - * unexpected behavior when using the old global interface with services that - * use many endpoint-related customizations such as S3. - */ - interface EndpointResolver { - [key:string]: any; - resolveEndpoint(service: string, region: string): Endpoint - } - /** - * EndpointResolverWithOptions is an endpoint resolver that can be used to provide or - * override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will - * attempt to use the EndpointResolverWithOptions first to resolve an endpoint if - * available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error, - * API clients will fallback to attempting to resolve the endpoint using its - * internal default endpoint resolver. - * - * Deprecated: The global endpoint resolution interface is deprecated. See - * deprecation docs on [EndpointResolver]. - */ - interface EndpointResolverWithOptions { - [key:string]: any; - resolveEndpoint(service: string, region: string, ...options: { - }[]): Endpoint - } - /** - * ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where - * each bit is a flag that describes the logging behavior for one or more client components. - * The entire 64-bit group is reserved for later expansion by the SDK. - * - * Example: Setting ClientLogMode to enable logging of retries and requests - * - * ``` - * clientLogMode := aws.LogRetries | aws.LogRequest - * ``` - * - * Example: Adding an additional log mode to an existing ClientLogMode value - * - * ``` - * clientLogMode |= aws.LogResponse - * ``` - */ - interface ClientLogMode extends Number{} - interface ClientLogMode { - /** - * IsSigning returns whether the Signing logging mode bit is set - */ - isSigning(): boolean - } - interface ClientLogMode { - /** - * IsRetries returns whether the Retries logging mode bit is set - */ - isRetries(): boolean - } - interface ClientLogMode { - /** - * IsRequest returns whether the Request logging mode bit is set - */ - isRequest(): boolean - } - interface ClientLogMode { - /** - * IsRequestWithBody returns whether the RequestWithBody logging mode bit is set - */ - isRequestWithBody(): boolean - } - interface ClientLogMode { - /** - * IsResponse returns whether the Response logging mode bit is set - */ - isResponse(): boolean - } - interface ClientLogMode { - /** - * IsResponseWithBody returns whether the ResponseWithBody logging mode bit is set - */ - isResponseWithBody(): boolean - } - interface ClientLogMode { - /** - * IsDeprecatedUsage returns whether the DeprecatedUsage logging mode bit is set - */ - isDeprecatedUsage(): boolean - } - interface ClientLogMode { - /** - * IsRequestEventMessage returns whether the RequestEventMessage logging mode bit is set - */ - isRequestEventMessage(): boolean - } - interface ClientLogMode { - /** - * IsResponseEventMessage returns whether the ResponseEventMessage logging mode bit is set - */ - isResponseEventMessage(): boolean - } - interface ClientLogMode { - /** - * ClearSigning clears the Signing logging mode bit - */ - clearSigning(): void - } - interface ClientLogMode { - /** - * ClearRetries clears the Retries logging mode bit - */ - clearRetries(): void - } - interface ClientLogMode { - /** - * ClearRequest clears the Request logging mode bit - */ - clearRequest(): void - } - interface ClientLogMode { - /** - * ClearRequestWithBody clears the RequestWithBody logging mode bit - */ - clearRequestWithBody(): void - } - interface ClientLogMode { - /** - * ClearResponse clears the Response logging mode bit - */ - clearResponse(): void - } - interface ClientLogMode { - /** - * ClearResponseWithBody clears the ResponseWithBody logging mode bit - */ - clearResponseWithBody(): void - } - interface ClientLogMode { - /** - * ClearDeprecatedUsage clears the DeprecatedUsage logging mode bit - */ - clearDeprecatedUsage(): void - } - interface ClientLogMode { - /** - * ClearRequestEventMessage clears the RequestEventMessage logging mode bit - */ - clearRequestEventMessage(): void - } - interface ClientLogMode { - /** - * ClearResponseEventMessage clears the ResponseEventMessage logging mode bit - */ - clearResponseEventMessage(): void - } - /** - * RetryMode provides the mode the API client will use to create a retryer - * based on. - */ - interface RetryMode extends String{} - interface RetryMode { - string(): string - } - /** - * Retryer is an interface to determine if a given error from a - * attempt should be retried, and if so what backoff delay to apply. The - * default implementation used by most services is the retry package's Standard - * type. Which contains basic retry logic using exponential backoff. - */ - interface Retryer { - [key:string]: any; - /** - * IsErrorRetryable returns if the failed attempt is retryable. This check - * should determine if the error can be retried, or if the error is - * terminal. - */ - isErrorRetryable(_arg0: Error): boolean - /** - * MaxAttempts returns the maximum number of attempts that can be made for - * an attempt before failing. A value of 0 implies that the attempt should - * be retried until it succeeds if the errors are retryable. - */ - maxAttempts(): number - /** - * RetryDelay returns the delay that should be used before retrying the - * attempt. Will return error if the delay could not be determined. - */ - retryDelay(attempt: number, opErr: Error): time.Duration - /** - * GetRetryToken attempts to deduct the retry cost from the retry token pool. - * Returning the token release function, or error. - */ - getRetryToken(ctx: context.Context, opErr: Error): (_arg0: Error) => void - /** - * GetInitialToken returns the initial attempt token that can increment the - * retry token pool if the attempt is successful. - */ - getInitialToken(): (_arg0: Error) => void - } - /** - * RuntimeEnvironment is a collection of values that are determined at runtime - * based on the environment that the SDK is executing in. Some of these values - * may or may not be present based on the executing environment and certain SDK - * configuration properties that drive whether these values are populated.. - */ - interface RuntimeEnvironment { - environmentIdentifier: ExecutionEnvironmentID - region: string - ec2InstanceMetadataRegion: string - } -} - -/** - * Package s3 provides the API client, operations, and parameter types for Amazon - * Simple Storage Service. - */ -namespace s3 { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import awshttp = http - // @ts-ignore - import internalauth = auth - // @ts-ignore - import internalauthsmithy = smithy - // @ts-ignore - import internalConfig = configsources - // @ts-ignore - import internalmiddleware = middleware - // @ts-ignore - import acceptencodingcust = accept_encoding - // @ts-ignore - import internalChecksum = checksum - // @ts-ignore - import presignedurlcust = presigned_url - // @ts-ignore - import s3sharedconfig = config - // @ts-ignore - import s3cust = customizations - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithyauth = auth - // @ts-ignore - import smithydocument = document - // @ts-ignore - import smithyhttp = http - type _subQQXwh = noSmithyDocumentSerde - interface AbortMultipartUploadInput extends _subQQXwh { - /** - * The bucket name to which the upload was taking place. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Key of the object for which the multipart upload was initiated. - * - * This member is required. - */ - key?: string - /** - * Upload ID that identifies the multipart upload. - * - * This member is required. - */ - uploadId?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - } - type _subsLqIT = noSmithyDocumentSerde - interface AbortMultipartUploadOutput extends _subsLqIT { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subiloAc = noSmithyDocumentSerde - interface CompleteMultipartUploadInput extends _subiloAc { - /** - * Name of the bucket to which the multipart upload was initiated. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which the multipart upload was initiated. - * - * This member is required. - */ - key?: string - /** - * ID for the initiated multipart upload. - * - * This member is required. - */ - uploadId?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see - * [Checking object integrity]in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32C?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA1?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Uploads the object only if the object key name does not already exist in the - * bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. - * - * If a conflicting operation occurs during the upload S3 returns a 409 - * ConditionalRequestConflict response. On a 409 failure you should re-initiate the - * multipart upload with CreateMultipartUpload and re-upload each part. - * - * Expects the '*' (asterisk) character. - * - * For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 - * User Guide. - * - * [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifNoneMatch?: string - /** - * The container for the multipart upload request information. - */ - multipartUpload?: types.CompletedMultipartUpload - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The server-side encryption (SSE) algorithm used to encrypt the object. This - * parameter is required only when the object was created using a checksum - * algorithm or if your bucket policy requires the use of SSE-C. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#ssec-require-condition-key - */ - sseCustomerAlgorithm?: string - /** - * The server-side encryption (SSE) customer managed key. This parameter is needed - * only when the object was created using a checksum algorithm. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKey?: string - /** - * The MD5 server-side encryption (SSE) customer managed key. This parameter is - * needed only when the object was created using a checksum algorithm. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKeyMD5?: string - } - type _subllseS = noSmithyDocumentSerde - interface CompleteMultipartUploadOutput extends _subllseS { - /** - * The name of the bucket that contains the newly created object. Does not return - * the access point ARN or access point alias if used. - * - * Access points are not supported by directory buckets. - */ - bucket?: string - /** - * Indicates whether the multipart upload uses an S3 Bucket Key for server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - /** - * Entity tag that identifies the newly created object's data. Objects with - * different object data will have different entity tags. The entity tag is an - * opaque string. The entity tag may or may not be an MD5 digest of the object - * data. If the entity tag is not an MD5 digest of the object data, it will contain - * one or more nonhexadecimal characters and/or will consist of less than 32 or - * more than 32 hexadecimal digits. For more information about how the entity tag - * is calculated, see [Checking object integrity]in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - eTag?: string - /** - * If the object expiration is configured, this will contain the expiration date ( - * expiry-date ) and rule ID ( rule-id ). The value of rule-id is URL-encoded. - * - * This functionality is not supported for directory buckets. - */ - expiration?: string - /** - * The object key of the newly created object. - */ - key?: string - /** - * The URI that identifies the newly created object. - */ - location?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when storing this object in Amazon S3 - * (for example, AES256 , aws:kms ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Version ID of the newly created object, in case the bucket has versioning - * turned on. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subysoCn = noSmithyDocumentSerde - interface CopyObjectInput extends _subysoCn { - /** - * The name of the destination bucket. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Specifies the source object for the copy operation. The source object can be up - * to 5 GB. If the source object is an object that was uploaded by using a - * multipart upload, the object copy will be a single part object after the source - * object is copied to the destination bucket. - * - * You specify the value of the copy source in one of two formats, depending on - * whether you want to access the source object through an [access point]: - * - * ``` - * - For objects not accessed through an access point, specify the name of the - * source bucket and the key of the source object, separated by a slash (/). For - * example, to copy the object reports/january.pdf from the general purpose - * bucket awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value - * must be URL-encoded. To copy the object reports/january.pdf from the directory - * bucket awsexamplebucket--use1-az5--x-s3 , use - * awsexamplebucket--use1-az5--x-s3/reports/january.pdf . The value must be - * URL-encoded. - * - * - For objects accessed through access points, specify the Amazon Resource - * Name (ARN) of the object as accessed through the access point, in the format - * arn:aws:s3:::accesspoint//object/ . For example, to copy the object - * reports/january.pdf through access point my-access-point owned by account - * 123456789012 in Region us-west-2 , use the URL encoding of - * arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf - * . The value must be URL encoded. - * - * - Amazon S3 supports copy operations using Access points only when the source - * and destination buckets are in the same Amazon Web Services Region. - * - * - Access points are not supported by directory buckets. - * ``` - * - * Alternatively, for objects accessed through Amazon S3 on Outposts, specify the - * ``` - * ARN of the object as accessed in the format - * arn:aws:s3-outposts:::outpost//object/ . For example, to copy the object - * reports/january.pdf through outpost my-outpost owned by account 123456789012 - * in Region us-west-2 , use the URL encoding of - * arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf - * . The value must be URL-encoded. - * ``` - * - * If your source bucket versioning is enabled, the x-amz-copy-source header by - * default identifies the current version of an object to copy. If the current - * version is a delete marker, Amazon S3 behaves as if the object was deleted. To - * copy a different version, use the versionId query parameter. Specifically, - * append ?versionId= to the value (for example, - * awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 - * ). If you don't specify a version ID, Amazon S3 copies the latest version of the - * source object. - * - * If you enable versioning on the destination bucket, Amazon S3 generates a - * unique version ID for the copied object. This version ID is different from the - * version ID of the source object. Amazon S3 returns the version ID of the copied - * object in the x-amz-version-id response header in the response. - * - * If you do not enable versioning or suspend it on the destination bucket, the - * version ID that Amazon S3 generates in the x-amz-version-id response header is - * always null. - * - * Directory buckets - S3 Versioning isn't enabled and supported for directory - * buckets. - * - * [access point]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html - * - * This member is required. - */ - copySource?: string - /** - * The key of the destination object. - * - * This member is required. - */ - key?: string - /** - * The canned access control list (ACL) to apply to the object. - * - * When you copy an object, the ACL metadata is not preserved and is set to private - * by default. Only the owner has full access control. To override the default ACL - * setting, specify a new ACL when you generate a copy request. For more - * information, see [Using ACLs]. - * - * If the destination bucket that you're copying objects to uses the bucket owner - * enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect - * permissions. Buckets that use this setting only accept PUT requests that don't - * specify an ACL or PUT requests that specify bucket owner full control ACLs, - * such as the bucket-owner-full-control canned ACL or an equivalent form of this - * ACL expressed in the XML format. For more information, see [Controlling ownership of objects and disabling ACLs]in the Amazon S3 - * User Guide. - * - * ``` - * - If your destination bucket uses the bucket owner enforced setting for - * Object Ownership, all objects written to the bucket by any account will be owned - * by the bucket owner. - * - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html - * [Controlling ownership of objects and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - */ - acl: types.ObjectCannedACL - /** - * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - * with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). - * If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. - * - * Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object - * encryption with SSE-KMS. Specifying this header with a COPY action doesn’t - * affect bucket-level settings for S3 Bucket Key. - * - * For more information, see [Amazon S3 Bucket Keys] in the Amazon S3 User Guide. - * - * Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS - * encrypted objects from general purpose buckets to directory buckets, from - * directory buckets to general purpose buckets, or between directory buckets, - * through [CopyObject]. In this case, Amazon S3 makes a call to KMS every time a copy request - * is made for a KMS-encrypted object. - * - * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - */ - bucketKeyEnabled?: boolean - /** - * Specifies the caching behavior along the request/reply chain. - */ - cacheControl?: string - /** - * Indicates the algorithm that you want Amazon S3 to use to create the checksum - * for the object. For more information, see [Checking object integrity]in the Amazon S3 User Guide. - * - * When you copy an object, if the source object has a checksum, that checksum - * value will be copied to the new object by default. If the CopyObject request - * does not include this x-amz-checksum-algorithm header, the checksum algorithm - * will be copied from the source object to the destination object (if it's present - * on the source object). You can optionally specify a different checksum algorithm - * to use with the x-amz-checksum-algorithm header. Unrecognized or unsupported - * values will respond with the HTTP status code 400 Bad Request . - * - * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the - * default checksum algorithm that's used for performance. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * Specifies presentational information for the object. Indicates whether an - * object should be displayed in a web browser or downloaded as a file. It allows - * specifying the desired filename for the downloaded file. - */ - contentDisposition?: string - /** - * Specifies what content encodings have been applied to the object and thus what - * decoding mechanisms must be applied to obtain the media-type referenced by the - * Content-Type header field. - * - * For directory buckets, only the aws-chunked value is supported in this header - * field. - */ - contentEncoding?: string - /** - * The language the content is in. - */ - contentLanguage?: string - /** - * A standard MIME type that describes the format of the object data. - */ - contentType?: string - /** - * Copies the object if its entity tag (ETag) matches the specified tag. - * - * If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since - * headers are present in the request and evaluate as follows, Amazon S3 returns - * 200 OK and copies the data: - * - * ``` - * - x-amz-copy-source-if-match condition evaluates to true - * - * - x-amz-copy-source-if-unmodified-since condition evaluates to false - * ``` - */ - copySourceIfMatch?: string - /** - * Copies the object if it has been modified since the specified time. - * - * If both the x-amz-copy-source-if-none-match and - * x-amz-copy-source-if-modified-since headers are present in the request and - * evaluate as follows, Amazon S3 returns the 412 Precondition Failed response - * code: - * - * ``` - * - x-amz-copy-source-if-none-match condition evaluates to false - * - * - x-amz-copy-source-if-modified-since condition evaluates to true - * ``` - */ - copySourceIfModifiedSince?: time.Time - /** - * Copies the object if its entity tag (ETag) is different than the specified ETag. - * - * If both the x-amz-copy-source-if-none-match and - * x-amz-copy-source-if-modified-since headers are present in the request and - * evaluate as follows, Amazon S3 returns the 412 Precondition Failed response - * code: - * - * ``` - * - x-amz-copy-source-if-none-match condition evaluates to false - * - * - x-amz-copy-source-if-modified-since condition evaluates to true - * ``` - */ - copySourceIfNoneMatch?: string - /** - * Copies the object if it hasn't been modified since the specified time. - * - * If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since - * headers are present in the request and evaluate as follows, Amazon S3 returns - * 200 OK and copies the data: - * - * ``` - * - x-amz-copy-source-if-match condition evaluates to true - * - * - x-amz-copy-source-if-unmodified-since condition evaluates to false - * ``` - */ - copySourceIfUnmodifiedSince?: time.Time - /** - * Specifies the algorithm to use when decrypting the source object (for example, - * AES256 ). - * - * If the source object for the copy is stored in Amazon S3 using SSE-C, you must - * provide the necessary encryption information in your request so that Amazon S3 - * can decrypt the object for copying. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceSSECustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - * the source object. The encryption key provided in this header must be the same - * one that was used when the source object was created. - * - * If the source object for the copy is stored in Amazon S3 using SSE-C, you must - * provide the necessary encryption information in your request so that Amazon S3 - * can decrypt the object for copying. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceSSECustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * If the source object for the copy is stored in Amazon S3 using SSE-C, you must - * provide the necessary encryption information in your request so that Amazon S3 - * can decrypt the object for copying. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceSSECustomerKeyMD5?: string - /** - * The account ID of the expected destination bucket owner. If the account ID that - * you provide does not match the actual owner of the destination bucket, the - * request fails with the HTTP status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The account ID of the expected source bucket owner. If the account ID that you - * provide does not match the actual owner of the source bucket, the request fails - * with the HTTP status code 403 Forbidden (access denied). - */ - expectedSourceBucketOwner?: string - /** - * The date and time at which the object is no longer cacheable. - */ - expires?: time.Time - /** - * Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantFullControl?: string - /** - * Allows grantee to read the object data and its metadata. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantRead?: string - /** - * Allows grantee to read the object ACL. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantReadACP?: string - /** - * Allows grantee to write the ACL for the applicable object. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantWriteACP?: string - /** - * A map of metadata to store with the object in S3. - */ - metadata: _TygojaDict - /** - * Specifies whether the metadata is copied from the source object or replaced - * with metadata that's provided in the request. When copying an object, you can - * preserve all metadata (the default) or specify new metadata. If this header - * isn’t specified, COPY is the default behavior. - * - * General purpose bucket - For general purpose buckets, when you grant - * permissions, you can use the s3:x-amz-metadata-directive condition key to - * enforce certain metadata behavior when objects are uploaded. For more - * information, see [Amazon S3 condition key examples]in the Amazon S3 User Guide. - * - * x-amz-website-redirect-location is unique to each object and is not copied when - * using the x-amz-metadata-directive header. To copy the value, you must specify - * x-amz-website-redirect-location in the request header. - * - * [Amazon S3 condition key examples]: https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html - */ - metadataDirective: types.MetadataDirective - /** - * Specifies whether you want to apply a legal hold to the object copy. - * - * This functionality is not supported for directory buckets. - */ - objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus - /** - * The Object Lock mode that you want to apply to the object copy. - * - * This functionality is not supported for directory buckets. - */ - objectLockMode: types.ObjectLockMode - /** - * The date and time when you want the Object Lock of the object copy to expire. - * - * This functionality is not supported for directory buckets. - */ - objectLockRetainUntilDate?: time.Time - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256 ). - * - * When you perform a CopyObject operation, if you want to use a different type of - * encryption setting for the target object, you can specify appropriate - * encryption-related headers to encrypt the target object with an Amazon S3 - * managed key, a KMS key, or a customer-provided key. If the encryption setting in - * your request is different from the default encryption configuration of the - * destination bucket, the encryption setting in your request takes precedence. - * - * This functionality is not supported when the destination bucket is a directory - * bucket. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded. Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. - * - * This functionality is not supported when the destination bucket is a directory - * bucket. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported when the destination bucket is a directory - * bucket. - */ - sseCustomerKeyMD5?: string - /** - * Specifies the Amazon Web Services KMS Encryption Context as an additional - * encryption context to use for the destination object encryption. The value of - * this header is a base64-encoded UTF-8 string holding JSON with the encryption - * context key-value pairs. - * - * General purpose buckets - This value must be explicitly added to specify - * encryption context for CopyObject requests if you want an additional encryption - * context for your destination object. The additional encryption context of the - * source object won't be copied to the destination object. For more information, - * see [Encryption context]in the Amazon S3 User Guide. - * - * Directory buckets - You can optionally provide an explicit encryption context - * value. The value must match the default encryption context - the bucket Amazon - * Resource Name (ARN). An additional encryption context value is not supported. - * - * [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context - */ - ssekmsEncryptionContext?: string - /** - * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object - * encryption. All GET and PUT requests for an object protected by KMS will fail if - * they're not made via SSL or using SigV4. For information about configuring any - * of the officially supported Amazon Web Services SDKs and Amazon Web Services - * CLI, see [Specifying the Signature Version in Request Authentication]in the Amazon S3 User Guide. - * - * Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , - * you must specify the x-amz-server-side-encryption-aws-kms-key-id header with - * the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key - * to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID - * or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS - * configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the - * bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Specifying the Signature Version in Request Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when storing this object in Amazon - * S3. Unrecognized or unsupported values won’t write a destination object and will - * receive a 400 Bad Request response. - * - * Amazon S3 automatically encrypts all new objects that are copied to an S3 - * bucket. When copying an object, if you don't specify encryption information in - * your copy request, the encryption setting of the target object is set to the - * default encryption configuration of the destination bucket. By default, all - * buckets have a base level of encryption configuration that uses server-side - * encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a - * different default encryption configuration, Amazon S3 uses the corresponding - * encryption key to encrypt the target object copy. - * - * With server-side encryption, Amazon S3 encrypts your data as it writes your - * data to disks in its data centers and decrypts the data when you access it. For - * more information about server-side encryption, see [Using Server-Side Encryption]in the Amazon S3 User Guide. - * - * General purpose buckets - * - * ``` - * - For general purpose buckets, there are the following supported options for - * server-side encryption: server-side encryption with Key Management Service (KMS) - * keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS - * keys (DSSE-KMS), and server-side encryption with customer-provided encryption - * keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided - * key to encrypt the target object copy. - * - * - When you perform a CopyObject operation, if you want to use a different type - * of encryption setting for the target object, you can specify appropriate - * encryption-related headers to encrypt the target object with an Amazon S3 - * managed key, a KMS key, or a customer-provided key. If the encryption setting in - * your request is different from the default encryption configuration of the - * destination bucket, the encryption setting in your request takes precedence. - * ``` - * - * Directory buckets - * - * ``` - * - For directory buckets, there are only two supported options for server-side - * encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( - * AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). We - * recommend that the bucket's default encryption uses the desired encryption - * configuration and you don't override the bucket default encryption in your - * CreateSession requests or PUT object requests. Then, new objects are - * automatically encrypted with the desired encryption settings. For more - * information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about the - * encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. - * - * - To encrypt new object copies to a directory bucket with SSE-KMS, we - * recommend you specify SSE-KMS as the directory bucket's default encryption - * configuration with a KMS key (specifically, a [customer managed key]). [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * Your SSE-KMS configuration can only support 1 [customer managed key]per directory bucket for the - * lifetime of the bucket. After you specify a customer managed key for SSE-KMS, - * you can't override the customer managed key for the bucket's SSE-KMS - * configuration. Then, when you perform a CopyObject operation and want to - * specify server-side encryption settings for new object copies with SSE-KMS in - * the encryption-related request headers, you must ensure the encryption key is - * the same customer managed key that you specified for the directory bucket's - * default encryption configuration. - * ``` - * - * [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - serverSideEncryption: types.ServerSideEncryption - /** - * If the x-amz-storage-class header is not used, the copied object will be stored - * in the STANDARD Storage Class by default. The STANDARD storage class provides - * high durability and high availability. Depending on performance needs, you can - * specify a different Storage Class. - * - * ``` - * - Directory buckets - For directory buckets, only the S3 Express One Zone - * storage class is supported to store newly created objects. Unsupported storage - * class values won't write a destination object and will respond with the HTTP - * status code 400 Bad Request . - * - * - Amazon S3 on Outposts - S3 on Outposts only uses the OUTPOSTS Storage Class. - * ``` - * - * You can use the CopyObject action to change the storage class of an object that - * is already stored in Amazon S3 by using the x-amz-storage-class header. For - * more information, see [Storage Classes]in the Amazon S3 User Guide. - * - * Before using an object as a source object for the copy operation, you must - * restore a copy of it if it meets any of the following conditions: - * - * ``` - * - The storage class of the source object is GLACIER or DEEP_ARCHIVE . - * - * - The storage class of the source object is INTELLIGENT_TIERING and it's [S3 Intelligent-Tiering access tier]is - * Archive Access or Deep Archive Access . - * ``` - * - * For more information, see [RestoreObject] and [Copying Objects] in the Amazon S3 User Guide. - * - * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html - * [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html - * [Copying Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html - * [S3 Intelligent-Tiering access tier]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering-overview.html#intel-tiering-tier-definition - */ - storageClass: types.StorageClass - /** - * The tag-set for the object copy in the destination bucket. This value must be - * used in conjunction with the x-amz-tagging-directive if you choose REPLACE for - * the x-amz-tagging-directive . If you choose COPY for the x-amz-tagging-directive - * , you don't need to set the x-amz-tagging header, because the tag-set will be - * copied from the source object directly. The tag-set must be encoded as URL Query - * parameters. - * - * The default value is the empty value. - * - * Directory buckets - For directory buckets in a CopyObject operation, only the - * empty tag-set is supported. Any requests that attempt to write non-empty tags - * into directory buckets will receive a 501 Not Implemented status code. When the - * destination bucket is a directory bucket, you will receive a 501 Not Implemented - * response in any of the following situations: - * - * ``` - * - When you attempt to COPY the tag-set from an S3 source object that has - * non-empty tags. - * - * - When you attempt to REPLACE the tag-set of a source object and set a - * non-empty value to x-amz-tagging . - * - * - When you don't set the x-amz-tagging-directive header and the source object - * has non-empty tags. This is because the default value of - * x-amz-tagging-directive is COPY . - * ``` - * - * Because only the empty tag-set is supported for directory buckets in a - * CopyObject operation, the following situations are allowed: - * - * ``` - * - When you attempt to COPY the tag-set from a directory bucket source object - * that has no tags to a general purpose bucket. It copies an empty tag-set to the - * destination object. - * - * - When you attempt to REPLACE the tag-set of a directory bucket source object - * and set the x-amz-tagging value of the directory bucket destination object to - * empty. - * - * - When you attempt to REPLACE the tag-set of a general purpose bucket source - * object that has non-empty tags and set the x-amz-tagging value of the - * directory bucket destination object to empty. - * - * - When you attempt to REPLACE the tag-set of a directory bucket source object - * and don't set the x-amz-tagging value of the directory bucket destination - * object. This is because the default value of x-amz-tagging is the empty value. - * ``` - */ - tagging?: string - /** - * Specifies whether the object tag-set is copied from the source object or - * replaced with the tag-set that's provided in the request. - * - * The default value is COPY . - * - * Directory buckets - For directory buckets in a CopyObject operation, only the - * empty tag-set is supported. Any requests that attempt to write non-empty tags - * into directory buckets will receive a 501 Not Implemented status code. When the - * destination bucket is a directory bucket, you will receive a 501 Not Implemented - * response in any of the following situations: - * - * ``` - * - When you attempt to COPY the tag-set from an S3 source object that has - * non-empty tags. - * - * - When you attempt to REPLACE the tag-set of a source object and set a - * non-empty value to x-amz-tagging . - * - * - When you don't set the x-amz-tagging-directive header and the source object - * has non-empty tags. This is because the default value of - * x-amz-tagging-directive is COPY . - * ``` - * - * Because only the empty tag-set is supported for directory buckets in a - * CopyObject operation, the following situations are allowed: - * - * ``` - * - When you attempt to COPY the tag-set from a directory bucket source object - * that has no tags to a general purpose bucket. It copies an empty tag-set to the - * destination object. - * - * - When you attempt to REPLACE the tag-set of a directory bucket source object - * and set the x-amz-tagging value of the directory bucket destination object to - * empty. - * - * - When you attempt to REPLACE the tag-set of a general purpose bucket source - * object that has non-empty tags and set the x-amz-tagging value of the - * directory bucket destination object to empty. - * - * - When you attempt to REPLACE the tag-set of a directory bucket source object - * and don't set the x-amz-tagging value of the directory bucket destination - * object. This is because the default value of x-amz-tagging is the empty value. - * ``` - */ - taggingDirective: types.TaggingDirective - /** - * If the destination bucket is configured as a website, redirects requests for - * this object copy to another object in the same bucket or to an external URL. - * Amazon S3 stores the value of this header in the object metadata. This value is - * unique to each object and is not copied when using the x-amz-metadata-directive - * header. Instead, you may opt to provide this header in combination with the - * x-amz-metadata-directive header. - * - * This functionality is not supported for directory buckets. - */ - websiteRedirectLocation?: string - } - type _subWpKZz = noSmithyDocumentSerde - interface CopyObjectOutput extends _subWpKZz { - /** - * Indicates whether the copied object uses an S3 Bucket Key for server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * Container for all response elements. - */ - copyObjectResult?: types.CopyObjectResult - /** - * Version ID of the source object that was copied. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceVersionId?: string - /** - * If the object expiration is configured, the response includes this header. - * - * This functionality is not supported for directory buckets. - */ - expiration?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the Amazon Web Services KMS Encryption Context to use for - * object encryption. The value of this header is a base64-encoded UTF-8 string - * holding JSON with the encryption context key-value pairs. - */ - ssekmsEncryptionContext?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3 (for example, AES256 , aws:kms , aws:kms:dsse ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Version ID of the newly created copy. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subrFiLm = noSmithyDocumentSerde - interface CreateBucketInput extends _subrFiLm { - /** - * The name of the bucket to create. - * - * General purpose buckets - For information about bucket naming restrictions, see [Bucket naming rules] - * in the Amazon S3 User Guide. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [Bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html - * - * This member is required. - */ - bucket?: string - /** - * The canned ACL to apply to the bucket. - * - * This functionality is not supported for directory buckets. - */ - acl: types.BucketCannedACL - /** - * The configuration information for the bucket. - */ - createBucketConfiguration?: types.CreateBucketConfiguration - /** - * Allows grantee the read, write, read ACP, and write ACP permissions on the - * bucket. - * - * This functionality is not supported for directory buckets. - */ - grantFullControl?: string - /** - * Allows grantee to list the objects in the bucket. - * - * This functionality is not supported for directory buckets. - */ - grantRead?: string - /** - * Allows grantee to read the bucket ACL. - * - * This functionality is not supported for directory buckets. - */ - grantReadACP?: string - /** - * Allows grantee to create new objects in the bucket. - * - * For the bucket and object owners of existing objects, also allows deletions and - * overwrites of those objects. - * - * This functionality is not supported for directory buckets. - */ - grantWrite?: string - /** - * Allows grantee to write the ACL for the applicable bucket. - * - * This functionality is not supported for directory buckets. - */ - grantWriteACP?: string - /** - * Specifies whether you want S3 Object Lock to be enabled for the new bucket. - * - * This functionality is not supported for directory buckets. - */ - objectLockEnabledForBucket?: boolean - /** - * The container element for object ownership for a bucket's ownership controls. - * - * BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the - * bucket owner if the objects are uploaded with the bucket-owner-full-control - * canned ACL. - * - * ObjectWriter - The uploading account will own the object if the object is - * uploaded with the bucket-owner-full-control canned ACL. - * - * BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer - * affect permissions. The bucket owner automatically owns and has full control - * over every object in the bucket. The bucket only accepts PUT requests that don't - * specify an ACL or specify bucket owner full control ACLs (such as the predefined - * bucket-owner-full-control canned ACL or a custom ACL in XML format that grants - * the same permissions). - * - * By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are - * disabled. We recommend keeping ACLs disabled, except in uncommon use cases where - * you must control access for each object individually. For more information about - * S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. Directory buckets - * use the bucket owner enforced setting for S3 Object Ownership. - * - * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - */ - objectOwnership: types.ObjectOwnership - } - type _subMLVEG = noSmithyDocumentSerde - interface CreateBucketOutput extends _subMLVEG { - /** - * A forward slash followed by the name of the bucket. - */ - location?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subMkBpH = noSmithyDocumentSerde - interface CreateMultipartUploadInput extends _subMkBpH { - /** - * The name of the bucket where the multipart upload is initiated and where the - * object is uploaded. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which the multipart upload is to be initiated. - * - * This member is required. - */ - key?: string - /** - * The canned ACL to apply to the object. Amazon S3 supports a set of predefined - * ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees and - * permissions. For more information, see [Canned ACL]in the Amazon S3 User Guide. - * - * By default, all objects are private. Only the owner has full access control. - * When uploading an object, you can grant access permissions to individual Amazon - * Web Services accounts or to predefined groups defined by Amazon S3. These - * permissions are then added to the access control list (ACL) on the new object. - * For more information, see [Using ACLs]. One way to grant the permissions using the request - * headers is to specify a canned ACL with the x-amz-acl request header. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL - * [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html - */ - acl: types.ObjectCannedACL - /** - * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - * with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). - * - * General purpose buckets - Setting this header to true causes Amazon S3 to use - * an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this - * header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. - * - * Directory buckets - S3 Bucket Keys are always enabled for GET and PUT - * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't - * supported, when you copy SSE-KMS encrypted objects from general purpose buckets - * to directory buckets, from directory buckets to general purpose buckets, or - * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a - * call to KMS every time a copy request is made for a KMS-encrypted object. - * - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops - */ - bucketKeyEnabled?: boolean - /** - * Specifies caching behavior along the request/reply chain. - */ - cacheControl?: string - /** - * Indicates the algorithm that you want Amazon S3 to use to create the checksum - * for the object. For more information, see [Checking object integrity]in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * Specifies presentational information for the object. - */ - contentDisposition?: string - /** - * Specifies what content encodings have been applied to the object and thus what - * decoding mechanisms must be applied to obtain the media-type referenced by the - * Content-Type header field. - * - * For directory buckets, only the aws-chunked value is supported in this header - * field. - */ - contentEncoding?: string - /** - * The language that the content is in. - */ - contentLanguage?: string - /** - * A standard MIME type describing the format of the object data. - */ - contentType?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The date and time at which the object is no longer cacheable. - */ - expires?: time.Time - /** - * Specify access permissions explicitly to give the grantee READ, READ_ACP, and - * WRITE_ACP permissions on the object. - * - * By default, all objects are private. Only the owner has full access control. - * When uploading an object, you can use this header to explicitly grant access - * permissions to specific Amazon Web Services accounts or groups. This header maps - * to specific permissions that Amazon S3 supports in an ACL. For more information, - * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. - * - * You specify each grantee as a type=value pair, where the type is one of the - * following: - * - * ``` - * - id – if the value specified is the canonical user ID of an Amazon Web - * Services account - * - * - uri – if you are granting permissions to a predefined group - * - * - emailAddress – if the value specified is the email address of an Amazon Web - * Services account - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * ``` - * Amazon Web Services General Reference. - * ``` - * - * For example, the following x-amz-grant-read header grants the Amazon Web - * Services accounts identified by account IDs permissions to read object data and - * its metadata: - * - * ``` - * x-amz-grant-read: id="11112222333", id="444455556666" - * - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - */ - grantFullControl?: string - /** - * Specify access permissions explicitly to allow grantee to read the object data - * and its metadata. - * - * By default, all objects are private. Only the owner has full access control. - * When uploading an object, you can use this header to explicitly grant access - * permissions to specific Amazon Web Services accounts or groups. This header maps - * to specific permissions that Amazon S3 supports in an ACL. For more information, - * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. - * - * You specify each grantee as a type=value pair, where the type is one of the - * following: - * - * ``` - * - id – if the value specified is the canonical user ID of an Amazon Web - * Services account - * - * - uri – if you are granting permissions to a predefined group - * - * - emailAddress – if the value specified is the email address of an Amazon Web - * Services account - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * ``` - * Amazon Web Services General Reference. - * ``` - * - * For example, the following x-amz-grant-read header grants the Amazon Web - * Services accounts identified by account IDs permissions to read object data and - * its metadata: - * - * ``` - * x-amz-grant-read: id="11112222333", id="444455556666" - * - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - */ - grantRead?: string - /** - * Specify access permissions explicitly to allows grantee to read the object ACL. - * - * By default, all objects are private. Only the owner has full access control. - * When uploading an object, you can use this header to explicitly grant access - * permissions to specific Amazon Web Services accounts or groups. This header maps - * to specific permissions that Amazon S3 supports in an ACL. For more information, - * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. - * - * You specify each grantee as a type=value pair, where the type is one of the - * following: - * - * ``` - * - id – if the value specified is the canonical user ID of an Amazon Web - * Services account - * - * - uri – if you are granting permissions to a predefined group - * - * - emailAddress – if the value specified is the email address of an Amazon Web - * Services account - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * ``` - * Amazon Web Services General Reference. - * ``` - * - * For example, the following x-amz-grant-read header grants the Amazon Web - * Services accounts identified by account IDs permissions to read object data and - * its metadata: - * - * ``` - * x-amz-grant-read: id="11112222333", id="444455556666" - * - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - */ - grantReadACP?: string - /** - * Specify access permissions explicitly to allows grantee to allow grantee to - * write the ACL for the applicable object. - * - * By default, all objects are private. Only the owner has full access control. - * When uploading an object, you can use this header to explicitly grant access - * permissions to specific Amazon Web Services accounts or groups. This header maps - * to specific permissions that Amazon S3 supports in an ACL. For more information, - * see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. - * - * You specify each grantee as a type=value pair, where the type is one of the - * following: - * - * ``` - * - id – if the value specified is the canonical user ID of an Amazon Web - * Services account - * - * - uri – if you are granting permissions to a predefined group - * - * - emailAddress – if the value specified is the email address of an Amazon Web - * Services account - * ``` - * - * Using email addresses to specify a grantee is only supported in the following - * ``` - * Amazon Web Services Regions: - * - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the - * ``` - * Amazon Web Services General Reference. - * ``` - * - * For example, the following x-amz-grant-read header grants the Amazon Web - * Services accounts identified by account IDs permissions to read object data and - * its metadata: - * - * ``` - * x-amz-grant-read: id="11112222333", id="444455556666" - * - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - */ - grantWriteACP?: string - /** - * A map of metadata to store with the object in S3. - */ - metadata: _TygojaDict - /** - * Specifies whether you want to apply a legal hold to the uploaded object. - * - * This functionality is not supported for directory buckets. - */ - objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus - /** - * Specifies the Object Lock mode that you want to apply to the uploaded object. - * - * This functionality is not supported for directory buckets. - */ - objectLockMode: types.ObjectLockMode - /** - * Specifies the date and time when you want the Object Lock to expire. - * - * This functionality is not supported for directory buckets. - */ - objectLockRetainUntilDate?: time.Time - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256). - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded; Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the customer-provided encryption key - * according to RFC 1321. Amazon S3 uses this header for a message integrity check - * to ensure that the encryption key was transmitted without error. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * Specifies the Amazon Web Services KMS Encryption Context to use for object - * encryption. The value of this header is a Base64-encoded string of a UTF-8 - * encoded JSON, which contains the encryption context as key-value pairs. - * - * Directory buckets - You can optionally provide an explicit encryption context - * value. The value must match the default encryption context - the bucket Amazon - * Resource Name (ARN). An additional encryption context value is not supported. - */ - ssekmsEncryptionContext?: string - /** - * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object - * encryption. If the KMS key doesn't exist in the same account that's issuing the - * command, you must use the full Key ARN not the Key ID. - * - * General purpose buckets - If you specify x-amz-server-side-encryption with - * aws:kms or aws:kms:dsse , this header specifies the ID (Key ID, Key ARN, or Key - * Alias) of the KMS key to use. If you specify - * x-amz-server-side-encryption:aws:kms or - * x-amz-server-side-encryption:aws:kms:dsse , but do not provide - * x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web - * Services managed key ( aws/s3 ) to protect the data. - * - * Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , - * you must specify the x-amz-server-side-encryption-aws-kms-key-id header with - * the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key - * to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID - * or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS - * configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the - * bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3 (for example, AES256 , aws:kms ). - * - * ``` - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: server-side encryption with Amazon S3 - * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys - * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses - * the desired encryption configuration and you don't override the bucket default - * encryption in your CreateSession requests or PUT object requests. Then, new - * objects are automatically encrypted with the desired encryption settings. For - * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about - * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. - * ``` - * - * In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the - * ``` - * encryption request headers must match the encryption settings that are specified - * in the CreateSession request. You can't override the values of the encryption - * settings ( x-amz-server-side-encryption , - * x-amz-server-side-encryption-aws-kms-key-id , - * x-amz-server-side-encryption-context , and - * x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the - * CreateSession request. You don't need to explicitly specify these encryption - * settings values in Zonal endpoint API calls, and Amazon S3 will use the - * encryption settings values from the CreateSession request to protect new - * objects in the directory bucket. - * ``` - * - * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the - * ``` - * session token refreshes automatically to avoid service interruptions when a - * session expires. The CLI or the Amazon Web Services SDKs use the bucket's - * default encryption configuration for the CreateSession request. It's not - * supported to override the encryption settings values in the CreateSession - * request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption - * request headers must match the default encryption configuration of the directory - * bucket. - * ``` - * - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - */ - serverSideEncryption: types.ServerSideEncryption - /** - * By default, Amazon S3 uses the STANDARD Storage Class to store newly created - * objects. The STANDARD storage class provides high durability and high - * availability. Depending on performance needs, you can specify a different - * Storage Class. For more information, see [Storage Classes]in the Amazon S3 User Guide. - * - * ``` - * - For directory buckets, only the S3 Express One Zone storage class is - * supported to store newly created objects. - * - * - Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. - * ``` - * - * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html - */ - storageClass: types.StorageClass - /** - * The tag-set for the object. The tag-set must be encoded as URL Query parameters. - * - * This functionality is not supported for directory buckets. - */ - tagging?: string - /** - * If the bucket is configured as a website, redirects requests for this object to - * another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata. - * - * This functionality is not supported for directory buckets. - */ - websiteRedirectLocation?: string - } - type _subIspSp = noSmithyDocumentSerde - interface CreateMultipartUploadOutput extends _subIspSp { - /** - * If the bucket has a lifecycle rule configured with an action to abort - * incomplete multipart uploads and the prefix in the lifecycle rule matches the - * object name in the request, the response includes this header. The header - * indicates when the initiated multipart upload becomes eligible for an abort - * operation. For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. - * - * The response also includes the x-amz-abort-rule-id header that provides the ID - * of the lifecycle configuration rule that defines the abort action. - * - * This functionality is not supported for directory buckets. - * - * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config - */ - abortDate?: time.Time - /** - * This header is returned along with the x-amz-abort-date header. It identifies - * the applicable lifecycle configuration rule that defines the action to abort - * incomplete multipart uploads. - * - * This functionality is not supported for directory buckets. - */ - abortRuleId?: string - /** - * The name of the bucket to which the multipart upload was initiated. Does not - * return the access point ARN or access point alias if used. - * - * Access points are not supported by directory buckets. - */ - bucket?: string - /** - * Indicates whether the multipart upload uses an S3 Bucket Key for server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * The algorithm that was used to create a checksum of the object. - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * Object key for which the multipart upload was initiated. - */ - key?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the Amazon Web Services KMS Encryption Context to use for - * object encryption. The value of this header is a Base64-encoded string of a - * UTF-8 encoded JSON, which contains the encryption context as key-value pairs. - */ - ssekmsEncryptionContext?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3 (for example, AES256 , aws:kms ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * ID for the initiated multipart upload. - */ - uploadId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subsHwVy = noSmithyDocumentSerde - interface CreateSessionInput extends _subsHwVy { - /** - * The name of the bucket that you create a session for. - * - * This member is required. - */ - bucket?: string - /** - * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - * with server-side encryption using KMS keys (SSE-KMS). - * - * S3 Bucket Keys are always enabled for GET and PUT operations in a directory - * bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy - * SSE-KMS encrypted objects from general purpose buckets to directory buckets, - * from directory buckets to general purpose buckets, or between directory buckets, - * through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a call to KMS every time a - * copy request is made for a KMS-encrypted object. - * - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops - */ - bucketKeyEnabled?: boolean - /** - * Specifies the Amazon Web Services KMS Encryption Context as an additional - * encryption context to use for object encryption. The value of this header is a - * Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption - * context as key-value pairs. This value is stored as object metadata and - * automatically gets passed on to Amazon Web Services KMS for future GetObject - * operations on this object. - * - * General purpose buckets - This value must be explicitly added during CopyObject - * operations if you want an additional encryption context for your object. For - * more information, see [Encryption context]in the Amazon S3 User Guide. - * - * Directory buckets - You can optionally provide an explicit encryption context - * value. The value must match the default encryption context - the bucket Amazon - * Resource Name (ARN). An additional encryption context value is not supported. - * - * [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context - */ - ssekmsEncryptionContext?: string - /** - * If you specify x-amz-server-side-encryption with aws:kms , you must specify the - * x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key - * ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you - * get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key - * alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist - * in the same account that't issuing the command, you must use the full Key ARN - * not the Key ID. - * - * Your SSE-KMS configuration can only support 1 [customer managed key] per directory bucket for the - * lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm to use when you store objects in the - * directory bucket. - * - * For directory buckets, there are only two supported options for server-side - * encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( AES256 - * ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). By default, - * Amazon S3 encrypts data with SSE-S3. For more information, see [Protecting data with server-side encryption]in the Amazon S3 - * User Guide. - * - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Specifies the mode of the session that will be created, either ReadWrite or - * ReadOnly . By default, a ReadWrite session is created. A ReadWrite session is - * capable of executing all the Zonal endpoint API operations on a directory - * bucket. A ReadOnly session is constrained to execute the following Zonal - * endpoint API operations: GetObject , HeadObject , ListObjectsV2 , - * GetObjectAttributes , ListParts , and ListMultipartUploads . - */ - sessionMode: types.SessionMode - } - type _subZmyqj = noSmithyDocumentSerde - interface CreateSessionOutput extends _subZmyqj { - /** - * The established temporary security credentials for the created session. - * - * This member is required. - */ - credentials?: types.SessionCredentials - /** - * Indicates whether to use an S3 Bucket Key for server-side encryption with KMS - * keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * If present, indicates the Amazon Web Services KMS Encryption Context to use for - * object encryption. The value of this header is a Base64-encoded string of a - * UTF-8 encoded JSON, which contains the encryption context as key-value pairs. - * This value is stored as object metadata and automatically gets passed on to - * Amazon Web Services KMS for future GetObject operations on this object. - */ - ssekmsEncryptionContext?: string - /** - * If you specify x-amz-server-side-encryption with aws:kms , this header indicates - * the ID of the KMS symmetric encryption customer managed key that was used for - * object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store objects in the - * directory bucket. - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subMzCGg = noSmithyDocumentSerde - interface DeleteBucketInput extends _subMzCGg { - /** - * Specifies the bucket being deleted. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _subhCCMG = noSmithyDocumentSerde - interface DeleteBucketOutput extends _subhCCMG { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subrMhZl = noSmithyDocumentSerde - interface DeleteBucketAnalyticsConfigurationInput extends _subrMhZl { - /** - * The name of the bucket from which an analytics configuration is deleted. - * - * This member is required. - */ - bucket?: string - /** - * The ID that identifies the analytics configuration. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subLRBxi = noSmithyDocumentSerde - interface DeleteBucketAnalyticsConfigurationOutput extends _subLRBxi { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subMlAuW = noSmithyDocumentSerde - interface DeleteBucketCorsInput extends _subMlAuW { - /** - * Specifies the bucket whose cors configuration is being deleted. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subOiuSW = noSmithyDocumentSerde - interface DeleteBucketCorsOutput extends _subOiuSW { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subZwZga = noSmithyDocumentSerde - interface DeleteBucketEncryptionInput extends _subZwZga { - /** - * The name of the bucket containing the server-side encryption configuration to - * delete. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _subObZOa = noSmithyDocumentSerde - interface DeleteBucketEncryptionOutput extends _subObZOa { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subZcJsr = noSmithyDocumentSerde - interface DeleteBucketIntelligentTieringConfigurationInput extends _subZcJsr { - /** - * The name of the Amazon S3 bucket whose configuration you want to modify or - * retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the S3 Intelligent-Tiering configuration. - * - * This member is required. - */ - id?: string - } - type _subxQKpF = noSmithyDocumentSerde - interface DeleteBucketIntelligentTieringConfigurationOutput extends _subxQKpF { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subpDwgQ = noSmithyDocumentSerde - interface DeleteBucketInventoryConfigurationInput extends _subpDwgQ { - /** - * The name of the bucket containing the inventory configuration to delete. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the inventory configuration. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subKYyoo = noSmithyDocumentSerde - interface DeleteBucketInventoryConfigurationOutput extends _subKYyoo { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _suboMivD = noSmithyDocumentSerde - interface DeleteBucketLifecycleInput extends _suboMivD { - /** - * The bucket name of the lifecycle to delete. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subOAFze = noSmithyDocumentSerde - interface DeleteBucketLifecycleOutput extends _subOAFze { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _submHPbK = noSmithyDocumentSerde - interface DeleteBucketMetricsConfigurationInput extends _submHPbK { - /** - * The name of the bucket containing the metrics configuration to delete. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the metrics configuration. The ID has a 64 character - * limit and can only contain letters, numbers, periods, dashes, and underscores. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subrBtWw = noSmithyDocumentSerde - interface DeleteBucketMetricsConfigurationOutput extends _subrBtWw { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subQLiKn = noSmithyDocumentSerde - interface DeleteBucketOwnershipControlsInput extends _subQLiKn { - /** - * The Amazon S3 bucket whose OwnershipControls you want to delete. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subarfSr = noSmithyDocumentSerde - interface DeleteBucketOwnershipControlsOutput extends _subarfSr { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subSdVFp = noSmithyDocumentSerde - interface DeleteBucketPolicyInput extends _subSdVFp { - /** - * The bucket name. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _subQIzev = noSmithyDocumentSerde - interface DeleteBucketPolicyOutput extends _subQIzev { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subbHFLQ = noSmithyDocumentSerde - interface DeleteBucketReplicationInput extends _subbHFLQ { - /** - * The bucket name. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subDVhHx = noSmithyDocumentSerde - interface DeleteBucketReplicationOutput extends _subDVhHx { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subeSpxr = noSmithyDocumentSerde - interface DeleteBucketTaggingInput extends _subeSpxr { - /** - * The bucket that has the tag set to be removed. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subdiYxH = noSmithyDocumentSerde - interface DeleteBucketTaggingOutput extends _subdiYxH { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subPaZot = noSmithyDocumentSerde - interface DeleteBucketWebsiteInput extends _subPaZot { - /** - * The bucket name for which you want to remove the website configuration. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subUVfOt = noSmithyDocumentSerde - interface DeleteBucketWebsiteOutput extends _subUVfOt { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subIJNwZ = noSmithyDocumentSerde - interface DeleteObjectInput extends _subIJNwZ { - /** - * The bucket name of the bucket containing the object. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Key name of the object to delete. - * - * This member is required. - */ - key?: string - /** - * Indicates whether S3 Object Lock should bypass Governance-mode restrictions to - * process this operation. To use this header, you must have the - * s3:BypassGovernanceRetention permission. - * - * This functionality is not supported for directory buckets. - */ - bypassGovernanceRetention?: boolean - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The concatenation of the authentication device's serial number, a space, and - * the value that is displayed on your authentication device. Required to - * permanently delete a versioned object if versioning is configured with MFA - * delete enabled. - * - * This functionality is not supported for directory buckets. - */ - mfa?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Version ID used to reference a specific version of the object. - * - * For directory buckets in this API operation, only the null value of the version - * ID is supported. - */ - versionId?: string - } - type _subfOOIN = noSmithyDocumentSerde - interface DeleteObjectOutput extends _subfOOIN { - /** - * Indicates whether the specified object version that was permanently deleted was - * (true) or was not (false) a delete marker before deletion. In a simple DELETE, - * this header indicates whether (true) or not (false) the current version of the - * object is a delete marker. - * - * This functionality is not supported for directory buckets. - */ - deleteMarker?: boolean - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Returns the version ID of the delete marker created as a result of the DELETE - * operation. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subAuQXB = noSmithyDocumentSerde - interface DeleteObjectTaggingInput extends _subAuQXB { - /** - * The bucket name containing the objects from which to remove the tags. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The key that identifies the object in the bucket from which to remove all tags. - * - * This member is required. - */ - key?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The versionId of the object that the tag-set will be removed from. - */ - versionId?: string - } - type _subZcXxD = noSmithyDocumentSerde - interface DeleteObjectTaggingOutput extends _subZcXxD { - /** - * The versionId of the object the tag-set was removed from. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subFyijG = noSmithyDocumentSerde - interface DeleteObjectsInput extends _subFyijG { - /** - * The bucket name containing the objects to delete. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Container for the request. - * - * This member is required. - */ - delete?: types.Delete - /** - * Specifies whether you want to delete this object even if it has a - * Governance-type Object Lock in place. To use this header, you must have the - * s3:BypassGovernanceRetention permission. - * - * This functionality is not supported for directory buckets. - */ - bypassGovernanceRetention?: boolean - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 - * fails the request with the HTTP status code 400 Bad Request . - * - * For the x-amz-checksum-algorithm header, replace algorithm with the - * supported algorithm from the following list: - * - * ``` - * - CRC32 - * - * - CRC32C - * - * - SHA1 - * - * - SHA256 - * ``` - * - * For more information, see [Checking object integrity] in the Amazon S3 User Guide. - * - * If the individual checksum value you provide through x-amz-checksum-algorithm - * doesn't match the checksum algorithm you set through - * x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm - * parameter and uses the checksum algorithm that matches the provided value in - * x-amz-checksum-algorithm . - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The concatenation of the authentication device's serial number, a space, and - * the value that is displayed on your authentication device. Required to - * permanently delete a versioned object if versioning is configured with MFA - * delete enabled. - * - * When performing the DeleteObjects operation on an MFA delete enabled bucket, - * which attempts to delete the specified versioned objects, you must include an - * MFA token. If you don't provide an MFA token, the entire request will fail, even - * if there are non-versioned objects that you are trying to delete. If you provide - * an invalid token, whether there are versioned object keys in the request or not, - * the entire Multi-Object Delete request will fail. For information about MFA - * Delete, see [MFA Delete]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete - */ - mfa?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - } - type _subkBpHA = noSmithyDocumentSerde - interface DeleteObjectsOutput extends _subkBpHA { - /** - * Container element for a successful delete. It identifies the object that was - * successfully deleted. - */ - deleted: Array - /** - * Container for a failed delete action that describes the object that Amazon S3 - * attempted to delete and the error it encountered. - */ - errors: Array - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subRaypk = noSmithyDocumentSerde - interface DeletePublicAccessBlockInput extends _subRaypk { - /** - * The Amazon S3 bucket whose PublicAccessBlock configuration you want to delete. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subYJcGi = noSmithyDocumentSerde - interface DeletePublicAccessBlockOutput extends _subYJcGi { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subpwmKr = noSmithyDocumentSerde - interface GetBucketAccelerateConfigurationInput extends _subpwmKr { - /** - * The name of the bucket for which the accelerate configuration is retrieved. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - } - type _subTsvha = noSmithyDocumentSerde - interface GetBucketAccelerateConfigurationOutput extends _subTsvha { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * The accelerate configuration of the bucket. - */ - status: types.BucketAccelerateStatus - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subqWjbv = noSmithyDocumentSerde - interface GetBucketAclInput extends _subqWjbv { - /** - * Specifies the S3 bucket whose ACL is being requested. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subuvftD = noSmithyDocumentSerde - interface GetBucketAclOutput extends _subuvftD { - /** - * A list of grants. - */ - grants: Array - /** - * Container for the bucket owner's display name and ID. - */ - owner?: types.Owner - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subCGWlj = noSmithyDocumentSerde - interface GetBucketAnalyticsConfigurationInput extends _subCGWlj { - /** - * The name of the bucket from which an analytics configuration is retrieved. - * - * This member is required. - */ - bucket?: string - /** - * The ID that identifies the analytics configuration. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subOLpbm = noSmithyDocumentSerde - interface GetBucketAnalyticsConfigurationOutput extends _subOLpbm { - /** - * The configuration and any analyses for the analytics filter. - */ - analyticsConfiguration?: types.AnalyticsConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subsnxdu = noSmithyDocumentSerde - interface GetBucketCorsInput extends _subsnxdu { - /** - * The bucket name for which to get the cors configuration. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subpeDCa = noSmithyDocumentSerde - interface GetBucketCorsOutput extends _subpeDCa { - /** - * A set of origins and methods (cross-origin access that you want to allow). You - * can add up to 100 rules to the configuration. - */ - corsRules: Array - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subHQfZu = noSmithyDocumentSerde - interface GetBucketEncryptionInput extends _subHQfZu { - /** - * The name of the bucket from which the server-side encryption configuration is - * retrieved. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _subcUJIz = noSmithyDocumentSerde - interface GetBucketEncryptionOutput extends _subcUJIz { - /** - * Specifies the default server-side-encryption configuration. - */ - serverSideEncryptionConfiguration?: types.ServerSideEncryptionConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subhJfTf = noSmithyDocumentSerde - interface GetBucketIntelligentTieringConfigurationInput extends _subhJfTf { - /** - * The name of the Amazon S3 bucket whose configuration you want to modify or - * retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the S3 Intelligent-Tiering configuration. - * - * This member is required. - */ - id?: string - } - type _subqAeZc = noSmithyDocumentSerde - interface GetBucketIntelligentTieringConfigurationOutput extends _subqAeZc { - /** - * Container for S3 Intelligent-Tiering configuration. - */ - intelligentTieringConfiguration?: types.IntelligentTieringConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subkwWWN = noSmithyDocumentSerde - interface GetBucketInventoryConfigurationInput extends _subkwWWN { - /** - * The name of the bucket containing the inventory configuration to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the inventory configuration. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subWHLLo = noSmithyDocumentSerde - interface GetBucketInventoryConfigurationOutput extends _subWHLLo { - /** - * Specifies the inventory configuration. - */ - inventoryConfiguration?: types.InventoryConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subnArOC = noSmithyDocumentSerde - interface GetBucketLifecycleConfigurationInput extends _subnArOC { - /** - * The name of the bucket for which to get the lifecycle information. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subXUZyS = noSmithyDocumentSerde - interface GetBucketLifecycleConfigurationOutput extends _subXUZyS { - /** - * Container for a lifecycle rule. - */ - rules: Array - /** - * Indicates which default minimum object size behavior is applied to the - * lifecycle configuration. - * - * ``` - * - all_storage_classes_128K - Objects smaller than 128 KB will not transition - * to any storage class by default. - * - * - varies_by_storage_class - Objects smaller than 128 KB will transition to - * Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, - * all other storage classes will prevent transitions smaller than 128 KB. - * ``` - * - * To customize the minimum object size for any transition you can add a filter - * that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body - * of your transition rule. Custom filters always take precedence over the default - * transition behavior. - */ - transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import smithyio = io - type _subAUxmS = noSmithyDocumentSerde - interface GetBucketLocationInput extends _subAUxmS { - /** - * The name of the bucket for which to get the location. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subJGlUu = noSmithyDocumentSerde - interface GetBucketLocationOutput extends _subJGlUu { - /** - * Specifies the Region where the bucket resides. For a list of all the Amazon S3 - * supported location constraints by Region, see [Regions and Endpoints]. Buckets in Region us-east-1 - * have a LocationConstraint of null . - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - */ - locationConstraint: types.BucketLocationConstraint - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subtfoeZ = noSmithyDocumentSerde - interface GetBucketLoggingInput extends _subtfoeZ { - /** - * The bucket name for which to get the logging information. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subbusuo = noSmithyDocumentSerde - interface GetBucketLoggingOutput extends _subbusuo { - /** - * Describes where logs are stored and the prefix that Amazon S3 assigns to all - * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API - * Reference. - * - * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html - */ - loggingEnabled?: types.LoggingEnabled - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subdtlCW = noSmithyDocumentSerde - interface GetBucketMetricsConfigurationInput extends _subdtlCW { - /** - * The name of the bucket containing the metrics configuration to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the metrics configuration. The ID has a 64 character - * limit and can only contain letters, numbers, periods, dashes, and underscores. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subDLNIq = noSmithyDocumentSerde - interface GetBucketMetricsConfigurationOutput extends _subDLNIq { - /** - * Specifies the metrics configuration. - */ - metricsConfiguration?: types.MetricsConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subIuYNe = noSmithyDocumentSerde - interface GetBucketNotificationConfigurationInput extends _subIuYNe { - /** - * The name of the bucket for which to get the notification configuration. - * - * When you use this API operation with an access point, provide the alias of the - * access point in place of the bucket name. - * - * When you use this API operation with an Object Lambda access point, provide the - * alias of the Object Lambda access point in place of the bucket name. If the - * Object Lambda access point alias in a request is not valid, the error code - * InvalidAccessPointAliasError is returned. For more information about - * InvalidAccessPointAliasError , see [List of Error Codes]. - * - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - /** - * A container for specifying the notification configuration of the bucket. If - * this element is empty, notifications are turned off for the bucket. - */ - type _subBVyDh = noSmithyDocumentSerde - interface GetBucketNotificationConfigurationOutput extends _subBVyDh { - /** - * Enables delivery of events to Amazon EventBridge. - */ - eventBridgeConfiguration?: types.EventBridgeConfiguration - /** - * Describes the Lambda functions to invoke and the events for which to invoke - * them. - */ - lambdaFunctionConfigurations: Array - /** - * The Amazon Simple Queue Service queues to publish messages to and the events - * for which to publish messages. - */ - queueConfigurations: Array - /** - * The topic to which notifications are sent and the events for which - * notifications are generated. - */ - topicConfigurations: Array - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subpwbTf = noSmithyDocumentSerde - interface GetBucketOwnershipControlsInput extends _subpwbTf { - /** - * The name of the Amazon S3 bucket whose OwnershipControls you want to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subFQhUc = noSmithyDocumentSerde - interface GetBucketOwnershipControlsOutput extends _subFQhUc { - /** - * The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or - * ObjectWriter) currently in effect for this Amazon S3 bucket. - */ - ownershipControls?: types.OwnershipControls - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subYRXXj = noSmithyDocumentSerde - interface GetBucketPolicyInput extends _subYRXXj { - /** - * The bucket name to get the bucket policy for. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * Access points - When you use this API operation with an access point, provide - * the alias of the access point in place of the bucket name. - * - * Object Lambda access points - When you use this API operation with an Object - * Lambda access point, provide the alias of the Object Lambda access point in - * place of the bucket name. If the Object Lambda access point alias in a request - * is not valid, the error code InvalidAccessPointAliasError is returned. For more - * information about InvalidAccessPointAliasError , see [List of Error Codes]. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _subkZmkL = noSmithyDocumentSerde - interface GetBucketPolicyOutput extends _subkZmkL { - /** - * The bucket policy as a JSON document. - */ - policy?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subOvbfe = noSmithyDocumentSerde - interface GetBucketPolicyStatusInput extends _subOvbfe { - /** - * The name of the Amazon S3 bucket whose policy status you want to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subcEEzY = noSmithyDocumentSerde - interface GetBucketPolicyStatusOutput extends _subcEEzY { - /** - * The policy status for the specified bucket. - */ - policyStatus?: types.PolicyStatus - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subfJyle = noSmithyDocumentSerde - interface GetBucketReplicationInput extends _subfJyle { - /** - * The bucket name for which to get the replication information. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subemVJG = noSmithyDocumentSerde - interface GetBucketReplicationOutput extends _subemVJG { - /** - * A container for replication rules. You can add up to 1,000 rules. The maximum - * size of a replication configuration is 2 MB. - */ - replicationConfiguration?: types.ReplicationConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subPHmQJ = noSmithyDocumentSerde - interface GetBucketRequestPaymentInput extends _subPHmQJ { - /** - * The name of the bucket for which to get the payment request configuration - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subobmEb = noSmithyDocumentSerde - interface GetBucketRequestPaymentOutput extends _subobmEb { - /** - * Specifies who pays for the download and request fees. - */ - payer: types.Payer - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subbPTIW = noSmithyDocumentSerde - interface GetBucketTaggingInput extends _subbPTIW { - /** - * The name of the bucket for which to get the tagging information. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subRiRIO = noSmithyDocumentSerde - interface GetBucketTaggingOutput extends _subRiRIO { - /** - * Contains the tag set. - * - * This member is required. - */ - tagSet: Array - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subjaJnG = noSmithyDocumentSerde - interface GetBucketVersioningInput extends _subjaJnG { - /** - * The name of the bucket for which to get the versioning information. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subJFesj = noSmithyDocumentSerde - interface GetBucketVersioningOutput extends _subJFesj { - /** - * Specifies whether MFA delete is enabled in the bucket versioning configuration. - * This element is only returned if the bucket has been configured with MFA delete. - * If the bucket has never been so configured, this element is not returned. - */ - mfaDelete: types.MFADeleteStatus - /** - * The versioning state of the bucket. - */ - status: types.BucketVersioningStatus - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subirskq = noSmithyDocumentSerde - interface GetBucketWebsiteInput extends _subirskq { - /** - * The bucket name for which to get the website configuration. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subiABkf = noSmithyDocumentSerde - interface GetBucketWebsiteOutput extends _subiABkf { - /** - * The object key name of the website error document to use for 4XX class errors. - */ - errorDocument?: types.ErrorDocument - /** - * The name of the index document for the website (for example index.html ). - */ - indexDocument?: types.IndexDocument - /** - * Specifies the redirect behavior of all requests to a website endpoint of an - * Amazon S3 bucket. - */ - redirectAllRequestsTo?: types.RedirectAllRequestsTo - /** - * Rules that define when a redirect is applied and the redirect behavior. - */ - routingRules: Array - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subyxkEG = noSmithyDocumentSerde - interface GetObjectInput extends _subyxkEG { - /** - * The bucket name containing the object. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Object Lambda access points - When you use this action with an Object Lambda - * access point, you must direct requests to the Object Lambda access point - * hostname. The Object Lambda access point hostname takes the form - * AccessPointName-AccountId.s3-object-lambda.Region.amazonaws.com. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Key of the object to get. - * - * This member is required. - */ - key?: string - /** - * To retrieve the checksum, this mode must be enabled. - * - * General purpose buckets - In addition, if you enable checksum mode and the - * object is uploaded with a [checksum]and encrypted with an Key Management Service (KMS) - * key, you must have permission to use the kms:Decrypt action to retrieve the - * checksum. - * - * [checksum]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html - */ - checksumMode: types.ChecksumMode - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Return the object only if its entity tag (ETag) is the same as the one - * specified in this header; otherwise, return a 412 Precondition Failed error. - * - * If both of the If-Match and If-Unmodified-Since headers are present in the - * request as follows: If-Match condition evaluates to true , and; - * If-Unmodified-Since condition evaluates to false ; then, S3 returns 200 OK and - * the data requested. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifMatch?: string - /** - * Return the object only if it has been modified since the specified time; - * otherwise, return a 304 Not Modified error. - * - * If both of the If-None-Match and If-Modified-Since headers are present in the - * request as follows: If-None-Match condition evaluates to false , and; - * If-Modified-Since condition evaluates to true ; then, S3 returns 304 Not - * Modified status code. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifModifiedSince?: time.Time - /** - * Return the object only if its entity tag (ETag) is different from the one - * specified in this header; otherwise, return a 304 Not Modified error. - * - * If both of the If-None-Match and If-Modified-Since headers are present in the - * request as follows: If-None-Match condition evaluates to false , and; - * If-Modified-Since condition evaluates to true ; then, S3 returns 304 Not - * Modified HTTP status code. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifNoneMatch?: string - /** - * Return the object only if it has not been modified since the specified time; - * otherwise, return a 412 Precondition Failed error. - * - * If both of the If-Match and If-Unmodified-Since headers are present in the - * request as follows: If-Match condition evaluates to true , and; - * If-Unmodified-Since condition evaluates to false ; then, S3 returns 200 OK and - * the data requested. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifUnmodifiedSince?: time.Time - /** - * Part number of the object being read. This is a positive integer between 1 and - * 10,000. Effectively performs a 'ranged' GET request for the part specified. - * Useful for downloading just a part of an object. - */ - partNumber?: number - /** - * Downloads the specified byte range of an object. For more information about the - * HTTP Range header, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-range]. - * - * Amazon S3 doesn't support retrieving multiple ranges of data per GET request. - * - * [https://www.rfc-editor.org/rfc/rfc9110.html#name-range]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range - */ - range?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Sets the Cache-Control header of the response. - */ - responseCacheControl?: string - /** - * Sets the Content-Disposition header of the response. - */ - responseContentDisposition?: string - /** - * Sets the Content-Encoding header of the response. - */ - responseContentEncoding?: string - /** - * Sets the Content-Language header of the response. - */ - responseContentLanguage?: string - /** - * Sets the Content-Type header of the response. - */ - responseContentType?: string - /** - * Sets the Expires header of the response. - */ - responseExpires?: time.Time - /** - * Specifies the algorithm to use when decrypting the object (for example, AES256 ). - * - * If you encrypt an object by using server-side encryption with customer-provided - * encryption keys (SSE-C) when you store the object in Amazon S3, then when you - * GET the object, you must use the following headers: - * - * ``` - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key that you originally provided for - * Amazon S3 to encrypt the data before storing it. This value is used to decrypt - * the object when recovering it and must match the one used when storing the data. - * The key must be appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. - * - * If you encrypt an object by using server-side encryption with customer-provided - * encryption keys (SSE-C) when you store the object in Amazon S3, then when you - * GET the object, you must use the following headers: - * - * ``` - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the customer-provided encryption key - * according to RFC 1321. Amazon S3 uses this header for a message integrity check - * to ensure that the encryption key was transmitted without error. - * - * If you encrypt an object by using server-side encryption with customer-provided - * encryption keys (SSE-C) when you store the object in Amazon S3, then when you - * GET the object, you must use the following headers: - * - * ``` - * - x-amz-server-side-encryption-customer-algorithm - * - * - x-amz-server-side-encryption-customer-key - * - * - x-amz-server-side-encryption-customer-key-MD5 - * ``` - * - * For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKeyMD5?: string - /** - * Version ID used to reference a specific version of the object. - * - * By default, the GetObject operation returns the current version of an object. - * To return a different version, use the versionId subresource. - * - * ``` - * - If you include a versionId in your request header, you must have the - * s3:GetObjectVersion permission to access a specific version of an object. The - * s3:GetObject permission is not required in this scenario. - * - * - If you request the current version of an object without a specific versionId - * in the request header, only the s3:GetObject permission is required. The - * s3:GetObjectVersion permission is not required in this scenario. - * - * - Directory buckets - S3 Versioning isn't enabled and supported for directory - * buckets. For this API operation, only the null value of the version ID is - * supported by directory buckets. You can only specify null to the versionId - * query parameter in the request. - * ``` - * - * For more information about versioning, see [PutBucketVersioning]. - * - * [PutBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html - */ - versionId?: string - } - type _subpBNvB = noSmithyDocumentSerde - interface GetObjectOutput extends _subpBNvB { - /** - * Indicates that a range of bytes was specified in the request. - */ - acceptRanges?: string - /** - * Object data. - */ - body: io.ReadCloser - /** - * Indicates whether the object uses an S3 Bucket Key for server-side encryption - * with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * Specifies caching behavior along the request/reply chain. - */ - cacheControl?: string - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Specifies presentational information for the object. - */ - contentDisposition?: string - /** - * Indicates what content encodings have been applied to the object and thus what - * decoding mechanisms must be applied to obtain the media-type referenced by the - * Content-Type header field. - */ - contentEncoding?: string - /** - * The language the content is in. - */ - contentLanguage?: string - /** - * Size of the body in bytes. - */ - contentLength?: number - /** - * The portion of the object returned in the response. - */ - contentRange?: string - /** - * A standard MIME type describing the format of the object data. - */ - contentType?: string - /** - * Indicates whether the object retrieved was (true) or was not (false) a Delete - * Marker. If false, this response header does not appear in the response. - * - * ``` - * - If the current version of the object is a delete marker, Amazon S3 behaves - * as if the object was deleted and includes x-amz-delete-marker: true in the - * response. - * - * - If the specified version in the request is a delete marker, the response - * returns a 405 Method Not Allowed error and the Last-Modified: timestamp - * response header. - * ``` - */ - deleteMarker?: boolean - /** - * An entity tag (ETag) is an opaque identifier assigned by a web server to a - * specific version of a resource found at a URL. - */ - eTag?: string - /** - * If the object expiration is configured (see [PutBucketLifecycleConfiguration]PutBucketLifecycleConfiguration ), - * the response includes this header. It includes the expiry-date and rule-id - * key-value pairs providing object expiration information. The value of the - * rule-id is URL-encoded. - * - * This functionality is not supported for directory buckets. - * - * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html - */ - expiration?: string - /** - * The date and time at which the object is no longer cacheable. - * - * Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using - * the ExpiresString field which contains the unparsed value from the service - * response. - */ - expires?: time.Time - /** - * The unparsed value of the Expires field from the service response. Prefer use - * of this value over the normal Expires response field where possible. - */ - expiresString?: string - /** - * Date and time when the object was last modified. - * - * General purpose buckets - When you specify a versionId of the object in your - * request, if the specified version in the request is a delete marker, the - * response returns a 405 Method Not Allowed error and the Last-Modified: timestamp - * response header. - */ - lastModified?: time.Time - /** - * A map of metadata to store with the object in S3. - * - * Map keys will be normalized to lower-case. - */ - metadata: _TygojaDict - /** - * This is set to the number of metadata entries not returned in the headers that - * are prefixed with x-amz-meta- . This can happen if you create metadata using an - * API like SOAP that supports more flexible metadata than the REST API. For - * example, using SOAP, you can create metadata whose values are not legal HTTP - * headers. - * - * This functionality is not supported for directory buckets. - */ - missingMeta?: number - /** - * Indicates whether this object has an active legal hold. This field is only - * returned if you have permission to view an object's legal hold status. - * - * This functionality is not supported for directory buckets. - */ - objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus - /** - * The Object Lock mode that's currently in place for this object. - * - * This functionality is not supported for directory buckets. - */ - objectLockMode: types.ObjectLockMode - /** - * The date and time when this object's Object Lock will expire. - * - * This functionality is not supported for directory buckets. - */ - objectLockRetainUntilDate?: time.Time - /** - * The count of parts this object has. This value is only returned if you specify - * partNumber in your request and the object was uploaded as a multipart upload. - */ - partsCount?: number - /** - * Amazon S3 can return this if your request involves a bucket that is either a - * source or destination in a replication rule. - * - * This functionality is not supported for directory buckets. - */ - replicationStatus: types.ReplicationStatus - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Provides information about object restoration action and expiration time of the - * restored object copy. - * - * This functionality is not supported for directory buckets. Only the S3 Express - * One Zone storage class is supported by directory buckets to store objects. - */ - restore?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3. - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Provides storage class information of the object. Amazon S3 returns this header - * for all objects except for S3 Standard storage class objects. - * - * Directory buckets - Only the S3 Express One Zone storage class is supported by - * directory buckets to store objects. - */ - storageClass: types.StorageClass - /** - * The number of tags, if any, on the object, when you have the relevant - * permission to read object tags. - * - * You can use [GetObjectTagging] to retrieve the tag set associated with an object. - * - * This functionality is not supported for directory buckets. - * - * [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html - */ - tagCount?: number - /** - * Version ID of the object. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - /** - * If the bucket is configured as a website, redirects requests for this object to - * another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata. - * - * This functionality is not supported for directory buckets. - */ - websiteRedirectLocation?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subEUnnZ = noSmithyDocumentSerde - interface GetObjectAclInput extends _subEUnnZ { - /** - * The bucket name that contains the object for which to get the ACL information. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The key of the object for which to get the ACL information. - * - * This member is required. - */ - key?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Version ID used to reference a specific version of the object. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - } - type _subagcvo = noSmithyDocumentSerde - interface GetObjectAclOutput extends _subagcvo { - /** - * A list of grants. - */ - grants: Array - /** - * Container for the bucket owner's display name and ID. - */ - owner?: types.Owner - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subSSgpw = noSmithyDocumentSerde - interface GetObjectAttributesInput extends _subSSgpw { - /** - * The name of the bucket that contains the object. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The object key. - * - * This member is required. - */ - key?: string - /** - * Specifies the fields at the root level that you want returned in the response. - * Fields that you do not specify are not returned. - * - * This member is required. - */ - objectAttributes: Array - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Sets the maximum number of parts to return. - */ - maxParts?: number - /** - * Specifies the part after which listing should begin. Only parts with higher - * part numbers will be listed. - */ - partNumberMarker?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256). - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded; Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * The version ID used to reference a specific version of the object. - * - * S3 Versioning isn't enabled and supported for directory buckets. For this API - * operation, only the null value of the version ID is supported by directory - * buckets. You can only specify null to the versionId query parameter in the - * request. - */ - versionId?: string - } - type _subYfQeA = noSmithyDocumentSerde - interface GetObjectAttributesOutput extends _subYfQeA { - /** - * The checksum or digest of the object. - */ - checksum?: types.Checksum - /** - * Specifies whether the object retrieved was ( true ) or was not ( false ) a - * delete marker. If false , this response header does not appear in the response. - * - * This functionality is not supported for directory buckets. - */ - deleteMarker?: boolean - /** - * An ETag is an opaque identifier assigned by a web server to a specific version - * of a resource found at a URL. - */ - eTag?: string - /** - * The creation date of the object. - */ - lastModified?: time.Time - /** - * A collection of parts associated with a multipart upload. - */ - objectParts?: types.GetObjectAttributesParts - /** - * The size of the object in bytes. - */ - objectSize?: number - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Provides the storage class information of the object. Amazon S3 returns this - * header for all objects except for S3 Standard storage class objects. - * - * For more information, see [Storage Classes]. - * - * Directory buckets - Only the S3 Express One Zone storage class is supported by - * directory buckets to store objects. - * - * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html - */ - storageClass: types.StorageClass - /** - * The version ID of the object. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subCrIAi = noSmithyDocumentSerde - interface GetObjectLegalHoldInput extends _subCrIAi { - /** - * The bucket name containing the object whose legal hold status you want to - * retrieve. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The key name for the object whose legal hold status you want to retrieve. - * - * This member is required. - */ - key?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The version ID of the object whose legal hold status you want to retrieve. - */ - versionId?: string - } - type _subgtndl = noSmithyDocumentSerde - interface GetObjectLegalHoldOutput extends _subgtndl { - /** - * The current legal hold status for the specified object. - */ - legalHold?: types.ObjectLockLegalHold - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subwElMD = noSmithyDocumentSerde - interface GetObjectLockConfigurationInput extends _subwElMD { - /** - * The bucket whose Object Lock configuration you want to retrieve. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subrkmid = noSmithyDocumentSerde - interface GetObjectLockConfigurationOutput extends _subrkmid { - /** - * The specified bucket's Object Lock configuration. - */ - objectLockConfiguration?: types.ObjectLockConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subBTEov = noSmithyDocumentSerde - interface GetObjectRetentionInput extends _subBTEov { - /** - * The bucket name containing the object whose retention settings you want to - * retrieve. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The key name for the object whose retention settings you want to retrieve. - * - * This member is required. - */ - key?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The version ID for the object whose retention settings you want to retrieve. - */ - versionId?: string - } - type _subFNcgn = noSmithyDocumentSerde - interface GetObjectRetentionOutput extends _subFNcgn { - /** - * The container element for an object's retention settings. - */ - retention?: types.ObjectLockRetention - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subxvHff = noSmithyDocumentSerde - interface GetObjectTaggingInput extends _subxvHff { - /** - * The bucket name containing the object for which to get the tagging information. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which to get the tagging information. - * - * This member is required. - */ - key?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The versionId of the object for which to get the tagging information. - */ - versionId?: string - } - type _subuqYCt = noSmithyDocumentSerde - interface GetObjectTaggingOutput extends _subuqYCt { - /** - * Contains the tag set. - * - * This member is required. - */ - tagSet: Array - /** - * The versionId of the object for which you got the tagging information. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subkOzNf = noSmithyDocumentSerde - interface GetObjectTorrentInput extends _subkOzNf { - /** - * The name of the bucket containing the object for which to get the torrent files. - * - * This member is required. - */ - bucket?: string - /** - * The object key for which to get the information. - * - * This member is required. - */ - key?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - } - type _subkuRvp = noSmithyDocumentSerde - interface GetObjectTorrentOutput extends _subkuRvp { - /** - * A Bencoded dictionary as defined by the BitTorrent specification - */ - body: io.ReadCloser - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subRuXex = noSmithyDocumentSerde - interface GetPublicAccessBlockInput extends _subRuXex { - /** - * The name of the Amazon S3 bucket whose PublicAccessBlock configuration you want - * to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subGopXJ = noSmithyDocumentSerde - interface GetPublicAccessBlockOutput extends _subGopXJ { - /** - * The PublicAccessBlock configuration currently in effect for this Amazon S3 - * bucket. - */ - publicAccessBlockConfiguration?: types.PublicAccessBlockConfiguration - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - // @ts-ignore - import smithytime = time - // @ts-ignore - import smithywaiter = waiter - type _subBOqiz = noSmithyDocumentSerde - interface HeadBucketInput extends _subBOqiz { - /** - * The bucket name. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Object Lambda access points - When you use this API operation with an Object - * Lambda access point, provide the alias of the Object Lambda access point in - * place of the bucket name. If the Object Lambda access point alias in a request - * is not valid, the error code InvalidAccessPointAliasError is returned. For more - * information about InvalidAccessPointAliasError , see [List of Error Codes]. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList - * - * This member is required. - */ - bucket?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _suboEBLa = noSmithyDocumentSerde - interface HeadBucketOutput extends _suboEBLa { - /** - * Indicates whether the bucket name used in the request is an access point alias. - * - * For directory buckets, the value of this field is false . - */ - accessPointAlias?: boolean - /** - * The name of the location where the bucket will be created. - * - * For directory buckets, the AZ ID of the Availability Zone where the bucket is - * created. An example AZ ID value is usw2-az1 . - * - * This functionality is only supported by directory buckets. - */ - bucketLocationName?: string - /** - * The type of location where the bucket is created. - * - * This functionality is only supported by directory buckets. - */ - bucketLocationType: types.LocationType - /** - * The Region that the bucket is located. - */ - bucketRegion?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subOUwOk = noSmithyDocumentSerde - interface HeadObjectInput extends _subOUwOk { - /** - * The name of the bucket that contains the object. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The object key. - * - * This member is required. - */ - key?: string - /** - * To retrieve the checksum, this parameter must be enabled. - * - * General purpose buckets - If you enable checksum mode and the object is - * uploaded with a [checksum]and encrypted with an Key Management Service (KMS) key, you - * must have permission to use the kms:Decrypt action to retrieve the checksum. - * - * Directory buckets - If you enable ChecksumMode and the object is encrypted with - * Amazon Web Services Key Management Service (Amazon Web Services KMS), you must - * also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM - * identity-based policies and KMS key policies for the KMS key to retrieve the - * checksum of the object. - * - * [checksum]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html - */ - checksumMode: types.ChecksumMode - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Return the object only if its entity tag (ETag) is the same as the one - * specified; otherwise, return a 412 (precondition failed) error. - * - * If both of the If-Match and If-Unmodified-Since headers are present in the - * request as follows: - * - * ``` - * - If-Match condition evaluates to true , and; - * - * - If-Unmodified-Since condition evaluates to false ; - * ``` - * - * Then Amazon S3 returns 200 OK and the data requested. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifMatch?: string - /** - * Return the object only if it has been modified since the specified time; - * otherwise, return a 304 (not modified) error. - * - * If both of the If-None-Match and If-Modified-Since headers are present in the - * request as follows: - * - * ``` - * - If-None-Match condition evaluates to false , and; - * - * - If-Modified-Since condition evaluates to true ; - * ``` - * - * Then Amazon S3 returns the 304 Not Modified response code. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifModifiedSince?: time.Time - /** - * Return the object only if its entity tag (ETag) is different from the one - * specified; otherwise, return a 304 (not modified) error. - * - * If both of the If-None-Match and If-Modified-Since headers are present in the - * request as follows: - * - * ``` - * - If-None-Match condition evaluates to false , and; - * - * - If-Modified-Since condition evaluates to true ; - * ``` - * - * Then Amazon S3 returns the 304 Not Modified response code. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifNoneMatch?: string - /** - * Return the object only if it has not been modified since the specified time; - * otherwise, return a 412 (precondition failed) error. - * - * If both of the If-Match and If-Unmodified-Since headers are present in the - * request as follows: - * - * ``` - * - If-Match condition evaluates to true , and; - * - * - If-Unmodified-Since condition evaluates to false ; - * ``` - * - * Then Amazon S3 returns 200 OK and the data requested. - * - * For more information about conditional requests, see [RFC 7232]. - * - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifUnmodifiedSince?: time.Time - /** - * Part number of the object being read. This is a positive integer between 1 and - * 10,000. Effectively performs a 'ranged' HEAD request for the part specified. - * Useful querying about the size of the part and the number of parts in this - * object. - */ - partNumber?: number - /** - * HeadObject returns only the metadata for an object. If the Range is - * satisfiable, only the ContentLength is affected in the response. If the Range - * is not satisfiable, S3 returns a 416 - Requested Range Not Satisfiable error. - */ - range?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Sets the Cache-Control header of the response. - */ - responseCacheControl?: string - /** - * Sets the Content-Disposition header of the response. - */ - responseContentDisposition?: string - /** - * Sets the Content-Encoding header of the response. - */ - responseContentEncoding?: string - /** - * Sets the Content-Language header of the response. - */ - responseContentLanguage?: string - /** - * Sets the Content-Type header of the response. - */ - responseContentType?: string - /** - * Sets the Expires header of the response. - */ - responseExpires?: time.Time - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256). - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded; Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * Version ID used to reference a specific version of the object. - * - * For directory buckets in this API operation, only the null value of the version - * ID is supported. - */ - versionId?: string - } - type _subhWMmV = noSmithyDocumentSerde - interface HeadObjectOutput extends _subhWMmV { - /** - * Indicates that a range of bytes was specified. - */ - acceptRanges?: string - /** - * The archive state of the head object. - * - * This functionality is not supported for directory buckets. - */ - archiveStatus: types.ArchiveStatus - /** - * Indicates whether the object uses an S3 Bucket Key for server-side encryption - * with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * Specifies caching behavior along the request/reply chain. - */ - cacheControl?: string - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - /** - * Specifies presentational information for the object. - */ - contentDisposition?: string - /** - * Indicates what content encodings have been applied to the object and thus what - * decoding mechanisms must be applied to obtain the media-type referenced by the - * Content-Type header field. - */ - contentEncoding?: string - /** - * The language the content is in. - */ - contentLanguage?: string - /** - * Size of the body in bytes. - */ - contentLength?: number - /** - * A standard MIME type describing the format of the object data. - */ - contentType?: string - /** - * Specifies whether the object retrieved was (true) or was not (false) a Delete - * Marker. If false, this response header does not appear in the response. - * - * This functionality is not supported for directory buckets. - */ - deleteMarker?: boolean - /** - * An entity tag (ETag) is an opaque identifier assigned by a web server to a - * specific version of a resource found at a URL. - */ - eTag?: string - /** - * If the object expiration is configured (see [PutBucketLifecycleConfiguration]PutBucketLifecycleConfiguration ), - * the response includes this header. It includes the expiry-date and rule-id - * key-value pairs providing object expiration information. The value of the - * rule-id is URL-encoded. - * - * This functionality is not supported for directory buckets. - * - * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html - */ - expiration?: string - /** - * The date and time at which the object is no longer cacheable. - * - * Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using - * the ExpiresString field which contains the unparsed value from the service - * response. - */ - expires?: time.Time - /** - * The unparsed value of the Expires field from the service response. Prefer use - * of this value over the normal Expires response field where possible. - */ - expiresString?: string - /** - * Date and time when the object was last modified. - */ - lastModified?: time.Time - /** - * A map of metadata to store with the object in S3. - * - * Map keys will be normalized to lower-case. - */ - metadata: _TygojaDict - /** - * This is set to the number of metadata entries not returned in x-amz-meta - * headers. This can happen if you create metadata using an API like SOAP that - * supports more flexible metadata than the REST API. For example, using SOAP, you - * can create metadata whose values are not legal HTTP headers. - * - * This functionality is not supported for directory buckets. - */ - missingMeta?: number - /** - * Specifies whether a legal hold is in effect for this object. This header is - * only returned if the requester has the s3:GetObjectLegalHold permission. This - * header is not returned if the specified version of this object has never had a - * legal hold applied. For more information about S3 Object Lock, see [Object Lock]. - * - * This functionality is not supported for directory buckets. - * - * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html - */ - objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus - /** - * The Object Lock mode, if any, that's in effect for this object. This header is - * only returned if the requester has the s3:GetObjectRetention permission. For - * more information about S3 Object Lock, see [Object Lock]. - * - * This functionality is not supported for directory buckets. - * - * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html - */ - objectLockMode: types.ObjectLockMode - /** - * The date and time when the Object Lock retention period expires. This header is - * only returned if the requester has the s3:GetObjectRetention permission. - * - * This functionality is not supported for directory buckets. - */ - objectLockRetainUntilDate?: time.Time - /** - * The count of parts this object has. This value is only returned if you specify - * partNumber in your request and the object was uploaded as a multipart upload. - */ - partsCount?: number - /** - * Amazon S3 can return this header if your request involves a bucket that is - * either a source or a destination in a replication rule. - * - * In replication, you have a source bucket on which you configure replication and - * destination bucket or buckets where Amazon S3 stores object replicas. When you - * request an object ( GetObject ) or object metadata ( HeadObject ) from these - * buckets, Amazon S3 will return the x-amz-replication-status header in the - * response as follows: - * - * ``` - * - If requesting an object from the source bucket, Amazon S3 will return the - * x-amz-replication-status header if the object in your request is eligible for - * replication. - * ``` - * - * For example, suppose that in your replication configuration, you specify object - * ``` - * prefix TaxDocs requesting Amazon S3 to replicate objects with key prefix - * TaxDocs . Any objects you upload with this key name prefix, for example - * TaxDocs/document1.pdf , are eligible for replication. For any object request - * with this key name prefix, Amazon S3 will return the x-amz-replication-status - * header with value PENDING, COMPLETED or FAILED indicating object replication - * status. - * - * - If requesting an object from a destination bucket, Amazon S3 will return - * the x-amz-replication-status header with value REPLICA if the object in your - * request is a replica that Amazon S3 created and there is no replica modification - * replication in progress. - * - * - When replicating objects to multiple destination buckets, the - * x-amz-replication-status header acts differently. The header of the source - * object will only return a value of COMPLETED when replication is successful to - * all destinations. The header will remain at value PENDING until replication has - * completed for all destinations. If one or more destinations fails replication - * the header will return FAILED. - * ``` - * - * For more information, see [Replication]. - * - * This functionality is not supported for directory buckets. - * - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - */ - replicationStatus: types.ReplicationStatus - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If the object is an archived object (an object whose storage class is GLACIER), - * the response includes this header if either the archive restoration is in - * progress (see [RestoreObject]or an archive copy is already restored. - * - * If an archive copy is already restored, the header value indicates when Amazon - * S3 is scheduled to delete the object copy. For example: - * - * ``` - * x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 - * GMT" - * ``` - * - * If the object restoration is in progress, the header returns the value - * ongoing-request="true" . - * - * For more information about archiving objects, see [Transitioning Objects: General Considerations]. - * - * This functionality is not supported for directory buckets. Only the S3 Express - * One Zone storage class is supported by directory buckets to store objects. - * - * [Transitioning Objects: General Considerations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations - * [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html - */ - restore?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3 (for example, AES256 , aws:kms , aws:kms:dsse ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Provides storage class information of the object. Amazon S3 returns this header - * for all objects except for S3 Standard storage class objects. - * - * For more information, see [Storage Classes]. - * - * Directory buckets - Only the S3 Express One Zone storage class is supported by - * directory buckets to store objects. - * - * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html - */ - storageClass: types.StorageClass - /** - * Version ID of the object. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - /** - * If the bucket is configured as a website, redirects requests for this object to - * another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata. - * - * This functionality is not supported for directory buckets. - */ - websiteRedirectLocation?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subgVQvH = noSmithyDocumentSerde - interface ListBucketAnalyticsConfigurationsInput extends _subgVQvH { - /** - * The name of the bucket from which analytics configurations are retrieved. - * - * This member is required. - */ - bucket?: string - /** - * The ContinuationToken that represents a placeholder from where this request - * should begin. - */ - continuationToken?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subSyBid = noSmithyDocumentSerde - interface ListBucketAnalyticsConfigurationsOutput extends _subSyBid { - /** - * The list of analytics configurations for a bucket. - */ - analyticsConfigurationList: Array - /** - * The marker that is used as a starting point for this analytics configuration - * list response. This value is present if it was sent in the request. - */ - continuationToken?: string - /** - * Indicates whether the returned list of analytics configurations is complete. A - * value of true indicates that the list is not complete and the - * NextContinuationToken will be provided for a subsequent request. - */ - isTruncated?: boolean - /** - * NextContinuationToken is sent when isTruncated is true, which indicates that - * there are more analytics configurations to list. The next request must include - * this NextContinuationToken . The token is obfuscated and is not a usable value. - */ - nextContinuationToken?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subKEOAP = noSmithyDocumentSerde - interface ListBucketIntelligentTieringConfigurationsInput extends _subKEOAP { - /** - * The name of the Amazon S3 bucket whose configuration you want to modify or - * retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The ContinuationToken that represents a placeholder from where this request - * should begin. - */ - continuationToken?: string - } - type _subNsryO = noSmithyDocumentSerde - interface ListBucketIntelligentTieringConfigurationsOutput extends _subNsryO { - /** - * The ContinuationToken that represents a placeholder from where this request - * should begin. - */ - continuationToken?: string - /** - * The list of S3 Intelligent-Tiering configurations for a bucket. - */ - intelligentTieringConfigurationList: Array - /** - * Indicates whether the returned list of analytics configurations is complete. A - * value of true indicates that the list is not complete and the - * NextContinuationToken will be provided for a subsequent request. - */ - isTruncated?: boolean - /** - * The marker used to continue this inventory configuration listing. Use the - * NextContinuationToken from this response to continue the listing in a subsequent - * request. The continuation token is an opaque value that Amazon S3 understands. - */ - nextContinuationToken?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subJIdrm = noSmithyDocumentSerde - interface ListBucketInventoryConfigurationsInput extends _subJIdrm { - /** - * The name of the bucket containing the inventory configurations to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The marker used to continue an inventory configuration listing that has been - * truncated. Use the NextContinuationToken from a previously truncated list - * response to continue the listing. The continuation token is an opaque value that - * Amazon S3 understands. - */ - continuationToken?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subzajyU = noSmithyDocumentSerde - interface ListBucketInventoryConfigurationsOutput extends _subzajyU { - /** - * If sent in the request, the marker that is used as a starting point for this - * inventory configuration list response. - */ - continuationToken?: string - /** - * The list of inventory configurations for a bucket. - */ - inventoryConfigurationList: Array - /** - * Tells whether the returned list of inventory configurations is complete. A - * value of true indicates that the list is not complete and the - * NextContinuationToken is provided for a subsequent request. - */ - isTruncated?: boolean - /** - * The marker used to continue this inventory configuration listing. Use the - * NextContinuationToken from this response to continue the listing in a subsequent - * request. The continuation token is an opaque value that Amazon S3 understands. - */ - nextContinuationToken?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subxcLXa = noSmithyDocumentSerde - interface ListBucketMetricsConfigurationsInput extends _subxcLXa { - /** - * The name of the bucket containing the metrics configurations to retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The marker that is used to continue a metrics configuration listing that has - * been truncated. Use the NextContinuationToken from a previously truncated list - * response to continue the listing. The continuation token is an opaque value that - * Amazon S3 understands. - */ - continuationToken?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subMszAf = noSmithyDocumentSerde - interface ListBucketMetricsConfigurationsOutput extends _subMszAf { - /** - * The marker that is used as a starting point for this metrics configuration list - * response. This value is present if it was sent in the request. - */ - continuationToken?: string - /** - * Indicates whether the returned list of metrics configurations is complete. A - * value of true indicates that the list is not complete and the - * NextContinuationToken will be provided for a subsequent request. - */ - isTruncated?: boolean - /** - * The list of metrics configurations for a bucket. - */ - metricsConfigurationList: Array - /** - * The marker used to continue a metrics configuration listing that has been - * truncated. Use the NextContinuationToken from a previously truncated list - * response to continue the listing. The continuation token is an opaque value that - * Amazon S3 understands. - */ - nextContinuationToken?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subTphwv = noSmithyDocumentSerde - interface ListBucketsInput extends _subTphwv { - /** - * ContinuationToken indicates to Amazon S3 that the list is being continued on - * this bucket with a token. ContinuationToken is obfuscated and is not a real - * key. You can use this ContinuationToken for pagination of the list results. - * - * Length Constraints: Minimum length of 0. Maximum length of 1024. - * - * Required: No. - */ - continuationToken?: string - /** - * Maximum number of buckets to be returned in response. When the number is more - * than the count of buckets that are owned by an Amazon Web Services account, - * return all the buckets in response. - */ - maxBuckets?: number - } - type _subHwIvk = noSmithyDocumentSerde - interface ListBucketsOutput extends _subHwIvk { - /** - * The list of buckets owned by the requester. - */ - buckets: Array - /** - * ContinuationToken is included in the response when there are more buckets that - * can be listed with pagination. The next ListBuckets request to Amazon S3 can be - * continued with this ContinuationToken . ContinuationToken is obfuscated and is - * not a real bucket. - */ - continuationToken?: string - /** - * The owner of the buckets listed. - */ - owner?: types.Owner - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subQszFC = noSmithyDocumentSerde - interface ListDirectoryBucketsInput extends _subQszFC { - /** - * ContinuationToken indicates to Amazon S3 that the list is being continued on - * buckets in this account with a token. ContinuationToken is obfuscated and is - * not a real bucket name. You can use this ContinuationToken for the pagination - * of the list results. - */ - continuationToken?: string - /** - * Maximum number of buckets to be returned in response. When the number is more - * than the count of buckets that are owned by an Amazon Web Services account, - * return all the buckets in response. - */ - maxDirectoryBuckets?: number - } - type _subPQBWD = noSmithyDocumentSerde - interface ListDirectoryBucketsOutput extends _subPQBWD { - /** - * The list of buckets owned by the requester. - */ - buckets: Array - /** - * If ContinuationToken was sent with the request, it is included in the response. - * You can use the returned ContinuationToken for pagination of the list response. - */ - continuationToken?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subsUpLq = noSmithyDocumentSerde - interface ListMultipartUploadsInput extends _subsUpLq { - /** - * The name of the bucket to which the multipart upload was initiated. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Character you use to group keys. - * - * All keys that contain the same string between the prefix, if specified, and the - * first occurrence of the delimiter after the prefix are grouped under a single - * result element, CommonPrefixes . If you don't specify the prefix parameter, then - * the substring starts at the beginning of the key. The keys that are grouped - * under CommonPrefixes result element are not returned elsewhere in the response. - * - * Directory buckets - For directory buckets, / is the only supported delimiter. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are - * encoded only in UTF-8. An object key can contain any Unicode character. However, - * the XML 1.0 parser can't parse certain characters, such as characters with an - * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you - * can add this parameter to request that Amazon S3 encode the keys in the - * response. For more information about characters to avoid in object key names, - * see [Object key naming guidelines]. - * - * When using the URL encoding type, non-ASCII characters that are used in an - * object's key name will be percent-encoded according to UTF-8 code values. For - * example, the object test_file(3).png will appear as test_file%283%29.png . - * - * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines - * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html - */ - encodingType: types.EncodingType - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Specifies the multipart upload after which listing should begin. - * - * ``` - * - General purpose buckets - For general purpose buckets, key-marker is an - * object key. Together with upload-id-marker , this parameter specifies the - * multipart upload after which listing should begin. - * ``` - * - * If upload-id-marker is not specified, only the keys lexicographically greater - * ``` - * than the specified key-marker will be included in the list. - * ``` - * - * If upload-id-marker is specified, any multipart uploads for a key equal to the - * ``` - * key-marker might also be included, provided those multipart uploads have - * upload IDs lexicographically greater than the specified upload-id-marker . - * - * - Directory buckets - For directory buckets, key-marker is obfuscated and - * isn't a real object key. The upload-id-marker parameter isn't supported by - * directory buckets. To list the additional multipart uploads, you only need to - * set the value of key-marker to the NextKeyMarker value from the previous - * response. - * ``` - * - * In the ListMultipartUploads response, the multipart uploads aren't sorted - * ``` - * lexicographically based on the object keys. - * ``` - */ - keyMarker?: string - /** - * Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the - * response body. 1,000 is the maximum number of uploads that can be returned in a - * response. - */ - maxUploads?: number - /** - * Lists in-progress uploads only for those keys that begin with the specified - * prefix. You can use prefixes to separate a bucket into different grouping of - * keys. (You can think of using prefix to make groups in the same way that you'd - * use a folder in a file system.) - * - * Directory buckets - For directory buckets, only prefixes that end in a - * delimiter ( / ) are supported. - */ - prefix?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Together with key-marker, specifies the multipart upload after which listing - * should begin. If key-marker is not specified, the upload-id-marker parameter is - * ignored. Otherwise, any multipart uploads for a key equal to the key-marker - * might be included in the list only if they have an upload ID lexicographically - * greater than the specified upload-id-marker . - * - * This functionality is not supported for directory buckets. - */ - uploadIdMarker?: string - } - type _subESnvi = noSmithyDocumentSerde - interface ListMultipartUploadsOutput extends _subESnvi { - /** - * The name of the bucket to which the multipart upload was initiated. Does not - * return the access point ARN or access point alias if used. - */ - bucket?: string - /** - * If you specify a delimiter in the request, then the result returns each - * distinct key prefix containing the delimiter in a CommonPrefixes element. The - * distinct key prefixes are returned in the Prefix child element. - * - * Directory buckets - For directory buckets, only prefixes that end in a - * delimiter ( / ) are supported. - */ - commonPrefixes: Array - /** - * Contains the delimiter you specified in the request. If you don't specify a - * delimiter in your request, this element is absent from the response. - * - * Directory buckets - For directory buckets, / is the only supported delimiter. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode object keys in the response. - * - * If you specify the encoding-type request parameter, Amazon S3 includes this - * element in the response, and returns encoded key name values in the following - * response elements: - * - * Delimiter , KeyMarker , Prefix , NextKeyMarker , Key . - */ - encodingType: types.EncodingType - /** - * Indicates whether the returned list of multipart uploads is truncated. A value - * of true indicates that the list was truncated. The list can be truncated if the - * number of multipart uploads exceeds the limit allowed or specified by max - * uploads. - */ - isTruncated?: boolean - /** - * The key at or after which the listing began. - */ - keyMarker?: string - /** - * Maximum number of multipart uploads that could have been included in the - * response. - */ - maxUploads?: number - /** - * When a list is truncated, this element specifies the value that should be used - * for the key-marker request parameter in a subsequent request. - */ - nextKeyMarker?: string - /** - * When a list is truncated, this element specifies the value that should be used - * for the upload-id-marker request parameter in a subsequent request. - * - * This functionality is not supported for directory buckets. - */ - nextUploadIdMarker?: string - /** - * When a prefix is provided in the request, this field contains the specified - * prefix. The result contains only keys starting with the specified prefix. - * - * Directory buckets - For directory buckets, only prefixes that end in a - * delimiter ( / ) are supported. - */ - prefix?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Together with key-marker, specifies the multipart upload after which listing - * should begin. If key-marker is not specified, the upload-id-marker parameter is - * ignored. Otherwise, any multipart uploads for a key equal to the key-marker - * might be included in the list only if they have an upload ID lexicographically - * greater than the specified upload-id-marker . - * - * This functionality is not supported for directory buckets. - */ - uploadIdMarker?: string - /** - * Container for elements related to a particular multipart upload. A response can - * contain zero or more Upload elements. - */ - uploads: Array - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _submRLUM = noSmithyDocumentSerde - interface ListObjectVersionsInput extends _submRLUM { - /** - * The bucket name that contains the objects. - * - * This member is required. - */ - bucket?: string - /** - * A delimiter is a character that you specify to group keys. All keys that - * contain the same string between the prefix and the first occurrence of the - * delimiter are grouped under a single result element in CommonPrefixes . These - * groups are counted as one result against the max-keys limitation. These keys - * are not returned elsewhere in the response. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are - * encoded only in UTF-8. An object key can contain any Unicode character. However, - * the XML 1.0 parser can't parse certain characters, such as characters with an - * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you - * can add this parameter to request that Amazon S3 encode the keys in the - * response. For more information about characters to avoid in object key names, - * see [Object key naming guidelines]. - * - * When using the URL encoding type, non-ASCII characters that are used in an - * object's key name will be percent-encoded according to UTF-8 code values. For - * example, the object test_file(3).png will appear as test_file%283%29.png . - * - * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines - * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html - */ - encodingType: types.EncodingType - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Specifies the key to start with when listing objects in a bucket. - */ - keyMarker?: string - /** - * Sets the maximum number of keys returned in the response. By default, the - * action returns up to 1,000 key names. The response might contain fewer keys but - * will never contain more. If additional keys satisfy the search criteria, but - * were not returned because max-keys was exceeded, the response contains true . To - * return the additional keys, see key-marker and version-id-marker . - */ - maxKeys?: number - /** - * Specifies the optional fields that you want returned in the response. Fields - * that you do not specify are not returned. - */ - optionalObjectAttributes: Array - /** - * Use this parameter to select only those keys that begin with the specified - * prefix. You can use prefixes to separate a bucket into different groupings of - * keys. (You can think of using prefix to make groups in the same way that you'd - * use a folder in a file system.) You can use prefix with delimiter to roll up - * numerous objects into a single result under CommonPrefixes . - */ - prefix?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the object version you want to start listing from. - */ - versionIdMarker?: string - } - type _subIJpmm = noSmithyDocumentSerde - interface ListObjectVersionsOutput extends _subIJpmm { - /** - * All of the keys rolled up into a common prefix count as a single return when - * calculating the number of returns. - */ - commonPrefixes: Array - /** - * Container for an object that is a delete marker. - */ - deleteMarkers: Array - /** - * The delimiter grouping the included keys. A delimiter is a character that you - * specify to group keys. All keys that contain the same string between the prefix - * and the first occurrence of the delimiter are grouped under a single result - * element in CommonPrefixes . These groups are counted as one result against the - * max-keys limitation. These keys are not returned elsewhere in the response. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode object key names in the XML response. - * - * If you specify the encoding-type request parameter, Amazon S3 includes this - * element in the response, and returns encoded key name values in the following - * response elements: - * - * KeyMarker, NextKeyMarker, Prefix, Key , and Delimiter . - */ - encodingType: types.EncodingType - /** - * A flag that indicates whether Amazon S3 returned all of the results that - * satisfied the search criteria. If your results were truncated, you can make a - * follow-up paginated request by using the NextKeyMarker and NextVersionIdMarker - * response parameters as a starting place in another request to return the rest of - * the results. - */ - isTruncated?: boolean - /** - * Marks the last key returned in a truncated response. - */ - keyMarker?: string - /** - * Specifies the maximum number of objects to return. - */ - maxKeys?: number - /** - * The bucket name. - */ - name?: string - /** - * When the number of responses exceeds the value of MaxKeys , NextKeyMarker - * specifies the first key not returned that satisfies the search criteria. Use - * this value for the key-marker request parameter in a subsequent request. - */ - nextKeyMarker?: string - /** - * When the number of responses exceeds the value of MaxKeys , NextVersionIdMarker - * specifies the first object version not returned that satisfies the search - * criteria. Use this value for the version-id-marker request parameter in a - * subsequent request. - */ - nextVersionIdMarker?: string - /** - * Selects objects that start with the value supplied by this parameter. - */ - prefix?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Marks the last version of the key returned in a truncated response. - */ - versionIdMarker?: string - /** - * Container for version information. - */ - versions: Array - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subzfSDR = noSmithyDocumentSerde - interface ListObjectsInput extends _subzfSDR { - /** - * The name of the bucket containing the objects. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * A delimiter is a character that you use to group keys. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are - * encoded only in UTF-8. An object key can contain any Unicode character. However, - * the XML 1.0 parser can't parse certain characters, such as characters with an - * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you - * can add this parameter to request that Amazon S3 encode the keys in the - * response. For more information about characters to avoid in object key names, - * see [Object key naming guidelines]. - * - * When using the URL encoding type, non-ASCII characters that are used in an - * object's key name will be percent-encoded according to UTF-8 code values. For - * example, the object test_file(3).png will appear as test_file%283%29.png . - * - * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines - * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html - */ - encodingType: types.EncodingType - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Marker is where you want Amazon S3 to start listing from. Amazon S3 starts - * listing after this specified key. Marker can be any key in the bucket. - */ - marker?: string - /** - * Sets the maximum number of keys returned in the response. By default, the - * action returns up to 1,000 key names. The response might contain fewer keys but - * will never contain more. - */ - maxKeys?: number - /** - * Specifies the optional fields that you want returned in the response. Fields - * that you do not specify are not returned. - */ - optionalObjectAttributes: Array - /** - * Limits the response to keys that begin with the specified prefix. - */ - prefix?: string - /** - * Confirms that the requester knows that she or he will be charged for the list - * objects request. Bucket owners need not specify this parameter in their - * requests. - */ - requestPayer: types.RequestPayer - } - type _subiNexF = noSmithyDocumentSerde - interface ListObjectsOutput extends _subiNexF { - /** - * All of the keys (up to 1,000) rolled up in a common prefix count as a single - * return when calculating the number of returns. - * - * A response can contain CommonPrefixes only if you specify a delimiter. - * - * CommonPrefixes contains all (if there are any) keys between Prefix and the next - * occurrence of the string specified by the delimiter. - * - * CommonPrefixes lists keys that act like subdirectories in the directory - * specified by Prefix . - * - * For example, if the prefix is notes/ and the delimiter is a slash ( / ), as in - * notes/summer/july , the common prefix is notes/summer/ . All of the keys that - * roll up into a common prefix count as a single return when calculating the - * number of returns. - */ - commonPrefixes: Array - /** - * Metadata about each object returned. - */ - contents: Array - /** - * Causes keys that contain the same string between the prefix and the first - * occurrence of the delimiter to be rolled up into a single result element in the - * CommonPrefixes collection. These rolled-up keys are not returned elsewhere in - * the response. Each rolled-up result counts as only one return against the - * MaxKeys value. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are - * encoded only in UTF-8. An object key can contain any Unicode character. However, - * the XML 1.0 parser can't parse certain characters, such as characters with an - * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you - * can add this parameter to request that Amazon S3 encode the keys in the - * response. For more information about characters to avoid in object key names, - * see [Object key naming guidelines]. - * - * When using the URL encoding type, non-ASCII characters that are used in an - * object's key name will be percent-encoded according to UTF-8 code values. For - * example, the object test_file(3).png will appear as test_file%283%29.png . - * - * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines - * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html - */ - encodingType: types.EncodingType - /** - * A flag that indicates whether Amazon S3 returned all of the results that - * satisfied the search criteria. - */ - isTruncated?: boolean - /** - * Indicates where in the bucket listing begins. Marker is included in the - * response if it was sent with the request. - */ - marker?: string - /** - * The maximum number of keys returned in the response body. - */ - maxKeys?: number - /** - * The bucket name. - */ - name?: string - /** - * When the response is truncated (the IsTruncated element value in the response - * is true ), you can use the key name in this field as the marker parameter in - * the subsequent request to get the next set of objects. Amazon S3 lists objects - * in alphabetical order. - * - * This element is returned only if you have the delimiter request parameter - * specified. If the response does not include the NextMarker element and it is - * truncated, you can use the value of the last Key element in the response as the - * marker parameter in the subsequent request to get the next set of object keys. - */ - nextMarker?: string - /** - * Keys that begin with the indicated prefix. - */ - prefix?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subjIzNE = noSmithyDocumentSerde - interface ListObjectsV2Input extends _subjIzNE { - /** - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * ContinuationToken indicates to Amazon S3 that the list is being continued on - * this bucket with a token. ContinuationToken is obfuscated and is not a real - * key. You can use this ContinuationToken for pagination of the list results. - */ - continuationToken?: string - /** - * A delimiter is a character that you use to group keys. - * - * ``` - * - Directory buckets - For directory buckets, / is the only supported delimiter. - * - * - Directory buckets - When you query ListObjectsV2 with a delimiter during - * in-progress multipart uploads, the CommonPrefixes response parameter contains - * the prefixes that are associated with the in-progress multipart uploads. For - * more information about multipart uploads, see [Multipart Upload Overview]in the Amazon S3 User Guide. - * ``` - * - * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are - * encoded only in UTF-8. An object key can contain any Unicode character. However, - * the XML 1.0 parser can't parse certain characters, such as characters with an - * ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you - * can add this parameter to request that Amazon S3 encode the keys in the - * response. For more information about characters to avoid in object key names, - * see [Object key naming guidelines]. - * - * When using the URL encoding type, non-ASCII characters that are used in an - * object's key name will be percent-encoded according to UTF-8 code values. For - * example, the object test_file(3).png will appear as test_file%283%29.png . - * - * [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines - * [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html - */ - encodingType: types.EncodingType - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The owner field is not present in ListObjectsV2 by default. If you want to - * return the owner field with each key in the result, then set the FetchOwner - * field to true . - * - * Directory buckets - For directory buckets, the bucket owner is returned as the - * object owner for all objects. - */ - fetchOwner?: boolean - /** - * Sets the maximum number of keys returned in the response. By default, the - * action returns up to 1,000 key names. The response might contain fewer keys but - * will never contain more. - */ - maxKeys?: number - /** - * Specifies the optional fields that you want returned in the response. Fields - * that you do not specify are not returned. - * - * This functionality is not supported for directory buckets. - */ - optionalObjectAttributes: Array - /** - * Limits the response to keys that begin with the specified prefix. - * - * Directory buckets - For directory buckets, only prefixes that end in a - * delimiter ( / ) are supported. - */ - prefix?: string - /** - * Confirms that the requester knows that she or he will be charged for the list - * objects request in V2 style. Bucket owners need not specify this parameter in - * their requests. - * - * This functionality is not supported for directory buckets. - */ - requestPayer: types.RequestPayer - /** - * StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts - * listing after this specified key. StartAfter can be any key in the bucket. - * - * This functionality is not supported for directory buckets. - */ - startAfter?: string - } - type _subwzDqH = noSmithyDocumentSerde - interface ListObjectsV2Output extends _subwzDqH { - /** - * All of the keys (up to 1,000) that share the same prefix are grouped together. - * When counting the total numbers of returns by this API operation, this group of - * keys is considered as one item. - * - * A response can contain CommonPrefixes only if you specify a delimiter. - * - * CommonPrefixes contains all (if there are any) keys between Prefix and the next - * occurrence of the string specified by a delimiter. - * - * CommonPrefixes lists keys that act like subdirectories in the directory - * specified by Prefix . - * - * For example, if the prefix is notes/ and the delimiter is a slash ( / ) as in - * notes/summer/july , the common prefix is notes/summer/ . All of the keys that - * roll up into a common prefix count as a single return when calculating the - * number of returns. - * - * ``` - * - Directory buckets - For directory buckets, only prefixes that end in a - * delimiter ( / ) are supported. - * - * - Directory buckets - When you query ListObjectsV2 with a delimiter during - * in-progress multipart uploads, the CommonPrefixes response parameter contains - * the prefixes that are associated with the in-progress multipart uploads. For - * more information about multipart uploads, see [Multipart Upload Overview]in the Amazon S3 User Guide. - * ``` - * - * [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html - */ - commonPrefixes: Array - /** - * Metadata about each object returned. - */ - contents: Array - /** - * If ContinuationToken was sent with the request, it is included in the - * response. You can use the returned ContinuationToken for pagination of the list - * response. You can use this ContinuationToken for pagination of the list - * results. - */ - continuationToken?: string - /** - * Causes keys that contain the same string between the prefix and the first - * occurrence of the delimiter to be rolled up into a single result element in the - * CommonPrefixes collection. These rolled-up keys are not returned elsewhere in - * the response. Each rolled-up result counts as only one return against the - * MaxKeys value. - * - * Directory buckets - For directory buckets, / is the only supported delimiter. - */ - delimiter?: string - /** - * Encoding type used by Amazon S3 to encode object key names in the XML response. - * - * If you specify the encoding-type request parameter, Amazon S3 includes this - * element in the response, and returns encoded key name values in the following - * response elements: - * - * Delimiter, Prefix, Key, and StartAfter . - */ - encodingType: types.EncodingType - /** - * Set to false if all of the results were returned. Set to true if more keys are - * available to return. If the number of results exceeds that specified by MaxKeys - * , all of the results might not be returned. - */ - isTruncated?: boolean - /** - * KeyCount is the number of keys returned with this request. KeyCount will always - * be less than or equal to the MaxKeys field. For example, if you ask for 50 - * keys, your result will include 50 keys or fewer. - */ - keyCount?: number - /** - * Sets the maximum number of keys returned in the response. By default, the - * action returns up to 1,000 key names. The response might contain fewer keys but - * will never contain more. - */ - maxKeys?: number - /** - * The bucket name. - */ - name?: string - /** - * NextContinuationToken is sent when isTruncated is true, which means there are - * more keys in the bucket that can be listed. The next list requests to Amazon S3 - * can be continued with this NextContinuationToken . NextContinuationToken is - * obfuscated and is not a real key - */ - nextContinuationToken?: string - /** - * Keys that begin with the indicated prefix. - * - * Directory buckets - For directory buckets, only prefixes that end in a - * delimiter ( / ) are supported. - */ - prefix?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If StartAfter was sent with the request, it is included in the response. - * - * This functionality is not supported for directory buckets. - */ - startAfter?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subyXYCR = noSmithyDocumentSerde - interface ListPartsInput extends _subyXYCR { - /** - * The name of the bucket to which the parts are being uploaded. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which the multipart upload was initiated. - * - * This member is required. - */ - key?: string - /** - * Upload ID identifying the multipart upload whose parts are being listed. - * - * This member is required. - */ - uploadId?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Sets the maximum number of parts to return. - */ - maxParts?: number - /** - * Specifies the part after which listing should begin. Only parts with higher - * part numbers will be listed. - */ - partNumberMarker?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The server-side encryption (SSE) algorithm used to encrypt the object. This - * parameter is needed only when the object was created using a checksum algorithm. - * For more information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerAlgorithm?: string - /** - * The server-side encryption (SSE) customer managed key. This parameter is needed - * only when the object was created using a checksum algorithm. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKey?: string - /** - * The MD5 server-side encryption (SSE) customer managed key. This parameter is - * needed only when the object was created using a checksum algorithm. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKeyMD5?: string - } - type _subflroF = noSmithyDocumentSerde - interface ListPartsOutput extends _subflroF { - /** - * If the bucket has a lifecycle rule configured with an action to abort - * incomplete multipart uploads and the prefix in the lifecycle rule matches the - * object name in the request, then the response includes this header indicating - * when the initiated multipart upload will become eligible for abort operation. - * For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]. - * - * The response will also include the x-amz-abort-rule-id header that will provide - * the ID of the lifecycle configuration rule that defines this action. - * - * This functionality is not supported for directory buckets. - * - * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config - */ - abortDate?: time.Time - /** - * This header is returned along with the x-amz-abort-date header. It identifies - * applicable lifecycle configuration rule that defines the action to abort - * incomplete multipart uploads. - * - * This functionality is not supported for directory buckets. - */ - abortRuleId?: string - /** - * The name of the bucket to which the multipart upload was initiated. Does not - * return the access point ARN or access point alias if used. - */ - bucket?: string - /** - * The algorithm that was used to create a checksum of the object. - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * Container element that identifies who initiated the multipart upload. If the - * initiator is an Amazon Web Services account, this element provides the same - * information as the Owner element. If the initiator is an IAM User, this element - * provides the user ARN and display name. - */ - initiator?: types.Initiator - /** - * Indicates whether the returned list of parts is truncated. A true value - * indicates that the list was truncated. A list can be truncated if the number of - * parts exceeds the limit returned in the MaxParts element. - */ - isTruncated?: boolean - /** - * Object key for which the multipart upload was initiated. - */ - key?: string - /** - * Maximum number of parts that were allowed in the response. - */ - maxParts?: number - /** - * When a list is truncated, this element specifies the last part in the list, as - * well as the value to use for the part-number-marker request parameter in a - * subsequent request. - */ - nextPartNumberMarker?: string - /** - * Container element that identifies the object owner, after the object is - * created. If multipart upload is initiated by an IAM user, this element provides - * the parent account ID and display name. - * - * Directory buckets - The bucket owner is returned as the object owner for all - * the parts. - */ - owner?: types.Owner - /** - * Specifies the part after which listing should begin. Only parts with higher - * part numbers will be listed. - */ - partNumberMarker?: string - /** - * Container for elements related to a particular part. A response can contain - * zero or more Part elements. - */ - parts: Array - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * The class of storage used to store the uploaded object. - * - * Directory buckets - Only the S3 Express One Zone storage class is supported by - * directory buckets to store objects. - */ - storageClass: types.StorageClass - /** - * Upload ID identifying the multipart upload whose parts are being listed. - */ - uploadId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subtigAb = noSmithyDocumentSerde - interface PutBucketAccelerateConfigurationInput extends _subtigAb { - /** - * Container for setting the transfer acceleration state. - * - * This member is required. - */ - accelerateConfiguration?: types.AccelerateConfiguration - /** - * The name of the bucket for which the accelerate configuration is set. - * - * This member is required. - */ - bucket?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subQbWOK = noSmithyDocumentSerde - interface PutBucketAccelerateConfigurationOutput extends _subQbWOK { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subSjgdG = noSmithyDocumentSerde - interface PutBucketAclInput extends _subSjgdG { - /** - * The bucket to which to apply the ACL. - * - * This member is required. - */ - bucket?: string - /** - * The canned ACL to apply to the bucket. - */ - acl: types.BucketCannedACL - /** - * Contains the elements that set the ACL permissions for an object per grantee. - */ - accessControlPolicy?: types.AccessControlPolicy - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. This header must be used as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, go to [RFC 1864.] - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864.]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Allows grantee the read, write, read ACP, and write ACP permissions on the - * bucket. - */ - grantFullControl?: string - /** - * Allows grantee to list the objects in the bucket. - */ - grantRead?: string - /** - * Allows grantee to read the bucket ACL. - */ - grantReadACP?: string - /** - * Allows grantee to create new objects in the bucket. - * - * For the bucket and object owners of existing objects, also allows deletions and - * overwrites of those objects. - */ - grantWrite?: string - /** - * Allows grantee to write the ACL for the applicable bucket. - */ - grantWriteACP?: string - } - type _subcbxne = noSmithyDocumentSerde - interface PutBucketAclOutput extends _subcbxne { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subsMlet = noSmithyDocumentSerde - interface PutBucketAnalyticsConfigurationInput extends _subsMlet { - /** - * The configuration and any analyses for the analytics filter. - * - * This member is required. - */ - analyticsConfiguration?: types.AnalyticsConfiguration - /** - * The name of the bucket to which an analytics configuration is stored. - * - * This member is required. - */ - bucket?: string - /** - * The ID that identifies the analytics configuration. - * - * This member is required. - */ - id?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subHOpFQ = noSmithyDocumentSerde - interface PutBucketAnalyticsConfigurationOutput extends _subHOpFQ { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subSWBAD = noSmithyDocumentSerde - interface PutBucketCorsInput extends _subSWBAD { - /** - * Specifies the bucket impacted by the cors configuration. - * - * This member is required. - */ - bucket?: string - /** - * Describes the cross-origin access configuration for objects in an Amazon S3 - * bucket. For more information, see [Enabling Cross-Origin Resource Sharing]in the Amazon S3 User Guide. - * - * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html - * - * This member is required. - */ - corsConfiguration?: types.CORSConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. This header must be used as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, go to [RFC 1864.] - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864.]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subjWSXi = noSmithyDocumentSerde - interface PutBucketCorsOutput extends _subjWSXi { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subZrxRN = noSmithyDocumentSerde - interface PutBucketEncryptionInput extends _subZrxRN { - /** - * Specifies default encryption for a bucket using server-side encryption with - * different key options. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * - * This member is required. - */ - bucket?: string - /** - * Specifies the default server-side-encryption configuration. - * - * This member is required. - */ - serverSideEncryptionConfiguration?: types.ServerSideEncryptionConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the - * default checksum algorithm that's used for performance. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the server-side encryption - * configuration. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * This functionality is not supported for directory buckets. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _submGsGB = noSmithyDocumentSerde - interface PutBucketEncryptionOutput extends _submGsGB { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subJmtZy = noSmithyDocumentSerde - interface PutBucketIntelligentTieringConfigurationInput extends _subJmtZy { - /** - * The name of the Amazon S3 bucket whose configuration you want to modify or - * retrieve. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the S3 Intelligent-Tiering configuration. - * - * This member is required. - */ - id?: string - /** - * Container for S3 Intelligent-Tiering configuration. - * - * This member is required. - */ - intelligentTieringConfiguration?: types.IntelligentTieringConfiguration - } - type _subzegRn = noSmithyDocumentSerde - interface PutBucketIntelligentTieringConfigurationOutput extends _subzegRn { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subFOyUH = noSmithyDocumentSerde - interface PutBucketInventoryConfigurationInput extends _subFOyUH { - /** - * The name of the bucket where the inventory configuration will be stored. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the inventory configuration. - * - * This member is required. - */ - id?: string - /** - * Specifies the inventory configuration. - * - * This member is required. - */ - inventoryConfiguration?: types.InventoryConfiguration - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subFUOFd = noSmithyDocumentSerde - interface PutBucketInventoryConfigurationOutput extends _subFUOFd { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subILaTt = noSmithyDocumentSerde - interface PutBucketLifecycleConfigurationInput extends _subILaTt { - /** - * The name of the bucket for which to set the configuration. - * - * This member is required. - */ - bucket?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Container for lifecycle rules. You can add as many as 1,000 rules. - */ - lifecycleConfiguration?: types.BucketLifecycleConfiguration - /** - * Indicates which default minimum object size behavior is applied to the - * lifecycle configuration. - * - * ``` - * - all_storage_classes_128K - Objects smaller than 128 KB will not transition - * to any storage class by default. - * - * - varies_by_storage_class - Objects smaller than 128 KB will transition to - * Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, - * all other storage classes will prevent transitions smaller than 128 KB. - * ``` - * - * To customize the minimum object size for any transition you can add a filter - * that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body - * of your transition rule. Custom filters always take precedence over the default - * transition behavior. - */ - transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize - } - type _subwdllN = noSmithyDocumentSerde - interface PutBucketLifecycleConfigurationOutput extends _subwdllN { - /** - * Indicates which default minimum object size behavior is applied to the - * lifecycle configuration. - * - * ``` - * - all_storage_classes_128K - Objects smaller than 128 KB will not transition - * to any storage class by default. - * - * - varies_by_storage_class - Objects smaller than 128 KB will transition to - * Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, - * all other storage classes will prevent transitions smaller than 128 KB. - * ``` - * - * To customize the minimum object size for any transition you can add a filter - * that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body - * of your transition rule. Custom filters always take precedence over the default - * transition behavior. - */ - transitionDefaultMinimumObjectSize: types.TransitionDefaultMinimumObjectSize - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subMirfx = noSmithyDocumentSerde - interface PutBucketLoggingInput extends _subMirfx { - /** - * The name of the bucket for which to set the logging parameters. - * - * This member is required. - */ - bucket?: string - /** - * Container for logging status information. - * - * This member is required. - */ - bucketLoggingStatus?: types.BucketLoggingStatus - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The MD5 hash of the PutBucketLogging request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subIGUPl = noSmithyDocumentSerde - interface PutBucketLoggingOutput extends _subIGUPl { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subqnExZ = noSmithyDocumentSerde - interface PutBucketMetricsConfigurationInput extends _subqnExZ { - /** - * The name of the bucket for which the metrics configuration is set. - * - * This member is required. - */ - bucket?: string - /** - * The ID used to identify the metrics configuration. The ID has a 64 character - * limit and can only contain letters, numbers, periods, dashes, and underscores. - * - * This member is required. - */ - id?: string - /** - * Specifies the metrics configuration. - * - * This member is required. - */ - metricsConfiguration?: types.MetricsConfiguration - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subkJTeS = noSmithyDocumentSerde - interface PutBucketMetricsConfigurationOutput extends _subkJTeS { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subZxDVa = noSmithyDocumentSerde - interface PutBucketNotificationConfigurationInput extends _subZxDVa { - /** - * The name of the bucket. - * - * This member is required. - */ - bucket?: string - /** - * A container for specifying the notification configuration of the bucket. If - * this element is empty, notifications are turned off for the bucket. - * - * This member is required. - */ - notificationConfiguration?: types.NotificationConfiguration - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or - * false value. - */ - skipDestinationValidation?: boolean - } - type _subyIqiK = noSmithyDocumentSerde - interface PutBucketNotificationConfigurationOutput extends _subyIqiK { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subKxghv = noSmithyDocumentSerde - interface PutBucketOwnershipControlsInput extends _subKxghv { - /** - * The name of the Amazon S3 bucket whose OwnershipControls you want to set. - * - * This member is required. - */ - bucket?: string - /** - * The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or - * ObjectWriter) that you want to apply to this Amazon S3 bucket. - * - * This member is required. - */ - ownershipControls?: types.OwnershipControls - /** - * The MD5 hash of the OwnershipControls request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subNDidY = noSmithyDocumentSerde - interface PutBucketOwnershipControlsOutput extends _subNDidY { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subkSYiw = noSmithyDocumentSerde - interface PutBucketPolicyInput extends _subkSYiw { - /** - * The name of the bucket. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use path-style requests in the format - * https://s3express-control.region_code.amazonaws.com/bucket-name . - * Virtual-hosted-style requests aren't supported. Directory bucket names must be - * unique in the chosen Availability Zone. Bucket names must also follow the format - * bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 - * ). For information about bucket naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User - * Guide - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * - * This member is required. - */ - bucket?: string - /** - * The bucket policy as a JSON document. - * - * For directory buckets, the only IAM action supported in the bucket policy is - * s3express:CreateSession . - * - * This member is required. - */ - policy?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 - * fails the request with the HTTP status code 400 Bad Request . - * - * For the x-amz-checksum-algorithm header, replace algorithm with the - * supported algorithm from the following list: - * - * ``` - * - CRC32 - * - * - CRC32C - * - * - SHA1 - * - * - SHA256 - * ``` - * - * For more information, see [Checking object integrity] in the Amazon S3 User Guide. - * - * If the individual checksum value you provide through x-amz-checksum-algorithm - * doesn't match the checksum algorithm you set through - * x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm - * parameter and uses the checksum algorithm that matches the provided value in - * x-amz-checksum-algorithm . - * - * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the - * default checksum algorithm that's used for performance. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * Set this parameter to true to confirm that you want to remove your permissions - * to change this bucket policy in the future. - * - * This functionality is not supported for directory buckets. - */ - confirmRemoveSelfBucketAccess?: boolean - /** - * The MD5 hash of the request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * This functionality is not supported for directory buckets. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - * - * For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 Not - * Implemented . - */ - expectedBucketOwner?: string - } - type _subiLJek = noSmithyDocumentSerde - interface PutBucketPolicyOutput extends _subiLJek { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subOPvAT = noSmithyDocumentSerde - interface PutBucketReplicationInput extends _subOPvAT { - /** - * The name of the bucket - * - * This member is required. - */ - bucket?: string - /** - * A container for replication rules. You can add up to 1,000 rules. The maximum - * size of a replication configuration is 2 MB. - * - * This member is required. - */ - replicationConfiguration?: types.ReplicationConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. You must use this header as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, see [RFC 1864]. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * A token to allow Object Lock to be enabled for an existing bucket. - */ - token?: string - } - type _subxOphO = noSmithyDocumentSerde - interface PutBucketReplicationOutput extends _subxOphO { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subGtezW = noSmithyDocumentSerde - interface PutBucketRequestPaymentInput extends _subGtezW { - /** - * The bucket name. - * - * This member is required. - */ - bucket?: string - /** - * Container for Payer. - * - * This member is required. - */ - requestPaymentConfiguration?: types.RequestPaymentConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. You must use this header as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, see [RFC 1864]. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subgDjyR = noSmithyDocumentSerde - interface PutBucketRequestPaymentOutput extends _subgDjyR { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subyNhEL = noSmithyDocumentSerde - interface PutBucketTaggingInput extends _subyNhEL { - /** - * The bucket name. - * - * This member is required. - */ - bucket?: string - /** - * Container for the TagSet and Tag elements. - * - * This member is required. - */ - tagging?: types.Tagging - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. You must use this header as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, see [RFC 1864]. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subgDkcm = noSmithyDocumentSerde - interface PutBucketTaggingOutput extends _subgDkcm { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subLQukt = noSmithyDocumentSerde - interface PutBucketVersioningInput extends _subLQukt { - /** - * The bucket name. - * - * This member is required. - */ - bucket?: string - /** - * Container for setting the versioning state. - * - * This member is required. - */ - versioningConfiguration?: types.VersioningConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * >The base64-encoded 128-bit MD5 digest of the data. You must use this header as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, see [RFC 1864]. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The concatenation of the authentication device's serial number, a space, and - * the value that is displayed on your authentication device. - */ - mfa?: string - } - type _subpbotJ = noSmithyDocumentSerde - interface PutBucketVersioningOutput extends _subpbotJ { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subNROnV = noSmithyDocumentSerde - interface PutBucketWebsiteInput extends _subNROnV { - /** - * The bucket name. - * - * This member is required. - */ - bucket?: string - /** - * Container for the request. - * - * This member is required. - */ - websiteConfiguration?: types.WebsiteConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. You must use this header as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, see [RFC 1864]. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subVBInS = noSmithyDocumentSerde - interface PutBucketWebsiteOutput extends _subVBInS { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subIjPul = noSmithyDocumentSerde - interface PutObjectInput extends _subIjPul { - /** - * The bucket name to which the PUT action was initiated. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which the PUT action was initiated. - * - * This member is required. - */ - key?: string - /** - * The canned ACL to apply to the object. For more information, see [Canned ACL] in the Amazon - * S3 User Guide. - * - * When adding a new object, you can use headers to grant ACL-based permissions to - * individual Amazon Web Services accounts or to predefined groups defined by - * Amazon S3. These permissions are then added to the ACL on the object. By - * default, all objects are private. Only the owner has full access control. For - * more information, see [Access Control List (ACL) Overview]and [Managing ACLs Using the REST API] in the Amazon S3 User Guide. - * - * If the bucket that you're uploading objects to uses the bucket owner enforced - * setting for S3 Object Ownership, ACLs are disabled and no longer affect - * permissions. Buckets that use this setting only accept PUT requests that don't - * specify an ACL or PUT requests that specify bucket owner full control ACLs, such - * as the bucket-owner-full-control canned ACL or an equivalent form of this ACL - * expressed in the XML format. PUT requests that contain other ACLs (for example, - * custom grants to certain Amazon Web Services accounts) fail and return a 400 - * error with the error code AccessControlListNotSupported . For more information, - * see [Controlling ownership of objects and disabling ACLs]in the Amazon S3 User Guide. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - * - * [Managing ACLs Using the REST API]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html - * [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html - * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL - * [Controlling ownership of objects and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - */ - acl: types.ObjectCannedACL - /** - * Object data. - */ - body: io.Reader - /** - * Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - * with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). - * - * General purpose buckets - Setting this header to true causes Amazon S3 to use - * an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this - * header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. - * - * Directory buckets - S3 Bucket Keys are always enabled for GET and PUT - * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't - * supported, when you copy SSE-KMS encrypted objects from general purpose buckets - * to directory buckets, from directory buckets to general purpose buckets, or - * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a - * call to KMS every time a copy request is made for a KMS-encrypted object. - * - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops - */ - bucketKeyEnabled?: boolean - /** - * Can be used to specify caching behavior along the request/reply chain. For more - * information, see [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9]. - * - * [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 - */ - cacheControl?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 - * fails the request with the HTTP status code 400 Bad Request . - * - * For the x-amz-checksum-algorithm header, replace algorithm with the - * supported algorithm from the following list: - * - * ``` - * - CRC32 - * - * - CRC32C - * - * - SHA1 - * - * - SHA256 - * ``` - * - * For more information, see [Checking object integrity] in the Amazon S3 User Guide. - * - * If the individual checksum value you provide through x-amz-checksum-algorithm - * doesn't match the checksum algorithm you set through - * x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm - * parameter and uses the checksum algorithm that matches the provided value in - * x-amz-checksum-algorithm . - * - * For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the - * default checksum algorithm that's used for performance. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see - * [Checking object integrity]in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32C?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA1?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Specifies presentational information for the object. For more information, see [https://www.rfc-editor.org/rfc/rfc6266#section-4]. - * - * [https://www.rfc-editor.org/rfc/rfc6266#section-4]: https://www.rfc-editor.org/rfc/rfc6266#section-4 - */ - contentDisposition?: string - /** - * Specifies what content encodings have been applied to the object and thus what - * decoding mechanisms must be applied to obtain the media-type referenced by the - * Content-Type header field. For more information, see [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding]. - * - * [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding - */ - contentEncoding?: string - /** - * The language the content is in. - */ - contentLanguage?: string - /** - * Size of the body in bytes. This parameter is useful when the size of the body - * cannot be determined automatically. For more information, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length]. - * - * [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length - */ - contentLength?: number - /** - * The base64-encoded 128-bit MD5 digest of the message (without the headers) - * according to RFC 1864. This header can be used as a message integrity check to - * verify that the data is the same data that was originally sent. Although it is - * optional, we recommend using the Content-MD5 mechanism as an end-to-end - * integrity check. For more information about REST request authentication, see [REST Authentication]. - * - * The Content-MD5 header is required for any request to upload an object with a - * retention period configured using Amazon S3 Object Lock. For more information - * about Amazon S3 Object Lock, see [Amazon S3 Object Lock Overview]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - * [Amazon S3 Object Lock Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html - */ - contentMD5?: string - /** - * A standard MIME type describing the format of the contents. For more - * information, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type]. - * - * [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type - */ - contentType?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The date and time at which the object is no longer cacheable. For more - * information, see [https://www.rfc-editor.org/rfc/rfc7234#section-5.3]. - * - * [https://www.rfc-editor.org/rfc/rfc7234#section-5.3]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3 - */ - expires?: time.Time - /** - * Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantFullControl?: string - /** - * Allows grantee to read the object data and its metadata. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantRead?: string - /** - * Allows grantee to read the object ACL. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantReadACP?: string - /** - * Allows grantee to write the ACL for the applicable object. - * - * ``` - * - This functionality is not supported for directory buckets. - * - * - This functionality is not supported for Amazon S3 on Outposts. - * ``` - */ - grantWriteACP?: string - /** - * Uploads the object only if the object key name does not already exist in the - * bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. - * - * If a conflicting operation occurs during the upload S3 returns a 409 - * ConditionalRequestConflict response. On a 409 failure you should retry the - * upload. - * - * Expects the '*' (asterisk) character. - * - * For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 - * User Guide. - * - * [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html - * [RFC 7232]: https://tools.ietf.org/html/rfc7232 - */ - ifNoneMatch?: string - /** - * A map of metadata to store with the object in S3. - */ - metadata: _TygojaDict - /** - * Specifies whether a legal hold will be applied to this object. For more - * information about S3 Object Lock, see [Object Lock]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html - */ - objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus - /** - * The Object Lock mode that you want to apply to this object. - * - * This functionality is not supported for directory buckets. - */ - objectLockMode: types.ObjectLockMode - /** - * The date and time when you want this object's Object Lock to expire. Must be - * formatted as a timestamp parameter. - * - * This functionality is not supported for directory buckets. - */ - objectLockRetainUntilDate?: time.Time - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256 ). - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded; Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * Specifies the Amazon Web Services KMS Encryption Context as an additional - * encryption context to use for object encryption. The value of this header is a - * Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption - * context as key-value pairs. This value is stored as object metadata and - * automatically gets passed on to Amazon Web Services KMS for future GetObject - * operations on this object. - * - * General purpose buckets - This value must be explicitly added during CopyObject - * operations if you want an additional encryption context for your object. For - * more information, see [Encryption context]in the Amazon S3 User Guide. - * - * Directory buckets - You can optionally provide an explicit encryption context - * value. The value must match the default encryption context - the bucket Amazon - * Resource Name (ARN). An additional encryption context value is not supported. - * - * [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context - */ - ssekmsEncryptionContext?: string - /** - * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object - * encryption. If the KMS key doesn't exist in the same account that's issuing the - * command, you must use the full Key ARN not the Key ID. - * - * General purpose buckets - If you specify x-amz-server-side-encryption with - * aws:kms or aws:kms:dsse , this header specifies the ID (Key ID, Key ARN, or Key - * Alias) of the KMS key to use. If you specify - * x-amz-server-side-encryption:aws:kms or - * x-amz-server-side-encryption:aws:kms:dsse , but do not provide - * x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web - * Services managed key ( aws/s3 ) to protect the data. - * - * Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , - * you must specify the x-amz-server-side-encryption-aws-kms-key-id header with - * the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key - * to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID - * or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS - * configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the - * bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm that was used when you store this object - * in Amazon S3 (for example, AES256 , aws:kms , aws:kms:dsse ). - * - * ``` - * - General purpose buckets - You have four mutually exclusive options to - * protect data using server-side encryption in Amazon S3, depending on how you - * choose to manage the encryption keys. Specifically, the encryption key options - * are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or - * DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with - * server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You - * can optionally tell Amazon S3 to encrypt data at rest by using server-side - * encryption with other key options. For more information, see [Using Server-Side Encryption]in the Amazon S3 - * User Guide. - * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: server-side encryption with Amazon S3 - * managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys - * (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses - * the desired encryption configuration and you don't override the bucket default - * encryption in your CreateSession requests or PUT object requests. Then, new - * objects are automatically encrypted with the desired encryption settings. For - * more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about - * the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. - * ``` - * - * In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the - * ``` - * encryption request headers must match the encryption settings that are specified - * in the CreateSession request. You can't override the values of the encryption - * settings ( x-amz-server-side-encryption , - * x-amz-server-side-encryption-aws-kms-key-id , - * x-amz-server-side-encryption-context , and - * x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the - * CreateSession request. You don't need to explicitly specify these encryption - * settings values in Zonal endpoint API calls, and Amazon S3 will use the - * encryption settings values from the CreateSession request to protect new - * objects in the directory bucket. - * ``` - * - * When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the - * ``` - * session token refreshes automatically to avoid service interruptions when a - * session expires. The CLI or the Amazon Web Services SDKs use the bucket's - * default encryption configuration for the CreateSession request. It's not - * supported to override the encryption settings values in the CreateSession - * request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption - * request headers must match the default encryption configuration of the directory - * bucket. - * ``` - * - * [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html - * [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html - * [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - */ - serverSideEncryption: types.ServerSideEncryption - /** - * By default, Amazon S3 uses the STANDARD Storage Class to store newly created - * objects. The STANDARD storage class provides high durability and high - * availability. Depending on performance needs, you can specify a different - * Storage Class. For more information, see [Storage Classes]in the Amazon S3 User Guide. - * - * ``` - * - For directory buckets, only the S3 Express One Zone storage class is - * supported to store newly created objects. - * - * - Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. - * ``` - * - * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html - */ - storageClass: types.StorageClass - /** - * The tag-set for the object. The tag-set must be encoded as URL Query - * parameters. (For example, "Key1=Value1") - * - * This functionality is not supported for directory buckets. - */ - tagging?: string - /** - * If the bucket is configured as a website, redirects requests for this object to - * another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata. For information about object - * metadata, see [Object Key and Metadata]in the Amazon S3 User Guide. - * - * In the following example, the request header sets the redirect to an object - * (anotherPage.html) in the same bucket: - * - * ``` - * x-amz-website-redirect-location: /anotherPage.html - * ``` - * - * In the following example, the request header sets the object redirect to - * another website: - * - * ``` - * x-amz-website-redirect-location: http://www.example.com/ - * ``` - * - * For more information about website hosting in Amazon S3, see [Hosting Websites on Amazon S3] and [How to Configure Website Page Redirects] in the - * Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. - * - * [How to Configure Website Page Redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html - * [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html - * [Object Key and Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html - */ - websiteRedirectLocation?: string - } - type _subjaEwo = noSmithyDocumentSerde - interface PutObjectOutput extends _subjaEwo { - /** - * Indicates whether the uploaded object uses an S3 Bucket Key for server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - /** - * Entity tag for the uploaded object. - * - * General purpose buckets - To ensure that data is not corrupted traversing the - * network, for objects where the ETag is the MD5 digest of the object, you can - * calculate the MD5 while putting an object to Amazon S3 and compare the returned - * ETag to the calculated MD5 value. - * - * Directory buckets - The ETag for the object in a directory bucket isn't the MD5 - * digest of the object. - */ - eTag?: string - /** - * If the expiration is configured for the object (see [PutBucketLifecycleConfiguration]) in the Amazon S3 User - * Guide, the response includes this header. It includes the expiry-date and - * rule-id key-value pairs that provide information about object expiration. The - * value of the rule-id is URL-encoded. - * - * This functionality is not supported for directory buckets. - * - * [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html - */ - expiration?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the Amazon Web Services KMS Encryption Context to use for - * object encryption. The value of this header is a Base64-encoded string of a - * UTF-8 encoded JSON, which contains the encryption context as key-value pairs. - * This value is stored as object metadata and automatically gets passed on to - * Amazon Web Services KMS for future GetObject operations on this object. - */ - ssekmsEncryptionContext?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3. - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Version ID of the object. - * - * If you enable versioning for a bucket, Amazon S3 automatically generates a - * unique version ID for the object being stored. Amazon S3 returns this ID in the - * response. When you enable versioning for a bucket, if Amazon S3 receives - * multiple write requests for the same object simultaneously, it stores all of the - * objects. For more information about versioning, see [Adding Objects to Versioning-Enabled Buckets]in the Amazon S3 User - * Guide. For information about returning the versioning state of a bucket, see [GetBucketVersioning]. - * - * This functionality is not supported for directory buckets. - * - * [Adding Objects to Versioning-Enabled Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html - * [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subVpPqA = noSmithyDocumentSerde - interface PutObjectAclInput extends _subVpPqA { - /** - * The bucket name that contains the object to which you want to attach the ACL. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Key for which the PUT action was initiated. - * - * This member is required. - */ - key?: string - /** - * The canned ACL to apply to the object. For more information, see [Canned ACL]. - * - * [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL - */ - acl: types.ObjectCannedACL - /** - * Contains the elements that set the ACL permissions for an object per grantee. - */ - accessControlPolicy?: types.AccessControlPolicy - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The base64-encoded 128-bit MD5 digest of the data. This header must be used as - * a message integrity check to verify that the request body was not corrupted in - * transit. For more information, go to [RFC 1864.>] - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - * - * [RFC 1864.>]: http://www.ietf.org/rfc/rfc1864.txt - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Allows grantee the read, write, read ACP, and write ACP permissions on the - * bucket. - * - * This functionality is not supported for Amazon S3 on Outposts. - */ - grantFullControl?: string - /** - * Allows grantee to list the objects in the bucket. - * - * This functionality is not supported for Amazon S3 on Outposts. - */ - grantRead?: string - /** - * Allows grantee to read the bucket ACL. - * - * This functionality is not supported for Amazon S3 on Outposts. - */ - grantReadACP?: string - /** - * Allows grantee to create new objects in the bucket. - * - * For the bucket and object owners of existing objects, also allows deletions and - * overwrites of those objects. - */ - grantWrite?: string - /** - * Allows grantee to write the ACL for the applicable bucket. - * - * This functionality is not supported for Amazon S3 on Outposts. - */ - grantWriteACP?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Version ID used to reference a specific version of the object. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - } - type _subVxRKD = noSmithyDocumentSerde - interface PutObjectAclOutput extends _subVxRKD { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subbvBPU = noSmithyDocumentSerde - interface PutObjectLegalHoldInput extends _subbvBPU { - /** - * The bucket name containing the object that you want to place a legal hold on. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The key name for the object that you want to place a legal hold on. - * - * This member is required. - */ - key?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The MD5 hash for the request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Container element for the legal hold configuration you want to apply to the - * specified object. - */ - legalHold?: types.ObjectLockLegalHold - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The version ID of the object that you want to place a legal hold on. - */ - versionId?: string - } - type _subDzyOS = noSmithyDocumentSerde - interface PutObjectLegalHoldOutput extends _subDzyOS { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subWezci = noSmithyDocumentSerde - interface PutObjectLockConfigurationInput extends _subWezci { - /** - * The bucket whose Object Lock configuration you want to create or replace. - * - * This member is required. - */ - bucket?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The MD5 hash for the request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The Object Lock configuration that you want to apply to the specified bucket. - */ - objectLockConfiguration?: types.ObjectLockConfiguration - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * A token to allow Object Lock to be enabled for an existing bucket. - */ - token?: string - } - type _subarufO = noSmithyDocumentSerde - interface PutObjectLockConfigurationOutput extends _subarufO { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subGRszz = noSmithyDocumentSerde - interface PutObjectRetentionInput extends _subGRszz { - /** - * The bucket name that contains the object you want to apply this Object - * Retention configuration to. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * The key name for the object that you want to apply this Object Retention - * configuration to. - * - * This member is required. - */ - key?: string - /** - * Indicates whether this action should bypass Governance-mode restrictions. - */ - bypassGovernanceRetention?: boolean - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The MD5 hash for the request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The container element for the Object Retention configuration. - */ - retention?: types.ObjectLockRetention - /** - * The version ID for the object that you want to apply this Object Retention - * configuration to. - */ - versionId?: string - } - type _subrNawZ = noSmithyDocumentSerde - interface PutObjectRetentionOutput extends _subrNawZ { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subMqnHb = noSmithyDocumentSerde - interface PutObjectTaggingInput extends _subMqnHb { - /** - * The bucket name containing the object. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Name of the object key. - * - * This member is required. - */ - key?: string - /** - * Container for the TagSet and Tag elements - * - * This member is required. - */ - tagging?: types.Tagging - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The MD5 hash for the request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * The versionId of the object that the tag-set will be added to. - */ - versionId?: string - } - type _subTwuto = noSmithyDocumentSerde - interface PutObjectTaggingOutput extends _subTwuto { - /** - * The versionId of the object the tag-set was added to. - */ - versionId?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subkucAm = noSmithyDocumentSerde - interface PutPublicAccessBlockInput extends _subkucAm { - /** - * The name of the Amazon S3 bucket whose PublicAccessBlock configuration you want - * to set. - * - * This member is required. - */ - bucket?: string - /** - * The PublicAccessBlock configuration that you want to apply to this Amazon S3 - * bucket. You can enable the configuration options in any combination. For more - * information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in - * the Amazon S3 User Guide. - * - * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status - * - * This member is required. - */ - publicAccessBlockConfiguration?: types.PublicAccessBlockConfiguration - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The MD5 hash of the PutPublicAccessBlock request body. - * - * For requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - } - type _subTHBGk = noSmithyDocumentSerde - interface PutPublicAccessBlockOutput extends _subTHBGk { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subBLDTT = noSmithyDocumentSerde - interface RestoreObjectInput extends _subBLDTT { - /** - * The bucket name containing the object to restore. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which the action was initiated. - * - * This member is required. - */ - key?: string - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Container for restore job parameters. - */ - restoreRequest?: types.RestoreRequest - /** - * VersionId used to reference a specific version of the object. - */ - versionId?: string - } - type _submerZr = noSmithyDocumentSerde - interface RestoreObjectOutput extends _submerZr { - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Indicates the path in the provided S3 output location where Select results will - * be restored to. - */ - restoreOutputPath?: string - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - // @ts-ignore - import smithysync = sync - /** - * Learn Amazon S3 Select is no longer available to new customers. Existing - * customers of Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Request to filter the contents of an Amazon S3 object based on a simple - * Structured Query Language (SQL) statement. In the request, along with the SQL - * expression, you must specify a data serialization format (JSON or CSV) of the - * object. Amazon S3 uses this to parse object data into records. It returns only - * records that match the specified SQL expression. You must also specify the data - * serialization format for the response. For more information, see [S3Select API Documentation]. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [S3Select API Documentation]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html - */ - type _subSsfuY = noSmithyDocumentSerde - interface SelectObjectContentInput extends _subSsfuY { - /** - * The S3 bucket. - * - * This member is required. - */ - bucket?: string - /** - * The expression that is used to query the object. - * - * This member is required. - */ - expression?: string - /** - * The type of the provided expression (for example, SQL). - * - * This member is required. - */ - expressionType: types.ExpressionType - /** - * Describes the format of the data in the object that is being queried. - * - * This member is required. - */ - inputSerialization?: types.InputSerialization - /** - * The object key. - * - * This member is required. - */ - key?: string - /** - * Describes the format of the data that you want Amazon S3 to return in response. - * - * This member is required. - */ - outputSerialization?: types.OutputSerialization - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Specifies if periodic request progress information should be enabled. - */ - requestProgress?: types.RequestProgress - /** - * The server-side encryption (SSE) algorithm used to encrypt the object. This - * parameter is needed only when the object was created using a checksum algorithm. - * For more information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerAlgorithm?: string - /** - * The server-side encryption (SSE) customer managed key. This parameter is needed - * only when the object was created using a checksum algorithm. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKey?: string - /** - * The MD5 server-side encryption (SSE) customer managed key. This parameter is - * needed only when the object was created using a checksum algorithm. For more - * information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. - * - * [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKeyMD5?: string - /** - * Specifies the byte range of the object to get the records from. A record is - * processed when its first byte is contained by the range. This parameter is - * optional, but when specified, it must not be empty. See RFC 2616, Section - * 14.35.1 about how to specify the start and end of the range. - * - * ScanRange may be used in the following ways: - * - * ``` - * - 50100 - process only the records starting between the bytes 50 and 100 - * (inclusive, counting from zero) - * - * - 50 - process only the records starting after the byte 50 - * - * - 50 - process only the records within the last 50 bytes of the file. - * ``` - */ - scanRange?: types.ScanRange - } - type _subWVucK = noSmithyDocumentSerde - interface SelectObjectContentOutput extends _subWVucK { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - interface SelectObjectContentOutput { - /** - * GetStream returns the type to interact with the event stream. - */ - getStream(): (SelectObjectContentEventStream) - } - type _subFirAv = noSmithyDocumentSerde - interface UploadPartInput extends _subFirAv { - /** - * The name of the bucket to which the multipart upload was initiated. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Object key for which the multipart upload was initiated. - * - * This member is required. - */ - key?: string - /** - * Part number of part being uploaded. This is a positive integer between 1 and - * 10,000. - * - * This member is required. - */ - partNumber?: number - /** - * Upload ID identifying the multipart upload whose part is being uploaded. - * - * This member is required. - */ - uploadId?: string - /** - * Object data. - */ - body: io.Reader - /** - * Indicates the algorithm used to create the checksum for the object when you use - * the SDK. This header will not provide any additional functionality if you don't - * use the SDK. When you send this header, there must be a corresponding - * x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - * request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * If you provide an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter. - * - * This checksum algorithm must be the same for all parts and it match the - * checksum value supplied in the CreateMultipartUpload request. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumAlgorithm: types.ChecksumAlgorithm - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see - * [Checking object integrity]in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32C?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA1?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Size of the body in bytes. This parameter is useful when the size of the body - * cannot be determined automatically. - */ - contentLength?: number - /** - * The base64-encoded 128-bit MD5 digest of the part data. This parameter is - * auto-populated when using the command from the CLI. This parameter is required - * if object lock parameters are specified. - * - * This functionality is not supported for directory buckets. - */ - contentMD5?: string - /** - * The account ID of the expected bucket owner. If the account ID that you provide - * does not match the actual owner of the bucket, the request fails with the HTTP - * status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256). - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded; Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header . This must be the same - * encryption key specified in the initiate multipart upload request. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - } - type _subcuUYr = noSmithyDocumentSerde - interface UploadPartOutput extends _subcuUYr { - /** - * Indicates whether the multipart upload uses an S3 Bucket Key for server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - /** - * Entity tag for the uploaded object. - */ - eTag?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3 (for example, AES256 , aws:kms ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subdnmpc = noSmithyDocumentSerde - interface UploadPartCopyInput extends _subdnmpc { - /** - * The bucket name. - * - * Directory buckets - When you use this operation with a directory bucket, you - * must use virtual-hosted-style requests in the format - * Bucket_name.s3express-az_id.region.amazonaws.com . Path-style requests are not - * supported. Directory bucket names must be unique in the chosen Availability - * Zone. Bucket names must follow the format bucket_base_name--az-id--x-s3 (for - * example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket - * naming restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. - * - * Access points - When you use this action with an access point, you must provide - * the alias of the access point in place of the bucket name or specify the access - * point ARN. When using the access point ARN, you must direct requests to the - * access point hostname. The access point hostname takes the form - * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - * action with an access point through the Amazon Web Services SDKs, you provide - * the access point ARN in place of the bucket name. For more information about - * access point ARNs, see [Using access points]in the Amazon S3 User Guide. - * - * Access points and Object Lambda access points are not supported by directory - * buckets. - * - * S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form - * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - * use this action with S3 on Outposts through the Amazon Web Services SDKs, you - * provide the Outposts access point ARN in place of the bucket name. For more - * information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. - * - * [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html - * [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html - * [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html - * - * This member is required. - */ - bucket?: string - /** - * Specifies the source object for the copy operation. You specify the value in - * one of two formats, depending on whether you want to access the source object - * through an [access point]: - * - * ``` - * - For objects not accessed through an access point, specify the name of the - * source bucket and key of the source object, separated by a slash (/). For - * example, to copy the object reports/january.pdf from the bucket - * awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value must - * be URL-encoded. - * - * - For objects accessed through access points, specify the Amazon Resource - * Name (ARN) of the object as accessed through the access point, in the format - * arn:aws:s3:::accesspoint//object/ . For example, to copy the object - * reports/january.pdf through access point my-access-point owned by account - * 123456789012 in Region us-west-2 , use the URL encoding of - * arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf - * . The value must be URL encoded. - * - * - Amazon S3 supports copy operations using Access points only when the source - * and destination buckets are in the same Amazon Web Services Region. - * - * - Access points are not supported by directory buckets. - * ``` - * - * Alternatively, for objects accessed through Amazon S3 on Outposts, specify the - * ``` - * ARN of the object as accessed in the format - * arn:aws:s3-outposts:::outpost//object/ . For example, to copy the object - * reports/january.pdf through outpost my-outpost owned by account 123456789012 - * in Region us-west-2 , use the URL encoding of - * arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf - * . The value must be URL-encoded. - * ``` - * - * If your bucket has versioning enabled, you could have multiple versions of the - * same object. By default, x-amz-copy-source identifies the current version of - * the source object to copy. To copy a specific version of the source object to - * copy, append ?versionId= to the x-amz-copy-source request header (for example, - * x-amz-copy-source: - * /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 - * ). - * - * If the current version is a delete marker and you don't specify a versionId in - * the x-amz-copy-source request header, Amazon S3 returns a 404 Not Found error, - * because the object does not exist. If you specify versionId in the - * x-amz-copy-source and the versionId is a delete marker, Amazon S3 returns an - * HTTP 400 Bad Request error, because you are not allowed to specify a delete - * marker as a version for the x-amz-copy-source . - * - * Directory buckets - S3 Versioning isn't enabled and supported for directory - * buckets. - * - * [access point]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html - * - * This member is required. - */ - copySource?: string - /** - * Object key for which the multipart upload was initiated. - * - * This member is required. - */ - key?: string - /** - * Part number of part being copied. This is a positive integer between 1 and - * 10,000. - * - * This member is required. - */ - partNumber?: number - /** - * Upload ID identifying the multipart upload whose part is being copied. - * - * This member is required. - */ - uploadId?: string - /** - * Copies the object if its entity tag (ETag) matches the specified tag. - * - * If both of the x-amz-copy-source-if-match and - * x-amz-copy-source-if-unmodified-since headers are present in the request as - * follows: - * - * x-amz-copy-source-if-match condition evaluates to true , and; - * - * x-amz-copy-source-if-unmodified-since condition evaluates to false ; - * - * Amazon S3 returns 200 OK and copies the data. - */ - copySourceIfMatch?: string - /** - * Copies the object if it has been modified since the specified time. - * - * If both of the x-amz-copy-source-if-none-match and - * x-amz-copy-source-if-modified-since headers are present in the request as - * follows: - * - * x-amz-copy-source-if-none-match condition evaluates to false , and; - * - * x-amz-copy-source-if-modified-since condition evaluates to true ; - * - * Amazon S3 returns 412 Precondition Failed response code. - */ - copySourceIfModifiedSince?: time.Time - /** - * Copies the object if its entity tag (ETag) is different than the specified ETag. - * - * If both of the x-amz-copy-source-if-none-match and - * x-amz-copy-source-if-modified-since headers are present in the request as - * follows: - * - * x-amz-copy-source-if-none-match condition evaluates to false , and; - * - * x-amz-copy-source-if-modified-since condition evaluates to true ; - * - * Amazon S3 returns 412 Precondition Failed response code. - */ - copySourceIfNoneMatch?: string - /** - * Copies the object if it hasn't been modified since the specified time. - * - * If both of the x-amz-copy-source-if-match and - * x-amz-copy-source-if-unmodified-since headers are present in the request as - * follows: - * - * x-amz-copy-source-if-match condition evaluates to true , and; - * - * x-amz-copy-source-if-unmodified-since condition evaluates to false ; - * - * Amazon S3 returns 200 OK and copies the data. - */ - copySourceIfUnmodifiedSince?: time.Time - /** - * The range of bytes to copy from the source object. The range value must use the - * form bytes=first-last, where the first and last are the zero-based byte offsets - * to copy. For example, bytes=0-9 indicates that you want to copy the first 10 - * bytes of the source. You can copy a range only if the source object is greater - * than 5 MB. - */ - copySourceRange?: string - /** - * Specifies the algorithm to use when decrypting the source object (for example, - * AES256 ). - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceSSECustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - * the source object. The encryption key provided in this header must be one that - * was used when the source object was created. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceSSECustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceSSECustomerKeyMD5?: string - /** - * The account ID of the expected destination bucket owner. If the account ID that - * you provide does not match the actual owner of the destination bucket, the - * request fails with the HTTP status code 403 Forbidden (access denied). - */ - expectedBucketOwner?: string - /** - * The account ID of the expected source bucket owner. If the account ID that you - * provide does not match the actual owner of the source bucket, the request fails - * with the HTTP status code 403 Forbidden (access denied). - */ - expectedSourceBucketOwner?: string - /** - * Confirms that the requester knows that they will be charged for the request. - * Bucket owners need not specify this parameter in their requests. If either the - * source or destination S3 bucket has Requester Pays enabled, the requester will - * pay for corresponding charges to copy the object. For information about - * downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User - * Guide. - * - * This functionality is not supported for directory buckets. - * - * [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - */ - requestPayer: types.RequestPayer - /** - * Specifies the algorithm to use when encrypting the object (for example, AES256). - * - * This functionality is not supported when the destination bucket is a directory - * bucket. - */ - sseCustomerAlgorithm?: string - /** - * Specifies the customer-provided encryption key for Amazon S3 to use in - * encrypting data. This value is used to store the object and then it is - * discarded; Amazon S3 does not store the encryption key. The key must be - * appropriate for use with the algorithm specified in the - * x-amz-server-side-encryption-customer-algorithm header. This must be the same - * encryption key specified in the initiate multipart upload request. - * - * This functionality is not supported when the destination bucket is a directory - * bucket. - */ - sseCustomerKey?: string - /** - * Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error. - * - * This functionality is not supported when the destination bucket is a directory - * bucket. - */ - sseCustomerKeyMD5?: string - } - type _subCujVN = noSmithyDocumentSerde - interface UploadPartCopyOutput extends _subCujVN { - /** - * Indicates whether the multipart upload uses an S3 Bucket Key for server-side - * encryption with Key Management Service (KMS) keys (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * Container for all response elements. - */ - copyPartResult?: types.CopyPartResult - /** - * The version of the source object that was copied, if you have enabled - * versioning on the source bucket. - * - * This functionality is not supported when the source object is in a directory - * bucket. - */ - copySourceVersionId?: string - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to confirm the encryption - * algorithm that's used. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerAlgorithm?: string - /** - * If server-side encryption with a customer-provided encryption key was - * requested, the response will include this header to provide the round-trip - * message integrity verification of the customer-provided encryption key. - * - * This functionality is not supported for directory buckets. - */ - sseCustomerKeyMD5?: string - /** - * If present, indicates the ID of the KMS key that was used for object encryption. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when you store this object in Amazon - * S3 (for example, AES256 , aws:kms ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - type _subzKJfa = noSmithyDocumentSerde - interface WriteGetObjectResponseInput extends _subzKJfa { - /** - * Route prefix to the HTTP URL generated. - * - * This member is required. - */ - requestRoute?: string - /** - * A single use encrypted token that maps WriteGetObjectResponse to the end user - * GetObject request. - * - * This member is required. - */ - requestToken?: string - /** - * Indicates that a range of bytes was specified. - */ - acceptRanges?: string - /** - * The object data. - */ - body: io.Reader - /** - * Indicates whether the object stored in Amazon S3 uses an S3 bucket key for - * server-side encryption with Amazon Web Services KMS (SSE-KMS). - */ - bucketKeyEnabled?: boolean - /** - * Specifies caching behavior along the request/reply chain. - */ - cacheControl?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object returned by the Object - * Lambda function. This may not match the checksum for the object stored in Amazon - * S3. Amazon S3 will perform validation of the checksum values only when the - * original GetObject request required checksum validation. For more information - * about checksums, see [Checking object integrity]in the Amazon S3 User Guide. - * - * Only one checksum header can be specified at a time. If you supply multiple - * checksum headers, this request will fail. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This specifies the - * base64-encoded, 32-bit CRC-32C checksum of the object returned by the Object - * Lambda function. This may not match the checksum for the object stored in Amazon - * S3. Amazon S3 will perform validation of the checksum values only when the - * original GetObject request required checksum validation. For more information - * about checksums, see [Checking object integrity]in the Amazon S3 User Guide. - * - * Only one checksum header can be specified at a time. If you supply multiple - * checksum headers, this request will fail. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32C?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This specifies the - * base64-encoded, 160-bit SHA-1 digest of the object returned by the Object Lambda - * function. This may not match the checksum for the object stored in Amazon S3. - * Amazon S3 will perform validation of the checksum values only when the original - * GetObject request required checksum validation. For more information about - * checksums, see [Checking object integrity]in the Amazon S3 User Guide. - * - * Only one checksum header can be specified at a time. If you supply multiple - * checksum headers, this request will fail. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA1?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This specifies the - * base64-encoded, 256-bit SHA-256 digest of the object returned by the Object - * Lambda function. This may not match the checksum for the object stored in Amazon - * S3. Amazon S3 will perform validation of the checksum values only when the - * original GetObject request required checksum validation. For more information - * about checksums, see [Checking object integrity]in the Amazon S3 User Guide. - * - * Only one checksum header can be specified at a time. If you supply multiple - * checksum headers, this request will fail. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Specifies presentational information for the object. - */ - contentDisposition?: string - /** - * Specifies what content encodings have been applied to the object and thus what - * decoding mechanisms must be applied to obtain the media-type referenced by the - * Content-Type header field. - */ - contentEncoding?: string - /** - * The language the content is in. - */ - contentLanguage?: string - /** - * The size of the content body in bytes. - */ - contentLength?: number - /** - * The portion of the object returned in the response. - */ - contentRange?: string - /** - * A standard MIME type describing the format of the object data. - */ - contentType?: string - /** - * Specifies whether an object stored in Amazon S3 is ( true ) or is not ( false ) - * a delete marker. - */ - deleteMarker?: boolean - /** - * An opaque identifier assigned by a web server to a specific version of a - * resource found at a URL. - */ - eTag?: string - /** - * A string that uniquely identifies an error condition. Returned in the tag of - * the error XML response for a corresponding GetObject call. Cannot be used with - * a successful StatusCode header or when the transformed object is provided in - * the body. All error codes from S3 are sentence-cased. The regular expression - * (regex) value is "^[A-Z][a-zA-Z]+$" . - */ - errorCode?: string - /** - * Contains a generic description of the error condition. Returned in the tag of - * the error XML response for a corresponding GetObject call. Cannot be used with - * a successful StatusCode header or when the transformed object is provided in - * body. - */ - errorMessage?: string - /** - * If the object expiration is configured (see PUT Bucket lifecycle), the response - * includes this header. It includes the expiry-date and rule-id key-value pairs - * that provide the object expiration information. The value of the rule-id is - * URL-encoded. - */ - expiration?: string - /** - * The date and time at which the object is no longer cacheable. - */ - expires?: time.Time - /** - * The date and time that the object was last modified. - */ - lastModified?: time.Time - /** - * A map of metadata to store with the object in S3. - */ - metadata: _TygojaDict - /** - * Set to the number of metadata entries not returned in x-amz-meta headers. This - * can happen if you create metadata using an API like SOAP that supports more - * flexible metadata than the REST API. For example, using SOAP, you can create - * metadata whose values are not legal HTTP headers. - */ - missingMeta?: number - /** - * Indicates whether an object stored in Amazon S3 has an active legal hold. - */ - objectLockLegalHoldStatus: types.ObjectLockLegalHoldStatus - /** - * Indicates whether an object stored in Amazon S3 has Object Lock enabled. For - * more information about S3 Object Lock, see [Object Lock]. - * - * [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html - */ - objectLockMode: types.ObjectLockMode - /** - * The date and time when Object Lock is configured to expire. - */ - objectLockRetainUntilDate?: time.Time - /** - * The count of parts this object has. - */ - partsCount?: number - /** - * Indicates if request involves bucket that is either a source or destination in - * a Replication rule. For more information about S3 Replication, see [Replication]. - * - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html - */ - replicationStatus: types.ReplicationStatus - /** - * If present, indicates that the requester was successfully charged for the - * request. - * - * This functionality is not supported for directory buckets. - */ - requestCharged: types.RequestCharged - /** - * Provides information about object restoration operation and expiration time of - * the restored object copy. - */ - restore?: string - /** - * Encryption algorithm used if server-side encryption with a customer-provided - * encryption key was specified for object stored in Amazon S3. - */ - sseCustomerAlgorithm?: string - /** - * 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 to - * encrypt data stored in S3. For more information, see [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]. - * - * [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html - */ - sseCustomerKeyMD5?: string - /** - * If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web - * Services Key Management Service (Amazon Web Services KMS) symmetric encryption - * customer managed key that was used for stored in Amazon S3 object. - */ - ssekmsKeyId?: string - /** - * The server-side encryption algorithm used when storing requested object in - * Amazon S3 (for example, AES256, aws:kms ). - */ - serverSideEncryption: types.ServerSideEncryption - /** - * The integer status code for an HTTP response of a corresponding GetObject - * request. The following is a list of status codes. - * - * ``` - * - 200 - OK - * - * - 206 - Partial Content - * - * - 304 - Not Modified - * - * - 400 - Bad Request - * - * - 401 - Unauthorized - * - * - 403 - Forbidden - * - * - 404 - Not Found - * - * - 405 - Method Not Allowed - * - * - 409 - Conflict - * - * - 411 - Length Required - * - * - 412 - Precondition Failed - * - * - 416 - Range Not Satisfiable - * - * - 500 - Internal Server Error - * - * - 503 - Service Unavailable - * ``` - */ - statusCode?: number - /** - * Provides storage class information of the object. Amazon S3 returns this header - * for all objects except for S3 Standard storage class objects. - * - * For more information, see [Storage Classes]. - * - * [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html - */ - storageClass: types.StorageClass - /** - * The number of tags, if any, on the object. - */ - tagCount?: number - /** - * An ID used to reference a specific version of the object. - */ - versionId?: string - } - type _subVwCeO = noSmithyDocumentSerde - interface WriteGetObjectResponseOutput extends _subVwCeO { - /** - * Metadata pertaining to the operation's result. - */ - resultMetadata: middleware.Metadata - } - // @ts-ignore - import internalcontext = context - // @ts-ignore - import awsxml = xml - // @ts-ignore - import internalendpoints = endpoints - // @ts-ignore - import smithyendpoints = endpoints - interface Options { - /** - * Set of options to modify how an operation is invoked. These apply to all - * operations invoked for this client. Use functional options on operation call to - * modify this list for per operation behavior. - */ - apiOptions: Array<(_arg0: middleware.Stack) => void> - /** - * The optional application specific identifier appended to the User-Agent header. - */ - appID: string - /** - * This endpoint will be given as input to an EndpointResolverV2. It is used for - * providing a custom base endpoint that is subject to modifications by the - * processing EndpointResolverV2. - */ - baseEndpoint?: string - /** - * Configures the events that will be sent to the configured logger. - */ - clientLogMode: aws.ClientLogMode - /** - * The threshold ContentLength in bytes for HTTP PUT request to receive {Expect: - * 100-continue} header. Setting to -1 will disable adding the Expect header to - * requests; setting to 0 will set the threshold to default 2MB - */ - continueHeaderThresholdBytes: number - /** - * The credentials object to use when signing requests. - */ - credentials: aws.CredentialsProvider - /** - * The configuration DefaultsMode that the SDK should use when constructing the - * clients initial default settings. - */ - defaultsMode: aws.DefaultsMode - /** - * Allows you to disable S3 Multi-Region access points feature. - */ - disableMultiRegionAccessPoints: boolean - /** - * Disables this client's usage of Session Auth for S3Express buckets and reverts - * to using conventional SigV4 for those. - */ - disableS3ExpressSessionAuth?: boolean - /** - * The endpoint options to be used when attempting to resolve an endpoint. - */ - endpointOptions: EndpointResolverOptions - /** - * The service endpoint resolver. - * - * Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - * value for this field will likely prevent you from using any endpoint-related - * service features released after the introduction of EndpointResolverV2 and - * BaseEndpoint. - * - * To migrate an EndpointResolver implementation that uses a custom endpoint, set - * the client option BaseEndpoint instead. - */ - endpointResolver: EndpointResolver - /** - * Resolves the endpoint used for a particular service operation. This should be - * used over the deprecated EndpointResolver. - */ - endpointResolverV2: EndpointResolverV2 - /** - * The credentials provider for S3Express requests. - */ - expressCredentials: ExpressCredentialsProvider - /** - * Signature Version 4 (SigV4) Signer - */ - httpSignerV4: HTTPSignerV4 - /** - * The logger writer interface to write logging messages to. - */ - logger: logging.Logger - /** - * The client meter provider. - */ - meterProvider: metrics.MeterProvider - /** - * The region to send requests to. (Required) - */ - region: string - /** - * RetryMaxAttempts specifies the maximum number attempts an API client will call - * an operation that fails with a retryable error. A value of 0 is ignored, and - * will not be used to configure the API client created default retryer, or modify - * per operation call's retry max attempts. - * - * If specified in an operation call's functional options with a value that is - * different than the constructed client's Options, the Client's Retryer will be - * wrapped to use the operation's specific RetryMaxAttempts value. - */ - retryMaxAttempts: number - /** - * RetryMode specifies the retry mode the API client will be created with, if - * Retryer option is not also specified. - * - * When creating a new API Clients this member will only be used if the Retryer - * Options member is nil. This value will be ignored if Retryer is not nil. - * - * Currently does not support per operation call overrides, may in the future. - */ - retryMode: aws.RetryMode - /** - * Retryer guides how HTTP requests should be retried in case of recoverable - * failures. When nil the API client will use a default retryer. The kind of - * default retry created by the API client can be changed with the RetryMode - * option. - */ - retryer: aws.Retryer - /** - * The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - * to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - * should not populate this structure programmatically, or rely on the values here - * within your applications. - */ - runtimeEnvironment: aws.RuntimeEnvironment - /** - * The client tracer provider. - */ - tracerProvider: tracing.TracerProvider - /** - * Allows you to enable arn region support for the service. - */ - useARNRegion: boolean - /** - * Allows you to enable S3 Accelerate feature. All operations compatible with S3 - * Accelerate will use the accelerate endpoint for requests. Requests not - * compatible will fall back to normal S3 requests. The bucket must be enabled for - * accelerate to be used with S3 client with accelerate enabled. If the bucket is - * not enabled for accelerate an error will be returned. The bucket name must be - * DNS compatible to work with accelerate. - */ - useAccelerate: boolean - /** - * Allows you to enable dual-stack endpoint support for the service. - * - * Deprecated: Set dual-stack by setting UseDualStackEndpoint on - * EndpointResolverOptions. When EndpointResolverOptions' UseDualStackEndpoint - * field is set it overrides this field value. - */ - useDualstack: boolean - /** - * Allows you to enable the client to use path-style addressing, i.e., - * https://s3.amazonaws.com/BUCKET/KEY . By default, the S3 client will use virtual - * hosted bucket addressing when possible( https://BUCKET.s3.amazonaws.com/KEY ). - */ - usePathStyle: boolean - /** - * The HTTP client to invoke API calls with. Defaults to client's default HTTP - * implementation if nil. - */ - httpClient: HTTPClient - /** - * The auth scheme resolver which determines how to authenticate for each - * operation. - */ - authSchemeResolver: AuthSchemeResolver - /** - * The list of auth schemes supported by the client. - */ - authSchemes: Array - } - interface Options { - /** - * Copy creates a clone where the APIOptions list is deep copied. - */ - copy(): Options - } - interface Options { - getIdentityResolver(schemeID: string): smithyauth.IdentityResolver - } - // @ts-ignore - import v4 = signer -} - -/** - * Package gcerr provides an error type for Go CDK APIs. - */ -namespace gcerr { - interface ErrorCode { - string(): string - } - /** - * An ErrorCode describes the error's category. - */ - interface ErrorCode extends Number{} -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Writer writes bytes to a blob. - * - * It implements io.WriteCloser (https://golang.org/pkg/io/#Closer), and must be - * closed after all writes are done. - */ - interface Writer { - } - interface Writer { - /** - * Write implements the io.Writer interface (https://golang.org/pkg/io/#Writer). - * - * Writes may happen asynchronously, so the returned error can be nil - * even if the actual write eventually fails. The write is only guaranteed to - * have succeeded if Close returns no error. - */ - write(p: string|Array): number - } - interface Writer { - /** - * Close closes the blob writer. The write operation is not guaranteed to have succeeded until - * Close returns with no error. - * Close may return an error if the context provided to create the Writer is - * canceled or reaches its deadline. - */ - close(): void - } - interface Writer { - /** - * ReadFrom reads from r and writes to w until EOF or error. - * The return value is the number of bytes read from r. - * - * It implements the io.ReaderFrom interface. - */ - readFrom(r: io.Reader): number - } - /** - * ListOptions sets options for listing blobs via Bucket.List. - */ - interface ListOptions { - /** - * Prefix indicates that only blobs with a key starting with this prefix - * should be returned. - */ - prefix: string - /** - * Delimiter sets the delimiter used to define a hierarchical namespace, - * like a filesystem with "directories". It is highly recommended that you - * use "" or "/" as the Delimiter. Other values should work through this API, - * but service UIs generally assume "/". - * - * An empty delimiter means that the bucket is treated as a single flat - * namespace. - * - * A non-empty delimiter means that any result with the delimiter in its key - * after Prefix is stripped will be returned with ListObject.IsDir = true, - * ListObject.Key truncated after the delimiter, and zero values for other - * ListObject fields. These results represent "directories". Multiple results - * in a "directory" are returned as a single result. - */ - delimiter: string - /** - * BeforeList is a callback that will be called before each call to the - * the underlying service's list functionality. - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. - */ - beforeList: (asFunc: (_arg0: { - }) => boolean) => void - } - /** - * ListIterator iterates over List results. - */ - interface ListIterator { - } - interface ListIterator { - /** - * Next returns a *ListObject for the next blob. It returns (nil, io.EOF) if - * there are no more. - */ - next(ctx: context.Context): (ListObject) - } - /** - * SignedURLOptions sets options for SignedURL. - */ - interface SignedURLOptions { - /** - * Expiry sets how long the returned URL is valid for. - * Defaults to DefaultSignedURLExpiry. - */ - expiry: time.Duration - /** - * Method is the HTTP method that can be used on the URL; one of "GET", "PUT", - * or "DELETE". Defaults to "GET". - */ - method: string - /** - * ContentType specifies the Content-Type HTTP header the user agent is - * permitted to use in the PUT request. It must match exactly. See - * EnforceAbsentContentType for behavior when ContentType is the empty string. - * If a bucket does not implement this verification, then it returns an - * Unimplemented error. - * - * Must be empty for non-PUT requests. - */ - contentType: string - /** - * If EnforceAbsentContentType is true and ContentType is the empty string, - * then PUTing to the signed URL will fail if the Content-Type header is - * present. Not all buckets support this: ones that do not will return an - * Unimplemented error. - * - * If EnforceAbsentContentType is false and ContentType is the empty string, - * then PUTing without a Content-Type header will succeed, but it is - * implementation-specific whether providing a Content-Type header will fail. - * - * Must be false for non-PUT requests. - */ - enforceAbsentContentType: boolean - /** - * BeforeSign is a callback that will be called before each call to the - * the underlying service's sign functionality. - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. - */ - beforeSign: (asFunc: (_arg0: { - }) => boolean) => void - } - /** - * ReaderOptions sets options for NewReader and NewRangeReader. - */ - interface ReaderOptions { - /** - * BeforeRead is a callback that will be called before - * any data is read (unless NewReader returns an error before then, in which - * case it may not be called at all). - * - * Calling Seek may reset the underlying reader, and result in BeforeRead - * getting called again with a different underlying provider-specific reader.. - * - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. - */ - beforeRead: (asFunc: (_arg0: { - }) => boolean) => void - } - /** - * WriterOptions sets options for NewWriter. - */ - interface WriterOptions { - /** - * BufferSize changes the default size in bytes of the chunks that - * Writer will upload in a single request; larger blobs will be split into - * multiple requests. - * - * This option may be ignored by some drivers. - * - * If 0, the driver will choose a reasonable default. - * - * If the Writer is used to do many small writes concurrently, using a - * smaller BufferSize may reduce memory usage. - */ - bufferSize: number - /** - * MaxConcurrency changes the default concurrency for parts of an upload. - * - * This option may be ignored by some drivers. - * - * If 0, the driver will choose a reasonable default. - */ - maxConcurrency: number - /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - */ - cacheControl: string - /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition - */ - contentDisposition: string - /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - */ - contentEncoding: string - /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language - */ - contentLanguage: string - /** - * ContentType specifies the MIME type of the blob being written. If not set, - * it will be inferred from the content using the algorithm described at - * http://mimesniff.spec.whatwg.org/. - * Set DisableContentTypeDetection to true to disable the above and force - * the ContentType to stay empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type - */ - contentType: string - /** - * When true, if ContentType is the empty string, it will stay the empty - * string rather than being inferred from the content. - * Note that while the blob will be written with an empty string ContentType, - * most providers will fill one in during reads, so don't expect an empty - * ContentType if you read the blob back. - */ - disableContentTypeDetection: boolean - /** - * ContentMD5 is used as a message integrity check. - * If len(ContentMD5) > 0, the MD5 hash of the bytes written must match - * ContentMD5, or Close will return an error without completing the write. - * https://tools.ietf.org/html/rfc1864 - */ - contentMD5: string|Array - /** - * Metadata holds key/value strings to be associated with the blob, or nil. - * Keys may not be empty, and are lowercased before being written. - * Duplicate case-insensitive keys (e.g., "foo" and "FOO") will result in - * an error. - */ - metadata: _TygojaDict - /** - * BeforeWrite is a callback that will be called exactly once, before - * any data is written (unless NewWriter returns an error, in which case - * it will not be called at all). Note that this is not necessarily during - * or after the first Write call, as drivers may buffer bytes before - * sending an upload request. - * - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. - */ - beforeWrite: (asFunc: (_arg0: { - }) => boolean) => void - } - /** - * CopyOptions sets options for Copy. - */ - interface CopyOptions { - /** - * BeforeCopy is a callback that will be called before the copy is - * initiated. - * - * asFunc converts its argument to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information. - */ - beforeCopy: (asFunc: (_arg0: { - }) => boolean) => void - } -} - -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * IsolationLevel is the transaction isolation level used in [TxOptions]. - */ - interface IsolationLevel extends Number{} - interface IsolationLevel { - /** - * String returns the name of the transaction isolation level. - */ - string(): string - } - /** - * DBStats contains database statistics. - */ - interface DBStats { - maxOpenConnections: number // Maximum number of open connections to the database. - /** - * Pool Status - */ - openConnections: number // The number of established connections both in use and idle. - inUse: number // The number of connections currently in use. - idle: number // The number of idle connections. - /** - * Counters - */ - waitCount: number // The total number of connections waited for. - waitDuration: time.Duration // The total time blocked waiting for a new connection. - maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. - maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. - maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. - } - /** - * Conn represents a single database connection rather than a pool of database - * connections. Prefer running queries from [DB] unless there is a specific - * need for a continuous single database connection. - * - * A Conn must call [Conn.Close] to return the connection to the database pool - * and may do so concurrently with a running query. - * - * After a call to [Conn.Close], all operations on the - * connection fail with [ErrConnDone]. - */ - interface Conn { - } - interface Conn { - /** - * PingContext verifies the connection to the database is still alive. - */ - pingContext(ctx: context.Context): void - } - interface Conn { - /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface Conn { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface Conn { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * the [*Row.Scan] method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface Conn { - /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface Conn { - /** - * Raw executes f exposing the underlying driver connection for the - * duration of f. The driverConn must not be used outside of f. - * - * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable - * until [Conn.Close] is called. - */ - raw(f: (driverConn: any) => void): void - } - interface Conn { - /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. - */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) - } - interface Conn { - /** - * Close returns the connection to the connection pool. - * All operations after a Close will return with [ErrConnDone]. - * Close is safe to call concurrently with other operations and will - * block until all other operations finish. It may be useful to first - * cancel any used context and then call close directly after. - */ - close(): void - } - /** - * ColumnType contains the name and type of a column. - */ - interface ColumnType { - } - interface ColumnType { - /** - * Name returns the name or alias of the column. - */ - name(): string - } - interface ColumnType { - /** - * Length returns the column type length for variable length column types such - * as text and binary field types. If the type length is unbounded the value will - * be [math.MaxInt64] (any database limits will still apply). - * If the column type is not variable length, such as an int, or if not supported - * by the driver ok is false. - */ - length(): [number, boolean] - } - interface ColumnType { - /** - * DecimalSize returns the scale and precision of a decimal type. - * If not applicable or if not supported ok is false. - */ - decimalSize(): [number, number, boolean] - } - interface ColumnType { - /** - * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. - * If a driver does not support this property ScanType will return - * the type of an empty interface. - */ - scanType(): any - } - interface ColumnType { - /** - * Nullable reports whether the column may be null. - * If a driver does not support this property ok will be false. - */ - nullable(): [boolean, boolean] - } - interface ColumnType { - /** - * DatabaseTypeName returns the database system name of the column type. If an empty - * string is returned, then the driver type name is not supported. - * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers - * are not included. - * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - * "INT", and "BIGINT". - */ - databaseTypeName(): string - } - /** - * Row is the result of calling [DB.QueryRow] to select a single row. - */ - interface Row { - } - interface Row { - /** - * Scan copies the columns from the matched row into the values - * pointed at by dest. See the documentation on [Rows.Scan] for details. - * If more than one row matches the query, - * Scan uses the first row and discards the rest. If no row matches - * the query, Scan returns [ErrNoRows]. - */ - scan(...dest: any[]): void - } - interface Row { - /** - * Err provides a way for wrapping packages to check for - * query errors without calling [Row.Scan]. - * Err returns the error, if any, that was encountered while running the query. - * If this error is not nil, this error will also be returned from [Row.Scan]. - */ - err(): void - } -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - interface TokenConfig { - secret: string - duration: number - } - interface TokenConfig { - /** - * Validate makes TokenConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface SmtpConfig { - enabled: boolean - host: string - port: number - username: string - password: string - /** - * SMTP AUTH - PLAIN (default) or LOGIN - */ - authMethod: string - /** - * Whether to enforce TLS encryption for the mail server connection. - * - * When set to false StartTLS command is send, leaving the server - * to decide whether to upgrade the connection or not. - */ - tls: boolean - /** - * LocalName is optional domain name or IP address used for the - * EHLO/HELO exchange (if not explicitly set, defaults to "localhost"). - * - * This is required only by some SMTP servers, such as Gmail SMTP-relay. - */ - localName: string - } - interface SmtpConfig { - /** - * Validate makes SmtpConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface S3Config { - enabled: boolean - bucket: string - region: string - endpoint: string - accessKey: string - secret: string - forcePathStyle: boolean - } - interface S3Config { - /** - * Validate makes S3Config validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface BackupsConfig { - /** - * Cron is a cron expression to schedule auto backups, eg. "* * * * *". - * - * Leave it empty to disable the auto backups functionality. - */ - cron: string - /** - * CronMaxKeep is the max number of cron generated backups to - * keep before removing older entries. - * - * This field works only when the cron config has valid cron expression. - */ - cronMaxKeep: number - /** - * S3 is an optional S3 storage config specifying where to store the app backups. - */ - s3: S3Config - } - interface BackupsConfig { - /** - * Validate makes BackupsConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface MetaConfig { - appName: string - appUrl: string - hideControls: boolean - senderName: string - senderAddress: string - verificationTemplate: EmailTemplate - resetPasswordTemplate: EmailTemplate - confirmEmailChangeTemplate: EmailTemplate - } - interface MetaConfig { - /** - * Validate makes MetaConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface LogsConfig { - maxDays: number - minLevel: number - logIp: boolean - } - interface LogsConfig { - /** - * Validate makes LogsConfig validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface AuthProviderConfig { - enabled: boolean - clientId: string - clientSecret: string - authUrl: string - tokenUrl: string - userApiUrl: string - displayName: string - pkce?: boolean - } - interface AuthProviderConfig { - /** - * Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface AuthProviderConfig { - /** - * SetupProvider loads the current AuthProviderConfig into the specified provider. - */ - setupProvider(provider: auth.Provider): void - } - /** - * Deprecated: Will be removed in v0.9+ - */ - interface EmailAuthConfig { - enabled: boolean - exceptDomains: Array - onlyDomains: Array - minPasswordLength: number - } - interface EmailAuthConfig { - /** - * Deprecated: Will be removed in v0.9+ - */ - validate(): void - } -} - -namespace subscriptions { - /** - * Broker defines a struct for managing subscriptions clients. - */ - interface Broker { - } - interface Broker { - /** - * Clients returns a shallow copy of all registered clients indexed - * with their connection id. - */ - clients(): _TygojaDict - } - interface Broker { - /** - * ClientById finds a registered client by its id. - * - * Returns non-nil error when client with clientId is not registered. - */ - clientById(clientId: string): Client - } - interface Broker { - /** - * Register adds a new client to the broker instance. - */ - register(client: Client): void - } - interface Broker { - /** - * Unregister removes a single client by its id. - * - * If client with clientId doesn't exist, this method does nothing. - */ - unregister(clientId: string): void - } -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` - * slog.SetDefault(logger) - * ``` - * - * will cause the top-level functions like [Info] to use it. - * [SetDefault] also updates the default logger used by the [log] package, - * so that existing applications that use [log.Printf] and related functions - * will send log records to the logger's handler without needing to be rewritten. - * - * Some attributes are common to many log calls. - * For example, you may wish to include the URL or trace identifier of a server request - * with all log events arising from the request. - * Rather than repeat the attribute with every log call, you can use [Logger.With] - * to construct a new Logger containing the attributes: - * - * ``` - * logger2 := logger.With("url", r.URL) - * ``` - * - * The arguments to With are the same key-value pairs used in [Logger.Info]. - * The result is a new Logger with the same handler as the original, but additional - * attributes that will appear in the output of every call. - * - * # Levels - * - * A [Level] is an integer representing the importance or severity of a log event. - * The higher the level, the more severe the event. - * This package defines constants for the most common levels, - * but any int can be used as a level. - * - * In an application, you may wish to log messages only at a certain level or greater. - * One common configuration is to log messages at Info or higher levels, - * suppressing debug logging until it is needed. - * The built-in handlers can be configured with the minimum level to output by - * setting [HandlerOptions.Level]. - * The program's `main` function typically does this. - * The default value is LevelInfo. - * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: - * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: - * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` - * - * Now the program can change its logging level with a single statement: - * - * ``` - * programLevel.Set(slog.LevelDebug) - * ``` - * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. - * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: - * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` - * - * TextHandler would display this group as - * - * ``` - * request.method=GET request.url=http://example.com - * ``` - * - * JSONHandler would display it as - * - * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. - * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: - * - * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. - * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, - * - * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement - * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` - * - * behaves the same as - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` - * - * is the most efficient way to achieve the same output as - * - * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call - * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` - * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: - * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` - * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: - * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: - * - * ``` - * type expensive struct { arg int } - * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } - * ``` - * - * Then use a value of that type in log calls: - * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - // @ts-ignore - import loginternal = internal - /** - * A Logger records structured information about each call to its - * Log, Debug, Info, Warn, and Error methods. - * For each call, it creates a [Record] and passes it to a [Handler]. - * - * To create a new Logger, call [New] or a Logger method - * that begins "With". - */ - interface Logger { - } - interface Logger { - /** - * Handler returns l's Handler. - */ - handler(): Handler - } - interface Logger { - /** - * With returns a Logger that includes the given attributes - * in each output operation. Arguments are converted to - * attributes as if by [Logger.Log]. - */ - with(...args: any[]): (Logger) - } - interface Logger { - /** - * WithGroup returns a Logger that starts a group, if name is non-empty. - * The keys of all attributes added to the Logger will be qualified by the given - * name. (How that qualification happens depends on the [Handler.WithGroup] - * method of the Logger's Handler.) - * - * If name is empty, WithGroup returns the receiver. - */ - withGroup(name: string): (Logger) - } - interface Logger { - /** - * Enabled reports whether l emits log records at the given context and level. - */ - enabled(ctx: context.Context, level: Level): boolean - } - interface Logger { - /** - * Log emits a log record with the current time and the given level and message. - * The Record's Attrs consist of the Logger's attributes followed by - * the Attrs specified by args. - * - * The attribute arguments are processed as follows: - * ``` - * - If an argument is an Attr, it is used as is. - * - If an argument is a string and this is not the last argument, - * the following argument is treated as the value and the two are combined - * into an Attr. - * - Otherwise, the argument is treated as a value with key "!BADKEY". - * ``` - */ - log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void - } - interface Logger { - /** - * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. - */ - logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void - } - interface Logger { - /** - * Debug logs at [LevelDebug]. - */ - debug(msg: string, ...args: any[]): void - } - interface Logger { - /** - * DebugContext logs at [LevelDebug] with the given context. - */ - debugContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { - /** - * Info logs at [LevelInfo]. - */ - info(msg: string, ...args: any[]): void - } - interface Logger { - /** - * InfoContext logs at [LevelInfo] with the given context. - */ - infoContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { - /** - * Warn logs at [LevelWarn]. - */ - warn(msg: string, ...args: any[]): void - } - interface Logger { - /** - * WarnContext logs at [LevelWarn] with the given context. - */ - warnContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { - /** - * Error logs at [LevelError]. - */ - error(msg: string, ...args: any[]): void - } - interface Logger { - /** - * ErrorContext logs at [LevelError] with the given context. - */ - errorContext(ctx: context.Context, msg: string, ...args: any[]): void - } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * SchemaField defines a single schema field structure. - */ - interface SchemaField { - system: boolean - id: string - name: string - type: string - required: boolean - /** - * Presentable indicates whether the field is suitable for - * visualization purposes (eg. in the Admin UI relation views). - */ - presentable: boolean - /** - * Deprecated: This field is no-op and will be removed in future versions. - * Please use the collection.Indexes field to define a unique constraint. - */ - unique: boolean - options: any - } - interface SchemaField { - /** - * ColDefinition returns the field db column type definition as string. - */ - colDefinition(): string - } - interface SchemaField { - /** - * String serializes and returns the current field as string. - */ - string(): string - } - interface SchemaField { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface SchemaField { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - * - * The schema field options are auto initialized on success. - */ - unmarshalJSON(data: string|Array): void - } - interface SchemaField { - /** - * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface SchemaField { - /** - * InitOptions initializes the current field options based on its type. - * - * Returns error on unknown field type. - */ - initOptions(): void - } - interface SchemaField { - /** - * PrepareValue returns normalized and properly formatted field value. - */ - prepareValue(value: any): any - } - interface SchemaField { - /** - * PrepareValueWithModifier returns normalized and properly formatted field value - * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). - */ - prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any - } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - /** - * Model defines an interface with common methods that all db models should have. - */ - interface Model { - [key:string]: any; - tableName(): string - isNew(): boolean - markAsNew(): void - markAsNotNew(): void - hasId(): boolean - getId(): string - setId(id: string): void - getCreated(): types.DateTime - getUpdated(): types.DateTime - refreshId(): void - refreshCreated(): void - refreshUpdated(): void - } - /** - * BaseModel defines common fields and methods used by all other models. - */ - interface BaseModel { - id: string - created: types.DateTime - updated: types.DateTime - } - interface BaseModel { - /** - * HasId returns whether the model has a nonzero id. - */ - hasId(): boolean - } - interface BaseModel { - /** - * GetId returns the model id. - */ - getId(): string - } - interface BaseModel { - /** - * SetId sets the model id to the provided string value. - */ - setId(id: string): void - } - interface BaseModel { - /** - * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). - */ - markAsNew(): void - } - interface BaseModel { - /** - * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) - */ - markAsNotNew(): void - } - interface BaseModel { - /** - * IsNew indicates what type of db query (insert or update) - * should be used with the model instance. - */ - isNew(): boolean - } - interface BaseModel { - /** - * GetCreated returns the model Created datetime. - */ - getCreated(): types.DateTime - } - interface BaseModel { - /** - * GetUpdated returns the model Updated datetime. - */ - getUpdated(): types.DateTime - } - interface BaseModel { - /** - * RefreshId generates and sets a new model id. - * - * The generated id is a cryptographically random 15 characters length string. - */ - refreshId(): void - } - interface BaseModel { - /** - * RefreshCreated updates the model Created field with the current datetime. - */ - refreshCreated(): void - } - interface BaseModel { - /** - * RefreshUpdated updates the model Updated field with the current datetime. - */ - refreshUpdated(): void - } - interface BaseModel { - /** - * PostScan implements the [dbx.PostScanner] interface. - * - * It is executed right after the model was populated with the db row values. - */ - postScan(): void - } - // @ts-ignore - import validation = ozzo_validation - /** - * CollectionBaseOptions defines the "base" Collection.Options fields. - */ - interface CollectionBaseOptions { - } - interface CollectionBaseOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - /** - * CollectionAuthOptions defines the "auth" Collection.Options fields. - */ - interface CollectionAuthOptions { - manageRule?: string - allowOAuth2Auth: boolean - allowUsernameAuth: boolean - allowEmailAuth: boolean - requireEmail: boolean - exceptEmailDomains: Array - onlyVerified: boolean - onlyEmailDomains: Array - minPasswordLength: number - } - interface CollectionAuthOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - /** - * CollectionViewOptions defines the "view" Collection.Options fields. - */ - interface CollectionViewOptions { - query: string - } - interface CollectionViewOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - type _subfMtQV = BaseModel - interface Log extends _subfMtQV { - data: types.JsonMap - message: string - level: number - } - interface Log { - tableName(): string - } - type _subFKVHZ = BaseModel - interface Param extends _subFKVHZ { - key: string - value: types.JsonRaw - } - interface Param { - tableName(): string - } - interface TableInfoRow { - /** - * the `db:"pk"` tag has special semantic so we cannot rename - * the original field without specifying a custom mapper - */ - pk: number - index: number - name: string - type: string - notNull: boolean - defaultValue: types.JsonRaw - } -} - -/** - * Package daos handles common PocketBase DB model manipulations. - * - * Think of daos as DB repository and service layer in one. - */ -namespace daos { - interface LogsStatsItem { - total: number - date: types.DateTime - } - /** - * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. - */ - interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } - // @ts-ignore - import validation = ozzo_validation -} - -namespace migrate { - interface Migration { - file: string - up: (db: dbx.Builder) => void - down: (db: dbx.Builder) => void - } -} - -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} - /** - * Group Structure to manage groups for commands - */ - interface Group { - id: string - title: string - } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} - /** - * CompletionOptions are the options to control shell completion - */ - interface CompletionOptions { - /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command - */ - disableDefaultCmd: boolean - /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions - */ - disableNoDescFlag: boolean - /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them - */ - disableDescriptions: boolean - /** - * HiddenDefaultCmd makes the default 'completion' command hidden - */ - hiddenDefaultCmd: boolean - } -} - -namespace hook { - /** - * Hook defines a concurrent safe structure for handling event hooks - * (aka. callbacks propagation). - */ - interface Hook { - } - interface Hook { - /** - * PreAdd registers a new handler to the hook by prepending it to the existing queue. - * - * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). - */ - preAdd(fn: Handler): string - } - interface Hook { - /** - * Add registers a new handler to the hook by appending it to the existing queue. - * - * Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id). - */ - add(fn: Handler): string - } - interface Hook { - /** - * Remove removes a single hook handler by its id. - */ - remove(id: string): void - } - interface Hook { - /** - * RemoveAll removes all registered handlers. - */ - removeAll(): void - } - interface Hook { - /** - * Trigger executes all registered hook handlers one by one - * with the specified `data` as an argument. - * - * Optionally, this method allows also to register additional one off - * handlers that will be temporary appended to the handlers queue. - * - * The execution stops when: - * - hook.StopPropagation is returned in one of the handlers - * - any non-nil error is returned in one of the handlers - */ - trigger(data: T, ...oneOffHandlers: Handler[]): void - } - /** - * TaggedHook defines a proxy hook which register handlers that are triggered only - * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). - */ - type _subODnSY = mainHook - interface TaggedHook extends _subODnSY { - } - interface TaggedHook { - /** - * CanTriggerOn checks if the current TaggedHook can be triggered with - * the provided event data tags. - */ - canTriggerOn(tags: Array): boolean - } - interface TaggedHook { - /** - * PreAdd registers a new handler to the hook by prepending it to the existing queue. - * - * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. - */ - preAdd(fn: Handler): string - } - interface TaggedHook { - /** - * Add registers a new handler to the hook by appending it to the existing queue. - * - * The fn handler will be called only if the event data tags satisfy h.CanTriggerOn. - */ - add(fn: Handler): string - } -} - -/** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. - */ -namespace core { - interface BootstrapEvent { - app: App - } - interface TerminateEvent { - app: App - isRestart: boolean - } - interface ServeEvent { - app: App - router?: echo.Echo - server?: http.Server - certManager?: any - } - interface ApiErrorEvent { - httpContext: echo.Context - error: Error - } - type _subStmDG = BaseModelEvent - interface ModelEvent extends _subStmDG { - dao?: daos.Dao - } - type _subQpmjZ = BaseCollectionEvent - interface MailerRecordEvent extends _subQpmjZ { - mailClient: mailer.Mailer - message?: mailer.Message - record?: models.Record - meta: _TygojaDict - } - interface MailerAdminEvent { - mailClient: mailer.Mailer - message?: mailer.Message - admin?: models.Admin - meta: _TygojaDict - } - interface RealtimeConnectEvent { - httpContext: echo.Context - client: subscriptions.Client - idleTimeout: time.Duration - } - interface RealtimeDisconnectEvent { - httpContext: echo.Context - client: subscriptions.Client - } - interface RealtimeMessageEvent { - httpContext: echo.Context - client: subscriptions.Client - message?: subscriptions.Message - } - interface RealtimeSubscribeEvent { - httpContext: echo.Context - client: subscriptions.Client - subscriptions: Array - } - interface SettingsListEvent { - httpContext: echo.Context - redactedSettings?: settings.Settings - } - interface SettingsUpdateEvent { - httpContext: echo.Context - oldSettings?: settings.Settings - newSettings?: settings.Settings - } - type _subelpWh = BaseCollectionEvent - interface RecordsListEvent extends _subelpWh { - httpContext: echo.Context - records: Array<(models.Record | undefined)> - result?: search.Result - } - type _subLvPKS = BaseCollectionEvent - interface RecordViewEvent extends _subLvPKS { - httpContext: echo.Context - record?: models.Record - } - type _subZtOqS = BaseCollectionEvent - interface RecordCreateEvent extends _subZtOqS { - httpContext: echo.Context - record?: models.Record - uploadedFiles: _TygojaDict - } - type _subAjkWJ = BaseCollectionEvent - interface RecordUpdateEvent extends _subAjkWJ { - httpContext: echo.Context - record?: models.Record - uploadedFiles: _TygojaDict - } - type _subkZlEQ = BaseCollectionEvent - interface RecordDeleteEvent extends _subkZlEQ { - httpContext: echo.Context - record?: models.Record - } - type _subeuCow = BaseCollectionEvent - interface RecordAuthEvent extends _subeuCow { - httpContext: echo.Context - record?: models.Record - token: string - meta: any - } - type _subviYXC = BaseCollectionEvent - interface RecordAuthWithPasswordEvent extends _subviYXC { - httpContext: echo.Context - record?: models.Record - identity: string - password: string - } - type _subFmeZh = BaseCollectionEvent - interface RecordAuthWithOAuth2Event extends _subFmeZh { - httpContext: echo.Context - providerName: string - providerClient: auth.Provider - record?: models.Record - oAuth2User?: auth.AuthUser - isNewRecord: boolean - } - type _subpoJmu = BaseCollectionEvent - interface RecordAuthRefreshEvent extends _subpoJmu { - httpContext: echo.Context - record?: models.Record - } - type _subHkEeE = BaseCollectionEvent - interface RecordRequestPasswordResetEvent extends _subHkEeE { - httpContext: echo.Context - record?: models.Record - } - type _subYEJqc = BaseCollectionEvent - interface RecordConfirmPasswordResetEvent extends _subYEJqc { - httpContext: echo.Context - record?: models.Record - } - type _subbBUmy = BaseCollectionEvent - interface RecordRequestVerificationEvent extends _subbBUmy { - httpContext: echo.Context - record?: models.Record - } - type _subtMtnn = BaseCollectionEvent - interface RecordConfirmVerificationEvent extends _subtMtnn { - httpContext: echo.Context - record?: models.Record - } - type _subnkOlf = BaseCollectionEvent - interface RecordRequestEmailChangeEvent extends _subnkOlf { - httpContext: echo.Context - record?: models.Record - } - type _subUjcfa = BaseCollectionEvent - interface RecordConfirmEmailChangeEvent extends _subUjcfa { - httpContext: echo.Context - record?: models.Record - } - type _subYEmXT = BaseCollectionEvent - interface RecordListExternalAuthsEvent extends _subYEmXT { - httpContext: echo.Context - record?: models.Record - externalAuths: Array<(models.ExternalAuth | undefined)> - } - type _subqoOQW = BaseCollectionEvent - interface RecordUnlinkExternalAuthEvent extends _subqoOQW { - httpContext: echo.Context - record?: models.Record - externalAuth?: models.ExternalAuth - } - interface AdminsListEvent { - httpContext: echo.Context - admins: Array<(models.Admin | undefined)> - result?: search.Result - } - interface AdminViewEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminCreateEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminUpdateEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminDeleteEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminAuthEvent { - httpContext: echo.Context - admin?: models.Admin - token: string - } - interface AdminAuthWithPasswordEvent { - httpContext: echo.Context - admin?: models.Admin - identity: string - password: string - } - interface AdminAuthRefreshEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminRequestPasswordResetEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface AdminConfirmPasswordResetEvent { - httpContext: echo.Context - admin?: models.Admin - } - interface CollectionsListEvent { - httpContext: echo.Context - collections: Array<(models.Collection | undefined)> - result?: search.Result - } - type _subeGmmK = BaseCollectionEvent - interface CollectionViewEvent extends _subeGmmK { - httpContext: echo.Context - } - type _subIzYYM = BaseCollectionEvent - interface CollectionCreateEvent extends _subIzYYM { - httpContext: echo.Context - } - type _subkgZTc = BaseCollectionEvent - interface CollectionUpdateEvent extends _subkgZTc { - httpContext: echo.Context - } - type _subLSHMR = BaseCollectionEvent - interface CollectionDeleteEvent extends _subLSHMR { - httpContext: echo.Context - } - interface CollectionsImportEvent { - httpContext: echo.Context - collections: Array<(models.Collection | undefined)> - } - type _subwfGve = BaseModelEvent - interface FileTokenEvent extends _subwfGve { - httpContext: echo.Context - token: string - } - type _subENXIg = BaseCollectionEvent - interface FileDownloadEvent extends _subENXIg { - httpContext: echo.Context - record?: models.Record - fileField?: schema.SchemaField - servedPath: string - servedName: string - } -} - -namespace store { -} - -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS - * request consumes only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement. - * - * On all systems (except Plan 9), when the cgo resolver is being used - * this package applies a concurrent cgo lookup limit to prevent the system - * from running out of system threads. Currently, it is limited to 500 concurrent lookups. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * The Go resolver will send an EDNS0 additional header with a DNS request, - * to signal a willingness to accept a larger DNS packet size. - * This can reportedly cause sporadic failures with the DNS server run - * by some modems and routers. Setting GODEBUG=netedns0=0 will disable - * sending the additional header. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. - * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. - */ -namespace net { - /** - * Addr represents a network end point address. - * - * The two methods [Addr.Network] and [Addr.String] conventionally return strings - * that can be passed as the arguments to [Dial], but the exact form - * and meaning of the strings is up to the implementation. - */ - interface Addr { - [key:string]: any; - network(): string // name of the network (for example, "tcp", "udp") - string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") - } -} - -namespace hook { - /** - * Handler defines a hook handler function. - */ - interface Handler {(e: T): void } - /** - * wrapped local Hook embedded struct to limit the public API surface. - */ - type _subFoqDt = Hook - interface mainHook extends _subFoqDt { - } -} - -namespace logging { - /** - * Classification is the type of the log entry's classification name. - */ - interface Classification extends String{} -} - -/** - * Package middleware provides transport agnostic middleware for decorating SDK - * handlers. - * - * The Smithy middleware stack provides ordered behavior to be invoked on an - * underlying handler. The stack is separated into steps that are invoked in a - * static order. A step is a collection of middleware that are injected into a - * ordered list defined by the user. The user may add, insert, swap, and remove a - * step's middleware. When the stack is invoked the step middleware become static, - * and their order cannot be modified. - * - * A stack and its step middleware are **not** safe to modify concurrently. - * - * A stack will use the ordered list of middleware to decorate a underlying - * handler. A handler could be something like an HTTP Client that round trips an - * API operation over HTTP. - * - * Smithy Middleware Stack - * - * A Stack is a collection of middleware that wrap a handler. The stack can be - * broken down into discreet steps. Each step may contain zero or more middleware - * specific to that stack's step. - * - * A Stack Step is a predefined set of middleware that are invoked in a static - * order by the Stack. These steps represent fixed points in the middleware stack - * for organizing specific behavior, such as serialize and build. A Stack Step is - * composed of zero or more middleware that are specific to that step. A step may - * define its own set of input/output parameters the generic input/output - * parameters are cast from. A step calls its middleware recursively, before - * calling the next step in the stack returning the result or error of the step - * middleware decorating the underlying handler. - * - * * Initialize: Prepares the input, and sets any default parameters as needed, - * (e.g. idempotency token, and presigned URLs). - * - * * Serialize: Serializes the prepared input into a data structure that can be - * consumed by the target transport's message, (e.g. REST-JSON serialization). - * - * * Build: Adds additional metadata to the serialized transport message, (e.g. - * HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. - * - * * Finalize: Performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated to - * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request - * signing). - * - * * Deserialize: Reacts to the handler's response returned by the recipient of - * the request message. Deserializes the response into a structured type or - * error above stacks can react to. - * - * Adding Middleware to a Stack Step - * - * Middleware can be added to a step front or back, or relative, by name, to an - * existing middleware in that stack. If a middleware does not have a name, a - * unique name will be generated at the middleware and be added to the step. - * - * ``` - * // Create middleware stack - * stack := middleware.NewStack() - * - * // Add middleware to stack steps - * stack.Initialize.Add(paramValidationMiddleware, middleware.After) - * stack.Serialize.Add(marshalOperationFoo, middleware.After) - * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) - * - * // Invoke middleware on handler. - * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) - * ``` - */ -namespace middleware { - /** - * Metadata provides storing and reading metadata values. Keys may be any - * comparable value type. Get and set will panic if key is not a comparable - * value type. - * - * Metadata uses lazy initialization, and Set method must be called as an - * addressable value, or pointer. Not doing so may cause key/value pair to not - * be set. - */ - interface Metadata { - } - interface Metadata { - /** - * Get attempts to retrieve the value the key points to. Returns nil if the - * key was not found. - * - * Panics if key type is not comparable. - */ - get(key: { - }): { - } - } - interface Metadata { - /** - * Clone creates a shallow copy of Metadata entries, returning a new Metadata - * value with the original entries copied into it. - */ - clone(): Metadata - } - interface Metadata { - /** - * Set stores the value pointed to by the key. If a value already exists at - * that key it will be replaced with the new value. - * - * Set method must be called as an addressable value, or pointer. If Set is not - * called as an addressable value or pointer, the key value pair being set may - * be lost. - * - * Panics if the key type is not comparable. - */ - set(key: { - }, value: { - }): void - } - interface Metadata { - /** - * Has returns whether the key exists in the metadata. - * - * Panics if the key type is not comparable. - */ - has(key: { - }): boolean - } - /** - * Handler provides the interface for performing the logic to obtain an output, - * or error for the given input. - */ - interface Handler { - [key:string]: any; - /** - * Handle performs logic to obtain an output for the given input. Handler - * should be decorated with middleware to perform input specific behavior. - */ - handle(ctx: context.Context, input: { - }): [{ - }, Metadata] - } - /** - * BuildStep provides the ordered grouping of BuildMiddleware to be invoked on - * a handler. - */ - interface BuildStep { - } - interface BuildStep { - /** - * ID returns the unique name of the step as a middleware. - */ - id(): string - } - interface BuildStep { - /** - * HandleMiddleware invokes the middleware by decorating the next handler - * provided. Returns the result of the middleware and handler being invoked. - * - * Implements Middleware interface. - */ - handleMiddleware(ctx: context.Context, _arg10: { - }, next: Handler): [{ - }, Metadata] - } - interface BuildStep { - /** - * Get retrieves the middleware identified by id. If the middleware is not present, returns false. - */ - get(id: string): [BuildMiddleware, boolean] - } - interface BuildStep { - /** - * Add injects the middleware to the relative position of the middleware group. - * Returns an error if the middleware already exists. - */ - add(m: BuildMiddleware, pos: RelativePosition): void - } - interface BuildStep { - /** - * Insert injects the middleware relative to an existing middleware id. - * Returns an error if the original middleware does not exist, or the middleware - * being added already exists. - */ - insert(m: BuildMiddleware, relativeTo: string, pos: RelativePosition): void - } - interface BuildStep { - /** - * Swap removes the middleware by id, replacing it with the new middleware. - * Returns the middleware removed, or an error if the middleware to be removed - * doesn't exist. - */ - swap(id: string, m: BuildMiddleware): BuildMiddleware - } - interface BuildStep { - /** - * Remove removes the middleware by id. Returns error if the middleware - * doesn't exist. - */ - remove(id: string): BuildMiddleware - } - interface BuildStep { - /** - * List returns a list of the middleware in the step. - */ - list(): Array - } - interface BuildStep { - /** - * Clear removes all middleware in the step. - */ - clear(): void - } - /** - * DeserializeStep provides the ordered grouping of DeserializeMiddleware to be - * invoked on a handler. - */ - interface DeserializeStep { - } - interface DeserializeStep { - /** - * ID returns the unique ID of the step as a middleware. - */ - id(): string - } - interface DeserializeStep { - /** - * HandleMiddleware invokes the middleware by decorating the next handler - * provided. Returns the result of the middleware and handler being invoked. - * - * Implements Middleware interface. - */ - handleMiddleware(ctx: context.Context, _arg10: { - }, next: Handler): [{ - }, Metadata] - } - interface DeserializeStep { - /** - * Get retrieves the middleware identified by id. If the middleware is not present, returns false. - */ - get(id: string): [DeserializeMiddleware, boolean] - } - interface DeserializeStep { - /** - * Add injects the middleware to the relative position of the middleware group. - * Returns an error if the middleware already exists. - */ - add(m: DeserializeMiddleware, pos: RelativePosition): void - } - interface DeserializeStep { - /** - * Insert injects the middleware relative to an existing middleware ID. - * Returns error if the original middleware does not exist, or the middleware - * being added already exists. - */ - insert(m: DeserializeMiddleware, relativeTo: string, pos: RelativePosition): void - } - interface DeserializeStep { - /** - * Swap removes the middleware by id, replacing it with the new middleware. - * Returns the middleware removed, or error if the middleware to be removed - * doesn't exist. - */ - swap(id: string, m: DeserializeMiddleware): DeserializeMiddleware - } - interface DeserializeStep { - /** - * Remove removes the middleware by id. Returns error if the middleware - * doesn't exist. - */ - remove(id: string): DeserializeMiddleware - } - interface DeserializeStep { - /** - * List returns a list of the middleware in the step. - */ - list(): Array - } - interface DeserializeStep { - /** - * Clear removes all middleware in the step. - */ - clear(): void - } - /** - * FinalizeStep provides the ordered grouping of FinalizeMiddleware to be - * invoked on a handler. - */ - interface FinalizeStep { - } - interface FinalizeStep { - /** - * ID returns the unique id of the step as a middleware. - */ - id(): string - } - interface FinalizeStep { - /** - * HandleMiddleware invokes the middleware by decorating the next handler - * provided. Returns the result of the middleware and handler being invoked. - * - * Implements Middleware interface. - */ - handleMiddleware(ctx: context.Context, _arg10: { - }, next: Handler): [{ - }, Metadata] - } - interface FinalizeStep { - /** - * Get retrieves the middleware identified by id. If the middleware is not present, returns false. - */ - get(id: string): [FinalizeMiddleware, boolean] - } - interface FinalizeStep { - /** - * Add injects the middleware to the relative position of the middleware group. - * Returns an error if the middleware already exists. - */ - add(m: FinalizeMiddleware, pos: RelativePosition): void - } - interface FinalizeStep { - /** - * Insert injects the middleware relative to an existing middleware ID. - * Returns error if the original middleware does not exist, or the middleware - * being added already exists. - */ - insert(m: FinalizeMiddleware, relativeTo: string, pos: RelativePosition): void - } - interface FinalizeStep { - /** - * Swap removes the middleware by id, replacing it with the new middleware. - * Returns the middleware removed, or error if the middleware to be removed - * doesn't exist. - */ - swap(id: string, m: FinalizeMiddleware): FinalizeMiddleware - } - interface FinalizeStep { - /** - * Remove removes the middleware by id. Returns error if the middleware - * doesn't exist. - */ - remove(id: string): FinalizeMiddleware - } - interface FinalizeStep { - /** - * List returns a list of the middleware in the step. - */ - list(): Array - } - interface FinalizeStep { - /** - * Clear removes all middleware in the step. - */ - clear(): void - } - /** - * InitializeStep provides the ordered grouping of InitializeMiddleware to be - * invoked on a handler. - */ - interface InitializeStep { - } - interface InitializeStep { - /** - * ID returns the unique ID of the step as a middleware. - */ - id(): string - } - interface InitializeStep { - /** - * HandleMiddleware invokes the middleware by decorating the next handler - * provided. Returns the result of the middleware and handler being invoked. - * - * Implements Middleware interface. - */ - handleMiddleware(ctx: context.Context, _arg10: { - }, next: Handler): [{ - }, Metadata] - } - interface InitializeStep { - /** - * Get retrieves the middleware identified by id. If the middleware is not present, returns false. - */ - get(id: string): [InitializeMiddleware, boolean] - } - interface InitializeStep { - /** - * Add injects the middleware to the relative position of the middleware group. - * Returns an error if the middleware already exists. - */ - add(m: InitializeMiddleware, pos: RelativePosition): void - } - interface InitializeStep { - /** - * Insert injects the middleware relative to an existing middleware ID. - * Returns error if the original middleware does not exist, or the middleware - * being added already exists. - */ - insert(m: InitializeMiddleware, relativeTo: string, pos: RelativePosition): void - } - interface InitializeStep { - /** - * Swap removes the middleware by id, replacing it with the new middleware. - * Returns the middleware removed, or error if the middleware to be removed - * doesn't exist. - */ - swap(id: string, m: InitializeMiddleware): InitializeMiddleware - } - interface InitializeStep { - /** - * Remove removes the middleware by id. Returns error if the middleware - * doesn't exist. - */ - remove(id: string): InitializeMiddleware - } - interface InitializeStep { - /** - * List returns a list of the middleware in the step. - */ - list(): Array - } - interface InitializeStep { - /** - * Clear removes all middleware in the step. - */ - clear(): void - } - /** - * SerializeStep provides the ordered grouping of SerializeMiddleware to be - * invoked on a handler. - */ - interface SerializeStep { - } - interface SerializeStep { - /** - * ID returns the unique ID of the step as a middleware. - */ - id(): string - } - interface SerializeStep { - /** - * HandleMiddleware invokes the middleware by decorating the next handler - * provided. Returns the result of the middleware and handler being invoked. - * - * Implements Middleware interface. - */ - handleMiddleware(ctx: context.Context, _arg10: { - }, next: Handler): [{ - }, Metadata] - } - interface SerializeStep { - /** - * Get retrieves the middleware identified by id. If the middleware is not present, returns false. - */ - get(id: string): [SerializeMiddleware, boolean] - } - interface SerializeStep { - /** - * Add injects the middleware to the relative position of the middleware group. - * Returns an error if the middleware already exists. - */ - add(m: SerializeMiddleware, pos: RelativePosition): void - } - interface SerializeStep { - /** - * Insert injects the middleware relative to an existing middleware ID. - * Returns error if the original middleware does not exist, or the middleware - * being added already exists. - */ - insert(m: SerializeMiddleware, relativeTo: string, pos: RelativePosition): void - } - interface SerializeStep { - /** - * Swap removes the middleware by id, replacing it with the new middleware. - * Returns the middleware removed, or error if the middleware to be removed - * doesn't exist. - */ - swap(id: string, m: SerializeMiddleware): SerializeMiddleware - } - interface SerializeStep { - /** - * Remove removes the middleware by id. Returns error if the middleware - * doesn't exist. - */ - remove(id: string): SerializeMiddleware - } - interface SerializeStep { - /** - * List returns a list of the middleware in the step. - */ - list(): Array - } - interface SerializeStep { - /** - * Clear removes all middleware in the step. - */ - clear(): void - } -} - -/** - * Package auth defines protocol-agnostic authentication types for smithy - * clients. - */ -namespace auth { - /** - * IdentityResolver defines the interface through which an Identity is - * retrieved. - */ - interface IdentityResolver { - [key:string]: any; - getIdentity(_arg0: context.Context, _arg1: smithy.Properties): Identity - } -} - -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { - /** - * MeterProvider is the entry point for creating a Meter. - */ - interface MeterProvider { - [key:string]: any; - meter(scope: string, ...opts: MeterOption[]): Meter - } -} - -/** - * Package tracing defines tracing APIs to be used by Smithy clients. - */ -namespace tracing { - /** - * TracerProvider is the entry point for creating client traces. - */ - interface TracerProvider { - [key:string]: any; - tracer(scope: string, ...opts: TracerOption[]): Tracer - } -} - -/** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. - */ -namespace bufio { - /** - * ReadWriter stores pointers to a [Reader] and a [Writer]. - * It implements [io.ReadWriter]. - */ - type _sububutk = Reader&Writer - interface ReadWriter extends _sububutk { - } -} - -/** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits - * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. - * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. - * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. - */ -namespace multipart { - /** - * A Part represents a single part in a multipart body. - */ - interface Part { - /** - * The headers of the body, if any, with the keys canonicalized - * in the same fashion that the Go http.Request headers are. - * For example, "foo-bar" changes case to "Foo-Bar" - */ - header: textproto.MIMEHeader - } - interface Part { - /** - * FormName returns the name parameter if p has a Content-Disposition - * of type "form-data". Otherwise it returns the empty string. - */ - formName(): string - } - interface Part { - /** - * FileName returns the filename parameter of the [Part]'s Content-Disposition - * header. If not empty, the filename is passed through filepath.Base (which is - * platform dependent) before being returned. - */ - fileName(): string - } - interface Part { - /** - * Read reads the body of a part, after its headers and before the - * next part (if any) begins. - */ - read(d: string|Array): number - } - interface Part { - close(): void - } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - /** - * SameSite allows a server to define a cookie attribute making it impossible for - * the browser to send this cookie along with cross-site requests. The main - * goal is to mitigate the risk of cross-origin information leakage, and provide - * some protection against cross-site request forgery attacks. - * - * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. - */ - interface SameSite extends Number{} - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url -} - -/** - * Package http provides the HTTP transport client and request/response types - * needed to round trip API operation calls with an service. - */ -namespace http { - // @ts-ignore - import smithy = smithy_go - /** - * AuthScheme defines an HTTP authentication scheme. - */ - interface AuthScheme { - [key:string]: any; - schemeID(): string - identityResolver(_arg0: auth.IdentityResolverOptions): auth.IdentityResolver - signer(): Signer - } - // @ts-ignore - import iointernal = io - // @ts-ignore - import smithytime = time -} - -/** - * Package bearer provides middleware and utilities for authenticating API - * operation calls with a Bearer Token. - */ -namespace bearer { - // @ts-ignore - import smithyhttp = http - /** - * Token provides a type wrapping a bearer token and expiration metadata. - */ - interface Token { - value: string - canExpire: boolean - expires: time.Time - } - interface Token { - /** - * Expired returns if the token's Expires time is before or equal to the time - * provided. If CanExpires is false, Expired will always return false. - */ - expired(now: time.Time): boolean - } - // @ts-ignore - import smithycontext = context -} - -namespace mailer { - /** - * Message defines a generic email message struct. - */ - interface Message { - from: mail.Address - to: Array - bcc: Array - cc: Array - subject: string - html: string - text: string - headers: _TygojaDict - attachments: _TygojaDict - } -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` - * slog.SetDefault(logger) - * ``` - * - * will cause the top-level functions like [Info] to use it. - * [SetDefault] also updates the default logger used by the [log] package, - * so that existing applications that use [log.Printf] and related functions - * will send log records to the logger's handler without needing to be rewritten. - * - * Some attributes are common to many log calls. - * For example, you may wish to include the URL or trace identifier of a server request - * with all log events arising from the request. - * Rather than repeat the attribute with every log call, you can use [Logger.With] - * to construct a new Logger containing the attributes: - * - * ``` - * logger2 := logger.With("url", r.URL) - * ``` - * - * The arguments to With are the same key-value pairs used in [Logger.Info]. - * The result is a new Logger with the same handler as the original, but additional - * attributes that will appear in the output of every call. - * - * # Levels - * - * A [Level] is an integer representing the importance or severity of a log event. - * The higher the level, the more severe the event. - * This package defines constants for the most common levels, - * but any int can be used as a level. - * - * In an application, you may wish to log messages only at a certain level or greater. - * One common configuration is to log messages at Info or higher levels, - * suppressing debug logging until it is needed. - * The built-in handlers can be configured with the minimum level to output by - * setting [HandlerOptions.Level]. - * The program's `main` function typically does this. - * The default value is LevelInfo. - * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: - * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: - * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` - * - * Now the program can change its logging level with a single statement: - * - * ``` - * programLevel.Set(slog.LevelDebug) - * ``` - * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. - * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: - * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` - * - * TextHandler would display this group as - * - * ``` - * request.method=GET request.url=http://example.com - * ``` - * - * JSONHandler would display it as - * - * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. - * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: - * - * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. - * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, - * - * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement - * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` - * - * behaves the same as - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` - * - * is the most efficient way to achieve the same output as - * - * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call - * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` - * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: - * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` - * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: - * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: - * - * ``` - * type expensive struct { arg int } - * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } - * ``` - * - * Then use a value of that type in log calls: - * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - /** - * An Attr is a key-value pair. - */ - interface Attr { - key: string - value: Value - } - interface Attr { - /** - * Equal reports whether a and b have equal keys and values. - */ - equal(b: Attr): boolean - } - interface Attr { - string(): string - } - /** - * A Handler handles log records produced by a Logger. - * - * A typical handler may print log records to standard error, - * or write them to a file or database, or perhaps augment them - * with additional attributes and pass them on to another handler. - * - * Any of the Handler's methods may be called concurrently with itself - * or with other methods. It is the responsibility of the Handler to - * manage this concurrency. - * - * Users of the slog package should not invoke Handler methods directly. - * They should use the methods of [Logger] instead. - */ - interface Handler { - [key:string]: any; - /** - * Enabled reports whether the handler handles records at the given level. - * The handler ignores records whose level is lower. - * It is called early, before any arguments are processed, - * to save effort if the log event should be discarded. - * If called from a Logger method, the first argument is the context - * passed to that method, or context.Background() if nil was passed - * or the method does not take a context. - * The context is passed so Enabled can use its values - * to make a decision. - */ - enabled(_arg0: context.Context, _arg1: Level): boolean - /** - * Handle handles the Record. - * It will only be called when Enabled returns true. - * The Context argument is as for Enabled. - * It is present solely to provide Handlers access to the context's values. - * Canceling the context should not affect record processing. - * (Among other things, log messages may be necessary to debug a - * cancellation-related problem.) - * - * Handle methods that produce output should observe the following rules: - * ``` - * - If r.Time is the zero time, ignore the time. - * - If r.PC is zero, ignore it. - * - Attr's values should be resolved. - * - If an Attr's key and value are both the zero value, ignore the Attr. - * This can be tested with attr.Equal(Attr{}). - * - If a group's key is empty, inline the group's Attrs. - * - If a group has no Attrs (even if it has a non-empty key), - * ignore it. - * ``` - */ - handle(_arg0: context.Context, _arg1: Record): void - /** - * WithAttrs returns a new Handler whose attributes consist of - * both the receiver's attributes and the arguments. - * The Handler owns the slice: it may retain, modify or discard it. - */ - withAttrs(attrs: Array): Handler - /** - * WithGroup returns a new Handler with the given group appended to - * the receiver's existing groups. - * The keys of all subsequent attributes, whether added by With or in a - * Record, should be qualified by the sequence of group names. - * - * How this qualification happens is up to the Handler, so long as - * this Handler's attribute keys differ from those of another Handler - * with a different sequence of group names. - * - * A Handler should treat WithGroup as starting a Group of Attrs that ends - * at the end of the log event. That is, - * - * ``` - * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) - * ``` - * - * should behave like - * - * ``` - * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) - * ``` - * - * If the name is empty, WithGroup returns the receiver. - */ - withGroup(name: string): Handler - } - /** - * A Level is the importance or severity of a log event. - * The higher the level, the more important or severe the event. - */ - interface Level extends Number{} - interface Level { - /** - * String returns a name for the level. - * If the level has a name, then that name - * in uppercase is returned. - * If the level is between named values, then - * an integer is appended to the uppercased name. - * Examples: - * - * ``` - * LevelWarn.String() => "WARN" - * (LevelInfo+2).String() => "INFO+2" - * ``` - */ - string(): string - } - interface Level { - /** - * MarshalJSON implements [encoding/json.Marshaler] - * by quoting the output of [Level.String]. - */ - marshalJSON(): string|Array - } - interface Level { - /** - * UnmarshalJSON implements [encoding/json.Unmarshaler] - * It accepts any string produced by [Level.MarshalJSON], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". - */ - unmarshalJSON(data: string|Array): void - } - interface Level { - /** - * MarshalText implements [encoding.TextMarshaler] - * by calling [Level.String]. - */ - marshalText(): string|Array - } - interface Level { - /** - * UnmarshalText implements [encoding.TextUnmarshaler]. - * It accepts any string produced by [Level.MarshalText], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". - */ - unmarshalText(data: string|Array): void - } - interface Level { - /** - * Level returns the receiver. - * It implements [Leveler]. - */ - level(): Level - } - // @ts-ignore - import loginternal = internal -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonRaw defines a json value type that is safe for db read/write. - */ - interface JsonRaw extends Array{} - interface JsonRaw { - /** - * String returns the current JsonRaw instance as a json encoded string. - */ - string(): string - } - interface JsonRaw { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonRaw { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string|Array): void - } - interface JsonRaw { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonRaw { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonRaw instance. - */ - scan(value: any): void - } -} - -namespace search { - /** - * Result defines the returned search result structure. - */ - interface Result { - page: number - perPage: number - totalItems: number - totalPages: number - items: any - } -} - -/** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: - * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) - * - * // Routes - * e.GET("/", hello) - * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` - * - * Learn more at https://echo.labstack.com - */ -namespace echo { - // @ts-ignore - import stdContext = context - /** - * Route contains information to adding/registering new route with the router. - * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. - */ - interface Route { - method: string - path: string - handler: HandlerFunc - middlewares: Array - name: string - } - interface Route { - /** - * ToRouteInfo converts Route to RouteInfo - */ - toRouteInfo(params: Array): RouteInfo - } - interface Route { - /** - * ToRoute returns Route which Router uses to register the method handler for path. - */ - toRoute(): Route - } - interface Route { - /** - * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. - */ - forGroup(pathPrefix: string, middlewares: Array): Routable - } - /** - * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this - * interface are meant for request routing purposes and should not be used in middlewares. - */ - interface RoutableContext { - [key:string]: any; - /** - * Request returns `*http.Request`. - */ - request(): (http.Request) - /** - * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. - */ - rawPathParams(): (PathParams) - /** - * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). - * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. - */ - setRawPathParams(params: PathParams): void - /** - * SetPath sets the registered path for the handler. - */ - setPath(p: string): void - /** - * SetRouteInfo sets the route info of this request to the context. - */ - setRouteInfo(ri: RouteInfo): void - /** - * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context - * for later use in middlewares/handler. - */ - set(key: string, val: { - }): void - } - /** - * PathParam is tuple pf path parameter name and its value in request path - */ - interface PathParam { - name: string - value: string - } -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - // @ts-ignore - import sdkrand = rand - /** - * A Credentials is the AWS credentials value for individual credential fields. - */ - interface Credentials { - /** - * AWS Access key ID - */ - accessKeyID: string - /** - * AWS Secret Access Key - */ - secretAccessKey: string - /** - * AWS Session Token - */ - sessionToken: string - /** - * Source of the credentials - */ - source: string - /** - * States if the credentials can expire or not. - */ - canExpire: boolean - /** - * The time the credentials will expire at. Should be ignored if CanExpire - * is false. - */ - expires: time.Time - /** - * The ID of the account for the credentials. - */ - accountID: string - } - interface Credentials { - /** - * Expired returns if the credentials have expired. - */ - expired(): boolean - } - interface Credentials { - /** - * HasKeys returns if the credentials keys are set. - */ - hasKeys(): boolean - } - /** - * Endpoint represents the endpoint a service client should make API operation - * calls to. - * - * The SDK will automatically resolve these endpoints per API client using an - * internal endpoint resolvers. If you'd like to provide custom endpoint - * resolving behavior you can implement the EndpointResolver interface. - * - * Deprecated: This structure was used with the global [EndpointResolver] - * interface, which has been deprecated in favor of service-specific endpoint - * resolution. See the deprecation docs on that interface for more information. - */ - interface Endpoint { - /** - * The base URL endpoint the SDK API clients will use to make API calls to. - * The SDK will suffix URI path and query elements to this endpoint. - */ - url: string - /** - * Specifies if the endpoint's hostname can be modified by the SDK's API - * client. - * - * If the hostname is mutable the SDK API clients may modify any part of - * the hostname based on the requirements of the API, (e.g. adding, or - * removing content in the hostname). Such as, Amazon S3 API client - * prefixing "bucketname" to the hostname, or changing the - * hostname service name component from "s3." to "s3-accesspoint.dualstack." - * for the dualstack endpoint of an S3 Accesspoint resource. - * - * Care should be taken when providing a custom endpoint for an API. If the - * endpoint hostname is mutable, and the client cannot modify the endpoint - * correctly, the operation call will most likely fail, or have undefined - * behavior. - * - * If hostname is immutable, the SDK API clients will not modify the - * hostname of the URL. This may cause the API client not to function - * correctly if the API requires the operation specific hostname values - * to be used by the client. - * - * This flag does not modify the API client's behavior if this endpoint - * will be used instead of Endpoint Discovery, or if the endpoint will be - * used to perform Endpoint Discovery. That behavior is configured via the - * API Client's Options. - */ - hostnameImmutable: boolean - /** - * The AWS partition the endpoint belongs to. - */ - partitionID: string - /** - * The service name that should be used for signing the requests to the - * endpoint. - */ - signingName: string - /** - * The region that should be used for signing the request to the endpoint. - */ - signingRegion: string - /** - * The signing method that should be used for signing the requests to the - * endpoint. - */ - signingMethod: string - /** - * The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata. - * When providing a custom endpoint, you should set the source as EndpointSourceCustom. - * If source is not provided when providing a custom endpoint, the SDK may not - * perform required host mutations correctly. Source should be used along with - * HostnameImmutable property as per the usage requirement. - */ - source: EndpointSource - } - /** - * ExecutionEnvironmentID is the AWS execution environment runtime identifier. - */ - interface ExecutionEnvironmentID extends String{} -} - -namespace types { - interface ArchiveStatus extends String{} - interface ArchiveStatus { - /** - * Values returns all known values for ArchiveStatus. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface BucketAccelerateStatus extends String{} - interface BucketAccelerateStatus { - /** - * Values returns all known values for BucketAccelerateStatus. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface BucketCannedACL extends String{} - interface BucketCannedACL { - /** - * Values returns all known values for BucketCannedACL. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface BucketLocationConstraint extends String{} - interface BucketLocationConstraint { - /** - * Values returns all known values for BucketLocationConstraint. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface BucketVersioningStatus extends String{} - interface BucketVersioningStatus { - /** - * Values returns all known values for BucketVersioningStatus. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ChecksumAlgorithm extends String{} - interface ChecksumAlgorithm { - /** - * Values returns all known values for ChecksumAlgorithm. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ChecksumMode extends String{} - interface ChecksumMode { - /** - * Values returns all known values for ChecksumMode. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface EncodingType extends String{} - interface EncodingType { - /** - * Values returns all known values for EncodingType. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ExpressionType extends String{} - interface ExpressionType { - /** - * Values returns all known values for ExpressionType. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface LocationType extends String{} - interface LocationType { - /** - * Values returns all known values for LocationType. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface MetadataDirective extends String{} - interface MetadataDirective { - /** - * Values returns all known values for MetadataDirective. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface MFADeleteStatus extends String{} - interface MFADeleteStatus { - /** - * Values returns all known values for MFADeleteStatus. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ObjectAttributes extends String{} - interface ObjectAttributes { - /** - * Values returns all known values for ObjectAttributes. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ObjectCannedACL extends String{} - interface ObjectCannedACL { - /** - * Values returns all known values for ObjectCannedACL. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ObjectLockLegalHoldStatus extends String{} - interface ObjectLockLegalHoldStatus { - /** - * Values returns all known values for ObjectLockLegalHoldStatus. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ObjectLockMode extends String{} - interface ObjectLockMode { - /** - * Values returns all known values for ObjectLockMode. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ObjectOwnership extends String{} - interface ObjectOwnership { - /** - * Values returns all known values for ObjectOwnership. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface OptionalObjectAttributes extends String{} - interface OptionalObjectAttributes { - /** - * Values returns all known values for OptionalObjectAttributes. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface Payer extends String{} - interface Payer { - /** - * Values returns all known values for Payer. Note that this can be expanded in - * the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ReplicationStatus extends String{} - interface ReplicationStatus { - /** - * Values returns all known values for ReplicationStatus. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface RequestCharged extends String{} - interface RequestCharged { - /** - * Values returns all known values for RequestCharged. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface RequestPayer extends String{} - interface RequestPayer { - /** - * Values returns all known values for RequestPayer. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ServerSideEncryption extends String{} - interface ServerSideEncryption { - /** - * Values returns all known values for ServerSideEncryption. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface SessionMode extends String{} - interface SessionMode { - /** - * Values returns all known values for SessionMode. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface StorageClass extends String{} - interface StorageClass { - /** - * Values returns all known values for StorageClass. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface TaggingDirective extends String{} - interface TaggingDirective { - /** - * Values returns all known values for TaggingDirective. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface TransitionDefaultMinimumObjectSize extends String{} - interface TransitionDefaultMinimumObjectSize { - /** - * Values returns all known values for TransitionDefaultMinimumObjectSize. Note - * that this can be expanded in the future, and so it is only as up to date as the - * client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithydocument = document - /** - * Configures the transfer acceleration state for an Amazon S3 bucket. For more - * information, see [Amazon S3 Transfer Acceleration]in the Amazon S3 User Guide. - * - * [Amazon S3 Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html - */ - type _suboupbj = noSmithyDocumentSerde - interface AccelerateConfiguration extends _suboupbj { - /** - * Specifies the transfer acceleration status of the bucket. - */ - status: BucketAccelerateStatus - } - /** - * Contains the elements that set the ACL permissions for an object per grantee. - */ - type _subSPxyB = noSmithyDocumentSerde - interface AccessControlPolicy extends _subSPxyB { - /** - * A list of grants. - */ - grants: Array - /** - * Container for the bucket owner's display name and ID. - */ - owner?: Owner - } - /** - * Specifies the configuration and any analyses for the analytics filter of an - * Amazon S3 bucket. - */ - type _subtcBQi = noSmithyDocumentSerde - interface AnalyticsConfiguration extends _subtcBQi { - /** - * The ID that identifies the analytics configuration. - * - * This member is required. - */ - id?: string - /** - * Contains data related to access patterns to be collected and made available to - * analyze the tradeoffs between different storage classes. - * - * This member is required. - */ - storageClassAnalysis?: StorageClassAnalysis - /** - * The filter used to describe a set of objects for analyses. A filter must have - * exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no - * filter is provided, all objects will be considered in any analysis. - */ - filter: AnalyticsFilter - } - /** - * In terms of implementation, a Bucket is a resource. - */ - type _subnHRrx = noSmithyDocumentSerde - interface Bucket extends _subnHRrx { - /** - * Date the bucket was created. This date can change when making changes to your - * bucket, such as editing its bucket policy. - */ - creationDate?: time.Time - /** - * The name of the bucket. - */ - name?: string - } - /** - * Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For - * more information, see [Object Lifecycle Management]in the Amazon S3 User Guide. - * - * [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html - */ - type _subYkJsN = noSmithyDocumentSerde - interface BucketLifecycleConfiguration extends _subYkJsN { - /** - * A lifecycle rule for individual objects in an Amazon S3 bucket. - * - * This member is required. - */ - rules: Array - } - /** - * Container for logging status information. - */ - type _subBBxuR = noSmithyDocumentSerde - interface BucketLoggingStatus extends _subBBxuR { - /** - * Describes where logs are stored and the prefix that Amazon S3 assigns to all - * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API - * Reference. - * - * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html - */ - loggingEnabled?: LoggingEnabled - } - /** - * Contains all the possible checksum or digest values for an object. - */ - type _subIqiaI = noSmithyDocumentSerde - interface Checksum extends _subIqiaI { - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - } - /** - * Container for all (if there are any) keys between Prefix and the next - * occurrence of the string specified by a delimiter. CommonPrefixes lists keys - * that act like subdirectories in the directory specified by Prefix. For example, - * if the prefix is notes/ and the delimiter is a slash (/) as in - * notes/summer/july, the common prefix is notes/summer/. - */ - type _subnfYXQ = noSmithyDocumentSerde - interface CommonPrefix extends _subnfYXQ { - /** - * Container for the specified common prefix. - */ - prefix?: string - } - /** - * The container for the completed multipart upload details. - */ - type _sublPvcF = noSmithyDocumentSerde - interface CompletedMultipartUpload extends _sublPvcF { - /** - * Array of CompletedPart data types. - * - * If you do not supply a valid Part with your request, the service sends back an - * HTTP 400 response. - */ - parts: Array - } - /** - * Container for all response elements. - */ - type _subHUIMd = noSmithyDocumentSerde - interface CopyObjectResult extends _subHUIMd { - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. For more information, see [Checking object integrity]in the - * Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Returns the ETag of the new object. The ETag reflects only changes to the - * contents of an object, not its metadata. - */ - eTag?: string - /** - * Creation date of the object. - */ - lastModified?: time.Time - } - /** - * Container for all response elements. - */ - type _subVgsnT = noSmithyDocumentSerde - interface CopyPartResult extends _subVgsnT { - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - /** - * Entity tag of the object. - */ - eTag?: string - /** - * Date and time at which the object was uploaded. - */ - lastModified?: time.Time - } - /** - * Describes the cross-origin access configuration for objects in an Amazon S3 - * bucket. For more information, see [Enabling Cross-Origin Resource Sharing]in the Amazon S3 User Guide. - * - * [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html - */ - type _subxlNzL = noSmithyDocumentSerde - interface CORSConfiguration extends _subxlNzL { - /** - * A set of origins and methods (cross-origin access that you want to allow). You - * can add up to 100 rules to the configuration. - * - * This member is required. - */ - corsRules: Array - } - /** - * Specifies a cross-origin access rule for an Amazon S3 bucket. - */ - type _subvJddm = noSmithyDocumentSerde - interface CORSRule extends _subvJddm { - /** - * An HTTP method that you allow the origin to execute. Valid values are GET , PUT - * , HEAD , POST , and DELETE . - * - * This member is required. - */ - allowedMethods: Array - /** - * One or more origins you want customers to be able to access the bucket from. - * - * This member is required. - */ - allowedOrigins: Array - /** - * Headers that are specified in the Access-Control-Request-Headers header. These - * headers are allowed in a preflight OPTIONS request. In response to any preflight - * OPTIONS request, Amazon S3 returns any requested headers that are allowed. - */ - allowedHeaders: Array - /** - * One or more headers in the response that you want customers to be able to - * access from their applications (for example, from a JavaScript XMLHttpRequest - * object). - */ - exposeHeaders: Array - /** - * Unique identifier for the rule. The value cannot be longer than 255 characters. - */ - id?: string - /** - * The time in seconds that your browser is to cache the preflight response for - * the specified resource. - */ - maxAgeSeconds?: number - } - /** - * The configuration information for the bucket. - */ - type _subDqXck = noSmithyDocumentSerde - interface CreateBucketConfiguration extends _subDqXck { - /** - * Specifies the information about the bucket that will be created. - * - * This functionality is only supported by directory buckets. - */ - bucket?: BucketInfo - /** - * Specifies the location where the bucket will be created. - * - * For directory buckets, the location type is Availability Zone. - * - * This functionality is only supported by directory buckets. - */ - location?: LocationInfo - /** - * Specifies the Region where the bucket will be created. You might choose a - * Region to optimize latency, minimize costs, or address regulatory requirements. - * For example, if you reside in Europe, you will probably find it advantageous to - * create buckets in the Europe (Ireland) Region. For more information, see [Accessing a bucket]in the - * Amazon S3 User Guide. - * - * If you don't specify a Region, the bucket is created in the US East (N. - * Virginia) Region (us-east-1) by default. - * - * This functionality is not supported for directory buckets. - * - * [Accessing a bucket]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro - */ - locationConstraint: BucketLocationConstraint - } - /** - * Container for the objects to delete. - */ - type _subVsMDX = noSmithyDocumentSerde - interface Delete extends _subVsMDX { - /** - * The object to delete. - * - * Directory buckets - For directory buckets, an object that's composed entirely - * of whitespace characters is not supported by the DeleteObjects API operation. - * The request will receive a 400 Bad Request error and none of the objects in the - * request will be deleted. - * - * This member is required. - */ - objects: Array - /** - * Element to enable quiet mode for the request. When you add this element, you - * must set its value to true . - */ - quiet?: boolean - } - /** - * Information about the deleted object. - */ - type _subdPtrS = noSmithyDocumentSerde - interface DeletedObject extends _subdPtrS { - /** - * Indicates whether the specified object version that was permanently deleted was - * (true) or was not (false) a delete marker before deletion. In a simple DELETE, - * this header indicates whether (true) or not (false) the current version of the - * object is a delete marker. - * - * This functionality is not supported for directory buckets. - */ - deleteMarker?: boolean - /** - * The version ID of the delete marker created as a result of the DELETE - * operation. If you delete a specific object version, the value returned by this - * header is the version ID of the object version deleted. - * - * This functionality is not supported for directory buckets. - */ - deleteMarkerVersionId?: string - /** - * The name of the deleted object. - */ - key?: string - /** - * The version ID of the deleted object. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - } - /** - * Information about the delete marker. - */ - type _subPAfKs = noSmithyDocumentSerde - interface DeleteMarkerEntry extends _subPAfKs { - /** - * Specifies whether the object is (true) or is not (false) the latest version of - * an object. - */ - isLatest?: boolean - /** - * The object key. - */ - key?: string - /** - * Date and time when the object was last modified. - */ - lastModified?: time.Time - /** - * The account that created the delete marker.> - */ - owner?: Owner - /** - * Version ID of an object. - */ - versionId?: string - } - /** - * Container for all error elements. - */ - type _subHZsof = noSmithyDocumentSerde - interface Error extends _subHZsof { - /** - * The error code is a string that uniquely identifies an error condition. It is - * meant to be read and understood by programs that detect and handle errors by - * type. The following is a list of Amazon S3 error codes. For more information, - * see [Error responses]. - * - * ``` - * - Code: AccessDenied - * - * - Description: Access Denied - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: AccountProblem - * - * - Description: There is a problem with your Amazon Web Services account that - * prevents the action from completing successfully. Contact Amazon Web Services - * Support for further assistance. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: AllAccessDisabled - * - * - Description: All access to this Amazon S3 resource has been disabled. - * Contact Amazon Web Services Support for further assistance. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: AmbiguousGrantByEmailAddress - * - * - Description: The email address you provided is associated with more than - * one account. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: AuthorizationHeaderMalformed - * - * - Description: The authorization header you provided is invalid. - * - * - HTTP Status Code: 400 Bad Request - * - * - HTTP Status Code: N/A - * - * - Code: BadDigest - * - * - Description: The Content-MD5 you specified did not match what we received. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: BucketAlreadyExists - * - * - Description: The requested bucket name is not available. The bucket - * namespace is shared by all users of the system. Please select a different name - * and try again. - * - * - HTTP Status Code: 409 Conflict - * - * - SOAP Fault Code Prefix: Client - * - * - Code: BucketAlreadyOwnedByYou - * - * - Description: The bucket you tried to create already exists, and you own it. - * Amazon S3 returns this error in all Amazon Web Services Regions except in the - * North Virginia Region. For legacy compatibility, if you re-create an existing - * bucket that you already own in the North Virginia Region, Amazon S3 returns 200 - * OK and resets the bucket access control lists (ACLs). - * - * - Code: 409 Conflict (in all Regions except the North Virginia Region) - * - * - SOAP Fault Code Prefix: Client - * - * - Code: BucketNotEmpty - * - * - Description: The bucket you tried to delete is not empty. - * - * - HTTP Status Code: 409 Conflict - * - * - SOAP Fault Code Prefix: Client - * - * - Code: CredentialsNotSupported - * - * - Description: This request does not support credentials. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: CrossLocationLoggingProhibited - * - * - Description: Cross-location logging not allowed. Buckets in one geographic - * location cannot log information to a bucket in another location. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: EntityTooSmall - * - * - Description: Your proposed upload is smaller than the minimum allowed - * object size. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: EntityTooLarge - * - * - Description: Your proposed upload exceeds the maximum allowed object size. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: ExpiredToken - * - * - Description: The provided token has expired. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: IllegalVersioningConfigurationException - * - * - Description: Indicates that the versioning configuration specified in the - * request is invalid. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: IncompleteBody - * - * - Description: You did not provide the number of bytes specified by the - * Content-Length HTTP header - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: IncorrectNumberOfFilesInPostRequest - * - * - Description: POST requires exactly one file upload per request. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InlineDataTooLarge - * - * - Description: Inline data exceeds the maximum allowed size. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InternalError - * - * - Description: We encountered an internal error. Please try again. - * - * - HTTP Status Code: 500 Internal Server Error - * - * - SOAP Fault Code Prefix: Server - * - * - Code: InvalidAccessKeyId - * - * - Description: The Amazon Web Services access key ID you provided does not - * exist in our records. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidAddressingHeader - * - * - Description: You must specify the Anonymous role. - * - * - HTTP Status Code: N/A - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidArgument - * - * - Description: Invalid Argument - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidBucketName - * - * - Description: The specified bucket is not valid. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidBucketState - * - * - Description: The request is not valid with the current state of the bucket. - * - * - HTTP Status Code: 409 Conflict - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidDigest - * - * - Description: The Content-MD5 you specified is not valid. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidEncryptionAlgorithmError - * - * - Description: The encryption request you specified is not valid. The valid - * value is AES256. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidLocationConstraint - * - * - Description: The specified location constraint is not valid. For more - * information about Regions, see [How to Select a Region for Your Buckets]. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidObjectState - * - * - Description: The action is not valid for the current state of the object. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidPart - * - * - Description: One or more of the specified parts could not be found. The - * part might not have been uploaded, or the specified entity tag might not have - * matched the part's entity tag. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidPartOrder - * - * - Description: The list of parts was not in ascending order. Parts list must - * be specified in order by part number. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidPayer - * - * - Description: All access to this object has been disabled. Please contact - * Amazon Web Services Support for further assistance. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidPolicyDocument - * - * - Description: The content of the form does not meet the conditions specified - * in the policy document. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidRange - * - * - Description: The requested range cannot be satisfied. - * - * - HTTP Status Code: 416 Requested Range Not Satisfiable - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidRequest - * - * - Description: Please use AWS4-HMAC-SHA256 . - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: SOAP requests must be made over an HTTPS connection. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Acceleration is not supported for buckets - * with non-DNS compliant names. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Acceleration is not supported for buckets - * with periods (.) in their names. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Accelerate endpoint only supports virtual - * style requests. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Accelerate is not configured on this bucket. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Accelerate is disabled on this bucket. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Acceleration is not supported on this - * bucket. Contact Amazon Web Services Support for more information. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidRequest - * - * - Description: Amazon S3 Transfer Acceleration cannot be enabled on this - * bucket. Contact Amazon Web Services Support for more information. - * - * - HTTP Status Code: 400 Bad Request - * - * - Code: N/A - * - * - Code: InvalidSecurity - * - * - Description: The provided security credentials are not valid. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidSOAPRequest - * - * - Description: The SOAP request body is invalid. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidStorageClass - * - * - Description: The storage class you specified is not valid. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidTargetBucketForLogging - * - * - Description: The target bucket for logging does not exist, is not owned by - * you, or does not have the appropriate grants for the log-delivery group. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidToken - * - * - Description: The provided token is malformed or otherwise invalid. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: InvalidURI - * - * - Description: Couldn't parse the specified URI. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: KeyTooLongError - * - * - Description: Your key is too long. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MalformedACLError - * - * - Description: The XML you provided was not well-formed or did not validate - * against our published schema. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MalformedPOSTRequest - * - * - Description: The body of your POST request is not well-formed - * multipart/form-data. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MalformedXML - * - * - Description: This happens when the user sends malformed XML (XML that - * doesn't conform to the published XSD) for the configuration. The error message - * is, "The XML you provided was not well-formed or did not validate against our - * published schema." - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MaxMessageLengthExceeded - * - * - Description: Your request was too big. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MaxPostPreDataLengthExceededError - * - * - Description: Your POST request fields preceding the upload file were too - * large. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MetadataTooLarge - * - * - Description: Your metadata headers exceed the maximum allowed metadata size. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MethodNotAllowed - * - * - Description: The specified method is not allowed against this resource. - * - * - HTTP Status Code: 405 Method Not Allowed - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MissingAttachment - * - * - Description: A SOAP attachment was expected, but none were found. - * - * - HTTP Status Code: N/A - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MissingContentLength - * - * - Description: You must provide the Content-Length HTTP header. - * - * - HTTP Status Code: 411 Length Required - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MissingRequestBodyError - * - * - Description: This happens when the user sends an empty XML document as a - * request. The error message is, "Request body is empty." - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MissingSecurityElement - * - * - Description: The SOAP 1.1 request is missing a security element. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: MissingSecurityHeader - * - * - Description: Your request is missing a required header. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoLoggingStatusForKey - * - * - Description: There is no such thing as a logging status subresource for a - * key. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoSuchBucket - * - * - Description: The specified bucket does not exist. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoSuchBucketPolicy - * - * - Description: The specified bucket does not have a bucket policy. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoSuchKey - * - * - Description: The specified key does not exist. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoSuchLifecycleConfiguration - * - * - Description: The lifecycle configuration does not exist. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoSuchUpload - * - * - Description: The specified multipart upload does not exist. The upload ID - * might be invalid, or the multipart upload might have been aborted or completed. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NoSuchVersion - * - * - Description: Indicates that the version ID specified in the request does - * not match an existing version. - * - * - HTTP Status Code: 404 Not Found - * - * - SOAP Fault Code Prefix: Client - * - * - Code: NotImplemented - * - * - Description: A header you provided implies functionality that is not - * implemented. - * - * - HTTP Status Code: 501 Not Implemented - * - * - SOAP Fault Code Prefix: Server - * - * - Code: NotSignedUp - * - * - Description: Your account is not signed up for the Amazon S3 service. You - * must sign up before you can use Amazon S3. You can sign up at the following URL: - * [Amazon S3] - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: OperationAborted - * - * - Description: A conflicting conditional action is currently in progress - * against this resource. Try again. - * - * - HTTP Status Code: 409 Conflict - * - * - SOAP Fault Code Prefix: Client - * - * - Code: PermanentRedirect - * - * - Description: The bucket you are attempting to access must be addressed - * using the specified endpoint. Send all future requests to this endpoint. - * - * - HTTP Status Code: 301 Moved Permanently - * - * - SOAP Fault Code Prefix: Client - * - * - Code: PreconditionFailed - * - * - Description: At least one of the preconditions you specified did not hold. - * - * - HTTP Status Code: 412 Precondition Failed - * - * - SOAP Fault Code Prefix: Client - * - * - Code: Redirect - * - * - Description: Temporary redirect. - * - * - HTTP Status Code: 307 Moved Temporarily - * - * - SOAP Fault Code Prefix: Client - * - * - Code: RestoreAlreadyInProgress - * - * - Description: Object restore is already in progress. - * - * - HTTP Status Code: 409 Conflict - * - * - SOAP Fault Code Prefix: Client - * - * - Code: RequestIsNotMultiPartContent - * - * - Description: Bucket POST must be of the enclosure-type multipart/form-data. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: RequestTimeout - * - * - Description: Your socket connection to the server was not read from or - * written to within the timeout period. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: RequestTimeTooSkewed - * - * - Description: The difference between the request time and the server's time - * is too large. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: RequestTorrentOfBucketError - * - * - Description: Requesting the torrent file of a bucket is not permitted. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: SignatureDoesNotMatch - * - * - Description: The request signature we calculated does not match the - * signature you provided. Check your Amazon Web Services secret access key and - * signing method. For more information, see [REST Authentication]and [SOAP Authentication]for details. - * - * - HTTP Status Code: 403 Forbidden - * - * - SOAP Fault Code Prefix: Client - * - * - Code: ServiceUnavailable - * - * - Description: Service is unable to handle request. - * - * - HTTP Status Code: 503 Service Unavailable - * - * - SOAP Fault Code Prefix: Server - * - * - Code: SlowDown - * - * - Description: Reduce your request rate. - * - * - HTTP Status Code: 503 Slow Down - * - * - SOAP Fault Code Prefix: Server - * - * - Code: TemporaryRedirect - * - * - Description: You are being redirected to the bucket while DNS updates. - * - * - HTTP Status Code: 307 Moved Temporarily - * - * - SOAP Fault Code Prefix: Client - * - * - Code: TokenRefreshRequired - * - * - Description: The provided token must be refreshed. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: TooManyBuckets - * - * - Description: You have attempted to create more buckets than allowed. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: UnexpectedContent - * - * - Description: This request does not support content. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: UnresolvableGrantByEmailAddress - * - * - Description: The email address you provided does not match any account on - * record. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * - * - Code: UserKeyMustBeSpecified - * - * - Description: The bucket POST must contain the specified field name. If it - * is specified, check the order of the fields. - * - * - HTTP Status Code: 400 Bad Request - * - * - SOAP Fault Code Prefix: Client - * ``` - * - * [How to Select a Region for Your Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro - * [Error responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html - * [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - * [Amazon S3]: http://aws.amazon.com/s3 - * [SOAP Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/SOAPAuthentication.html - */ - code?: string - /** - * The error key. - */ - key?: string - /** - * The error message contains a generic description of the error condition in - * English. It is intended for a human audience. Simple programs display the - * message directly to the end user if they encounter an error condition they don't - * know how or don't care to handle. Sophisticated programs with more exhaustive - * error handling and proper internationalization are more likely to ignore the - * error message. - */ - message?: string - /** - * The version ID of the error. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - } - /** - * The error information. - */ - type _subqXSdr = noSmithyDocumentSerde - interface ErrorDocument extends _subqXSdr { - /** - * The object key name to use when a 4XX class error occurs. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - * - * This member is required. - */ - key?: string - } - /** - * A container for specifying the configuration for Amazon EventBridge. - */ - type _subOMMVt = noSmithyDocumentSerde - interface EventBridgeConfiguration extends _subOMMVt { - } - /** - * A collection of parts associated with a multipart upload. - */ - type _subZajtR = noSmithyDocumentSerde - interface GetObjectAttributesParts extends _subZajtR { - /** - * Indicates whether the returned list of parts is truncated. A value of true - * indicates that the list was truncated. A list can be truncated if the number of - * parts exceeds the limit returned in the MaxParts element. - */ - isTruncated?: boolean - /** - * The maximum number of parts allowed in the response. - */ - maxParts?: number - /** - * When a list is truncated, this element specifies the last part in the list, as - * well as the value to use for the PartNumberMarker request parameter in a - * subsequent request. - */ - nextPartNumberMarker?: string - /** - * The marker for the current part. - */ - partNumberMarker?: string - /** - * A container for elements related to a particular part. A response can contain - * zero or more Parts elements. - * - * ``` - * - General purpose buckets - For GetObjectAttributes , if a additional checksum - * (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , x-amz-checksum-sha1 - * , or x-amz-checksum-sha256 ) isn't applied to the object specified in the - * request, the response doesn't return Part . - * - * - Directory buckets - For GetObjectAttributes , no matter whether a additional - * checksum is applied to the object specified in the request, the response returns - * Part . - * ``` - */ - parts: Array - /** - * The total number of parts. - */ - totalPartsCount?: number - } - /** - * Container for grant information. - */ - type _subIsxyk = noSmithyDocumentSerde - interface Grant extends _subIsxyk { - /** - * The person being granted permissions. - */ - grantee?: Grantee - /** - * Specifies the permission given to the grantee. - */ - permission: Permission - } - /** - * Container for the Suffix element. - */ - type _subWouSZ = noSmithyDocumentSerde - interface IndexDocument extends _subWouSZ { - /** - * A suffix that is appended to a request that is for a directory on the website - * endpoint. (For example, if the suffix is index.html and you make a request to - * samplebucket/images/ , the data that is returned will be for the object with the - * key name images/index.html .) The suffix must not be empty and must not include - * a slash character. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - * - * This member is required. - */ - suffix?: string - } - /** - * Container element that identifies who initiated the multipart upload. - */ - type _subhONmI = noSmithyDocumentSerde - interface Initiator extends _subhONmI { - /** - * Name of the Principal. - * - * This functionality is not supported for directory buckets. - */ - displayName?: string - /** - * If the principal is an Amazon Web Services account, it provides the Canonical - * User ID. If the principal is an IAM User, it provides a user ARN value. - * - * Directory buckets - If the principal is an Amazon Web Services account, it - * provides the Amazon Web Services account ID. If the principal is an IAM User, it - * provides a user ARN value. - */ - id?: string - } - /** - * Describes the serialization format of the object. - */ - type _subzrXpB = noSmithyDocumentSerde - interface InputSerialization extends _subzrXpB { - /** - * Describes the serialization of a CSV-encoded object. - */ - csv?: CSVInput - /** - * Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default - * Value: NONE. - */ - compressionType: CompressionType - /** - * Specifies JSON as object's input serialization format. - */ - json?: JSONInput - /** - * Specifies Parquet as object's input serialization format. - */ - parquet?: ParquetInput - } - /** - * Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. - * - * For information about the S3 Intelligent-Tiering storage class, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. - * - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access - */ - type _subICxld = noSmithyDocumentSerde - interface IntelligentTieringConfiguration extends _subICxld { - /** - * The ID used to identify the S3 Intelligent-Tiering configuration. - * - * This member is required. - */ - id?: string - /** - * Specifies the status of the configuration. - * - * This member is required. - */ - status: IntelligentTieringStatus - /** - * Specifies the S3 Intelligent-Tiering storage class tier of the configuration. - * - * This member is required. - */ - tierings: Array - /** - * Specifies a bucket filter. The configuration only includes objects that meet - * the filter's criteria. - */ - filter?: IntelligentTieringFilter - } - /** - * Specifies the inventory configuration for an Amazon S3 bucket. For more - * information, see [GET Bucket inventory]in the Amazon S3 API Reference. - * - * [GET Bucket inventory]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html - */ - type _subYZjch = noSmithyDocumentSerde - interface InventoryConfiguration extends _subYZjch { - /** - * Contains information about where to publish the inventory results. - * - * This member is required. - */ - destination?: InventoryDestination - /** - * The ID used to identify the inventory configuration. - * - * This member is required. - */ - id?: string - /** - * Object versions to include in the inventory list. If set to All , the list - * includes all the object versions, which adds the version-related fields - * VersionId , IsLatest , and DeleteMarker to the list. If set to Current , the - * list does not contain these version-related fields. - * - * This member is required. - */ - includedObjectVersions: InventoryIncludedObjectVersions - /** - * Specifies whether the inventory is enabled or disabled. If set to True , an - * inventory list is generated. If set to False , no inventory list is generated. - * - * This member is required. - */ - isEnabled?: boolean - /** - * Specifies the schedule for generating inventory results. - * - * This member is required. - */ - schedule?: InventorySchedule - /** - * Specifies an inventory filter. The inventory only includes objects that meet - * the filter's criteria. - */ - filter?: InventoryFilter - /** - * Contains the optional fields that are included in the inventory results. - */ - optionalFields: Array - } - /** - * A container for specifying the configuration for Lambda notifications. - */ - type _sublzkaU = noSmithyDocumentSerde - interface LambdaFunctionConfiguration extends _sublzkaU { - /** - * The Amazon S3 bucket event for which to invoke the Lambda function. For more - * information, see [Supported Event Types]in the Amazon S3 User Guide. - * - * [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - * - * This member is required. - */ - events: Array - /** - * The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes - * when the specified event type occurs. - * - * This member is required. - */ - lambdaFunctionArn?: string - /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html - */ - filter?: NotificationConfigurationFilter - /** - * An optional unique identifier for configurations in a notification - * configuration. If you don't provide one, Amazon S3 will assign an ID. - */ - id?: string - } - /** - * A lifecycle rule for individual objects in an Amazon S3 bucket. - * - * For more information see, [Managing your storage lifecycle] in the Amazon S3 User Guide. - * - * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html - */ - type _subAkDst = noSmithyDocumentSerde - interface LifecycleRule extends _subAkDst { - /** - * If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is - * not currently being applied. - * - * This member is required. - */ - status: ExpirationStatus - /** - * Specifies the days since the initiation of an incomplete multipart upload that - * Amazon S3 will wait before permanently removing all parts of the upload. For - * more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. - * - * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config - */ - abortIncompleteMultipartUpload?: AbortIncompleteMultipartUpload - /** - * Specifies the expiration for the lifecycle of the object in the form of date, - * days and, whether the object has a delete marker. - */ - expiration?: LifecycleExpiration - /** - * The Filter is used to identify objects that a Lifecycle Rule applies to. A - * Filter must have exactly one of Prefix , Tag , or And specified. Filter is - * required if the LifecycleRule does not contain a Prefix element. - */ - filter: LifecycleRuleFilter - /** - * Unique identifier for the rule. The value cannot be longer than 255 characters. - */ - id?: string - /** - * Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 - * permanently deletes the noncurrent object versions. You set this lifecycle - * configuration action on a bucket that has versioning enabled (or suspended) to - * request that Amazon S3 delete noncurrent object versions at a specific period in - * the object's lifetime. - */ - noncurrentVersionExpiration?: NoncurrentVersionExpiration - /** - * Specifies the transition rule for the lifecycle rule that describes when - * noncurrent objects transition to a specific storage class. If your bucket is - * versioning-enabled (or versioning is suspended), you can set this action to - * request that Amazon S3 transition noncurrent object versions to a specific - * storage class at a set period in the object's lifetime. - */ - noncurrentVersionTransitions: Array - /** - * Prefix identifying one or more objects to which the rule applies. This is no - * longer used; use Filter instead. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - * - * Deprecated: This member has been deprecated. - */ - prefix?: string - /** - * Specifies when an Amazon S3 object transitions to a specified storage class. - */ - transitions: Array - } - /** - * Describes where logs are stored and the prefix that Amazon S3 assigns to all - * log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API - * Reference. - * - * [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html - */ - type _subcqzdK = noSmithyDocumentSerde - interface LoggingEnabled extends _subcqzdK { - /** - * Specifies the bucket where you want Amazon S3 to store server access logs. You - * can have your logs delivered to any bucket that you own, including the same - * bucket that is being logged. You can also configure multiple buckets to deliver - * their logs to the same target bucket. In this case, you should choose a - * different TargetPrefix for each source bucket so that the delivered log files - * can be distinguished by key. - * - * This member is required. - */ - targetBucket?: string - /** - * A prefix for all log object keys. If you store log files from multiple Amazon - * S3 buckets in a single bucket, you can use a prefix to distinguish which log - * files came from which bucket. - * - * This member is required. - */ - targetPrefix?: string - /** - * Container for granting information. - * - * Buckets that use the bucket owner enforced setting for Object Ownership don't - * support target grants. For more information, see [Permissions for server access log delivery]in the Amazon S3 User Guide. - * - * [Permissions for server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general - */ - targetGrants: Array - /** - * Amazon S3 key format for log objects. - */ - targetObjectKeyFormat?: TargetObjectKeyFormat - } - /** - * Specifies a metrics configuration for the CloudWatch request metrics (specified - * by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an - * existing metrics configuration, note that this is a full replacement of the - * existing metrics configuration. If you don't include the elements you want to - * keep, they are erased. For more information, see [PutBucketMetricsConfiguration]. - * - * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html - */ - type _subsQNZP = noSmithyDocumentSerde - interface MetricsConfiguration extends _subsQNZP { - /** - * The ID used to identify the metrics configuration. The ID has a 64 character - * limit and can only contain letters, numbers, periods, dashes, and underscores. - * - * This member is required. - */ - id?: string - /** - * Specifies a metrics configuration filter. The metrics configuration will only - * include objects that meet the filter's criteria. A filter must be a prefix, an - * object tag, an access point ARN, or a conjunction (MetricsAndOperator). - */ - filter: MetricsFilter - } - /** - * Container for the MultipartUpload for the Amazon S3 object. - */ - type _subgrMIB = noSmithyDocumentSerde - interface MultipartUpload extends _subgrMIB { - /** - * The algorithm that was used to create a checksum of the object. - */ - checksumAlgorithm: ChecksumAlgorithm - /** - * Date and time at which the multipart upload was initiated. - */ - initiated?: time.Time - /** - * Identifies who initiated the multipart upload. - */ - initiator?: Initiator - /** - * Key of the object for which the multipart upload was initiated. - */ - key?: string - /** - * Specifies the owner of the object that is part of the multipart upload. - * - * Directory buckets - The bucket owner is returned as the object owner for all - * the objects. - */ - owner?: Owner - /** - * The class of storage used to store the object. - * - * Directory buckets - Only the S3 Express One Zone storage class is supported by - * directory buckets to store objects. - */ - storageClass: StorageClass - /** - * Upload ID that identifies the multipart upload. - */ - uploadId?: string - } - /** - * A container for specifying the notification configuration of the bucket. If - * this element is empty, notifications are turned off for the bucket. - */ - type _subORLDi = noSmithyDocumentSerde - interface NotificationConfiguration extends _subORLDi { - /** - * Enables delivery of events to Amazon EventBridge. - */ - eventBridgeConfiguration?: EventBridgeConfiguration - /** - * Describes the Lambda functions to invoke and the events for which to invoke - * them. - */ - lambdaFunctionConfigurations: Array - /** - * The Amazon Simple Queue Service queues to publish messages to and the events - * for which to publish messages. - */ - queueConfigurations: Array - /** - * The topic to which notifications are sent and the events for which - * notifications are generated. - */ - topicConfigurations: Array - } - /** - * An object consists of data and its descriptive metadata. - */ - type _subygDwi = noSmithyDocumentSerde - interface Object extends _subygDwi { - /** - * The algorithm that was used to create a checksum of the object. - */ - checksumAlgorithm: Array - /** - * The entity tag is a hash of the object. The ETag reflects changes only to the - * contents of an object, not its metadata. The ETag may or may not be an MD5 - * digest of the object data. Whether or not it is depends on how the object was - * created and how it is encrypted as described below: - * - * ``` - * - Objects created by the PUT Object, POST Object, or Copy operation, or - * through the Amazon Web Services Management Console, and are encrypted by SSE-S3 - * or plaintext, have ETags that are an MD5 digest of their object data. - * - * - Objects created by the PUT Object, POST Object, or Copy operation, or - * through the Amazon Web Services Management Console, and are encrypted by SSE-C - * or SSE-KMS, have ETags that are not an MD5 digest of their object data. - * - * - If an object is created by either the Multipart Upload or Part Copy - * operation, the ETag is not an MD5 digest, regardless of the method of - * encryption. If an object is larger than 16 MB, the Amazon Web Services - * Management Console will upload or copy that object as a Multipart Upload, and - * therefore the ETag will not be an MD5 digest. - * ``` - * - * Directory buckets - MD5 is not supported by directory buckets. - */ - eTag?: string - /** - * The name that you assign to an object. You use the object key to retrieve the - * object. - */ - key?: string - /** - * Creation date of the object. - */ - lastModified?: time.Time - /** - * The owner of the object - * - * Directory buckets - The bucket owner is returned as the object owner. - */ - owner?: Owner - /** - * Specifies the restoration status of an object. Objects in certain storage - * classes must be restored before they can be retrieved. For more information - * about these storage classes and how to work with archived objects, see [Working with archived objects]in the - * Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. Only the S3 Express - * One Zone storage class is supported by directory buckets to store objects. - * - * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html - */ - restoreStatus?: RestoreStatus - /** - * Size in bytes of the object - */ - size?: number - /** - * The class of storage used to store the object. - * - * Directory buckets - Only the S3 Express One Zone storage class is supported by - * directory buckets to store objects. - */ - storageClass: ObjectStorageClass - } - /** - * The container element for Object Lock configuration parameters. - */ - type _subPmUFU = noSmithyDocumentSerde - interface ObjectLockConfiguration extends _subPmUFU { - /** - * Indicates whether this bucket has an Object Lock configuration enabled. Enable - * ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket. - */ - objectLockEnabled: ObjectLockEnabled - /** - * Specifies the Object Lock rule for the specified object. Enable the this rule - * when you apply ObjectLockConfiguration to a bucket. Bucket settings require - * both a mode and a period. The period can be either Days or Years but you must - * select one. You cannot specify Days and Years at the same time. - */ - rule?: ObjectLockRule - } - /** - * A legal hold configuration for an object. - */ - type _subRuoIU = noSmithyDocumentSerde - interface ObjectLockLegalHold extends _subRuoIU { - /** - * Indicates whether the specified object has a legal hold in place. - */ - status: ObjectLockLegalHoldStatus - } - /** - * A Retention configuration for an object. - */ - type _subeRKwD = noSmithyDocumentSerde - interface ObjectLockRetention extends _subeRKwD { - /** - * Indicates the Retention mode for the specified object. - */ - mode: ObjectLockRetentionMode - /** - * The date on which this Object Lock Retention will expire. - */ - retainUntilDate?: time.Time - } - /** - * The version of an object. - */ - type _subMRzMq = noSmithyDocumentSerde - interface ObjectVersion extends _subMRzMq { - /** - * The algorithm that was used to create a checksum of the object. - */ - checksumAlgorithm: Array - /** - * The entity tag is an MD5 hash of that version of the object. - */ - eTag?: string - /** - * Specifies whether the object is (true) or is not (false) the latest version of - * an object. - */ - isLatest?: boolean - /** - * The object key. - */ - key?: string - /** - * Date and time when the object was last modified. - */ - lastModified?: time.Time - /** - * Specifies the owner of the object. - */ - owner?: Owner - /** - * Specifies the restoration status of an object. Objects in certain storage - * classes must be restored before they can be retrieved. For more information - * about these storage classes and how to work with archived objects, see [Working with archived objects]in the - * Amazon S3 User Guide. - * - * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html - */ - restoreStatus?: RestoreStatus - /** - * Size in bytes of the object. - */ - size?: number - /** - * The class of storage used to store the object. - */ - storageClass: ObjectVersionStorageClass - /** - * Version ID of an object. - */ - versionId?: string - } - /** - * Describes how results of the Select job are serialized. - */ - type _submqdFf = noSmithyDocumentSerde - interface OutputSerialization extends _submqdFf { - /** - * Describes the serialization of CSV-encoded Select results. - */ - csv?: CSVOutput - /** - * Specifies JSON as request's output serialization format. - */ - json?: JSONOutput - } - /** - * Container for the owner's display name and ID. - */ - type _subbNdPB = noSmithyDocumentSerde - interface Owner extends _subbNdPB { - /** - * Container for the display name of the owner. This value is only supported in - * the following Amazon Web Services Regions: - * - * ``` - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * This functionality is not supported for directory buckets. - */ - displayName?: string - /** - * Container for the ID of the owner. - */ - id?: string - } - /** - * The container element for a bucket's ownership controls. - */ - type _subaEOKu = noSmithyDocumentSerde - interface OwnershipControls extends _subaEOKu { - /** - * The container element for an ownership control rule. - * - * This member is required. - */ - rules: Array - } - /** - * Container for elements related to a part. - */ - type _subboIgG = noSmithyDocumentSerde - interface Part extends _subboIgG { - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumSHA256?: string - /** - * Entity tag returned when the part was uploaded. - */ - eTag?: string - /** - * Date and time at which the part was uploaded. - */ - lastModified?: time.Time - /** - * Part number identifying the part. This is a positive integer between 1 and - * 10,000. - */ - partNumber?: number - /** - * Size in bytes of the uploaded part data. - */ - size?: number - } - /** - * The container element for a bucket's policy status. - */ - type _subSlORQ = noSmithyDocumentSerde - interface PolicyStatus extends _subSlORQ { - /** - * The policy status for this bucket. TRUE indicates that this bucket is public. - * FALSE indicates that the bucket is not public. - */ - isPublic?: boolean - } - /** - * The PublicAccessBlock configuration that you want to apply to this Amazon S3 - * bucket. You can enable the configuration options in any combination. For more - * information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in - * the Amazon S3 User Guide. - * - * [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status - */ - type _subfBNiK = noSmithyDocumentSerde - interface PublicAccessBlockConfiguration extends _subfBNiK { - /** - * Specifies whether Amazon S3 should block public access control lists (ACLs) for - * this bucket and objects in this bucket. Setting this element to TRUE causes the - * following behavior: - * - * ``` - * - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. - * - * - PUT Object calls fail if the request includes a public ACL. - * - * - PUT Bucket calls fail if the request includes a public ACL. - * ``` - * - * Enabling this setting doesn't affect existing policies or ACLs. - */ - blockPublicAcls?: boolean - /** - * Specifies whether Amazon S3 should block public bucket policies for this - * bucket. Setting this element to TRUE causes Amazon S3 to reject calls to PUT - * Bucket policy if the specified bucket policy allows public access. - * - * Enabling this setting doesn't affect existing bucket policies. - */ - blockPublicPolicy?: boolean - /** - * Specifies whether Amazon S3 should ignore public ACLs for this bucket and - * objects in this bucket. Setting this element to TRUE causes Amazon S3 to ignore - * all public ACLs on this bucket and objects in this bucket. - * - * Enabling this setting doesn't affect the persistence of any existing ACLs and - * doesn't prevent new public ACLs from being set. - */ - ignorePublicAcls?: boolean - /** - * Specifies whether Amazon S3 should restrict public bucket policies for this - * bucket. Setting this element to TRUE restricts access to this bucket to only - * Amazon Web Servicesservice principals and authorized users within this account - * if the bucket has a public policy. - * - * Enabling this setting doesn't affect previously stored bucket policies, except - * that public and cross-account access within any public bucket policy, including - * non-public delegation to specific accounts, is blocked. - */ - restrictPublicBuckets?: boolean - } - /** - * Specifies the configuration for publishing messages to an Amazon Simple Queue - * Service (Amazon SQS) queue when Amazon S3 detects specified events. - */ - type _subYmItT = noSmithyDocumentSerde - interface QueueConfiguration extends _subYmItT { - /** - * A collection of bucket events for which to send notifications - * - * This member is required. - */ - events: Array - /** - * The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 - * publishes a message when it detects events of the specified type. - * - * This member is required. - */ - queueArn?: string - /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html - */ - filter?: NotificationConfigurationFilter - /** - * An optional unique identifier for configurations in a notification - * configuration. If you don't provide one, Amazon S3 will assign an ID. - */ - id?: string - } - /** - * Specifies the redirect behavior of all requests to a website endpoint of an - * Amazon S3 bucket. - */ - type _subrdDeP = noSmithyDocumentSerde - interface RedirectAllRequestsTo extends _subrdDeP { - /** - * Name of the host where requests are redirected. - * - * This member is required. - */ - hostName?: string - /** - * Protocol to use when redirecting requests. The default is the protocol that is - * used in the original request. - */ - protocol: Protocol - } - /** - * A container for replication rules. You can add up to 1,000 rules. The maximum - * size of a replication configuration is 2 MB. - */ - type _subhluIr = noSmithyDocumentSerde - interface ReplicationConfiguration extends _subhluIr { - /** - * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role - * that Amazon S3 assumes when replicating objects. For more information, see [How to Set Up Replication]in - * the Amazon S3 User Guide. - * - * [How to Set Up Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html - * - * This member is required. - */ - role?: string - /** - * A container for one or more replication rules. A replication configuration must - * have at least one rule and can contain a maximum of 1,000 rules. - * - * This member is required. - */ - rules: Array - } - /** - * Container for Payer. - */ - type _subAbWTq = noSmithyDocumentSerde - interface RequestPaymentConfiguration extends _subAbWTq { - /** - * Specifies who pays for the download and request fees. - * - * This member is required. - */ - payer: Payer - } - /** - * Container for specifying if periodic QueryProgress messages should be sent. - */ - type _subfVUrc = noSmithyDocumentSerde - interface RequestProgress extends _subfVUrc { - /** - * Specifies whether periodic QueryProgress frames should be sent. Valid values: - * TRUE, FALSE. Default value: FALSE. - */ - enabled?: boolean - } - /** - * Container for restore job parameters. - */ - type _subpgvbW = noSmithyDocumentSerde - interface RestoreRequest extends _subpgvbW { - /** - * Lifetime of the active copy in days. Do not use with restores that specify - * OutputLocation . - * - * The Days element is required for regular restores, and must not be provided for - * select requests. - */ - days?: number - /** - * The optional description for the job. - */ - description?: string - /** - * S3 Glacier related parameters pertaining to this job. Do not use with restores - * that specify OutputLocation . - */ - glacierJobParameters?: GlacierJobParameters - /** - * Describes the location where the restore job's output is stored. - */ - outputLocation?: OutputLocation - /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Describes the parameters for Select job types. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - */ - selectParameters?: SelectParameters - /** - * Retrieval tier at which the restore will be processed. - */ - tier: Tier - /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Type of restore request. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - */ - type: RestoreRequestType - } - /** - * Specifies the redirect behavior and when a redirect is applied. For more - * information about routing rules, see [Configuring advanced conditional redirects]in the Amazon S3 User Guide. - * - * [Configuring advanced conditional redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects - */ - type _subgmBiz = noSmithyDocumentSerde - interface RoutingRule extends _subgmBiz { - /** - * Container for redirect information. You can redirect requests to another host, - * to another page, or with another protocol. In the event of an error, you can - * specify a different error code to return. - * - * This member is required. - */ - redirect?: Redirect - /** - * A container for describing a condition that must be met for the specified - * redirect to apply. For example, 1. If request is for pages in the /docs folder, - * redirect to the /documents folder. 2. If request results in HTTP error 4xx, - * redirect request to another host where you might process the error. - */ - condition?: Condition - } - /** - * Specifies the byte range of the object to get the records from. A record is - * processed when its first byte is contained by the range. This parameter is - * optional, but when specified, it must not be empty. See RFC 2616, Section - * 14.35.1 about how to specify the start and end of the range. - */ - type _subkqDeR = noSmithyDocumentSerde - interface ScanRange extends _subkqDeR { - /** - * Specifies the end of the byte range. This parameter is optional. Valid values: - * non-negative integers. The default value is one less than the size of the object - * being queried. If only the End parameter is supplied, it is interpreted to mean - * scan the last N bytes of the file. For example, 50 means scan the last 50 bytes. - */ - end?: number - /** - * Specifies the start of the byte range. This parameter is optional. Valid - * values: non-negative integers. The default value is 0. If only start is - * supplied, it means scan from that point to the end of the file. For example, 50 - * means scan from byte 50 until the end of the file. - */ - start?: number - } - /** - * Specifies the default server-side-encryption configuration. - */ - type _subULGqH = noSmithyDocumentSerde - interface ServerSideEncryptionConfiguration extends _subULGqH { - /** - * Container for information about a particular server-side encryption - * configuration rule. - * - * This member is required. - */ - rules: Array - } - /** - * The established temporary security credentials of the session. - * - * Directory buckets - These session credentials are only supported for the - * authentication and authorization of Zonal endpoint API operations on directory - * buckets. - */ - type _subBNDTI = noSmithyDocumentSerde - interface SessionCredentials extends _subBNDTI { - /** - * A unique identifier that's associated with a secret access key. The access key - * ID and the secret access key are used together to sign programmatic Amazon Web - * Services requests cryptographically. - * - * This member is required. - */ - accessKeyId?: string - /** - * Temporary security credentials expire after a specified interval. After - * temporary credentials expire, any calls that you make with those credentials - * will fail. So you must generate a new set of temporary credentials. Temporary - * credentials cannot be extended or refreshed beyond the original specified - * interval. - * - * This member is required. - */ - expiration?: time.Time - /** - * A key that's used with the access key ID to cryptographically sign programmatic - * Amazon Web Services requests. Signing a request identifies the sender and - * prevents the request from being altered. - * - * This member is required. - */ - secretAccessKey?: string - /** - * A part of the temporary security credentials. The session token is used to - * validate the temporary security credentials. - * - * This member is required. - */ - sessionToken?: string - } - /** - * A container of a key value name pair. - */ - type _subcoyTd = noSmithyDocumentSerde - interface Tag extends _subcoyTd { - /** - * Name of the object key. - * - * This member is required. - */ - key?: string - /** - * Value of the tag. - * - * This member is required. - */ - value?: string - } - /** - * Container for TagSet elements. - */ - type _subTATMo = noSmithyDocumentSerde - interface Tagging extends _subTATMo { - /** - * A collection for a set of tags - * - * This member is required. - */ - tagSet: Array - } - /** - * A container for specifying the configuration for publication of messages to an - * Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects - * specified events. - */ - type _subHWkEl = noSmithyDocumentSerde - interface TopicConfiguration extends _subHWkEl { - /** - * The Amazon S3 bucket event about which to send notifications. For more - * information, see [Supported Event Types]in the Amazon S3 User Guide. - * - * [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - * - * This member is required. - */ - events: Array - /** - * The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 - * publishes a message when it detects events of the specified type. - * - * This member is required. - */ - topicArn?: string - /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html - */ - filter?: NotificationConfigurationFilter - /** - * An optional unique identifier for configurations in a notification - * configuration. If you don't provide one, Amazon S3 will assign an ID. - */ - id?: string - } - /** - * Describes the versioning state of an Amazon S3 bucket. For more information, - * see [PUT Bucket versioning]in the Amazon S3 API Reference. - * - * [PUT Bucket versioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html - */ - type _subIcZDf = noSmithyDocumentSerde - interface VersioningConfiguration extends _subIcZDf { - /** - * Specifies whether MFA delete is enabled in the bucket versioning configuration. - * This element is only returned if the bucket has been configured with MFA delete. - * If the bucket has never been so configured, this element is not returned. - */ - mfaDelete: MFADelete - /** - * The versioning state of the bucket. - */ - status: BucketVersioningStatus - } - /** - * Specifies website configuration parameters for an Amazon S3 bucket. - */ - type _subtLumZ = noSmithyDocumentSerde - interface WebsiteConfiguration extends _subtLumZ { - /** - * The name of the error document for the website. - */ - errorDocument?: ErrorDocument - /** - * The name of the index document for the website. - */ - indexDocument?: IndexDocument - /** - * The redirect behavior for every request to this bucket's website endpoint. - * - * If you specify this property, you can't specify any other property. - */ - redirectAllRequestsTo?: RedirectAllRequestsTo - /** - * Rules that define when a redirect is applied and the redirect behavior. - */ - routingRules: Array - } -} - -/** - * Package s3 provides the API client, operations, and parameter types for Amazon - * Simple Storage Service. - */ -namespace s3 { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import awshttp = http - // @ts-ignore - import internalauth = auth - // @ts-ignore - import internalauthsmithy = smithy - // @ts-ignore - import internalConfig = configsources - // @ts-ignore - import internalmiddleware = middleware - // @ts-ignore - import acceptencodingcust = accept_encoding - // @ts-ignore - import internalChecksum = checksum - // @ts-ignore - import presignedurlcust = presigned_url - // @ts-ignore - import s3sharedconfig = config - // @ts-ignore - import s3cust = customizations - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithyauth = auth - // @ts-ignore - import smithydocument = document - // @ts-ignore - import smithyhttp = http - interface noSmithyDocumentSerde extends smithydocument.NoSerde{} - interface HTTPSignerV4 { - [key:string]: any; - signHTTP(ctx: context.Context, credentials: aws.Credentials, r: http.Request, payloadHash: string, service: string, region: string, signingTime: time.Time, ...optFns: ((_arg0: v4.SignerOptions) => void)[]): void - } - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import smithyio = io - // @ts-ignore - import smithytime = time - // @ts-ignore - import smithywaiter = waiter - // @ts-ignore - import smithysync = sync - /** - * SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent operation. - * - * For testing and mocking the event stream this type should be initialized via - * the NewSelectObjectContentEventStream constructor function. Using the functional options - * to pass in nested mock behavior. - */ - interface SelectObjectContentEventStream { - /** - * SelectObjectContentEventStreamReader is the EventStream reader for the - * SelectObjectContentEventStream events. This value is automatically set by the - * SDK when the API call is made Use this member when unit testing your code with - * the SDK to mock out the EventStream Reader. - * - * Must not be nil. - */ - reader: SelectObjectContentEventStreamReader - } - interface SelectObjectContentEventStream { - /** - * Events returns a channel to read events from. - */ - events(): undefined - } - interface SelectObjectContentEventStream { - /** - * Close closes the stream. This will also cause the stream to be closed. - * Close must be called when done using the stream API. Not calling Close - * may result in resource leaks. - * - * Will close the underlying EventStream writer and reader, and no more events can be - * sent or received. - */ - close(): void - } - interface SelectObjectContentEventStream { - /** - * Err returns any error that occurred while reading or writing EventStream Events - * from the service API's response. Returns nil if there were no errors. - */ - err(): void - } - /** - * AuthSchemeResolver returns a set of possible authentication options for an - * operation. - */ - interface AuthSchemeResolver { - [key:string]: any; - resolveAuthSchemes(_arg0: context.Context, _arg1: AuthResolverParameters): Array<(smithyauth.Option | undefined)> - } - // @ts-ignore - import internalcontext = context - // @ts-ignore - import awsxml = xml - // @ts-ignore - import internalendpoints = endpoints - // @ts-ignore - import smithyendpoints = endpoints - /** - * EndpointResolverOptions is the service endpoint resolver options - */ - interface EndpointResolverOptions extends internalendpoints.Options{} - /** - * EndpointResolver interface for resolving service endpoints. - */ - interface EndpointResolver { - [key:string]: any; - resolveEndpoint(region: string, options: EndpointResolverOptions): aws.Endpoint - } - /** - * EndpointResolverV2 provides the interface for resolving service endpoints. - */ - interface EndpointResolverV2 { - [key:string]: any; - /** - * ResolveEndpoint attempts to resolve the endpoint with the provided options, - * returning the endpoint if found. Otherwise an error is returned. - */ - resolveEndpoint(ctx: context.Context, params: EndpointParameters): smithyendpoints.Endpoint - } - /** - * ExpressCredentialsProvider retrieves credentials for operations against the - * S3Express storage class. - */ - interface ExpressCredentialsProvider extends customizations.S3ExpressCredentialsProvider{} - interface HTTPClient { - [key:string]: any; - do(_arg0: http.Request): (http.Response) - } - // @ts-ignore - import v4 = signer -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - interface EmailTemplate { - body: string - subject: string - actionUrl: string - hidden: boolean - } - interface EmailTemplate { - /** - * Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface EmailTemplate { - /** - * Resolve replaces the placeholder parameters in the current email - * template and returns its components as ready-to-use strings. - */ - resolve(appName: string, appUrl: string, token: string): [string, string, string] - } -} - -namespace subscriptions { - /** - * Message defines a client's channel data. - */ - interface Message { - name: string - data: string|Array - } - /** - * Client is an interface for a generic subscription client. - */ - interface Client { - [key:string]: any; - /** - * Id Returns the unique id of the client. - */ - id(): string - /** - * Channel returns the client's communication channel. - */ - channel(): undefined - /** - * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. - * If no prefix is specified, returns all subscriptions. - */ - subscriptions(...prefixes: string[]): _TygojaDict - /** - * Subscribe subscribes the client to the provided subscriptions list. - * - * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. - * - * Example: - * - * ``` - * Subscribe( - * "subscriptionA", - * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, - * ) - * ``` - */ - subscribe(...subs: string[]): void - /** - * Unsubscribe unsubscribes the client from the provided subscriptions list. - */ - unsubscribe(...subs: string[]): void - /** - * HasSubscription checks if the client is subscribed to `sub`. - */ - hasSubscription(sub: string): boolean - /** - * Set stores any value to the client's context. - */ - set(key: string, value: any): void - /** - * Unset removes a single value from the client's context. - */ - unset(key: string): void - /** - * Get retrieves the key value from the client's context. - */ - get(key: string): any - /** - * Discard marks the client as "discarded", meaning that it - * shouldn't be used anymore for sending new messages. - * - * It is safe to call Discard() multiple times. - */ - discard(): void - /** - * IsDiscarded indicates whether the client has been "discarded" - * and should no longer be used. - */ - isDiscarded(): boolean - /** - * Send sends the specified message to the client's channel (if not discarded). - */ - send(m: Message): void - } -} - -/** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. - */ -namespace core { - interface BaseModelEvent { - model: models.Model - } - interface BaseModelEvent { - tags(): Array - } - interface BaseCollectionEvent { - collection?: models.Collection - } - interface BaseCollectionEvent { - tags(): Array - } -} - -/** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. - */ -namespace bufio { - /** - * Reader implements buffering for an io.Reader object. - */ - interface Reader { - } - interface Reader { - /** - * Size returns the size of the underlying buffer in bytes. - */ - size(): number - } - interface Reader { - /** - * Reset discards any buffered data, resets all state, and switches - * the buffered reader to read from r. - * Calling Reset on the zero value of [Reader] initializes the internal buffer - * to the default size. - * Calling b.Reset(b) (that is, resetting a [Reader] to itself) does nothing. - */ - reset(r: io.Reader): void - } - interface Reader { - /** - * Peek returns the next n bytes without advancing the reader. The bytes stop - * being valid at the next read call. If Peek returns fewer than n bytes, it - * also returns an error explaining why the read is short. The error is - * [ErrBufferFull] if n is larger than b's buffer size. - * - * Calling Peek prevents a [Reader.UnreadByte] or [Reader.UnreadRune] call from succeeding - * until the next read operation. - */ - peek(n: number): string|Array - } - interface Reader { - /** - * Discard skips the next n bytes, returning the number of bytes discarded. - * - * If Discard skips fewer than n bytes, it also returns an error. - * If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without - * reading from the underlying io.Reader. - */ - discard(n: number): number - } - interface Reader { - /** - * Read reads data into p. - * It returns the number of bytes read into p. - * The bytes are taken from at most one Read on the underlying [Reader], - * hence n may be less than len(p). - * To read exactly len(p) bytes, use io.ReadFull(b, p). - * If the underlying [Reader] can return a non-zero count with io.EOF, - * then this Read method can do so as well; see the [io.Reader] docs. - */ - read(p: string|Array): number - } - interface Reader { - /** - * ReadByte reads and returns a single byte. - * If no byte is available, returns an error. - */ - readByte(): number - } - interface Reader { - /** - * UnreadByte unreads the last byte. Only the most recently read byte can be unread. - * - * UnreadByte returns an error if the most recent method called on the - * [Reader] was not a read operation. Notably, [Reader.Peek], [Reader.Discard], and [Reader.WriteTo] are not - * considered read operations. - */ - unreadByte(): void - } - interface Reader { - /** - * ReadRune reads a single UTF-8 encoded Unicode character and returns the - * rune and its size in bytes. If the encoded rune is invalid, it consumes one byte - * and returns unicode.ReplacementChar (U+FFFD) with a size of 1. - */ - readRune(): [number, number] - } - interface Reader { - /** - * UnreadRune unreads the last rune. If the most recent method called on - * the [Reader] was not a [Reader.ReadRune], [Reader.UnreadRune] returns an error. (In this - * regard it is stricter than [Reader.UnreadByte], which will unread the last byte - * from any read operation.) - */ - unreadRune(): void - } - interface Reader { - /** - * Buffered returns the number of bytes that can be read from the current buffer. - */ - buffered(): number - } - interface Reader { - /** - * ReadSlice reads until the first occurrence of delim in the input, - * returning a slice pointing at the bytes in the buffer. - * The bytes stop being valid at the next read. - * If ReadSlice encounters an error before finding a delimiter, - * it returns all the data in the buffer and the error itself (often io.EOF). - * ReadSlice fails with error [ErrBufferFull] if the buffer fills without a delim. - * Because the data returned from ReadSlice will be overwritten - * by the next I/O operation, most clients should use - * [Reader.ReadBytes] or ReadString instead. - * ReadSlice returns err != nil if and only if line does not end in delim. - */ - readSlice(delim: number): string|Array - } - interface Reader { - /** - * ReadLine is a low-level line-reading primitive. Most callers should use - * [Reader.ReadBytes]('\n') or [Reader.ReadString]('\n') instead or use a [Scanner]. - * - * ReadLine tries to return a single line, not including the end-of-line bytes. - * If the line was too long for the buffer then isPrefix is set and the - * beginning of the line is returned. The rest of the line will be returned - * from future calls. isPrefix will be false when returning the last fragment - * of the line. The returned buffer is only valid until the next call to - * ReadLine. ReadLine either returns a non-nil line or it returns an error, - * never both. - * - * The text returned from ReadLine does not include the line end ("\r\n" or "\n"). - * No indication or error is given if the input ends without a final line end. - * Calling [Reader.UnreadByte] after ReadLine will always unread the last byte read - * (possibly a character belonging to the line end) even if that byte is not - * part of the line returned by ReadLine. - */ - readLine(): [string|Array, boolean] - } - interface Reader { - /** - * ReadBytes reads until the first occurrence of delim in the input, - * returning a slice containing the data up to and including the delimiter. - * If ReadBytes encounters an error before finding a delimiter, - * it returns the data read before the error and the error itself (often io.EOF). - * ReadBytes returns err != nil if and only if the returned data does not end in - * delim. - * For simple uses, a Scanner may be more convenient. - */ - readBytes(delim: number): string|Array - } - interface Reader { - /** - * ReadString reads until the first occurrence of delim in the input, - * returning a string containing the data up to and including the delimiter. - * If ReadString encounters an error before finding a delimiter, - * it returns the data read before the error and the error itself (often io.EOF). - * ReadString returns err != nil if and only if the returned data does not end in - * delim. - * For simple uses, a Scanner may be more convenient. - */ - readString(delim: number): string - } - interface Reader { - /** - * WriteTo implements io.WriterTo. - * This may make multiple calls to the [Reader.Read] method of the underlying [Reader]. - * If the underlying reader supports the [Reader.WriteTo] method, - * this calls the underlying [Reader.WriteTo] without buffering. - */ - writeTo(w: io.Writer): number - } - /** - * Writer implements buffering for an [io.Writer] object. - * If an error occurs writing to a [Writer], no more data will be - * accepted and all subsequent writes, and [Writer.Flush], will return the error. - * After all data has been written, the client should call the - * [Writer.Flush] method to guarantee all data has been forwarded to - * the underlying [io.Writer]. - */ - interface Writer { - } - interface Writer { - /** - * Size returns the size of the underlying buffer in bytes. - */ - size(): number - } - interface Writer { - /** - * Reset discards any unflushed buffered data, clears any error, and - * resets b to write its output to w. - * Calling Reset on the zero value of [Writer] initializes the internal buffer - * to the default size. - * Calling w.Reset(w) (that is, resetting a [Writer] to itself) does nothing. - */ - reset(w: io.Writer): void - } - interface Writer { - /** - * Flush writes any buffered data to the underlying [io.Writer]. - */ - flush(): void - } - interface Writer { - /** - * Available returns how many bytes are unused in the buffer. - */ - available(): number - } - interface Writer { - /** - * AvailableBuffer returns an empty buffer with b.Available() capacity. - * This buffer is intended to be appended to and - * passed to an immediately succeeding [Writer.Write] call. - * The buffer is only valid until the next write operation on b. - */ - availableBuffer(): string|Array - } - interface Writer { - /** - * Buffered returns the number of bytes that have been written into the current buffer. - */ - buffered(): number - } - interface Writer { - /** - * Write writes the contents of p into the buffer. - * It returns the number of bytes written. - * If nn < len(p), it also returns an error explaining - * why the write is short. - */ - write(p: string|Array): number - } - interface Writer { - /** - * WriteByte writes a single byte. - */ - writeByte(c: number): void - } - interface Writer { - /** - * WriteRune writes a single Unicode code point, returning - * the number of bytes written and any error. - */ - writeRune(r: number): number - } - interface Writer { - /** - * WriteString writes a string. - * It returns the number of bytes written. - * If the count is less than len(s), it also returns an error explaining - * why the write is short. - */ - writeString(s: string): number - } - interface Writer { - /** - * ReadFrom implements [io.ReaderFrom]. If the underlying writer - * supports the ReadFrom method, this calls the underlying ReadFrom. - * If there is buffered data and an underlying ReadFrom, this fills - * the buffer and writes it before calling ReadFrom. - */ - readFrom(r: io.Reader): number - } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url -} - -/** - * Package middleware provides transport agnostic middleware for decorating SDK - * handlers. - * - * The Smithy middleware stack provides ordered behavior to be invoked on an - * underlying handler. The stack is separated into steps that are invoked in a - * static order. A step is a collection of middleware that are injected into a - * ordered list defined by the user. The user may add, insert, swap, and remove a - * step's middleware. When the stack is invoked the step middleware become static, - * and their order cannot be modified. - * - * A stack and its step middleware are **not** safe to modify concurrently. - * - * A stack will use the ordered list of middleware to decorate a underlying - * handler. A handler could be something like an HTTP Client that round trips an - * API operation over HTTP. - * - * Smithy Middleware Stack - * - * A Stack is a collection of middleware that wrap a handler. The stack can be - * broken down into discreet steps. Each step may contain zero or more middleware - * specific to that stack's step. - * - * A Stack Step is a predefined set of middleware that are invoked in a static - * order by the Stack. These steps represent fixed points in the middleware stack - * for organizing specific behavior, such as serialize and build. A Stack Step is - * composed of zero or more middleware that are specific to that step. A step may - * define its own set of input/output parameters the generic input/output - * parameters are cast from. A step calls its middleware recursively, before - * calling the next step in the stack returning the result or error of the step - * middleware decorating the underlying handler. - * - * * Initialize: Prepares the input, and sets any default parameters as needed, - * (e.g. idempotency token, and presigned URLs). - * - * * Serialize: Serializes the prepared input into a data structure that can be - * consumed by the target transport's message, (e.g. REST-JSON serialization). - * - * * Build: Adds additional metadata to the serialized transport message, (e.g. - * HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. - * - * * Finalize: Performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated to - * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request - * signing). - * - * * Deserialize: Reacts to the handler's response returned by the recipient of - * the request message. Deserializes the response into a structured type or - * error above stacks can react to. - * - * Adding Middleware to a Stack Step - * - * Middleware can be added to a step front or back, or relative, by name, to an - * existing middleware in that stack. If a middleware does not have a name, a - * unique name will be generated at the middleware and be added to the step. - * - * ``` - * // Create middleware stack - * stack := middleware.NewStack() - * - * // Add middleware to stack steps - * stack.Initialize.Add(paramValidationMiddleware, middleware.After) - * stack.Serialize.Add(marshalOperationFoo, middleware.After) - * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) - * - * // Invoke middleware on handler. - * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) - * ``` - */ -namespace middleware { - /** - * RelativePosition provides specifying the relative position of a middleware - * in an ordered group. - */ - interface RelativePosition extends Number{} - /** - * BuildMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next BuildHandler for further - * processing. - */ - interface BuildMiddleware { - [key:string]: any; - /** - * Unique ID for the middleware in theBuildStep. The step does not allow - * duplicate IDs. - */ - id(): string - /** - * Invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleBuild(ctx: context.Context, _arg10: BuildInput, next: BuildHandler): [BuildOutput, Metadata] - } - /** - * DeserializeMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next DeserializeHandler for further - * processing. - */ - interface DeserializeMiddleware { - [key:string]: any; - /** - * ID returns a unique ID for the middleware in the DeserializeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleDeserialize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleDeserialize(ctx: context.Context, _arg10: DeserializeInput, next: DeserializeHandler): [DeserializeOutput, Metadata] - } - /** - * FinalizeMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next FinalizeHandler for further - * processing. - */ - interface FinalizeMiddleware { - [key:string]: any; - /** - * ID returns a unique ID for the middleware in the FinalizeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleFinalize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleFinalize(ctx: context.Context, _arg10: FinalizeInput, next: FinalizeHandler): [FinalizeOutput, Metadata] - } - /** - * InitializeMiddleware provides the interface for middleware specific to the - * initialize step. Delegates to the next InitializeHandler for further - * processing. - */ - interface InitializeMiddleware { - [key:string]: any; - /** - * ID returns a unique ID for the middleware in the InitializeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleInitialize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleInitialize(ctx: context.Context, _arg10: InitializeInput, next: InitializeHandler): [InitializeOutput, Metadata] - } - /** - * SerializeMiddleware provides the interface for middleware specific to the - * serialize step. Delegates to the next SerializeHandler for further - * processing. - */ - interface SerializeMiddleware { - [key:string]: any; - /** - * ID returns a unique ID for the middleware in the SerializeStep. The step does not - * allow duplicate IDs. - */ - id(): string - /** - * HandleSerialize invokes the middleware behavior which must delegate to the next handler - * for the middleware chain to continue. The method must return a result or - * error to its caller. - */ - handleSerialize(ctx: context.Context, _arg10: SerializeInput, next: SerializeHandler): [SerializeOutput, Metadata] - } -} - -/** - * Package auth defines protocol-agnostic authentication types for smithy - * clients. - */ -namespace auth { - /** - * Identity contains information that identifies who the user making the - * request is. - */ - interface Identity { - [key:string]: any; - expiration(): time.Time - } - /** - * IdentityResolverOptions defines the interface through which an entity can be - * queried to retrieve an IdentityResolver for a given auth scheme. - */ - interface IdentityResolverOptions { - [key:string]: any; - getIdentityResolver(schemeID: string): IdentityResolver - } - /** - * Option represents a possible authentication method for an operation. - */ - interface Option { - schemeID: string - identityProperties: smithy.Properties - signerProperties: smithy.Properties - } -} - -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { - /** - * MeterOption applies configuration to a Meter. - */ - interface MeterOption {(o: MeterOptions): void } - /** - * Meter is the entry point for creation of measurement instruments. - */ - interface Meter { - [key:string]: any; - /** - * integer/synchronous - */ - int64Counter(name: string, ...opts: InstrumentOption[]): Int64Counter - int64UpDownCounter(name: string, ...opts: InstrumentOption[]): Int64UpDownCounter - int64Gauge(name: string, ...opts: InstrumentOption[]): Int64Gauge - int64Histogram(name: string, ...opts: InstrumentOption[]): Int64Histogram - /** - * integer/asynchronous - */ - int64AsyncCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument - int64AsyncUpDownCounter(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument - int64AsyncGauge(name: string, callback: Int64Callback, ...opts: InstrumentOption[]): AsyncInstrument - /** - * floating-point/synchronous - */ - float64Counter(name: string, ...opts: InstrumentOption[]): Float64Counter - float64UpDownCounter(name: string, ...opts: InstrumentOption[]): Float64UpDownCounter - float64Gauge(name: string, ...opts: InstrumentOption[]): Float64Gauge - float64Histogram(name: string, ...opts: InstrumentOption[]): Float64Histogram - /** - * floating-point/asynchronous - */ - float64AsyncCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument - float64AsyncUpDownCounter(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument - float64AsyncGauge(name: string, callback: Float64Callback, ...opts: InstrumentOption[]): AsyncInstrument - } -} - -/** - * Package tracing defines tracing APIs to be used by Smithy clients. - */ -namespace tracing { - /** - * TracerOption applies configuration to a tracer. - */ - interface TracerOption {(o: TracerOptions): void } - /** - * Tracer is the entry point for creating observed client Spans. - * - * Spans created by tracers propagate by existing on the Context. Consumers of - * the API can use [GetSpan] to pull the active Span from a Context. - * - * Creation of child Spans is implicit through Context persistence. If - * CreateSpan is called with a Context that holds a Span, the result will be a - * child of that Span. - */ - interface Tracer { - [key:string]: any; - startSpan(ctx: context.Context, name: string, ...opts: SpanOption[]): [context.Context, Span] - } -} - -/** - * Package http provides the HTTP transport client and request/response types - * needed to round trip API operation calls with an service. - */ -namespace http { - // @ts-ignore - import smithy = smithy_go - /** - * Signer defines the interface through which HTTP requests are supplemented - * with an Identity. - */ - interface Signer { - [key:string]: any; - signRequest(_arg0: context.Context, _arg1: Request, _arg2: auth.Identity, _arg3: smithy.Properties): void - } - // @ts-ignore - import iointernal = io - // @ts-ignore - import smithytime = time -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client - * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. - * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - // @ts-ignore - import sdkrand = rand - /** - * EndpointSource is the endpoint source type. - * - * Deprecated: The global [Endpoint] structure is deprecated. - */ - interface EndpointSource extends Number{} -} - -/** - * Package v4 implements the AWS signature version 4 algorithm (commonly known - * as SigV4). - * - * For more information about SigV4, see [Signing AWS API requests] in the IAM - * user guide. - * - * While this implementation CAN work in an external context, it is developed - * primarily for SDK use and you may encounter fringe behaviors around header - * canonicalization. - * - * # Pre-escaping a request URI - * - * AWS v4 signature validation requires that the canonical string's URI path - * component must be the escaped form of the HTTP request's path. - * - * The Go HTTP client will perform escaping automatically on the HTTP request. - * This may cause signature validation errors because the request differs from - * the URI path or query from which the signature was generated. - * - * Because of this, we recommend that you explicitly escape the request when - * using this signer outside of the SDK to prevent possible signature mismatch. - * This can be done by setting URL.Opaque on the request. The signer will - * prefer that value, falling back to the return of URL.EscapedPath if unset. - * - * When setting URL.Opaque you must do so in the form of: - * - * ``` - * "///" - * - * // e.g. - * "//example.com/some/path" - * ``` - * - * The leading "//" and hostname are required or the escaping will not work - * correctly. - * - * The TestStandaloneSign unit test provides a complete example of using the - * signer outside of the SDK and pre-escaping the URI path. - * - * [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html - */ -namespace signer { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import v4Internal = internal - // @ts-ignore - import internalauth = auth - // @ts-ignore - import smithyhttp = http - // @ts-ignore - import smithyHTTP = http - /** - * SignerOptions is the SigV4 Signer options. - */ - interface SignerOptions { - /** - * Disables the Signer's moving HTTP header key/value pairs from the HTTP - * request header to the request's query string. This is most commonly used - * with pre-signed requests preventing headers from being added to the - * request's query string. - */ - disableHeaderHoisting: boolean - /** - * Disables the automatic escaping of the URI path of the request for the - * siganture's canonical string's path. For services that do not need additional - * escaping then use this to disable the signer escaping the path. - * - * S3 is an example of a service that does not need additional escaping. - * - * http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html - */ - disableURIPathEscaping: boolean - /** - * The logger to send log messages to. - */ - logger: logging.Logger - /** - * Enable logging of signed requests. - * This will enable logging of the canonical request, the string to sign, and for presigning the subsequent - * presigned URL. - */ - logSigning: boolean - /** - * Disables setting the session token on the request as part of signing - * through X-Amz-Security-Token. This is needed for variations of v4 that - * present the token elsewhere. - */ - disableSessionToken: boolean - } -} - -namespace subscriptions { -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) * ``` * * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously @@ -41569,3173 +17538,2787 @@ namespace subscriptions { * A LevelVar holds a Level and is safe to read or write from multiple * goroutines. * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: - * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: - * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` - * - * Now the program can change its logging level with a single statement: - * - * ``` - * programLevel.Set(slog.LevelDebug) - * ``` - * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. - * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: - * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` - * - * TextHandler would display this group as - * - * ``` - * request.method=GET request.url=http://example.com - * ``` - * - * JSONHandler would display it as - * - * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. - * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: - * - * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. - * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, - * - * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement - * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` - * - * behaves the same as - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` - * - * is the most efficient way to achieve the same output as - * - * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call + * a global LevelVar: * * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * var programLevel = new(slog.LevelVar) // Info by default * ``` * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: + * Then use the LevelVar to construct a handler, and make it the default: * * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) * ``` * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: + * Now the program can change its logging level with a single statement: * * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * programLevel.Set(slog.LevelDebug) * ``` * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: + * # Groups * - * ``` - * type expensive struct { arg int } + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) * ``` * - * Then use a value of that type in log calls: + * TextHandler would display this group as * * ``` - * slog.Debug("frobbing", "value", expensive{arg}) + * request.method=GET request.url=http://example.com * ``` * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. + * JSONHandler would display it as * - * # Writing a handler + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - // @ts-ignore - import loginternal = internal - /** - * A Record holds information about a log event. - * Copies of a Record share state. - * Do not modify a Record after handing out a copy to it. - * Call [NewRecord] to create a new Record. - * Use [Record.Clone] to create a copy with no shared state. - */ - interface Record { - /** - * The time at which the output method (Log, Info, etc.) was called. - */ - time: time.Time - /** - * The log message. - */ - message: string - /** - * The level of the event. - */ - level: Level - /** - * The program counter at the time the record was constructed, as determined - * by runtime.Callers. If zero, no program counter is available. - * - * The only valid use for this value is as an argument to - * [runtime.CallersFrames]. In particular, it must not be passed to - * [runtime.FuncForPC]. - */ - pc: number - } - interface Record { - /** - * Clone returns a copy of the record with no shared state. - * The original record and the clone can both be modified - * without interfering with each other. - */ - clone(): Record - } - interface Record { - /** - * NumAttrs returns the number of attributes in the [Record]. - */ - numAttrs(): number - } - interface Record { - /** - * Attrs calls f on each Attr in the [Record]. - * Iteration stops if f returns false. - */ - attrs(f: (_arg0: Attr) => boolean): void - } - interface Record { - /** - * AddAttrs appends the given Attrs to the [Record]'s list of Attrs. - * It omits empty groups. - */ - addAttrs(...attrs: Attr[]): void - } - interface Record { - /** - * Add converts the args to Attrs as described in [Logger.Log], - * then appends the Attrs to the [Record]'s list of Attrs. - * It omits empty groups. - */ - add(...args: any[]): void - } - /** - * A Value can represent any Go value, but unlike type any, - * it can represent most small values without an allocation. - * The zero Value corresponds to nil. - */ - interface Value { - } - interface Value { - /** - * Kind returns v's Kind. - */ - kind(): Kind - } - interface Value { - /** - * Any returns v's value as an any. - */ - any(): any - } - interface Value { - /** - * String returns Value's value as a string, formatted like [fmt.Sprint]. Unlike - * the methods Int64, Float64, and so on, which panic if v is of the - * wrong kind, String never panics. - */ - string(): string - } - interface Value { - /** - * Int64 returns v's value as an int64. It panics - * if v is not a signed integer. - */ - int64(): number - } - interface Value { - /** - * Uint64 returns v's value as a uint64. It panics - * if v is not an unsigned integer. - */ - uint64(): number - } - interface Value { - /** - * Bool returns v's value as a bool. It panics - * if v is not a bool. - */ - bool(): boolean - } - interface Value { - /** - * Duration returns v's value as a [time.Duration]. It panics - * if v is not a time.Duration. - */ - duration(): time.Duration - } - interface Value { - /** - * Float64 returns v's value as a float64. It panics - * if v is not a float64. - */ - float64(): number - } - interface Value { - /** - * Time returns v's value as a [time.Time]. It panics - * if v is not a time.Time. - */ - time(): time.Time - } - interface Value { - /** - * LogValuer returns v's value as a LogValuer. It panics - * if v is not a LogValuer. - */ - logValuer(): LogValuer - } - interface Value { - /** - * Group returns v's value as a []Attr. - * It panics if v's [Kind] is not [KindGroup]. - */ - group(): Array - } - interface Value { - /** - * Equal reports whether v and w represent the same Go value. - */ - equal(w: Value): boolean - } - interface Value { - /** - * Resolve repeatedly calls LogValue on v while it implements [LogValuer], - * and returns the result. - * If v resolves to a group, the group's attributes' values are not recursively - * resolved. - * If the number of LogValue calls exceeds a threshold, a Value containing an - * error is returned. - * Resolve's return value is guaranteed not to be of Kind [KindLogValuer]. - */ - resolve(): Value - } -} - -namespace endpoints { - // @ts-ignore - import endpoints = endpoints - /** - * Options is the endpoint resolver configuration options - */ - interface Options { - /** - * Logger is a logging implementation that log events should be sent to. - */ - logger: logging.Logger - /** - * LogDeprecated indicates that deprecated endpoints should be logged to the - * provided logger. - */ - logDeprecated: boolean - /** - * ResolvedRegion is used to override the region to be resolved, rather then the - * using the value passed to the ResolveEndpoint method. This value is used by the - * SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - * name. You must not set this value directly in your application. - */ - resolvedRegion: string - /** - * DisableHTTPS informs the resolver to return an endpoint that does not use the - * HTTPS scheme. - */ - disableHTTPS: boolean - /** - * UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - */ - useDualStackEndpoint: aws.DualStackEndpointState - /** - * UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - */ - useFIPSEndpoint: aws.FIPSEndpointState - } - interface Options { - getResolvedRegion(): string - } - interface Options { - getDisableHTTPS(): boolean - } - interface Options { - getUseDualStackEndpoint(): aws.DualStackEndpointState - } - interface Options { - getUseFIPSEndpoint(): aws.FIPSEndpointState - } -} - -/** - * Package document provides interface definitions and error types for document types. + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. * - * A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send - * UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 - * strings to these values. + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: * - * API Clients expose document constructors in their respective client document packages which must be used to - * Marshal and Unmarshal Go types to and from their respective protocol representations. + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` * - * See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from - * document types. - */ -namespace document { - /** - * NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled - * into a protocol document. - */ - interface NoSerde { - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { -} - -/** - * Package customizations provides customizations for the Amazon S3 API client. + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. * - * This package provides support for following S3 customizations + * # Contexts * - * ``` - * ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. * - * UpdateEndpoint Middleware: resolves a custom endpoint as per s3 config options + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. * - * RemoveBucket Middleware: removes a serialized bucket name from request url path + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, * - * processResponseWith200Error Middleware: Deserializing response error with 200 status code * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values * - * # Virtual Host style url addressing + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement * - * Since serializers serialize by default as path style url, we use customization - * to modify the endpoint url when `UsePathStyle` option on S3Client is unset or - * false. This flag will be ignored if `UseAccelerate` option is set to true. + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` * - * If UseAccelerate is not enabled, and the bucket name is not a valid hostname - * label, they SDK will fallback to forcing the request to be made as if - * UsePathStyle was enabled. This behavior is also used if UseDualStackEndpoint is enabled. + * behaves the same as * - * https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html#dual-stack-endpoints-description + * ``` + * slog.Info("hello", "count", 3) + * ``` * - * # Transfer acceleration + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. * - * By default S3 Transfer acceleration support is disabled. By enabling `UseAccelerate` - * option on S3Client, one can enable s3 transfer acceleration support. Transfer - * acceleration only works with Virtual Host style addressing, and thus `UsePathStyle` - * option if set is ignored. Transfer acceleration is not supported for S3 operations - * DeleteBucket, ListBuckets, and CreateBucket. + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. * - * # Dualstack support + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. * - * By default dualstack support for s3 client is disabled. By enabling `UseDualstack` - * option on s3 client, you can enable dualstack endpoint support. + * The call * - * # Endpoint customizations + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` * - * Customizations to lookup ARN, process ARN needs to happen before request serialization. - * UpdateEndpoint middleware which mutates resources based on Options such as - * UseDualstack, UseAccelerate for modifying resolved endpoint are executed after - * request serialization. Remove bucket middleware is executed after - * an request is serialized, and removes the serialized bucket name from request path + * is the most efficient way to achieve the same output as * * ``` - * Middleware layering: + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods * - * Initialize : HTTP Request -> ARN Lookup -> Input-Validation -> Serialize step + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: * - * Serialize : HTTP Request -> Process ARN -> operation serializer -> Update-Endpoint customization -> Remove-Bucket -> next middleware + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } * ``` * - * Customization options: + * and you call it like this in main.go: * * ``` - * UseARNRegion (Disabled by Default) + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call * - * UsePathStyle (Disabled by Default) + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` * - * UseAccelerate (Disabled by Default) + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: * - * UseDualstack (Disabled by Default) * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. * - * # Handle Error response with 200 status code + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: * - * S3 operations: CopyObject, CompleteMultipartUpload, UploadPartCopy can have an - * error Response with status code 2xx. The processResponseWith200Error middleware - * customizations enables SDK to check for an error within response body prior to - * deserialization. + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` * - * As the check for 2xx response containing an error needs to be performed earlier - * than response deserialization. Since the behavior of Deserialization is in - * reverse order to the other stack steps its easier to consider that "after" means - * "before". + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: * * ``` - * Middleware layering: + * type expensive struct { arg int } * - * HTTP Response -> handle 200 error customization -> deserialize + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } * ``` - */ -namespace customizations { - // @ts-ignore - import internalauthsmithy = smithy - /** - * S3ExpressCredentialsProvider retrieves credentials for the S3Express storage - * class. - */ - interface S3ExpressCredentialsProvider { - [key:string]: any; - retrieve(ctx: context.Context, bucket: string): aws.Credentials - } - // @ts-ignore - import ictx = context - // @ts-ignore - import v4 = signer - // @ts-ignore - import smithyhttp = http - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import s3arn = arn - // @ts-ignore - import internalendpoints = endpoints -} - -/** - * Package mail implements parsing of mail messages. * - * For the most part, this package follows the syntax as specified by RFC 5322 and - * extended by RFC 6532. - * Notable divergences: + * Then use a value of that type in log calls: + * * ``` - * - Obsolete address formats are not parsed, including addresses with - * embedded route information. - * - The full range of spacing (the CFWS syntax element) is not supported, - * such as breaking addresses across lines. - * - No unicode normalization is performed. - * - A leading From line is permitted, as in mbox format (RFC 4155). + * slog.Debug("frobbing", "value", expensive{arg}) * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. */ -namespace mail { +namespace slog { + // @ts-ignore + import loginternal = internal /** - * Address represents a single mail address. - * An address such as "Barry Gibbs " is represented - * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. + * A Logger records structured information about each call to its + * Log, Debug, Info, Warn, and Error methods. + * For each call, it creates a [Record] and passes it to a [Handler]. + * + * To create a new Logger, call [New] or a Logger method + * that begins "With". */ - interface Address { - name: string // Proper name; may be empty. - address: string // user@domain + interface Logger { + } + interface Logger { + /** + * Handler returns l's Handler. + */ + handler(): Handler + } + interface Logger { + /** + * With returns a Logger that includes the given attributes + * in each output operation. Arguments are converted to + * attributes as if by [Logger.Log]. + */ + with(...args: any[]): (Logger) + } + interface Logger { + /** + * WithGroup returns a Logger that starts a group, if name is non-empty. + * The keys of all attributes added to the Logger will be qualified by the given + * name. (How that qualification happens depends on the [Handler.WithGroup] + * method of the Logger's Handler.) + * + * If name is empty, WithGroup returns the receiver. + */ + withGroup(name: string): (Logger) + } + interface Logger { + /** + * Enabled reports whether l emits log records at the given context and level. + */ + enabled(ctx: context.Context, level: Level): boolean + } + interface Logger { + /** + * Log emits a log record with the current time and the given level and message. + * The Record's Attrs consist of the Logger's attributes followed by + * the Attrs specified by args. + * + * The attribute arguments are processed as follows: + * ``` + * - If an argument is an Attr, it is used as is. + * - If an argument is a string and this is not the last argument, + * the following argument is treated as the value and the two are combined + * into an Attr. + * - Otherwise, the argument is treated as a value with key "!BADKEY". + * ``` + */ + log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void } - interface Address { + interface Logger { /** - * String formats the address as a valid RFC 5322 address. - * If the address's name contains non-ASCII characters - * the name will be rendered according to RFC 2047. + * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. */ - string(): string + logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void } -} - -namespace search { -} - -namespace endpoints { - /** - * Endpoint is the endpoint object returned by Endpoint resolution V2 - */ - interface Endpoint { + interface Logger { + /** + * Debug logs at [LevelDebug]. + */ + debug(msg: string, ...args: any[]): void + } + interface Logger { /** - * The complete URL minimally specfiying the scheme and host. - * May optionally specify the port and base path component. + * DebugContext logs at [LevelDebug] with the given context. */ - uri: url.URL + debugContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { /** - * An optional set of headers to be sent using transport layer headers. + * Info logs at [LevelInfo]. */ - headers: http.Header + info(msg: string, ...args: any[]): void + } + interface Logger { /** - * A grab-bag property map of endpoint attributes. The - * values present here are subject to change, or being add/removed at any - * time. + * InfoContext logs at [LevelInfo] with the given context. */ - properties: smithy.Properties + infoContext(ctx: context.Context, msg: string, ...args: any[]): void } -} - -namespace types { - interface CompressionType extends String{} - interface CompressionType { + interface Logger { /** - * Values returns all known values for CompressionType. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * Warn logs at [LevelWarn]. */ - values(): Array + warn(msg: string, ...args: any[]): void } - interface Event extends String{} - interface Event { + interface Logger { /** - * Values returns all known values for Event. Note that this can be expanded in - * the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * WarnContext logs at [LevelWarn] with the given context. */ - values(): Array + warnContext(ctx: context.Context, msg: string, ...args: any[]): void } - interface ExpirationStatus extends String{} - interface ExpirationStatus { + interface Logger { /** - * Values returns all known values for ExpirationStatus. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * Error logs at [LevelError]. */ - values(): Array + error(msg: string, ...args: any[]): void } - interface IntelligentTieringStatus extends String{} - interface IntelligentTieringStatus { + interface Logger { /** - * Values returns all known values for IntelligentTieringStatus. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * ErrorContext logs at [LevelError] with the given context. + */ + errorContext(ctx: context.Context, msg: string, ...args: any[]): void + } +} + +namespace subscriptions { + /** + * Broker defines a struct for managing subscriptions clients. + */ + interface Broker { + } + interface Broker { + /** + * Clients returns a shallow copy of all registered clients indexed + * with their connection id. */ - values(): Array + clients(): _TygojaDict } - interface InventoryIncludedObjectVersions extends String{} - interface InventoryIncludedObjectVersions { + interface Broker { /** - * Values returns all known values for InventoryIncludedObjectVersions. Note that - * this can be expanded in the future, and so it is only as up to date as the - * client. + * ClientById finds a registered client by its id. * - * The ordering of this slice is not guaranteed to be stable across updates. + * Returns non-nil error when client with clientId is not registered. + */ + clientById(clientId: string): Client + } + interface Broker { + /** + * Register adds a new client to the broker instance. */ - values(): Array + register(client: Client): void } - interface InventoryOptionalField extends String{} - interface InventoryOptionalField { + interface Broker { /** - * Values returns all known values for InventoryOptionalField. Note that this can - * be expanded in the future, and so it is only as up to date as the client. + * Unregister removes a single client by its id. * - * The ordering of this slice is not guaranteed to be stable across updates. + * If client with clientId doesn't exist, this method does nothing. */ - values(): Array + unregister(clientId: string): void + } +} + +/** + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. + */ +namespace core { + interface BootstrapEvent { + app: App + } + interface TerminateEvent { + app: App + isRestart: boolean + } + interface ServeEvent { + app: App + router?: echo.Echo + server?: http.Server + certManager?: any + } + interface ApiErrorEvent { + httpContext: echo.Context + error: Error + } + type _subKMccQ = BaseModelEvent + interface ModelEvent extends _subKMccQ { + dao?: daos.Dao + } + type _subbaMsx = BaseCollectionEvent + interface MailerRecordEvent extends _subbaMsx { + mailClient: mailer.Mailer + message?: mailer.Message + record?: models.Record + meta: _TygojaDict + } + interface MailerAdminEvent { + mailClient: mailer.Mailer + message?: mailer.Message + admin?: models.Admin + meta: _TygojaDict + } + interface RealtimeConnectEvent { + httpContext: echo.Context + client: subscriptions.Client + idleTimeout: time.Duration + } + interface RealtimeDisconnectEvent { + httpContext: echo.Context + client: subscriptions.Client + } + interface RealtimeMessageEvent { + httpContext: echo.Context + client: subscriptions.Client + message?: subscriptions.Message + } + interface RealtimeSubscribeEvent { + httpContext: echo.Context + client: subscriptions.Client + subscriptions: Array + } + interface SettingsListEvent { + httpContext: echo.Context + redactedSettings?: settings.Settings + } + interface SettingsUpdateEvent { + httpContext: echo.Context + oldSettings?: settings.Settings + newSettings?: settings.Settings + } + type _subwUSsg = BaseCollectionEvent + interface RecordsListEvent extends _subwUSsg { + httpContext: echo.Context + records: Array<(models.Record | undefined)> + result?: search.Result + } + type _subSuCxZ = BaseCollectionEvent + interface RecordViewEvent extends _subSuCxZ { + httpContext: echo.Context + record?: models.Record + } + type _subOIUfd = BaseCollectionEvent + interface RecordCreateEvent extends _subOIUfd { + httpContext: echo.Context + record?: models.Record + uploadedFiles: _TygojaDict + } + type _subndfPe = BaseCollectionEvent + interface RecordUpdateEvent extends _subndfPe { + httpContext: echo.Context + record?: models.Record + uploadedFiles: _TygojaDict + } + type _subhhPha = BaseCollectionEvent + interface RecordDeleteEvent extends _subhhPha { + httpContext: echo.Context + record?: models.Record + } + type _subjKIme = BaseCollectionEvent + interface RecordAuthEvent extends _subjKIme { + httpContext: echo.Context + record?: models.Record + token: string + meta: any + } + type _subMzagN = BaseCollectionEvent + interface RecordAuthWithPasswordEvent extends _subMzagN { + httpContext: echo.Context + record?: models.Record + identity: string + password: string + } + type _subnprfs = BaseCollectionEvent + interface RecordAuthWithOAuth2Event extends _subnprfs { + httpContext: echo.Context + providerName: string + providerClient: auth.Provider + record?: models.Record + oAuth2User?: auth.AuthUser + isNewRecord: boolean + } + type _subBxwEM = BaseCollectionEvent + interface RecordAuthRefreshEvent extends _subBxwEM { + httpContext: echo.Context + record?: models.Record + } + type _subxYtTe = BaseCollectionEvent + interface RecordRequestPasswordResetEvent extends _subxYtTe { + httpContext: echo.Context + record?: models.Record + } + type _subRKUzR = BaseCollectionEvent + interface RecordConfirmPasswordResetEvent extends _subRKUzR { + httpContext: echo.Context + record?: models.Record + } + type _subCsAJx = BaseCollectionEvent + interface RecordRequestVerificationEvent extends _subCsAJx { + httpContext: echo.Context + record?: models.Record + } + type _subWXfwy = BaseCollectionEvent + interface RecordConfirmVerificationEvent extends _subWXfwy { + httpContext: echo.Context + record?: models.Record + } + type _subDwvoH = BaseCollectionEvent + interface RecordRequestEmailChangeEvent extends _subDwvoH { + httpContext: echo.Context + record?: models.Record + } + type _subwlCeW = BaseCollectionEvent + interface RecordConfirmEmailChangeEvent extends _subwlCeW { + httpContext: echo.Context + record?: models.Record + } + type _sublLDXl = BaseCollectionEvent + interface RecordListExternalAuthsEvent extends _sublLDXl { + httpContext: echo.Context + record?: models.Record + externalAuths: Array<(models.ExternalAuth | undefined)> + } + type _subrvhdJ = BaseCollectionEvent + interface RecordUnlinkExternalAuthEvent extends _subrvhdJ { + httpContext: echo.Context + record?: models.Record + externalAuth?: models.ExternalAuth + } + interface AdminsListEvent { + httpContext: echo.Context + admins: Array<(models.Admin | undefined)> + result?: search.Result + } + interface AdminViewEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminCreateEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminUpdateEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminDeleteEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminAuthEvent { + httpContext: echo.Context + admin?: models.Admin + token: string + } + interface AdminAuthWithPasswordEvent { + httpContext: echo.Context + admin?: models.Admin + identity: string + password: string + } + interface AdminAuthRefreshEvent { + httpContext: echo.Context + admin?: models.Admin + } + interface AdminRequestPasswordResetEvent { + httpContext: echo.Context + admin?: models.Admin } - interface MFADelete extends String{} - interface MFADelete { - /** - * Values returns all known values for MFADelete. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + interface AdminConfirmPasswordResetEvent { + httpContext: echo.Context + admin?: models.Admin } - interface ObjectLockEnabled extends String{} - interface ObjectLockEnabled { - /** - * Values returns all known values for ObjectLockEnabled. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + interface CollectionsListEvent { + httpContext: echo.Context + collections: Array<(models.Collection | undefined)> + result?: search.Result } - interface ObjectLockRetentionMode extends String{} - interface ObjectLockRetentionMode { - /** - * Values returns all known values for ObjectLockRetentionMode. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + type _subgkTpy = BaseCollectionEvent + interface CollectionViewEvent extends _subgkTpy { + httpContext: echo.Context } - interface ObjectStorageClass extends String{} - interface ObjectStorageClass { - /** - * Values returns all known values for ObjectStorageClass. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + type _subthylS = BaseCollectionEvent + interface CollectionCreateEvent extends _subthylS { + httpContext: echo.Context } - interface ObjectVersionStorageClass extends String{} - interface ObjectVersionStorageClass { - /** - * Values returns all known values for ObjectVersionStorageClass. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + type _subdwBvz = BaseCollectionEvent + interface CollectionUpdateEvent extends _subdwBvz { + httpContext: echo.Context } - interface Permission extends String{} - interface Permission { - /** - * Values returns all known values for Permission. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + type _subEsmEe = BaseCollectionEvent + interface CollectionDeleteEvent extends _subEsmEe { + httpContext: echo.Context } - interface Protocol extends String{} - interface Protocol { - /** - * Values returns all known values for Protocol. Note that this can be expanded in - * the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + interface CollectionsImportEvent { + httpContext: echo.Context + collections: Array<(models.Collection | undefined)> } - interface RestoreRequestType extends String{} - interface RestoreRequestType { - /** - * Values returns all known values for RestoreRequestType. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + type _subCrHsh = BaseModelEvent + interface FileTokenEvent extends _subCrHsh { + httpContext: echo.Context + token: string } - interface Tier extends String{} - interface Tier { - /** - * Values returns all known values for Tier. Note that this can be expanded in the - * future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + type _subilHAM = BaseCollectionEvent + interface FileDownloadEvent extends _subilHAM { + httpContext: echo.Context + record?: models.Record + fileField?: schema.SchemaField + servedPath: string + servedName: string } +} + +namespace migrate { + interface Migration { + file: string + up: (db: dbx.Builder) => void + down: (db: dbx.Builder) => void + } +} + +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithydocument = document + import flag = pflag /** - * Specifies the days since the initiation of an incomplete multipart upload that - * Amazon S3 will wait before permanently removing all parts of the upload. For - * more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. - * - * [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config + * FParseErrWhitelist configures Flag parse errors to be ignored */ - type _subTGUuf = noSmithyDocumentSerde - interface AbortIncompleteMultipartUpload extends _subTGUuf { - /** - * Specifies the number of days after which Amazon S3 aborts an incomplete - * multipart upload. - */ - daysAfterInitiation?: number - } + interface FParseErrWhitelist extends _TygojaAny{} /** - * The filter used to describe a set of objects for analyses. A filter must have - * exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no - * filter is provided, all objects will be considered in any analysis. - * - * The following types satisfy this interface: - * - * ``` - * AnalyticsFilterMemberAnd - * AnalyticsFilterMemberPrefix - * AnalyticsFilterMemberTag - * ``` + * Group Structure to manage groups for commands */ - interface AnalyticsFilter { - [key:string]: any; + interface Group { + id: string + title: string } /** - * Specifies the information about the bucket that will be created. For more - * information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. - * - * This functionality is only supported by directory buckets. - * - * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. */ - type _subwsyMZ = noSmithyDocumentSerde - interface BucketInfo extends _subwsyMZ { - /** - * The number of Availability Zone that's used for redundancy for the bucket. - */ - dataRedundancy: DataRedundancy - /** - * The type of bucket. - */ - type: BucketType - } + interface ShellCompDirective extends Number{} /** - * Details of the parts that were uploaded. + * CompletionOptions are the options to control shell completion */ - type _subgUiBN = noSmithyDocumentSerde - interface CompletedPart extends _subgUiBN { - /** - * The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string + interface CompletionOptions { /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command */ - checksumSHA1?: string + disableDefaultCmd: boolean /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions */ - checksumSHA256?: string + disableNoDescFlag: boolean /** - * Entity tag returned when the part was uploaded. + * DisableDescriptions turns off all completion descriptions for shells + * that support them */ - eTag?: string + disableDescriptions: boolean /** - * Part number that identifies the part. This is a positive integer between 1 and - * 10,000. - * - * ``` - * - General purpose buckets - In CompleteMultipartUpload , when a additional - * checksum (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , - * x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is applied to each part, the - * PartNumber must start at 1 and the part numbers must be consecutive. - * Otherwise, Amazon S3 generates an HTTP 400 Bad Request status code and an - * InvalidPartOrder error code. - * - * - Directory buckets - In CompleteMultipartUpload , the PartNumber must start - * at 1 and the part numbers must be consecutive. - * ``` + * HiddenDefaultCmd makes the default 'completion' command hidden */ - partNumber?: number + hiddenDefaultCmd: boolean } +} + +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { /** - * A container for describing a condition that must be met for the specified - * redirect to apply. For example, 1. If request is for pages in the /docs folder, - * redirect to the /documents folder. 2. If request results in HTTP error 4xx, - * redirect request to another host where you might process the error. + * The Userinfo type is an immutable encapsulation of username and + * password details for a [URL]. An existing Userinfo value is guaranteed + * to have a username set (potentially empty, as allowed by RFC 2396), + * and optionally a password. */ - type _subdiwoz = noSmithyDocumentSerde - interface Condition extends _subdiwoz { - /** - * The HTTP error code when the redirect is applied. In the event of an error, if - * the error code equals this value, then the specified redirect is applied. - * Required when parent element Condition is specified and sibling KeyPrefixEquals - * is not specified. If both are specified, then both must be true for the redirect - * to be applied. - */ - httpErrorCodeReturnedEquals?: string - /** - * The object key name prefix when the redirect is applied. For example, to - * redirect requests for ExamplePage.html , the key prefix will be ExamplePage.html - * . To redirect request for all pages with the prefix docs/ , the key prefix will - * be /docs , which identifies all objects in the docs/ folder. Required when the - * parent element Condition is specified and sibling HttpErrorCodeReturnedEquals - * is not specified. If both conditions are specified, both must be true for the - * redirect to be applied. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - */ - keyPrefixEquals?: string + interface Userinfo { } - /** - * Describes how an uncompressed comma-separated values (CSV)-formatted input - * object is formatted. - */ - type _subArRzr = noSmithyDocumentSerde - interface CSVInput extends _subArRzr { - /** - * Specifies that CSV field values may contain quoted record delimiters and such - * records should be allowed. Default value is FALSE. Setting this value to TRUE - * may lower performance. - */ - allowQuotedRecordDelimiter?: boolean - /** - * A single character used to indicate that a row should be ignored when the - * character is present at the start of that row. You can specify any character to - * indicate a comment line. The default character is # . - * - * Default: # - */ - comments?: string - /** - * A single character used to separate individual fields in a record. You can - * specify an arbitrary delimiter. - */ - fieldDelimiter?: string - /** - * Describes the first line of input. Valid values are: - * - * ``` - * - NONE : First line is not a header. - * - * - IGNORE : First line is a header, but you can't use the header values to - * indicate the column in an expression. You can use column position (such as _1, - * _2, …) to indicate the column ( SELECT s._1 FROM OBJECT s ). - * - * - Use : First line is a header, and you can use the header value to identify a - * column in an expression ( SELECT "name" FROM OBJECT ). - * ``` - */ - fileHeaderInfo: FileHeaderInfo + interface Userinfo { /** - * A single character used for escaping when the field delimiter is part of the - * value. For example, if the value is a, b , Amazon S3 wraps this field value in - * quotation marks, as follows: " a , b " . - * - * Type: String - * - * Default: " - * - * Ancestors: CSV + * Username returns the username. */ - quoteCharacter?: string + username(): string + } + interface Userinfo { /** - * A single character used for escaping the quotation mark character inside an - * already escaped value. For example, the value """ a , b """ is parsed as " a , - * b " . + * Password returns the password in case it is set, and whether it is set. */ - quoteEscapeCharacter?: string + password(): [string, boolean] + } + interface Userinfo { /** - * A single character used to separate individual records in the input. Instead of - * the default value, you can specify an arbitrary delimiter. + * String returns the encoded userinfo information in the standard form + * of "username[:password]". */ - recordDelimiter?: string + string(): string } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { /** - * Describes how uncompressed comma-separated values (CSV)-formatted results are - * formatted. + * JsonRaw defines a json value type that is safe for db read/write. */ - type _subtiTxV = noSmithyDocumentSerde - interface CSVOutput extends _subtiTxV { + interface JsonRaw extends Array{} + interface JsonRaw { /** - * The value used to separate individual fields in a record. You can specify an - * arbitrary delimiter. + * String returns the current JsonRaw instance as a json encoded string. */ - fieldDelimiter?: string + string(): string + } + interface JsonRaw { /** - * A single character used for escaping when the field delimiter is part of the - * value. For example, if the value is a, b , Amazon S3 wraps this field value in - * quotation marks, as follows: " a , b " . + * MarshalJSON implements the [json.Marshaler] interface. */ - quoteCharacter?: string + marshalJSON(): string|Array + } + interface JsonRaw { /** - * The single character used for escaping the quote character inside an already - * escaped value. + * UnmarshalJSON implements the [json.Unmarshaler] interface. */ - quoteEscapeCharacter?: string + unmarshalJSON(b: string|Array): void + } + interface JsonRaw { /** - * Indicates whether to use quotation marks around output fields. - * - * ``` - * - ALWAYS : Always use quotation marks for output fields. - * - * - ASNEEDED : Use quotation marks for output fields when needed. - * ``` + * Value implements the [driver.Valuer] interface. */ - quoteFields: QuoteFields + value(): any + } + interface JsonRaw { /** - * A single character used to separate individual records in the output. Instead - * of the default value, you can specify an arbitrary delimiter. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonRaw instance. */ - recordDelimiter?: string + scan(value: any): void } +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { /** - * Container for S3 Glacier job parameters. + * Addr represents a network end point address. + * + * The two methods [Addr.Network] and [Addr.String] conventionally return strings + * that can be passed as the arguments to [Dial], but the exact form + * and meaning of the strings is up to the implementation. */ - type _sublYhOb = noSmithyDocumentSerde - interface GlacierJobParameters extends _sublYhOb { - /** - * Retrieval tier at which the restore will be processed. - * - * This member is required. - */ - tier: Tier + interface Addr { + [key:string]: any; + network(): string // name of the network (for example, "tcp", "udp") + string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") } +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { /** - * Container for the person being granted permissions. + * ReadWriter stores pointers to a [Reader] and a [Writer]. + * It implements [io.ReadWriter]. */ - type _subBVJYu = noSmithyDocumentSerde - interface Grantee extends _subBVJYu { - /** - * Type of grantee - * - * This member is required. - */ - type: Type - /** - * Screen name of the grantee. - */ - displayName?: string - /** - * Email address of the grantee. - * - * Using email addresses to specify a grantee is only supported in the following - * Amazon Web Services Regions: - * - * ``` - * - US East (N. Virginia) - * - * - US West (N. California) - * - * - US West (Oregon) - * - * - Asia Pacific (Singapore) - * - * - Asia Pacific (Sydney) - * - * - Asia Pacific (Tokyo) - * - * - Europe (Ireland) - * - * - South America (São Paulo) - * ``` - * - * For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints] in the - * Amazon Web Services General Reference. - * - * [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region - */ - emailAddress?: string - /** - * The canonical user ID of the grantee. - */ - id?: string - /** - * URI of the grantee group. - */ - uri?: string + type _subFtvZa = Reader&Writer + interface ReadWriter extends _subFtvZa { } +} + +/** + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. + */ +namespace multipart { /** - * The Filter is used to identify objects that the S3 Intelligent-Tiering - * configuration applies to. + * A Part represents a single part in a multipart body. */ - type _subRvWPi = noSmithyDocumentSerde - interface IntelligentTieringFilter extends _subRvWPi { - /** - * A conjunction (logical AND) of predicates, which is used in evaluating a - * metrics filter. The operator must have at least two predicates, and an object - * must match all of the predicates in order for the filter to apply. - */ - and?: IntelligentTieringAndOperator - /** - * An object key name prefix that identifies the subset of objects to which the - * rule applies. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - */ - prefix?: string + interface Part { /** - * A container of a key value name pair. + * The headers of the body, if any, with the keys canonicalized + * in the same fashion that the Go http.Request headers are. + * For example, "foo-bar" changes case to "Foo-Bar" */ - tag?: Tag + header: textproto.MIMEHeader } - /** - * Specifies the inventory configuration for an Amazon S3 bucket. - */ - type _subSNUXZ = noSmithyDocumentSerde - interface InventoryDestination extends _subSNUXZ { + interface Part { /** - * Contains the bucket name, file format, bucket owner (optional), and prefix - * (optional) where inventory results are published. - * - * This member is required. + * FormName returns the name parameter if p has a Content-Disposition + * of type "form-data". Otherwise it returns the empty string. */ - s3BucketDestination?: InventoryS3BucketDestination + formName(): string } - /** - * Specifies an inventory filter. The inventory only includes objects that meet - * the filter's criteria. - */ - type _subITVSf = noSmithyDocumentSerde - interface InventoryFilter extends _subITVSf { + interface Part { /** - * The prefix that an object must have to be included in the inventory results. - * - * This member is required. + * FileName returns the filename parameter of the [Part]'s Content-Disposition + * header. If not empty, the filename is passed through filepath.Base (which is + * platform dependent) before being returned. */ - prefix?: string + fileName(): string } - /** - * Specifies the schedule for generating inventory results. - */ - type _subjrnpt = noSmithyDocumentSerde - interface InventorySchedule extends _subjrnpt { + interface Part { /** - * Specifies how frequently inventory results are produced. - * - * This member is required. + * Read reads the body of a part, after its headers and before the + * next part (if any) begins. */ - frequency: InventoryFrequency + read(d: string|Array): number } - /** - * Specifies JSON as object's input serialization format. - */ - type _subSpwfD = noSmithyDocumentSerde - interface JSONInput extends _subSpwfD { - /** - * The type of JSON. Valid values: Document, Lines. - */ - type: JSONType + interface Part { + close(): void } +} + +namespace store { +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { /** - * Specifies JSON as request's output serialization format. + * An Attr is a key-value pair. */ - type _subkIKSy = noSmithyDocumentSerde - interface JSONOutput extends _subkIKSy { - /** - * The value used to separate individual records in the output. If no value is - * specified, Amazon S3 uses a newline character ('\n'). - */ - recordDelimiter?: string + interface Attr { + key: string + value: Value } - /** - * Container for the expiration for the lifecycle of the object. - * - * For more information see, [Managing your storage lifecycle] in the Amazon S3 User Guide. - * - * [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html - */ - type _subIwqVo = noSmithyDocumentSerde - interface LifecycleExpiration extends _subIwqVo { - /** - * Indicates at what date the object is to be moved or deleted. The date value - * must conform to the ISO 8601 format. The time is always midnight UTC. - */ - date?: time.Time - /** - * Indicates the lifetime, in days, of the objects that are subject to the rule. - * The value must be a non-zero positive integer. - */ - days?: number + interface Attr { /** - * Indicates whether Amazon S3 will remove a delete marker with no noncurrent - * versions. If set to true, the delete marker will be expired; if set to false the - * policy takes no action. This cannot be specified with Days or Date in a - * Lifecycle Expiration Policy. + * Equal reports whether a and b have equal keys and values. */ - expiredObjectDeleteMarker?: boolean - } - /** - * The Filter is used to identify objects that a Lifecycle Rule applies to. A - * Filter can have exactly one of Prefix , Tag , ObjectSizeGreaterThan , - * ObjectSizeLessThan , or And specified. If the Filter element is left empty, the - * Lifecycle Rule applies to all objects in the bucket. - * - * The following types satisfy this interface: - * - * ``` - * LifecycleRuleFilterMemberAnd - * LifecycleRuleFilterMemberObjectSizeGreaterThan - * LifecycleRuleFilterMemberObjectSizeLessThan - * LifecycleRuleFilterMemberPrefix - * LifecycleRuleFilterMemberTag - * ``` - */ - interface LifecycleRuleFilter { - [key:string]: any; + equal(b: Attr): boolean } - /** - * Specifies the location where the bucket will be created. - * - * For directory buckets, the location type is Availability Zone. For more - * information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. - * - * This functionality is only supported by directory buckets. - * - * [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html - */ - type _subpgwtx = noSmithyDocumentSerde - interface LocationInfo extends _subpgwtx { - /** - * The name of the location where the bucket will be created. - * - * For directory buckets, the name of the location is the AZ ID of the - * Availability Zone where the bucket will be created. An example AZ ID value is - * usw2-az1 . - */ - name?: string - /** - * The type of location where the bucket will be created. - */ - type: LocationType + interface Attr { + string(): string } /** - * Specifies a metrics configuration filter. The metrics configuration only - * includes objects that meet the filter's criteria. A filter must be a prefix, an - * object tag, an access point ARN, or a conjunction (MetricsAndOperator). For more - * information, see [PutBucketMetricsConfiguration]. + * A Handler handles log records produced by a Logger. * - * The following types satisfy this interface: + * A typical handler may print log records to standard error, + * or write them to a file or database, or perhaps augment them + * with additional attributes and pass them on to another handler. * - * ``` - * MetricsFilterMemberAccessPointArn - * MetricsFilterMemberAnd - * MetricsFilterMemberPrefix - * MetricsFilterMemberTag - * ``` + * Any of the Handler's methods may be called concurrently with itself + * or with other methods. It is the responsibility of the Handler to + * manage this concurrency. * - * [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html + * Users of the slog package should not invoke Handler methods directly. + * They should use the methods of [Logger] instead. */ - interface MetricsFilter { + interface Handler { [key:string]: any; - } - /** - * Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 - * permanently deletes the noncurrent object versions. You set this lifecycle - * configuration action on a bucket that has versioning enabled (or suspended) to - * request that Amazon S3 delete noncurrent object versions at a specific period in - * the object's lifetime. - */ - type _subOkXCM = noSmithyDocumentSerde - interface NoncurrentVersionExpiration extends _subOkXCM { - /** - * Specifies how many noncurrent versions Amazon S3 will retain. You can specify - * up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any - * additional noncurrent versions beyond the specified number to retain. For more - * information about noncurrent versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. - * - * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html - */ - newerNoncurrentVersions?: number - /** - * Specifies the number of days an object is noncurrent before Amazon S3 can - * perform the associated action. The value must be a non-zero positive integer. - * For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent]in the Amazon S3 - * User Guide. - * - * [How Amazon S3 Calculates When an Object Became Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations - */ - noncurrentDays?: number - } - /** - * Container for the transition rule that describes when noncurrent objects - * transition to the STANDARD_IA , ONEZONE_IA , INTELLIGENT_TIERING , GLACIER_IR , - * GLACIER , or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled - * (or versioning is suspended), you can set this action to request that Amazon S3 - * transition noncurrent object versions to the STANDARD_IA , ONEZONE_IA , - * INTELLIGENT_TIERING , GLACIER_IR , GLACIER , or DEEP_ARCHIVE storage class at a - * specific period in the object's lifetime. - */ - type _subxybkO = noSmithyDocumentSerde - interface NoncurrentVersionTransition extends _subxybkO { - /** - * Specifies how many noncurrent versions Amazon S3 will retain in the same - * storage class before transitioning objects. You can specify up to 100 noncurrent - * versions to retain. Amazon S3 will transition any additional noncurrent versions - * beyond the specified number to retain. For more information about noncurrent - * versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. - * - * [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html - */ - newerNoncurrentVersions?: number - /** - * Specifies the number of days an object is noncurrent before Amazon S3 can - * perform the associated action. For information about the noncurrent days - * calculations, see [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]in the Amazon S3 User Guide. - * - * [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations - */ - noncurrentDays?: number - /** - * The class of storage used to store the object. - */ - storageClass: TransitionStorageClass - } - /** - * Specifies object key name filtering rules. For information about key name - * filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. - * - * [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html - */ - type _subqUNze = noSmithyDocumentSerde - interface NotificationConfigurationFilter extends _subqUNze { - /** - * A container for object key name prefix and suffix filtering rules. - */ - key?: S3KeyFilter - } - /** - * Object Identifier is unique value to identify objects. - */ - type _subwqbXl = noSmithyDocumentSerde - interface ObjectIdentifier extends _subwqbXl { - /** - * Key name of the object. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - * - * This member is required. - */ - key?: string - /** - * Version ID for the specific version of the object to delete. - * - * This functionality is not supported for directory buckets. - */ - versionId?: string - } - /** - * The container element for an Object Lock rule. - */ - type _subsFmDf = noSmithyDocumentSerde - interface ObjectLockRule extends _subsFmDf { - /** - * The default Object Lock retention mode and period that you want to apply to new - * objects placed in the specified bucket. Bucket settings require both a mode and - * a period. The period can be either Days or Years but you must select one. You - * cannot specify Days and Years at the same time. - */ - defaultRetention?: DefaultRetention - } - /** - * A container for elements related to an individual part. - */ - type _subZzZHD = noSmithyDocumentSerde - interface ObjectPart extends _subZzZHD { - /** - * This header can be used as a data integrity check to verify that the data - * received is the same data that was originally sent. This header specifies the - * base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] - * in the Amazon S3 User Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html - */ - checksumCRC32?: string - /** - * The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumCRC32C?: string - /** - * The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - * present if it was uploaded with the object. When you use the API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA1?: string - /** - * The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - * present if it was uploaded with the object. When you use an API operation on an - * object that was uploaded using multipart uploads, this value may not be a direct - * checksum value of the full object. Instead, it's a calculation based on the - * checksum values of each individual part. For more information about how - * checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User - * Guide. - * - * [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums - */ - checksumSHA256?: string - /** - * The part number identifying the part. This value is a positive integer between - * 1 and 10,000. - */ - partNumber?: number - /** - * The size of the uploaded part in bytes. - */ - size?: number - } - /** - * Describes the location where the restore job's output is stored. - */ - type _subSpKZD = noSmithyDocumentSerde - interface OutputLocation extends _subSpKZD { - /** - * Describes an S3 location that will receive the results of the restore request. - */ - s3?: S3Location - } - /** - * The container element for an ownership control rule. - */ - type _subDWjeb = noSmithyDocumentSerde - interface OwnershipControlsRule extends _subDWjeb { - /** - * The container element for object ownership for a bucket's ownership controls. - * - * BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the - * bucket owner if the objects are uploaded with the bucket-owner-full-control - * canned ACL. - * - * ObjectWriter - The uploading account will own the object if the object is - * uploaded with the bucket-owner-full-control canned ACL. - * - * BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer - * affect permissions. The bucket owner automatically owns and has full control - * over every object in the bucket. The bucket only accepts PUT requests that don't - * specify an ACL or specify bucket owner full control ACLs (such as the predefined - * bucket-owner-full-control canned ACL or a custom ACL in XML format that grants - * the same permissions). - * - * By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are - * disabled. We recommend keeping ACLs disabled, except in uncommon use cases where - * you must control access for each object individually. For more information about - * S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. Directory buckets - * use the bucket owner enforced setting for S3 Object Ownership. - * - * [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html - * - * This member is required. - */ - objectOwnership: ObjectOwnership - } - /** - * Container for Parquet. - */ - type _subEjLVy = noSmithyDocumentSerde - interface ParquetInput extends _subEjLVy { - } - /** - * Specifies how requests are redirected. In the event of an error, you can - * specify a different error code to return. - */ - type _subtBJpK = noSmithyDocumentSerde - interface Redirect extends _subtBJpK { - /** - * The host name to use in the redirect request. - */ - hostName?: string - /** - * The HTTP redirect code to use on the response. Not required if one of the - * siblings is present. - */ - httpRedirectCode?: string - /** - * Protocol to use when redirecting requests. The default is the protocol that is - * used in the original request. - */ - protocol: Protocol - /** - * The object key prefix to use in the redirect request. For example, to redirect - * requests for all pages with prefix docs/ (objects in the docs/ folder) to - * documents/ , you can set a condition block with KeyPrefixEquals set to docs/ - * and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one - * of the siblings is present. Can be present only if ReplaceKeyWith is not - * provided. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - */ - replaceKeyPrefixWith?: string - /** - * The specific object key to use in the redirect request. For example, redirect - * request to error.html . Not required if one of the siblings is present. Can be - * present only if ReplaceKeyPrefixWith is not provided. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - */ - replaceKeyWith?: string - } - /** - * Specifies which Amazon S3 objects to replicate and where to store the replicas. - */ - type _subpkUOi = noSmithyDocumentSerde - interface ReplicationRule extends _subpkUOi { - /** - * A container for information about the replication destination and its - * configurations including enabling the S3 Replication Time Control (S3 RTC). - * - * This member is required. - */ - destination?: Destination - /** - * Specifies whether the rule is enabled. - * - * This member is required. - */ - status: ReplicationRuleStatus /** - * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter - * in your replication configuration, you must also include a - * DeleteMarkerReplication element. If your Filter includes a Tag element, the - * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does - * not support replicating delete markers for tag-based rules. For an example - * configuration, see [Basic Rule Configuration]. - * - * For more information about delete marker replication, see [Basic Rule Configuration]. - * - * If you are using an earlier version of the replication configuration, Amazon S3 - * handles replication of delete markers differently. For more information, see [Backward Compatibility]. - * - * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html - * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations + * Enabled reports whether the handler handles records at the given level. + * The handler ignores records whose level is lower. + * It is called early, before any arguments are processed, + * to save effort if the log event should be discarded. + * If called from a Logger method, the first argument is the context + * passed to that method, or context.Background() if nil was passed + * or the method does not take a context. + * The context is passed so Enabled can use its values + * to make a decision. */ - deleteMarkerReplication?: DeleteMarkerReplication + enabled(_arg0: context.Context, _arg1: Level): boolean /** - * Optional configuration to replicate existing source bucket objects. - * - * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in - * the Amazon S3 User Guide. + * Handle handles the Record. + * It will only be called when Enabled returns true. + * The Context argument is as for Enabled. + * It is present solely to provide Handlers access to the context's values. + * Canceling the context should not affect record processing. + * (Among other things, log messages may be necessary to debug a + * cancellation-related problem.) * - * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html - */ - existingObjectReplication?: ExistingObjectReplication - /** - * A filter that identifies the subset of objects to which the replication rule - * applies. A Filter must specify exactly one Prefix , Tag , or an And child - * element. - */ - filter: ReplicationRuleFilter - /** - * A unique identifier for the rule. The maximum value is 255 characters. + * Handle methods that produce output should observe the following rules: + * ``` + * - If r.Time is the zero time, ignore the time. + * - If r.PC is zero, ignore it. + * - Attr's values should be resolved. + * - If an Attr's key and value are both the zero value, ignore the Attr. + * This can be tested with attr.Equal(Attr{}). + * - If a group's key is empty, inline the group's Attrs. + * - If a group has no Attrs (even if it has a non-empty key), + * ignore it. + * ``` */ - id?: string + handle(_arg0: context.Context, _arg1: Record): void /** - * An object key name prefix that identifies the object or objects to which the - * rule applies. The maximum prefix length is 1,024 characters. To include all - * objects in a bucket, specify an empty string. - * - * Replacement must be made for object keys containing special characters (such as - * carriage returns) when using XML requests. For more information, see [XML related object key constraints]. - * - * [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints - * - * Deprecated: This member has been deprecated. + * WithAttrs returns a new Handler whose attributes consist of + * both the receiver's attributes and the arguments. + * The Handler owns the slice: it may retain, modify or discard it. */ - prefix?: string + withAttrs(attrs: Array): Handler /** - * The priority indicates which rule has precedence whenever two or more - * replication rules conflict. Amazon S3 will attempt to replicate objects - * according to all replication rules. However, if there are two or more rules with - * the same destination bucket, then objects will be replicated according to the - * rule with the highest priority. The higher the number, the higher the priority. + * WithGroup returns a new Handler with the given group appended to + * the receiver's existing groups. + * The keys of all subsequent attributes, whether added by With or in a + * Record, should be qualified by the sequence of group names. * - * For more information, see [Replication] in the Amazon S3 User Guide. + * How this qualification happens is up to the Handler, so long as + * this Handler's attribute keys differ from those of another Handler + * with a different sequence of group names. * - * [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html - */ - priority?: number - /** - * A container that describes additional filters for identifying the source - * objects that you want to replicate. You can choose to enable or disable the - * replication of these objects. Currently, Amazon S3 supports only the filter that - * you can specify for objects created with server-side encryption using a customer - * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). - */ - sourceSelectionCriteria?: SourceSelectionCriteria - } - /** - * Specifies the restoration status of an object. Objects in certain storage - * classes must be restored before they can be retrieved. For more information - * about these storage classes and how to work with archived objects, see [Working with archived objects]in the - * Amazon S3 User Guide. - * - * This functionality is not supported for directory buckets. Only the S3 Express - * One Zone storage class is supported by directory buckets to store objects. - * - * [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html - */ - type _suboDeJO = noSmithyDocumentSerde - interface RestoreStatus extends _suboDeJO { - /** - * Specifies whether the object is currently being restored. If the object - * restoration is in progress, the header returns the value TRUE . For example: + * A Handler should treat WithGroup as starting a Group of Attrs that ends + * at the end of the log event. That is, * * ``` - * x-amz-optional-object-attributes: IsRestoreInProgress="true" + * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) * ``` * - * If the object restoration has completed, the header returns the value FALSE . - * For example: + * should behave like * * ``` - * x-amz-optional-object-attributes: IsRestoreInProgress="false", - * RestoreExpiryDate="2012-12-21T00:00:00.000Z" + * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) * ``` * - * If the object hasn't been restored, there is no header response. + * If the name is empty, WithGroup returns the receiver. */ - isRestoreInProgress?: boolean + withGroup(name: string): Handler + } + /** + * A Level is the importance or severity of a log event. + * The higher the level, the more important or severe the event. + */ + interface Level extends Number{} + interface Level { /** - * Indicates when the restored copy will expire. This value is populated only if - * the object has already been restored. For example: + * String returns a name for the level. + * If the level has a name, then that name + * in uppercase is returned. + * If the level is between named values, then + * an integer is appended to the uppercased name. + * Examples: * * ``` - * x-amz-optional-object-attributes: IsRestoreInProgress="false", - * RestoreExpiryDate="2012-12-21T00:00:00.000Z" + * LevelWarn.String() => "WARN" + * (LevelInfo+2).String() => "INFO+2" * ``` */ - restoreExpiryDate?: time.Time + string(): string + } + interface Level { + /** + * MarshalJSON implements [encoding/json.Marshaler] + * by quoting the output of [Level.String]. + */ + marshalJSON(): string|Array } - /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * Describes the parameters for Select job types. - * - * Learn [How to optimize querying your data in Amazon S3] using [Amazon Athena], [S3 Object Lambda], or client-side filtering. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [How to optimize querying your data in Amazon S3]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * [Amazon Athena]: https://docs.aws.amazon.com/athena/latest/ug/what-is.html - * [S3 Object Lambda]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html - */ - type _subLvMOu = noSmithyDocumentSerde - interface SelectParameters extends _subLvMOu { + interface Level { /** - * Amazon S3 Select is no longer available to new customers. Existing customers of - * Amazon S3 Select can continue to use the feature as usual. [Learn more] - * - * The expression that is used to query the object. - * - * [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ - * - * This member is required. + * UnmarshalJSON implements [encoding/json.Unmarshaler] + * It accepts any string produced by [Level.MarshalJSON], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". */ - expression?: string + unmarshalJSON(data: string|Array): void + } + interface Level { /** - * The type of the provided expression (for example, SQL). - * - * This member is required. + * MarshalText implements [encoding.TextMarshaler] + * by calling [Level.String]. */ - expressionType: ExpressionType + marshalText(): string|Array + } + interface Level { /** - * Describes the serialization format of the object. - * - * This member is required. + * UnmarshalText implements [encoding.TextUnmarshaler]. + * It accepts any string produced by [Level.MarshalText], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". */ - inputSerialization?: InputSerialization + unmarshalText(data: string|Array): void + } + interface Level { /** - * Describes how the results of the Select job are serialized. - * - * This member is required. + * Level returns the receiver. + * It implements [Leveler]. */ - outputSerialization?: OutputSerialization + level(): Level } + // @ts-ignore + import loginternal = internal +} + +namespace search { /** - * Specifies the default server-side encryption configuration. - * - * ``` - * - General purpose buckets - If you're specifying a customer managed KMS key, - * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias - * instead, then KMS resolves the key within the requester’s account. This behavior - * can result in data that's encrypted with a KMS key that belongs to the - * requester, and not the bucket owner. - * - * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory - * bucket, only use the key ID or key ARN. The key alias format of the KMS key - * isn't supported. - * ``` + * Result defines the returned search result structure. + */ + interface Result { + page: number + perPage: number + totalItems: number + totalPages: number + items: any + } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + /** + * SameSite allows a server to define a cookie attribute making it impossible for + * the browser to send this cookie along with cross-site requests. The main + * goal is to mitigate the risk of cross-origin information leakage, and provide + * some protection against cross-site request forgery attacks. * - * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. + */ + interface SameSite extends Number{} + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + // @ts-ignore + import stdContext = context + /** + * Route contains information to adding/registering new route with the router. + * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. */ - type _subsAkJx = noSmithyDocumentSerde - interface ServerSideEncryptionRule extends _subsAkJx { + interface Route { + method: string + path: string + handler: HandlerFunc + middlewares: Array + name: string + } + interface Route { /** - * Specifies the default server-side encryption to apply to new objects in the - * bucket. If a PUT Object request doesn't specify any server-side encryption, this - * default encryption will be applied. + * ToRouteInfo converts Route to RouteInfo */ - applyServerSideEncryptionByDefault?: ServerSideEncryptionByDefault - /** - * Specifies whether Amazon S3 should use an S3 Bucket Key with server-side - * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects - * are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 - * to use an S3 Bucket Key. - * - * ``` - * - General purpose buckets - By default, S3 Bucket Key is not enabled. For - * more information, see [Amazon S3 Bucket Keys]in the Amazon S3 User Guide. - * - * - Directory buckets - S3 Bucket Keys are always enabled for GET and PUT - * operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't - * supported, when you copy SSE-KMS encrypted objects from general purpose buckets - * to directory buckets, from directory buckets to general purpose buckets, or - * between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a - * call to KMS every time a copy request is made for a KMS-encrypted object. - * ``` - * - * [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html - * [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html - * [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job - * [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html - * [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + toRouteInfo(params: Array): RouteInfo + } + interface Route { + /** + * ToRoute returns Route which Router uses to register the method handler for path. */ - bucketKeyEnabled?: boolean + toRoute(): Route } - /** - * Specifies data related to access patterns to be collected and made available to - * analyze the tradeoffs between different storage classes for an Amazon S3 bucket. - */ - type _subqvUbE = noSmithyDocumentSerde - interface StorageClassAnalysis extends _subqvUbE { + interface Route { /** - * Specifies how data related to the storage class analysis for an Amazon S3 - * bucket should be exported. + * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. */ - dataExport?: StorageClassAnalysisDataExport + forGroup(pathPrefix: string, middlewares: Array): Routable } /** - * Container for granting information. - * - * Buckets that use the bucket owner enforced setting for Object Ownership don't - * support target grants. For more information, see [Permissions server access log delivery]in the Amazon S3 User Guide. - * - * [Permissions server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general + * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this + * interface are meant for request routing purposes and should not be used in middlewares. */ - type _subUKRbv = noSmithyDocumentSerde - interface TargetGrant extends _subUKRbv { + interface RoutableContext { + [key:string]: any; /** - * Container for the person being granted permissions. + * Request returns `*http.Request`. */ - grantee?: Grantee + request(): (http.Request) /** - * Logging permissions assigned to the grantee for the bucket. + * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. */ - permission: BucketLogsPermission - } - /** - * Amazon S3 key format for log objects. Only one format, PartitionedPrefix or - * SimplePrefix, is allowed. - */ - type _subQKjZL = noSmithyDocumentSerde - interface TargetObjectKeyFormat extends _subQKjZL { + rawPathParams(): (PathParams) /** - * Partitioned S3 key for log objects. + * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). + * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. */ - partitionedPrefix?: PartitionedPrefix + setRawPathParams(params: PathParams): void /** - * To use the simple format for S3 keys for log objects. To specify SimplePrefix - * format, set SimplePrefix to {}. + * SetPath sets the registered path for the handler. */ - simplePrefix?: SimplePrefix - } - /** - * The S3 Intelligent-Tiering storage class is designed to optimize storage costs - * by automatically moving data to the most cost-effective storage access tier, - * without additional operational overhead. - */ - type _subQJvwL = noSmithyDocumentSerde - interface Tiering extends _subQJvwL { + setPath(p: string): void /** - * S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently accessed objects] for a list of access tiers in the S3 - * Intelligent-Tiering storage class. - * - * [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access - * - * This member is required. + * SetRouteInfo sets the route info of this request to the context. */ - accessTier: IntelligentTieringAccessTier + setRouteInfo(ri: RouteInfo): void /** - * The number of consecutive days of no access after which an object will be - * eligible to be transitioned to the corresponding tier. The minimum number of - * days specified for Archive Access tier must be at least 90 days and Deep Archive - * Access tier must be at least 180 days. The maximum can be up to 2 years (730 - * days). - * - * This member is required. + * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context + * for later use in middlewares/handler. */ - days?: number + set(key: string, val: { + }): void } /** - * Specifies when an object transitions to a specified storage class. For more - * information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 Lifecycle]in the Amazon S3 - * User Guide. - * - * [Transitioning Objects Using Amazon S3 Lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html + * PathParam is tuple pf path parameter name and its value in request path */ - type _sublHufA = noSmithyDocumentSerde - interface Transition extends _sublHufA { - /** - * Indicates when objects are transitioned to the specified storage class. The - * date value must be in ISO 8601 format. The time is always midnight UTC. - */ - date?: time.Time - /** - * Indicates the number of days after creation when objects are transitioned to - * the specified storage class. The value must be a positive integer. - */ - days?: number - /** - * The storage class to which you want the object to transition. - */ - storageClass: TransitionStorageClass + interface PathParam { + name: string + value: string } - interface noSmithyDocumentSerde extends smithydocument.NoSerde{} } -/** - * Package s3 provides the API client, operations, and parameter types for Amazon - * Simple Storage Service. - */ -namespace s3 { - // @ts-ignore - import awsmiddleware = middleware - // @ts-ignore - import awshttp = http - // @ts-ignore - import internalauth = auth - // @ts-ignore - import internalauthsmithy = smithy - // @ts-ignore - import internalConfig = configsources - // @ts-ignore - import internalmiddleware = middleware - // @ts-ignore - import acceptencodingcust = accept_encoding - // @ts-ignore - import internalChecksum = checksum - // @ts-ignore - import presignedurlcust = presigned_url - // @ts-ignore - import s3sharedconfig = config - // @ts-ignore - import s3cust = customizations - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithyauth = auth - // @ts-ignore - import smithydocument = document - // @ts-ignore - import smithyhttp = http - // @ts-ignore - import smithyxml = xml - // @ts-ignore - import smithyio = io - // @ts-ignore - import smithytime = time - // @ts-ignore - import smithywaiter = waiter - // @ts-ignore - import smithysync = sync +namespace mailer { /** - * AuthResolverParameters contains the set of inputs necessary for auth scheme - * resolution. + * Message defines a generic email message struct. */ - interface AuthResolverParameters { + interface Message { + from: mail.Address + to: Array + bcc: Array + cc: Array + subject: string + html: string + text: string + headers: _TygojaDict + attachments: _TygojaDict + } +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + interface EmailTemplate { + body: string + subject: string + actionUrl: string + hidden: boolean + } + interface EmailTemplate { /** - * The name of the operation being invoked. + * Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. */ - operation: string + validate(): void + } + interface EmailTemplate { /** - * The region in which the operation is being invoked. + * Resolve replaces the placeholder parameters in the current email + * template and returns its components as ready-to-use strings. */ - region: string + resolve(appName: string, appUrl: string, token: string): [string, string, string] } - // @ts-ignore - import internalcontext = context - // @ts-ignore - import awsxml = xml - // @ts-ignore - import internalendpoints = endpoints - // @ts-ignore - import smithyendpoints = endpoints +} + +namespace hook { /** - * EndpointParameters provides the parameters that influence how endpoints are - * resolved. + * Handler defines a hook handler function. */ - interface EndpointParameters { - /** - * The S3 bucket used to send the request. This is an optional parameter that will - * be set automatically for operations that are scoped to an S3 bucket. - * - * Parameter - * is required. - */ - bucket?: string - /** - * The AWS region used to dispatch the request. - * - * Parameter is - * required. - * - * AWS::Region - */ - region?: string - /** - * When true, send this request to the FIPS-compliant regional endpoint. If the - * configured endpoint does not have a FIPS compliant endpoint, dispatching the - * request will return an error. - * - * Defaults to false if no value is - * provided. - * - * AWS::UseFIPS - */ - useFIPS?: boolean - /** - * When true, use the dual-stack endpoint. If the configured endpoint does not - * support dual-stack, dispatching the request MAY return an error. - * - * Defaults to - * false if no value is provided. - * - * AWS::UseDualStack - */ - useDualStack?: boolean - /** - * Override the endpoint used to send this request - * - * Parameter is - * required. - * - * SDK::Endpoint - */ - endpoint?: string + interface Handler {(e: T): void } + /** + * wrapped local Hook embedded struct to limit the public API surface. + */ + type _subJIkCv = Hook + interface mainHook extends _subJIkCv { + } +} + +namespace subscriptions { + /** + * Message defines a client's channel data. + */ + interface Message { + name: string + data: string|Array + } + /** + * Client is an interface for a generic subscription client. + */ + interface Client { + [key:string]: any; /** - * When true, force a path-style endpoint to be used where the bucket name is part - * of the path. - * - * Defaults to false if no value is - * provided. - * - * AWS::S3::ForcePathStyle + * Id Returns the unique id of the client. */ - forcePathStyle?: boolean + id(): string /** - * When true, use S3 Accelerate. NOTE: Not all regions support S3 - * accelerate. - * - * Defaults to false if no value is provided. - * - * AWS::S3::Accelerate + * Channel returns the client's communication channel. */ - accelerate?: boolean + channel(): undefined /** - * Whether the global endpoint should be used, rather then the regional endpoint - * for us-east-1. - * - * Defaults to false if no value is - * provided. - * - * AWS::S3::UseGlobalEndpoint + * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. + * If no prefix is specified, returns all subscriptions. */ - useGlobalEndpoint?: boolean + subscriptions(...prefixes: string[]): _TygojaDict /** - * Internal parameter to use object lambda endpoint for an operation (eg: - * WriteGetObjectResponse) + * Subscribe subscribes the client to the provided subscriptions list. * - * Parameter is required. - */ - useObjectLambdaEndpoint?: boolean - /** - * The S3 Key used to send the request. This is an optional parameter that will be - * set automatically for operations that are scoped to an S3 Key. + * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. * - * Parameter is - * required. - */ - key?: string - /** - * The S3 Prefix used to send the request. This is an optional parameter that will - * be set automatically for operations that are scoped to an S3 Prefix. + * Example: * - * Parameter - * is required. + * ``` + * Subscribe( + * "subscriptionA", + * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, + * ) + * ``` */ - prefix?: string + subscribe(...subs: string[]): void /** - * The Copy Source used for Copy Object request. This is an optional parameter that - * will be set automatically for operations that are scoped to Copy - * Source. - * - * Parameter is required. + * Unsubscribe unsubscribes the client from the provided subscriptions list. */ - copySource?: string + unsubscribe(...subs: string[]): void /** - * Internal parameter to disable Access Point Buckets - * - * Parameter is required. + * HasSubscription checks if the client is subscribed to `sub`. */ - disableAccessPoints?: boolean + hasSubscription(sub: string): boolean /** - * Whether multi-region access points (MRAP) should be disabled. - * - * Defaults to false - * if no value is provided. - * - * AWS::S3::DisableMultiRegionAccessPoints + * Set stores any value to the client's context. */ - disableMultiRegionAccessPoints?: boolean + set(key: string, value: any): void /** - * When an Access Point ARN is provided and this flag is enabled, the SDK MUST use - * the ARN's region when constructing the endpoint instead of the client's - * configured region. - * - * Parameter is required. - * - * AWS::S3::UseArnRegion + * Unset removes a single value from the client's context. */ - useArnRegion?: boolean + unset(key: string): void /** - * Internal parameter to indicate whether S3Express operation should use control - * plane, (ex. CreateBucket) - * - * Parameter is required. + * Get retrieves the key value from the client's context. */ - useS3ExpressControlEndpoint?: boolean + get(key: string): any /** - * Parameter to indicate whether S3Express session auth should be - * disabled + * Discard marks the client as "discarded", meaning that it + * shouldn't be used anymore for sending new messages. * - * Parameter is required. + * It is safe to call Discard() multiple times. */ - disableS3ExpressSessionAuth?: boolean - } - interface EndpointParameters { + discard(): void /** - * ValidateRequired validates required parameters are set. + * IsDiscarded indicates whether the client has been "discarded" + * and should no longer be used. */ - validateRequired(): void - } - interface EndpointParameters { + isDiscarded(): boolean /** - * WithDefaults returns a shallow copy of EndpointParameterswith default values - * applied to members where applicable. + * Send sends the specified message to the client's channel (if not discarded). */ - withDefaults(): EndpointParameters - } - /** - * SelectObjectContentEventStreamReader provides the interface for reading events - * from a stream. - * - * The writer's Close method must allow multiple concurrent calls. - */ - interface SelectObjectContentEventStreamReader { - [key:string]: any; - events(): undefined - close(): void - err(): void + send(m: Message): void } - // @ts-ignore - import v4 = signer } /** - * Package smithy provides the core components for a Smithy SDK. + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. */ -namespace smithy_go { - /** - * Properties provides storing and reading metadata values. Keys may be any - * comparable value type. Get and Set will panic if a key is not comparable. - * - * The zero value for a Properties instance is ready for reads/writes without - * any additional initialization. - */ - interface Properties { - } - interface Properties { - /** - * Get attempts to retrieve the value the key points to. Returns nil if the - * key was not found. - * - * Panics if key type is not comparable. - */ - get(key: any): any - } - interface Properties { - /** - * Set stores the value pointed to by the key. If a value already exists at - * that key it will be replaced with the new value. - * - * Panics if the key type is not comparable. - */ - set(key: any, value: any): void +namespace core { + interface BaseModelEvent { + model: models.Model } - interface Properties { - /** - * Has returns whether the key exists in the metadata. - * - * Panics if the key type is not comparable. - */ - has(key: any): boolean + interface BaseModelEvent { + tags(): Array } - interface Properties { - /** - * SetAll accepts all of the given Properties into the receiver, overwriting - * any existing keys in the case of conflicts. - */ - setAll(other: Properties): void + interface BaseCollectionEvent { + collection?: models.Collection } - interface Properties { - /** - * Values returns a shallow clone of the property set's values. - */ - values(): _TygojaDict + interface BaseCollectionEvent { + tags(): Array } } -namespace types { - interface BucketLogsPermission extends String{} - interface BucketLogsPermission { - /** - * Values returns all known values for BucketLogsPermission. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface BucketType extends String{} - interface BucketType { - /** - * Values returns all known values for BucketType. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array +namespace subscriptions { +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { + /** + * Reader implements buffering for an io.Reader object. + */ + interface Reader { } - interface DataRedundancy extends String{} - interface DataRedundancy { + interface Reader { /** - * Values returns all known values for DataRedundancy. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * Size returns the size of the underlying buffer in bytes. */ - values(): Array + size(): number } - interface FileHeaderInfo extends String{} - interface FileHeaderInfo { + interface Reader { /** - * Values returns all known values for FileHeaderInfo. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * Reset discards any buffered data, resets all state, and switches + * the buffered reader to read from r. + * Calling Reset on the zero value of [Reader] initializes the internal buffer + * to the default size. + * Calling b.Reset(b) (that is, resetting a [Reader] to itself) does nothing. */ - values(): Array + reset(r: io.Reader): void } - interface IntelligentTieringAccessTier extends String{} - interface IntelligentTieringAccessTier { + interface Reader { /** - * Values returns all known values for IntelligentTieringAccessTier. Note that - * this can be expanded in the future, and so it is only as up to date as the - * client. + * Peek returns the next n bytes without advancing the reader. The bytes stop + * being valid at the next read call. If Peek returns fewer than n bytes, it + * also returns an error explaining why the read is short. The error is + * [ErrBufferFull] if n is larger than b's buffer size. * - * The ordering of this slice is not guaranteed to be stable across updates. + * Calling Peek prevents a [Reader.UnreadByte] or [Reader.UnreadRune] call from succeeding + * until the next read operation. */ - values(): Array + peek(n: number): string|Array } - interface InventoryFrequency extends String{} - interface InventoryFrequency { + interface Reader { /** - * Values returns all known values for InventoryFrequency. Note that this can be - * expanded in the future, and so it is only as up to date as the client. + * Discard skips the next n bytes, returning the number of bytes discarded. * - * The ordering of this slice is not guaranteed to be stable across updates. + * If Discard skips fewer than n bytes, it also returns an error. + * If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without + * reading from the underlying io.Reader. */ - values(): Array + discard(n: number): number } - interface JSONType extends String{} - interface JSONType { + interface Reader { /** - * Values returns all known values for JSONType. Note that this can be expanded in - * the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * Read reads data into p. + * It returns the number of bytes read into p. + * The bytes are taken from at most one Read on the underlying [Reader], + * hence n may be less than len(p). + * To read exactly len(p) bytes, use io.ReadFull(b, p). + * If the underlying [Reader] can return a non-zero count with io.EOF, + * then this Read method can do so as well; see the [io.Reader] docs. */ - values(): Array + read(p: string|Array): number } - interface QuoteFields extends String{} - interface QuoteFields { + interface Reader { /** - * Values returns all known values for QuoteFields. Note that this can be expanded - * in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * ReadByte reads and returns a single byte. + * If no byte is available, returns an error. */ - values(): Array + readByte(): number } - interface ReplicationRuleStatus extends String{} - interface ReplicationRuleStatus { + interface Reader { /** - * Values returns all known values for ReplicationRuleStatus. Note that this can - * be expanded in the future, and so it is only as up to date as the client. + * UnreadByte unreads the last byte. Only the most recently read byte can be unread. * - * The ordering of this slice is not guaranteed to be stable across updates. + * UnreadByte returns an error if the most recent method called on the + * [Reader] was not a read operation. Notably, [Reader.Peek], [Reader.Discard], and [Reader.WriteTo] are not + * considered read operations. */ - values(): Array + unreadByte(): void } - interface TransitionStorageClass extends String{} - interface TransitionStorageClass { + interface Reader { /** - * Values returns all known values for TransitionStorageClass. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * ReadRune reads a single UTF-8 encoded Unicode character and returns the + * rune and its size in bytes. If the encoded rune is invalid, it consumes one byte + * and returns unicode.ReplacementChar (U+FFFD) with a size of 1. */ - values(): Array + readRune(): [number, number] } - interface Type extends String{} - interface Type { + interface Reader { /** - * Values returns all known values for Type. Note that this can be expanded in the - * future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. + * UnreadRune unreads the last rune. If the most recent method called on + * the [Reader] was not a [Reader.ReadRune], [Reader.UnreadRune] returns an error. (In this + * regard it is stricter than [Reader.UnreadByte], which will unread the last byte + * from any read operation.) */ - values(): Array + unreadRune(): void } - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithydocument = document - /** - * The container element for optionally specifying the default Object Lock - * retention settings for new objects placed in the specified bucket. - * - * ``` - * - The DefaultRetention settings require both a mode and a period. - * - * - The DefaultRetention period can be either Days or Years but you must select - * one. You cannot specify Days and Years at the same time. - * ``` - */ - type _subYowwS = noSmithyDocumentSerde - interface DefaultRetention extends _subYowwS { - /** - * The number of days that you want to specify for the default retention period. - * Must be used with Mode . - */ - days?: number - /** - * The default Object Lock retention mode you want to apply to new objects placed - * in the specified bucket. Must be used with either Days or Years . - */ - mode: ObjectLockRetentionMode + interface Reader { /** - * The number of years that you want to specify for the default retention period. - * Must be used with Mode . + * Buffered returns the number of bytes that can be read from the current buffer. */ - years?: number + buffered(): number } - /** - * Specifies whether Amazon S3 replicates delete markers. If you specify a Filter - * in your replication configuration, you must also include a - * DeleteMarkerReplication element. If your Filter includes a Tag element, the - * DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does - * not support replicating delete markers for tag-based rules. For an example - * configuration, see [Basic Rule Configuration]. - * - * For more information about delete marker replication, see [Basic Rule Configuration]. - * - * If you are using an earlier version of the replication configuration, Amazon S3 - * handles replication of delete markers differently. For more information, see [Backward Compatibility]. - * - * [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html - * [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations - */ - type _subuQntD = noSmithyDocumentSerde - interface DeleteMarkerReplication extends _subuQntD { + interface Reader { /** - * Indicates whether to replicate delete markers. - * - * Indicates whether to replicate delete markers. + * ReadSlice reads until the first occurrence of delim in the input, + * returning a slice pointing at the bytes in the buffer. + * The bytes stop being valid at the next read. + * If ReadSlice encounters an error before finding a delimiter, + * it returns all the data in the buffer and the error itself (often io.EOF). + * ReadSlice fails with error [ErrBufferFull] if the buffer fills without a delim. + * Because the data returned from ReadSlice will be overwritten + * by the next I/O operation, most clients should use + * [Reader.ReadBytes] or ReadString instead. + * ReadSlice returns err != nil if and only if line does not end in delim. */ - status: DeleteMarkerReplicationStatus + readSlice(delim: number): string|Array } - /** - * Specifies information about where to publish analysis or configuration results - * for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). - */ - type _subrhMEC = noSmithyDocumentSerde - interface Destination extends _subrhMEC { - /** - * The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store - * the results. - * - * This member is required. - */ - bucket?: string - /** - * Specify this only in a cross-account scenario (where source and destination - * bucket owners are not the same), and you want to change replica ownership to the - * Amazon Web Services account that owns the destination bucket. If this is not - * specified in the replication configuration, the replicas are owned by same - * Amazon Web Services account that owns the source object. - */ - accessControlTranslation?: AccessControlTranslation - /** - * Destination bucket owner account ID. In a cross-account scenario, if you direct - * Amazon S3 to change replica ownership to the Amazon Web Services account that - * owns the destination bucket by specifying the AccessControlTranslation - * property, this is the account ID of the destination bucket owner. For more - * information, see [Replication Additional Configuration: Changing the Replica Owner]in the Amazon S3 User Guide. - * - * [Replication Additional Configuration: Changing the Replica Owner]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html - */ - account?: string - /** - * A container that provides information about encryption. If - * SourceSelectionCriteria is specified, you must specify this element. - */ - encryptionConfiguration?: EncryptionConfiguration - /** - * A container specifying replication metrics-related settings enabling - * replication metrics and events. - */ - metrics?: Metrics - /** - * A container specifying S3 Replication Time Control (S3 RTC), including whether - * S3 RTC is enabled and the time when all objects and operations on objects must - * be replicated. Must be specified together with a Metrics block. - */ - replicationTime?: ReplicationTime + interface Reader { /** - * The storage class to use when replicating objects, such as S3 Standard or - * reduced redundancy. By default, Amazon S3 uses the storage class of the source - * object to create the object replica. - * - * For valid values, see the StorageClass element of the [PUT Bucket replication] action in the Amazon S3 - * API Reference. + * ReadLine is a low-level line-reading primitive. Most callers should use + * [Reader.ReadBytes]('\n') or [Reader.ReadString]('\n') instead or use a [Scanner]. * - * [PUT Bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html - */ - storageClass: StorageClass - } - /** - * Optional configuration to replicate existing source bucket objects. - * - * This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in - * the Amazon S3 User Guide. - * - * [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html - */ - type _subNbEDs = noSmithyDocumentSerde - interface ExistingObjectReplication extends _subNbEDs { - /** - * Specifies whether Amazon S3 replicates existing source bucket objects. + * ReadLine tries to return a single line, not including the end-of-line bytes. + * If the line was too long for the buffer then isPrefix is set and the + * beginning of the line is returned. The rest of the line will be returned + * from future calls. isPrefix will be false when returning the last fragment + * of the line. The returned buffer is only valid until the next call to + * ReadLine. ReadLine either returns a non-nil line or it returns an error, + * never both. * - * This member is required. + * The text returned from ReadLine does not include the line end ("\r\n" or "\n"). + * No indication or error is given if the input ends without a final line end. + * Calling [Reader.UnreadByte] after ReadLine will always unread the last byte read + * (possibly a character belonging to the line end) even if that byte is not + * part of the line returned by ReadLine. */ - status: ExistingObjectReplicationStatus + readLine(): [string|Array, boolean] } - /** - * A container for specifying S3 Intelligent-Tiering filters. The filters - * determine the subset of objects to which the rule applies. - */ - type _subABktB = noSmithyDocumentSerde - interface IntelligentTieringAndOperator extends _subABktB { - /** - * An object key name prefix that identifies the subset of objects to which the - * configuration applies. - */ - prefix?: string + interface Reader { /** - * All of these tags must exist in the object's tag set in order for the - * configuration to apply. + * ReadBytes reads until the first occurrence of delim in the input, + * returning a slice containing the data up to and including the delimiter. + * If ReadBytes encounters an error before finding a delimiter, + * it returns the data read before the error and the error itself (often io.EOF). + * ReadBytes returns err != nil if and only if the returned data does not end in + * delim. + * For simple uses, a Scanner may be more convenient. */ - tags: Array + readBytes(delim: number): string|Array } - /** - * Contains the bucket name, file format, bucket owner (optional), and prefix - * (optional) where inventory results are published. - */ - type _subaMwDp = noSmithyDocumentSerde - interface InventoryS3BucketDestination extends _subaMwDp { - /** - * The Amazon Resource Name (ARN) of the bucket where inventory results will be - * published. - * - * This member is required. - */ - bucket?: string - /** - * Specifies the output format of the inventory results. - * - * This member is required. - */ - format: InventoryFormat - /** - * The account ID that owns the destination S3 bucket. If no account ID is - * provided, the owner is not validated before exporting data. - * - * Although this value is optional, we strongly recommend that you set it to help - * prevent problems if the destination bucket ownership changes. - */ - accountId?: string - /** - * Contains the type of server-side encryption used to encrypt the inventory - * results. - */ - encryption?: InventoryEncryption + interface Reader { /** - * The prefix that is prepended to all inventory results. + * ReadString reads until the first occurrence of delim in the input, + * returning a string containing the data up to and including the delimiter. + * If ReadString encounters an error before finding a delimiter, + * it returns the data read before the error and the error itself (often io.EOF). + * ReadString returns err != nil if and only if the returned data does not end in + * delim. + * For simple uses, a Scanner may be more convenient. */ - prefix?: string + readString(delim: number): string } - /** - * Amazon S3 keys for log objects are partitioned in the following format: - * - * ``` - * [DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] - * ``` - * - * PartitionedPrefix defaults to EventTime delivery when server access logs are - * delivered. - */ - type _subaPbjW = noSmithyDocumentSerde - interface PartitionedPrefix extends _subaPbjW { + interface Reader { /** - * Specifies the partition date source for the partitioned prefix. - * PartitionDateSource can be EventTime or DeliveryTime . - * - * For DeliveryTime , the time in the log file names corresponds to the delivery - * time for the log files. - * - * For EventTime , The logs delivered are for a specific day only. The year, month, - * and day correspond to the day on which the event occurred, and the hour, minutes - * and seconds are set to 00 in the key. + * WriteTo implements io.WriterTo. + * This may make multiple calls to the [Reader.Read] method of the underlying [Reader]. + * If the underlying reader supports the [Reader.WriteTo] method, + * this calls the underlying [Reader.WriteTo] without buffering. */ - partitionDateSource: PartitionDateSource + writeTo(w: io.Writer): number } /** - * A filter that identifies the subset of objects to which the replication rule - * applies. A Filter must specify exactly one Prefix , Tag , or an And child - * element. - * - * The following types satisfy this interface: - * - * ``` - * ReplicationRuleFilterMemberAnd - * ReplicationRuleFilterMemberPrefix - * ReplicationRuleFilterMemberTag - * ``` + * Writer implements buffering for an [io.Writer] object. + * If an error occurs writing to a [Writer], no more data will be + * accepted and all subsequent writes, and [Writer.Flush], will return the error. + * After all data has been written, the client should call the + * [Writer.Flush] method to guarantee all data has been forwarded to + * the underlying [io.Writer]. */ - interface ReplicationRuleFilter { - [key:string]: any; + interface Writer { } - /** - * A container for object key name prefix and suffix filtering rules. - */ - type _subaAyWd = noSmithyDocumentSerde - interface S3KeyFilter extends _subaAyWd { + interface Writer { /** - * A list of containers for the key-value pair that defines the criteria for the - * filter rule. + * Size returns the size of the underlying buffer in bytes. */ - filterRules: Array + size(): number } - /** - * Describes an Amazon S3 location that will receive the results of the restore - * request. - */ - type _subKPOOV = noSmithyDocumentSerde - interface S3Location extends _subKPOOV { - /** - * The name of the bucket where the restore results will be placed. - * - * This member is required. - */ - bucketName?: string - /** - * The prefix that is prepended to the restore results for this request. - * - * This member is required. - */ - prefix?: string - /** - * A list of grants that control access to the staged results. - */ - accessControlList: Array - /** - * The canned ACL to apply to the restore results. - */ - cannedACL: ObjectCannedACL - /** - * Contains the type of server-side encryption used. - */ - encryption?: Encryption + interface Writer { /** - * The class of storage used to store the restore results. + * Reset discards any unflushed buffered data, clears any error, and + * resets b to write its output to w. + * Calling Reset on the zero value of [Writer] initializes the internal buffer + * to the default size. + * Calling w.Reset(w) (that is, resetting a [Writer] to itself) does nothing. */ - storageClass: StorageClass + reset(w: io.Writer): void + } + interface Writer { /** - * The tag-set that is applied to the restore results. + * Flush writes any buffered data to the underlying [io.Writer]. */ - tagging?: Tagging + flush(): void + } + interface Writer { /** - * A list of metadata to store with the restore results in S3. + * Available returns how many bytes are unused in the buffer. */ - userMetadata: Array + available(): number } - /** - * Describes the default server-side encryption to apply to new objects in the - * bucket. If a PUT Object request doesn't specify any server-side encryption, this - * default encryption will be applied. For more information, see [PutBucketEncryption]. - * - * ``` - * - General purpose buckets - If you don't specify a customer managed key at - * configuration, Amazon S3 automatically creates an Amazon Web Services KMS key ( - * aws/s3 ) in your Amazon Web Services account the first time that you add an - * object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS - * key for SSE-KMS. - * - * - Directory buckets - Your SSE-KMS configuration can only support 1 [customer managed key]per - * directory bucket for the lifetime of the bucket. [Amazon Web Services managed key]( aws/s3 ) isn't supported. - * - * - Directory buckets - For directory buckets, there are only two supported - * options for server-side encryption: SSE-S3 and SSE-KMS. - * ``` - * - * [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html - * [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk - */ - type _subrVhbL = noSmithyDocumentSerde - interface ServerSideEncryptionByDefault extends _subrVhbL { + interface Writer { /** - * Server-side encryption algorithm to use for the default encryption. - * - * For directory buckets, there are only two supported values for server-side - * encryption: AES256 and aws:kms . - * - * This member is required. + * AvailableBuffer returns an empty buffer with b.Available() capacity. + * This buffer is intended to be appended to and + * passed to an immediately succeeding [Writer.Write] call. + * The buffer is only valid until the next write operation on b. */ - sseAlgorithm: ServerSideEncryption + availableBuffer(): string|Array + } + interface Writer { /** - * Amazon Web Services Key Management Service (KMS) customer managed key ID to use - * for the default encryption. - * - * ``` - * - General purpose buckets - This parameter is allowed if and only if - * SSEAlgorithm is set to aws:kms or aws:kms:dsse . - * - * - Directory buckets - This parameter is allowed if and only if SSEAlgorithm is - * set to aws:kms . - * ``` - * - * You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the - * KMS key. - * - * ``` - * - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - * - * - Key ARN: - * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - * - * - Key Alias: alias/alias-name - * ``` - * - * If you are using encryption with cross-account or Amazon Web Services service - * operations, you must use a fully qualified KMS key ARN. For more information, - * see [Using encryption for cross-account operations]. - * - * ``` - * - General purpose buckets - If you're specifying a customer managed KMS key, - * we recommend using a fully qualified KMS key ARN. If you use a KMS key alias - * instead, then KMS resolves the key within the requester’s account. This behavior - * can result in data that's encrypted with a KMS key that belongs to the - * requester, and not the bucket owner. Also, if you use a key ID, you can run into - * a LogDestination undeliverable error when creating a VPC flow log. - * - * - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory - * bucket, only use the key ID or key ARN. The key alias format of the KMS key - * isn't supported. - * ``` - * - * Amazon S3 only supports symmetric encryption KMS keys. For more information, - * see [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. - * - * [Using encryption for cross-account operations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy - * [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk - * [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html + * Buffered returns the number of bytes that have been written into the current buffer. */ - kmsMasterKeyID?: string + buffered(): number } - /** - * To use simple format for S3 keys for log objects, set SimplePrefix to an empty - * object. - * - * ``` - * [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] - * ``` - */ - type _subwIMUw = noSmithyDocumentSerde - interface SimplePrefix extends _subwIMUw { + interface Writer { + /** + * Write writes the contents of p into the buffer. + * It returns the number of bytes written. + * If nn < len(p), it also returns an error explaining + * why the write is short. + */ + write(p: string|Array): number } - /** - * A container that describes additional filters for identifying the source - * objects that you want to replicate. You can choose to enable or disable the - * replication of these objects. Currently, Amazon S3 supports only the filter that - * you can specify for objects created with server-side encryption using a customer - * managed key stored in Amazon Web Services Key Management Service (SSE-KMS). - */ - type _subnEjxu = noSmithyDocumentSerde - interface SourceSelectionCriteria extends _subnEjxu { + interface Writer { /** - * A filter that you can specify for selections for modifications on replicas. - * Amazon S3 doesn't replicate replica modifications by default. In the latest - * version of replication configuration (when Filter is specified), you can - * specify this element and set the status to Enabled to replicate modifications - * on replicas. - * - * If you don't specify the Filter element, Amazon S3 assumes that the replication - * configuration is the earlier version, V1. In the earlier version, this element - * is not allowed + * WriteByte writes a single byte. */ - replicaModifications?: ReplicaModifications + writeByte(c: number): void + } + interface Writer { /** - * A container for filter information for the selection of Amazon S3 objects - * encrypted with Amazon Web Services KMS. If you include SourceSelectionCriteria - * in the replication configuration, this element is required. + * WriteRune writes a single Unicode code point, returning + * the number of bytes written and any error. */ - sseKmsEncryptedObjects?: SseKmsEncryptedObjects + writeRune(r: number): number } - /** - * Container for data related to the storage class analysis for an Amazon S3 - * bucket for export. - */ - type _subiipYU = noSmithyDocumentSerde - interface StorageClassAnalysisDataExport extends _subiipYU { + interface Writer { /** - * The place to store the data for an analysis. - * - * This member is required. + * WriteString writes a string. + * It returns the number of bytes written. + * If the count is less than len(s), it also returns an error explaining + * why the write is short. */ - destination?: AnalyticsExportDestination + writeString(s: string): number + } + interface Writer { /** - * The version of the output schema to use when exporting data. Must be V_1 . - * - * This member is required. + * ReadFrom implements [io.ReaderFrom]. If the underlying writer + * supports the ReadFrom method, this calls the underlying ReadFrom. + * If there is buffered data and an underlying ReadFrom, this fills + * the buffer and writes it before calling ReadFrom. */ - outputSchemaVersion: StorageClassAnalysisSchemaVersion + readFrom(r: io.Reader): number } } /** - * Package middleware provides transport agnostic middleware for decorating SDK - * handlers. + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` * - * The Smithy middleware stack provides ordered behavior to be invoked on an - * underlying handler. The stack is separated into steps that are invoked in a - * static order. A step is a collection of middleware that are injected into a - * ordered list defined by the user. The user may add, insert, swap, and remove a - * step's middleware. When the stack is invoked the step middleware become static, - * and their order cannot be modified. + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. * - * A stack and its step middleware are **not** safe to modify concurrently. + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, * - * A stack will use the ordered list of middleware to decorate a underlying - * handler. A handler could be something like an HTTP Client that round trips an - * API operation over HTTP. + * ``` + * slog.InfoContext(ctx, "message") + * ``` * - * Smithy Middleware Stack + * It is recommended to pass a context to an output method if one is available. * - * A Stack is a collection of middleware that wrap a handler. The stack can be - * broken down into discreet steps. Each step may contain zero or more middleware - * specific to that stack's step. + * # Attrs and Values * - * A Stack Step is a predefined set of middleware that are invoked in a static - * order by the Stack. These steps represent fixed points in the middleware stack - * for organizing specific behavior, such as serialize and build. A Stack Step is - * composed of zero or more middleware that are specific to that step. A step may - * define its own set of input/output parameters the generic input/output - * parameters are cast from. A step calls its middleware recursively, before - * calling the next step in the stack returning the result or error of the step - * middleware decorating the underlying handler. + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement * - * * Initialize: Prepares the input, and sets any default parameters as needed, - * (e.g. idempotency token, and presigned URLs). + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` * - * * Serialize: Serializes the prepared input into a data structure that can be - * consumed by the target transport's message, (e.g. REST-JSON serialization). + * behaves the same as * - * * Build: Adds additional metadata to the serialized transport message, (e.g. - * HTTP's Content-Length header, or body checksum). Decorations and - * modifications to the message should be copied to all message attempts. + * ``` + * slog.Info("hello", "count", 3) + * ``` * - * * Finalize: Performs final preparations needed before sending the message. The - * message should already be complete by this stage, and is only alternated to - * meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request - * signing). + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. * - * * Deserialize: Reacts to the handler's response returned by the recipient of - * the request message. Deserializes the response into a structured type or - * error above stacks can react to. + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. * - * Adding Middleware to a Stack Step + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. * - * Middleware can be added to a step front or back, or relative, by name, to an - * existing middleware in that stack. If a middleware does not have a name, a - * unique name will be generated at the middleware and be added to the step. + * The call * * ``` - * // Create middleware stack - * stack := middleware.NewStack() + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` * - * // Add middleware to stack steps - * stack.Initialize.Add(paramValidationMiddleware, middleware.After) - * stack.Serialize.Add(marshalOperationFoo, middleware.After) - * stack.Deserialize.Add(unmarshalOperationFoo, middleware.After) + * is the most efficient way to achieve the same output as * - * // Invoke middleware on handler. - * resp, err := stack.HandleMiddleware(ctx, req.Input, clientHandler) * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. */ -namespace middleware { - /** - * BuildInput provides the input parameters for the BuildMiddleware to consume. - * BuildMiddleware may modify the Request value before forwarding the input - * along to the next BuildHandler. - */ - interface BuildInput { - request: { - } - } - /** - * BuildOutput provides the result returned by the next BuildHandler. - */ - interface BuildOutput { - result: { - } - } - /** - * BuildHandler provides the interface for the next handler the - * BuildMiddleware will call in the middleware chain. - */ - interface BuildHandler { - [key:string]: any; - handleBuild(ctx: context.Context, _arg10: BuildInput): [BuildOutput, Metadata] - } - /** - * DeserializeInput provides the input parameters for the DeserializeInput to - * consume. DeserializeMiddleware should not modify the Request, and instead - * forward it along to the next DeserializeHandler. - */ - interface DeserializeInput { - request: { - } - } - /** - * DeserializeOutput provides the result returned by the next - * DeserializeHandler. The DeserializeMiddleware should deserialize the - * RawResponse into a Result that can be consumed by middleware higher up in - * the stack. - */ - interface DeserializeOutput { - rawResponse: { - } - result: { - } - } - /** - * DeserializeHandler provides the interface for the next handler the - * DeserializeMiddleware will call in the middleware chain. - */ - interface DeserializeHandler { - [key:string]: any; - handleDeserialize(ctx: context.Context, _arg10: DeserializeInput): [DeserializeOutput, Metadata] - } - /** - * FinalizeInput provides the input parameters for the FinalizeMiddleware to - * consume. FinalizeMiddleware may modify the Request value before forwarding - * the FinalizeInput along to the next next FinalizeHandler. - */ - interface FinalizeInput { - request: { - } - } - /** - * FinalizeOutput provides the result returned by the next FinalizeHandler. - */ - interface FinalizeOutput { - result: { - } - } - /** - * FinalizeHandler provides the interface for the next handler the - * FinalizeMiddleware will call in the middleware chain. - */ - interface FinalizeHandler { - [key:string]: any; - handleFinalize(ctx: context.Context, _arg10: FinalizeInput): [FinalizeOutput, Metadata] - } - /** - * InitializeInput wraps the input parameters for the InitializeMiddlewares to - * consume. InitializeMiddleware may modify the parameter value before - * forwarding it along to the next InitializeHandler. - */ - interface InitializeInput { - parameters: { - } - } - /** - * InitializeOutput provides the result returned by the next InitializeHandler. - */ - interface InitializeOutput { - result: { - } - } - /** - * InitializeHandler provides the interface for the next handler the - * InitializeMiddleware will call in the middleware chain. - */ - interface InitializeHandler { - [key:string]: any; - handleInitialize(ctx: context.Context, _arg10: InitializeInput): [InitializeOutput, Metadata] - } - /** - * SerializeInput provides the input parameters for the SerializeMiddleware to - * consume. SerializeMiddleware may modify the Request value before forwarding - * SerializeInput along to the next SerializeHandler. The Parameters member - * should not be modified by SerializeMiddleware, InitializeMiddleware should - * be responsible for modifying the provided Parameter value. - */ - interface SerializeInput { - parameters: { - } - request: { - } - } - /** - * SerializeOutput provides the result returned by the next SerializeHandler. - */ - interface SerializeOutput { - result: { - } - } - /** - * SerializeHandler provides the interface for the next handler the - * SerializeMiddleware will call in the middleware chain. - */ - interface SerializeHandler { - [key:string]: any; - handleSerialize(ctx: context.Context, _arg10: SerializeInput): [SerializeOutput, Metadata] - } -} - -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { +namespace slog { + // @ts-ignore + import loginternal = internal /** - * MeterOptions represents configuration for a Meter. + * A Record holds information about a log event. + * Copies of a Record share state. + * Do not modify a Record after handing out a copy to it. + * Call [NewRecord] to create a new Record. + * Use [Record.Clone] to create a copy with no shared state. */ - interface MeterOptions { - properties: smithy.Properties + interface Record { + /** + * The time at which the output method (Log, Info, etc.) was called. + */ + time: time.Time + /** + * The log message. + */ + message: string + /** + * The level of the event. + */ + level: Level + /** + * The program counter at the time the record was constructed, as determined + * by runtime.Callers. If zero, no program counter is available. + * + * The only valid use for this value is as an argument to + * [runtime.CallersFrames]. In particular, it must not be passed to + * [runtime.FuncForPC]. + */ + pc: number } - /** - * InstrumentOption applies configuration to an instrument. - */ - interface InstrumentOption {(o: InstrumentOptions): void } - /** - * Int64Counter measures a monotonically increasing int64 value. - */ - interface Int64Counter { - [key:string]: any; - add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Record { + /** + * Clone returns a copy of the record with no shared state. + * The original record and the clone can both be modified + * without interfering with each other. + */ + clone(): Record } - /** - * Int64UpDownCounter measures a fluctuating int64 value. - */ - interface Int64UpDownCounter { - [key:string]: any; - add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Record { + /** + * NumAttrs returns the number of attributes in the [Record]. + */ + numAttrs(): number } - /** - * Int64Gauge samples a discrete int64 value. - */ - interface Int64Gauge { - [key:string]: any; - sample(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Record { + /** + * Attrs calls f on each Attr in the [Record]. + * Iteration stops if f returns false. + */ + attrs(f: (_arg0: Attr) => boolean): void } - /** - * Int64Histogram records multiple data points for an int64 value. - */ - interface Int64Histogram { - [key:string]: any; - record(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Record { + /** + * AddAttrs appends the given Attrs to the [Record]'s list of Attrs. + * It omits empty groups. + */ + addAttrs(...attrs: Attr[]): void } - /** - * Float64Counter measures a monotonically increasing float64 value. - */ - interface Float64Counter { - [key:string]: any; - add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Record { + /** + * Add converts the args to Attrs as described in [Logger.Log], + * then appends the Attrs to the [Record]'s list of Attrs. + * It omits empty groups. + */ + add(...args: any[]): void } /** - * Float64UpDownCounter measures a fluctuating float64 value. + * A Value can represent any Go value, but unlike type any, + * it can represent most small values without an allocation. + * The zero Value corresponds to nil. */ - interface Float64UpDownCounter { - [key:string]: any; - add(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Value { } - /** - * Float64Gauge samples a discrete float64 value. - */ - interface Float64Gauge { - [key:string]: any; - sample(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Value { + /** + * Kind returns v's Kind. + */ + kind(): Kind } - /** - * Float64Histogram records multiple data points for an float64 value. - */ - interface Float64Histogram { - [key:string]: any; - record(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Value { + /** + * Any returns v's value as an any. + */ + any(): any } - /** - * AsyncInstrument is the universal handle returned for creation of all async - * instruments. - * - * Callers use the Stop() API to unregister the callback passed at instrument - * creation. - */ - interface AsyncInstrument { - [key:string]: any; - stop(): void + interface Value { + /** + * String returns Value's value as a string, formatted like [fmt.Sprint]. Unlike + * the methods Int64, Float64, and so on, which panic if v is of the + * wrong kind, String never panics. + */ + string(): string } - /** - * Int64Callback describes a function invoked when an async int64 instrument is - * read. - */ - interface Int64Callback {(_arg0: context.Context, _arg1: Int64Observer): void } - /** - * Float64Callback describes a function invoked when an async float64 - * instrument is read. - */ - interface Float64Callback {(_arg0: context.Context, _arg1: Float64Observer): void } -} - -/** - * Package tracing defines tracing APIs to be used by Smithy clients. - */ -namespace tracing { - /** - * TracerOptions represent configuration for tracers. - */ - interface TracerOptions { - properties: smithy.Properties + interface Value { + /** + * Int64 returns v's value as an int64. It panics + * if v is not a signed integer. + */ + int64(): number } - /** - * SpanOption applies configuration to a span. - */ - interface SpanOption {(o: SpanOptions): void } - /** - * Span records a conceptually individual unit of work that takes place in a - * Smithy client operation. - */ - interface Span { - [key:string]: any; - name(): string - context(): SpanContext - addEvent(name: string, ...opts: EventOption[]): void - setStatus(status: SpanStatus): void - setProperty(k: any, v: any): void - end(): void + interface Value { + /** + * Uint64 returns v's value as a uint64. It panics + * if v is not an unsigned integer. + */ + uint64(): number } -} - -/** - * Package http provides the HTTP transport client and request/response types - * needed to round trip API operation calls with an service. - */ -namespace http { - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import iointernal = io - /** - * Request provides the HTTP specific request structure for HTTP specific - * middleware steps to use to serialize input, and send an operation's request. - */ - type _subwSKDK = http.Request - interface Request extends _subwSKDK { + interface Value { + /** + * Bool returns v's value as a bool. It panics + * if v is not a bool. + */ + bool(): boolean } - interface Request { + interface Value { /** - * IsHTTPS returns if the request is HTTPS. Returns false if no endpoint URL is set. + * Duration returns v's value as a [time.Duration]. It panics + * if v is not a time.Duration. */ - isHTTPS(): boolean + duration(): time.Duration } - interface Request { + interface Value { /** - * Clone returns a deep copy of the Request for the new context. A reference to - * the Stream is copied, but the underlying stream is not copied. + * Float64 returns v's value as a float64. It panics + * if v is not a float64. */ - clone(): (Request) + float64(): number } - interface Request { + interface Value { /** - * StreamLength returns the number of bytes of the serialized stream attached - * to the request and ok set. If the length cannot be determined, an error will - * be returned. + * Time returns v's value as a [time.Time]. It panics + * if v is not a time.Time. */ - streamLength(): [number, boolean] + time(): time.Time } - interface Request { + interface Value { /** - * RewindStream will rewind the io.Reader to the relative start position if it - * is an io.Seeker. + * LogValuer returns v's value as a LogValuer. It panics + * if v is not a LogValuer. */ - rewindStream(): void + logValuer(): LogValuer } - interface Request { + interface Value { /** - * GetStream returns the request stream io.Reader if a stream is set. If no - * stream is present nil will be returned. + * Group returns v's value as a []Attr. + * It panics if v's [Kind] is not [KindGroup]. */ - getStream(): io.Reader + group(): Array } - interface Request { + interface Value { /** - * IsStreamSeekable returns whether the stream is seekable. + * Equal reports whether v and w represent the same Go value. */ - isStreamSeekable(): boolean + equal(w: Value): boolean } - interface Request { + interface Value { /** - * SetStream returns a clone of the request with the stream set to the provided - * reader. May return an error if the provided reader is seekable but returns - * an error. + * Resolve repeatedly calls LogValue on v while it implements [LogValuer], + * and returns the result. + * If v resolves to a group, the group's attributes' values are not recursively + * resolved. + * If the number of LogValue calls exceeds a threshold, a Value containing an + * error is returned. + * Resolve's return value is guaranteed not to be of Kind [KindLogValuer]. */ - setStream(reader: io.Reader): (Request) + resolve(): Value } - interface Request { +} + +namespace search { +} + +/** + * Package mail implements parsing of mail messages. + * + * For the most part, this package follows the syntax as specified by RFC 5322 and + * extended by RFC 6532. + * Notable divergences: + * ``` + * - Obsolete address formats are not parsed, including addresses with + * embedded route information. + * - The full range of spacing (the CFWS syntax element) is not supported, + * such as breaking addresses across lines. + * - No unicode normalization is performed. + * - A leading From line is permitted, as in mbox format (RFC 4155). + * ``` + */ +namespace mail { + /** + * Address represents a single mail address. + * An address such as "Barry Gibbs " is represented + * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. + */ + interface Address { + name: string // Proper name; may be empty. + address: string // user@domain + } + interface Address { /** - * Build returns a build standard HTTP request value from the Smithy request. - * The request's stream is wrapped in a safe container that allows it to be - * reused for subsequent attempts. + * String formats the address as a valid RFC 5322 address. + * If the address's name contains non-ASCII characters + * the name will be rendered according to RFC 2047. */ - build(ctx: context.Context): (http.Request) + string(): string } - // @ts-ignore - import smithytime = time } /** @@ -45102,642 +20685,33 @@ namespace http { * Now computeExpensiveValue will only be called when the line is enabled. * * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - // @ts-ignore - import loginternal = internal - /** - * Kind is the kind of a [Value]. - */ - interface Kind extends Number{} - interface Kind { - string(): string - } - /** - * A LogValuer is any Go value that can convert itself into a Value for logging. - * - * This mechanism may be used to defer expensive operations until they are - * needed, or to expand a single value into a sequence of components. - */ - interface LogValuer { - [key:string]: any; - logValue(): Value - } -} - -/** - * Package aws provides the core SDK's utilities and shared types. Use this package's - * utilities to simplify setting and reading API operations parameters. - * - * # Value and Pointer Conversion Utilities - * - * This package includes a helper conversion utility for each scalar type the SDK's - * API use. These utilities make getting a pointer of the scalar, and dereferencing - * a pointer easier. - * - * Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. - * The Pointer to value will safely dereference the pointer and return its value. - * If the pointer was nil, the scalar's zero value will be returned. - * - * The value to pointer functions will be named after the scalar type. So get a - * *string from a string value use the "String" function. This makes it easy to - * to get pointer of a literal string value, because getting the address of a - * literal requires assigning the value to a variable first. - * - * ``` - * var strPtr *string - * - * // Without the SDK's conversion functions - * str := "my string" - * strPtr = &str - * - * // With the SDK's conversion functions - * strPtr = aws.String("my string") - * - * // Convert *string to string value - * str = aws.ToString(strPtr) - * ``` - * - * In addition to scalars the aws package also includes conversion utilities for - * map and slice for commonly types used in API parameters. The map and slice - * conversion functions use similar naming pattern as the scalar conversion - * functions. - * - * ``` - * var strPtrs []*string - * var strs []string = []string{"Go", "Gophers", "Go"} - * - * // Convert []string to []*string - * strPtrs = aws.StringSlice(strs) - * - * // Convert []*string to []string - * strs = aws.ToStringSlice(strPtrs) - * ``` - * - * # SDK Default HTTP Client + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. * - * The SDK will use the http.DefaultClient if a HTTP client is not provided to - * the SDK's Session, or service client constructor. This means that if the - * http.DefaultClient is modified by other components of your application the - * modifications will be picked up by the SDK as well. + * # Writing a handler * - * In some cases this might be intended, but it is a better practice to create - * a custom HTTP Client to share explicitly through your application. You can - * configure the SDK to use the custom HTTP Client by setting the HTTPClient - * value of the SDK's Config type when creating a Session or service client. - */ -/** - * Package aws provides core functionality for making requests to AWS services. - */ -namespace aws { - // @ts-ignore - import smithybearer = bearer - // @ts-ignore - import sdkrand = rand - /** - * DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior. - */ - interface DualStackEndpointState extends Number{} - /** - * FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. - */ - interface FIPSEndpointState extends Number{} -} - -/** - * Package smithy provides the core components for a Smithy SDK. + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. */ -namespace smithy_go { -} - -namespace types { - interface DeleteMarkerReplicationStatus extends String{} - interface DeleteMarkerReplicationStatus { - /** - * Values returns all known values for DeleteMarkerReplicationStatus. Note that - * this can be expanded in the future, and so it is only as up to date as the - * client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ExistingObjectReplicationStatus extends String{} - interface ExistingObjectReplicationStatus { - /** - * Values returns all known values for ExistingObjectReplicationStatus. Note that - * this can be expanded in the future, and so it is only as up to date as the - * client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface InventoryFormat extends String{} - interface InventoryFormat { - /** - * Values returns all known values for InventoryFormat. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface PartitionDateSource extends String{} - interface PartitionDateSource { - /** - * Values returns all known values for PartitionDateSource. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface StorageClassAnalysisSchemaVersion extends String{} - interface StorageClassAnalysisSchemaVersion { - /** - * Values returns all known values for StorageClassAnalysisSchemaVersion. Note - * that this can be expanded in the future, and so it is only as up to date as the - * client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - // @ts-ignore - import smithy = smithy_go +namespace slog { // @ts-ignore - import smithydocument = document - /** - * A container for information about access control for replicas. - */ - type _subqSeRK = noSmithyDocumentSerde - interface AccessControlTranslation extends _subqSeRK { - /** - * Specifies the replica ownership. For default and valid values, see [PUT bucket replication] in the - * Amazon S3 API Reference. - * - * [PUT bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html - * - * This member is required. - */ - owner: OwnerOverride - } - /** - * Where to publish the analytics results. - */ - type _subNGQDq = noSmithyDocumentSerde - interface AnalyticsExportDestination extends _subNGQDq { - /** - * A destination signifying output to an S3 bucket. - * - * This member is required. - */ - s3BucketDestination?: AnalyticsS3BucketDestination - } - /** - * Contains the type of server-side encryption used. - */ - type _subhslTa = noSmithyDocumentSerde - interface Encryption extends _subhslTa { - /** - * The server-side encryption algorithm used when storing job results in Amazon S3 - * (for example, AES256, aws:kms ). - * - * This member is required. - */ - encryptionType: ServerSideEncryption - /** - * If the encryption type is aws:kms , this optional value can be used to specify - * the encryption context for the restore results. - */ - kmsContext?: string - /** - * If the encryption type is aws:kms , this optional value specifies the ID of the - * symmetric encryption customer managed key to use for encryption of job results. - * Amazon S3 only supports symmetric encryption KMS keys. For more information, see - * [Asymmetric keys in KMS]in the Amazon Web Services Key Management Service Developer Guide. - * - * [Asymmetric keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html - */ - kmsKeyId?: string - } - /** - * Specifies encryption-related information for an Amazon S3 bucket that is a - * destination for replicated objects. - * - * If you're specifying a customer managed KMS key, we recommend using a fully - * qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the - * key within the requester’s account. This behavior can result in data that's - * encrypted with a KMS key that belongs to the requester, and not the bucket - * owner. - */ - type _subQHKNO = noSmithyDocumentSerde - interface EncryptionConfiguration extends _subQHKNO { - /** - * Specifies the ID (Key ARN or Alias ARN) of the customer managed Amazon Web - * Services KMS key stored in Amazon Web Services Key Management Service (KMS) for - * the destination bucket. Amazon S3 uses this key to encrypt replica objects. - * Amazon S3 only supports symmetric encryption KMS keys. For more information, see - * [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. - * - * [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html - */ - replicaKmsKeyID?: string - } - /** - * Specifies the Amazon S3 object key name to filter on. An object key name is the - * name assigned to an object in your Amazon S3 bucket. You specify whether to - * filter on the suffix or prefix of the object key name. A prefix is a specific - * string of characters at the beginning of an object key name, which you can use - * to organize objects. For example, you can start the key names of related objects - * with a prefix, such as 2023- or engineering/ . Then, you can use FilterRule to - * find objects in a bucket with key names that have the same prefix. A suffix is - * similar to a prefix, but it is at the end of the object key name instead of at - * the beginning. - */ - type _subZWWhB = noSmithyDocumentSerde - interface FilterRule extends _subZWWhB { - /** - * The object key name prefix or suffix identifying one or more objects to which - * the filtering rule applies. The maximum length is 1,024 characters. Overlapping - * prefixes and suffixes are not supported. For more information, see [Configuring Event Notifications]in the - * Amazon S3 User Guide. - * - * [Configuring Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - */ - name: FilterRuleName - /** - * The value that the filter searches for in object key names. - */ - value?: string - } - /** - * Contains the type of server-side encryption used to encrypt the inventory - * results. - */ - type _submkDBV = noSmithyDocumentSerde - interface InventoryEncryption extends _submkDBV { - /** - * Specifies the use of SSE-KMS to encrypt delivered inventory reports. - */ - ssekms?: SSEKMS - /** - * Specifies the use of SSE-S3 to encrypt delivered inventory reports. - */ - sses3?: SSES3 - } - /** - * A metadata key-value pair to store with an object. - */ - type _subiEQYR = noSmithyDocumentSerde - interface MetadataEntry extends _subiEQYR { - /** - * Name of the object. - */ - name?: string - /** - * Value of the object. - */ - value?: string - } - /** - * ``` - * A container specifying replication metrics-related settings enabling - * ``` - * - * replication metrics and events. - */ - type _subWYKpu = noSmithyDocumentSerde - interface Metrics extends _subWYKpu { - /** - * Specifies whether the replication metrics are enabled. - * - * This member is required. - */ - status: MetricsStatus - /** - * A container specifying the time threshold for emitting the - * s3:Replication:OperationMissedThreshold event. - */ - eventThreshold?: ReplicationTimeValue - } - /** - * A filter that you can specify for selection for modifications on replicas. - * Amazon S3 doesn't replicate replica modifications by default. In the latest - * version of replication configuration (when Filter is specified), you can - * specify this element and set the status to Enabled to replicate modifications - * on replicas. - * - * If you don't specify the Filter element, Amazon S3 assumes that the replication - * configuration is the earlier version, V1. In the earlier version, this element - * is not allowed. - */ - type _subCFAvR = noSmithyDocumentSerde - interface ReplicaModifications extends _subCFAvR { - /** - * Specifies whether Amazon S3 replicates modifications on replicas. - * - * This member is required. - */ - status: ReplicaModificationsStatus - } - /** - * ``` - * A container specifying S3 Replication Time Control (S3 RTC) related - * ``` - * - * information, including whether S3 RTC is enabled and the time when all objects - * and operations on objects must be replicated. Must be specified together with a - * Metrics block. - */ - type _sublFYgy = noSmithyDocumentSerde - interface ReplicationTime extends _sublFYgy { - /** - * Specifies whether the replication time is enabled. - * - * This member is required. - */ - status: ReplicationTimeStatus - /** - * A container specifying the time by which replication should be complete for - * all objects and operations on objects. - * - * This member is required. - */ - time?: ReplicationTimeValue - } - /** - * A container for filter information for the selection of S3 objects encrypted - * with Amazon Web Services KMS. - */ - type _suboeYHh = noSmithyDocumentSerde - interface SseKmsEncryptedObjects extends _suboeYHh { - /** - * Specifies whether Amazon S3 replicates objects created with server-side - * encryption using an Amazon Web Services KMS key stored in Amazon Web Services - * Key Management Service. - * - * This member is required. - */ - status: SseKmsEncryptedObjectsStatus - } -} - -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { - /** - * InstrumentOptions represents configuration for an instrument. - */ - interface InstrumentOptions { - unitLabel: string - description: string - } + import loginternal = internal /** - * Int64Observer is the interface passed to async int64 instruments. - * - * Callers use the Observe() API of this interface to report metrics to the - * underlying collector. + * Kind is the kind of a [Value]. */ - interface Int64Observer { - [key:string]: any; - observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void + interface Kind extends Number{} + interface Kind { + string(): string } /** - * Float64Observer is the interface passed to async int64 instruments. + * A LogValuer is any Go value that can convert itself into a Value for logging. * - * Callers use the Observe() API of this interface to report metrics to the - * underlying collector. + * This mechanism may be used to defer expensive operations until they are + * needed, or to expand a single value into a sequence of components. */ - interface Float64Observer { + interface LogValuer { [key:string]: any; - observe(_arg0: context.Context, _arg1: number, ..._arg2: RecordMetricOption[]): void - } - /** - * RecordMetricOption applies configuration to a recorded metric. - */ - interface RecordMetricOption {(o: RecordMetricOptions): void } -} - -/** - * Package tracing defines tracing APIs to be used by Smithy clients. - */ -namespace tracing { - /** - * SpanStatus records the "success" state of an observed span. - */ - interface SpanStatus extends Number{} - /** - * SpanOptions represent configuration for span events. - */ - interface SpanOptions { - kind: SpanKind - properties: smithy.Properties - } - /** - * EventOption applies configuration to a span event. - */ - interface EventOption {(o: EventOptions): void } - /** - * SpanContext uniquely identifies a Span. - */ - interface SpanContext { - traceID: string - spanID: string - isRemote: boolean - } - interface SpanContext { - /** - * IsValid is true when a span has nonzero trace and span IDs. - */ - isValid(): boolean - } -} - -namespace types { - interface FilterRuleName extends String{} - interface FilterRuleName { - /** - * Values returns all known values for FilterRuleName. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface MetricsStatus extends String{} - interface MetricsStatus { - /** - * Values returns all known values for MetricsStatus. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface OwnerOverride extends String{} - interface OwnerOverride { - /** - * Values returns all known values for OwnerOverride. Note that this can be - * expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ReplicaModificationsStatus extends String{} - interface ReplicaModificationsStatus { - /** - * Values returns all known values for ReplicaModificationsStatus. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface ReplicationTimeStatus extends String{} - interface ReplicationTimeStatus { - /** - * Values returns all known values for ReplicationTimeStatus. Note that this can - * be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - interface SseKmsEncryptedObjectsStatus extends String{} - interface SseKmsEncryptedObjectsStatus { - /** - * Values returns all known values for SseKmsEncryptedObjectsStatus. Note that - * this can be expanded in the future, and so it is only as up to date as the - * client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array - } - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithydocument = document - /** - * Contains information about where to publish the analytics results. - */ - type _subDFCCP = noSmithyDocumentSerde - interface AnalyticsS3BucketDestination extends _subDFCCP { - /** - * The Amazon Resource Name (ARN) of the bucket to which data is exported. - * - * This member is required. - */ - bucket?: string - /** - * Specifies the file format used when exporting data to Amazon S3. - * - * This member is required. - */ - format: AnalyticsS3ExportFileFormat - /** - * The account ID that owns the destination S3 bucket. If no account ID is - * provided, the owner is not validated before exporting data. - * - * Although this value is optional, we strongly recommend that you set it to help - * prevent problems if the destination bucket ownership changes. - */ - bucketAccountId?: string - /** - * The prefix to use when exporting data. The prefix is prepended to all results. - */ - prefix?: string - } - /** - * ``` - * A container specifying the time value for S3 Replication Time Control (S3 RTC) - * ``` - * - * and replication metrics EventThreshold . - */ - type _subkIxFQ = noSmithyDocumentSerde - interface ReplicationTimeValue extends _subkIxFQ { - /** - * Contains an integer specifying time in minutes. - * - * Valid value: 15 - */ - minutes?: number - } - /** - * Specifies the use of SSE-KMS to encrypt delivered inventory reports. - */ - type _subelKLl = noSmithyDocumentSerde - interface SSEKMS extends _subelKLl { - /** - * Specifies the ID of the Key Management Service (KMS) symmetric encryption - * customer managed key to use for encrypting inventory reports. - * - * This member is required. - */ - keyId?: string - } - /** - * Specifies the use of SSE-S3 to encrypt delivered inventory reports. - */ - type _subyycin = noSmithyDocumentSerde - interface SSES3 extends _subyycin { - } -} - -/** - * Package metrics defines the metrics APIs used by Smithy clients. - */ -namespace metrics { - /** - * RecordMetricOptions represents configuration for a recorded metric. - */ - interface RecordMetricOptions { - properties: smithy.Properties - } -} - -/** - * Package tracing defines tracing APIs to be used by Smithy clients. - */ -namespace tracing { - /** - * SpanKind indicates the nature of the work being performed. - */ - interface SpanKind extends Number{} - /** - * EventOptions represent configuration for span events. - */ - interface EventOptions { - properties: smithy.Properties - } -} - -namespace types { - interface AnalyticsS3ExportFileFormat extends String{} - interface AnalyticsS3ExportFileFormat { - /** - * Values returns all known values for AnalyticsS3ExportFileFormat. Note that this - * can be expanded in the future, and so it is only as up to date as the client. - * - * The ordering of this slice is not guaranteed to be stable across updates. - */ - values(): Array + logValue(): Value } - // @ts-ignore - import smithy = smithy_go - // @ts-ignore - import smithydocument = document } diff --git a/tools/filesystem/filesystem.go b/tools/filesystem/filesystem.go index b3a3bc0c33..bb0e6ec3f9 100644 --- a/tools/filesystem/filesystem.go +++ b/tools/filesystem/filesystem.go @@ -20,6 +20,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/disintegration/imaging" "github.com/gabriel-vasile/mimetype" + "github.com/pocketbase/pocketbase/tools/filesystem/internal/s3lite" "github.com/pocketbase/pocketbase/tools/list" "gocloud.dev/blob" "gocloud.dev/blob/fileblob" @@ -47,25 +48,23 @@ func NewS3( cred := credentials.NewStaticCredentialsProvider(accessKey, secretKey, "") - cfg, err := config.LoadDefaultConfig(ctx, + cfg, err := config.LoadDefaultConfig( + ctx, config.WithCredentialsProvider(cred), config.WithRegion(region), - config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { - // ensure that the endpoint has url scheme for - // backward compatibility with v1 of the aws sdk - prefixedEndpoint := endpoint - if !strings.Contains(endpoint, "://") { - prefixedEndpoint = "https://" + endpoint - } - - return aws.Endpoint{URL: prefixedEndpoint, SigningRegion: region}, nil - })), ) if err != nil { return nil, err } client := s3.NewFromConfig(cfg, func(o *s3.Options) { + // ensure that the endpoint has url scheme for + // backward compatibility with v1 of the aws sdk + if !strings.Contains(endpoint, "://") { + endpoint = "https://" + endpoint + } + o.BaseEndpoint = aws.String(endpoint) + o.UsePathStyle = s3ForcePathStyle // Google Cloud Storage alters the Accept-Encoding header, @@ -76,7 +75,7 @@ func NewS3( } }) - bucket, err := OpenBucketV2(ctx, client, bucketName, nil) + bucket, err := s3lite.OpenBucketV2(ctx, client, bucketName, nil) if err != nil { return nil, err } diff --git a/tools/filesystem/s3_trimmed.go b/tools/filesystem/internal/s3lite/s3lite.go similarity index 82% rename from tools/filesystem/s3_trimmed.go rename to tools/filesystem/internal/s3lite/s3lite.go index a50e86587d..926d71334e 100644 --- a/tools/filesystem/s3_trimmed.go +++ b/tools/filesystem/internal/s3lite/s3lite.go @@ -66,7 +66,7 @@ // (V1) *s3.PutObjectInput; (V2) *s3v2.PutObjectInput, when Options.Method == http.MethodPut, or // (V1) *s3.DeleteObjectInput; (V2) [not supported] when Options.Method == http.MethodDelete -package filesystem +package s3lite import ( "context" @@ -82,7 +82,6 @@ import ( "strings" awsv2 "github.com/aws/aws-sdk-go-v2/aws" - awsv2cfg "github.com/aws/aws-sdk-go-v2/config" s3managerv2 "github.com/aws/aws-sdk-go-v2/feature/s3/manager" s3v2 "github.com/aws/aws-sdk-go-v2/service/s3" typesv2 "github.com/aws/aws-sdk-go-v2/service/s3/types" @@ -244,116 +243,8 @@ func URLUnescape(s string) string { // ------------------------------------------------------------------- -// UseV2 returns true iff the URL parameters indicate that the provider -// should use the AWS SDK v2. -// -// "awssdk=v1" will force V1. -// "awssdk=v2" will force V2. -// No "awssdk" parameter (or any other value) will return the default, currently V1. -// Note that the default may change in the future. -func UseV2(q url.Values) bool { - if values, ok := q["awssdk"]; ok { - if values[0] == "v2" || values[0] == "V2" { - return true - } - } - return false -} - -// NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options. -func NewDefaultV2Config(ctx context.Context) (awsv2.Config, error) { - return awsv2cfg.LoadDefaultConfig(ctx) -} - -// V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL -// parameters in q. It is intended to be used by URLOpeners for AWS services if -// UseV2 returns true. -// -// https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config -// -// It returns an error if q contains any unknown query parameters; callers -// should remove any query parameters they know about from q before calling -// V2ConfigFromURLParams. -// -// The following query options are supported: -// - region: The AWS region for requests; sets WithRegion. -// - profile: The shared config profile to use; sets SharedConfigProfile. -// - endpoint: The AWS service endpoint to send HTTP request. -func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, error) { - var opts []func(*awsv2cfg.LoadOptions) error - for param, values := range q { - value := values[0] - switch param { - case "region": - opts = append(opts, awsv2cfg.WithRegion(value)) - case "endpoint": - customResolver := awsv2.EndpointResolverWithOptionsFunc( - func(service, region string, options ...interface{}) (awsv2.Endpoint, error) { - return awsv2.Endpoint{ - PartitionID: "aws", - URL: value, - SigningRegion: region, - }, nil - }) - opts = append(opts, awsv2cfg.WithEndpointResolverWithOptions(customResolver)) - case "profile": - opts = append(opts, awsv2cfg.WithSharedConfigProfile(value)) - case "awssdk": - // ignore, should be handled before this - default: - return awsv2.Config{}, fmt.Errorf("unknown query parameter %q", param) - } - } - return awsv2cfg.LoadDefaultConfig(ctx, opts...) -} - -// ------------------------------------------------------------------- - const defaultPageSize = 1000 -func init() { - blob.DefaultURLMux().RegisterBucket(Scheme, new(urlSessionOpener)) -} - -type urlSessionOpener struct{} - -func (o *urlSessionOpener) OpenBucketURL(ctx context.Context, u *url.URL) (*blob.Bucket, error) { - opener := &URLOpener{UseV2: true} - return opener.OpenBucketURL(ctx, u) -} - -// Scheme is the URL scheme s3blob registers its URLOpener under on -// blob.DefaultMux. -const Scheme = "s3" - -// URLOpener opens S3 URLs like "s3://mybucket". -// -// The URL host is used as the bucket name. -// -// Use "awssdk=v1" to force using AWS SDK v1, "awssdk=v2" to force using AWS SDK v2, -// or anything else to accept the default. -// -// For V1, see gocloud.dev/aws/ConfigFromURLParams for supported query parameters -// for overriding the aws.Session from the URL. -// For V2, see gocloud.dev/aws/V2ConfigFromURLParams. -type URLOpener struct { - // UseV2 indicates whether the AWS SDK V2 should be used. - UseV2 bool - - // Options specifies the options to pass to OpenBucket. - Options Options -} - -// OpenBucketURL opens a blob.Bucket based on u. -func (o *URLOpener) OpenBucketURL(ctx context.Context, u *url.URL) (*blob.Bucket, error) { - cfg, err := V2ConfigFromURLParams(ctx, u.Query()) - if err != nil { - return nil, fmt.Errorf("open bucket %v: %v", u, err) - } - clientV2 := s3v2.NewFromConfig(cfg) - return OpenBucketV2(ctx, clientV2, u.Host, &o.Options) -} - // Options sets options for constructing a *blob.Bucket backed by fileblob. type Options struct { // UseLegacyList forces the use of ListObjects instead of ListObjectsV2. @@ -676,64 +567,6 @@ func (b *bucket) listObjectsV2(ctx context.Context, in *s3v2.ListObjectsV2Input, }, nil } -// func (b *bucket) listObjects(ctx context.Context, in *s3.ListObjectsV2Input, opts *driver.ListOptions) (*s3.ListObjectsV2Output, error) { -// if !b.useLegacyList { -// if opts.BeforeList != nil { -// asFunc := func(i interface{}) bool { -// if p, ok := i.(**s3.ListObjectsV2Input); ok { -// *p = in -// return true -// } -// return false -// } -// if err := opts.BeforeList(asFunc); err != nil { -// return nil, err -// } -// } -// return b.client.ListObjectsV2WithContext(ctx, in) -// } - -// // Use the legacy ListObjects request. -// legacyIn := &s3.ListObjectsInput{ -// Bucket: in.Bucket, -// Delimiter: in.Delimiter, -// EncodingType: in.EncodingType, -// Marker: in.ContinuationToken, -// MaxKeys: in.MaxKeys, -// Prefix: in.Prefix, -// RequestPayer: in.RequestPayer, -// } -// if opts.BeforeList != nil { -// asFunc := func(i interface{}) bool { -// p, ok := i.(**s3.ListObjectsInput) -// if !ok { -// return false -// } -// *p = legacyIn -// return true -// } -// if err := opts.BeforeList(asFunc); err != nil { -// return nil, err -// } -// } -// legacyResp, err := b.client.ListObjectsWithContext(ctx, legacyIn) -// if err != nil { -// return nil, err -// } - -// var nextContinuationToken *string -// if legacyResp.NextMarker != nil { -// nextContinuationToken = legacyResp.NextMarker -// } else if awsv2.ToBool(legacyResp.IsTruncated) { -// nextContinuationToken = awsv2.String(awsv2.ToString(legacyResp.Contents[len(legacyResp.Contents)-1].Key)) -// } -// return &s3.ListObjectsV2Output{ -// CommonPrefixes: legacyResp.CommonPrefixes, -// Contents: legacyResp.Contents, -// NextContinuationToken: nextContinuationToken, -// }, nil -// } - // As implements driver.As. func (b *bucket) As(i interface{}) bool { p, ok := i.(**s3v2.Client) From c4b1e2d55e98a32ff63f4f18ac14804043920256 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 17:08:02 +0300 Subject: [PATCH 10/44] updated changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9908c57d5a..b6394bfcfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ - Added deprecation log in case Instagram OAuth2 is used (_related to [#5652](https://github.com/pocketbase/pocketbase/discussions/5652)_). -- Added `update` command warning to prevent unnecessary downloading PocketBase v0.23.0 since it will contain breaking changes and it will fail anyway. +- Added `update` command warning to prevent unnecessary downloading PocketBase v0.23.0 since it will contain breaking changes. - Added global JSVM `toString()` helper (_successor of `readerToString()`_) to stringify any value (bool, number, multi-byte array, io.Reader, etc.). _`readerToString` is still available but it is marked as deprecated. You can also use `toString` as replacement for of `String.fromCharCode` to properly stringify multi-byte unicode characters like emojis._ @@ -10,6 +10,8 @@ decodeURIComponent(escape(String.fromCharCode(...bytes))) -> toString(bytes) ``` +- Updated `aws-sdk-go-v2` and removed deprecated `WithEndpointResolverWithOptions`. + - Backported some of the v0.23.0-rc form validators, fixes and tests. - Bumped GitHub action min Go version and dependencies. From 0b304351830a6b8d1254f9ed69f9991c0247243b Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 18 Oct 2024 17:09:55 +0300 Subject: [PATCH 11/44] updated go.mod --- go.mod | 1 - go.sum | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 388f761ac2..9d58818864 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,6 @@ require ( github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index 8234ea16ad..bfe48431b2 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,6 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8= -github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 h1:70PVAiL15/aBMh5LThwgXdSQorVr91L127ttckI9QQU= @@ -63,8 +61,7 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfO github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wINh+4UK+k/0Yo/q8= github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= -github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= -github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -164,7 +161,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -343,7 +339,6 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From cd14714cf31acc796387c7617f58c84b89f1038c Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 3 Nov 2024 11:11:23 +0200 Subject: [PATCH 12/44] updated npm deps --- ui/.env | 2 +- ...OKfHUKA.js => AuthMethodsDocs-DifPdWR1.js} | 8 +- ...OQHyuHB.js => AuthRefreshDocs-CdUir8-r.js} | 12 +- ...gvnJ.js => AuthWithOAuth2Docs-C9IystLV.js} | 14 +- ...Rc.js => AuthWithPasswordDocs-CaL3O2uX.js} | 20 +- ui/dist/assets/CodeEditor-97oGZhvg.js | 14 + ui/dist/assets/CodeEditor-C-zHBmhQ.js | 14 - ....js => ConfirmEmailChangeDocs-T4e4Bmxi.js} | 6 +- ...s => ConfirmPasswordResetDocs-DCQFPDN7.js} | 6 +- ...js => ConfirmVerificationDocs-BKx9x0MU.js} | 6 +- ui/dist/assets/CreateApiDocs-cTL4BTwH.js | 92 ++ ui/dist/assets/CreateApiDocs-jPKcVL6M.js | 92 -- ...-EnRun5cS.js => DeleteApiDocs-C521Da9d.js} | 8 +- ...7BgfEJ.js => FieldsQueryParam-DB2XHXnv.js} | 4 +- ...js => FilterAutocompleteInput-CFHe_5bb.js} | 2 +- ...-DhdAtA7Y.css => ListApiDocs-ByASLUZu.css} | 0 ...cs-bZ1-xl-p.js => ListApiDocs-CtNZ5G9D.js} | 2 +- ...0.js => ListExternalAuthsDocs-DCCFJUK6.js} | 12 +- ...PageAdminConfirmPasswordReset-C5ZKwumu.js} | 4 +- .../PageAdminRequestPasswordReset-DnoMIZGu.js | 1 + .../PageAdminRequestPasswordReset-vLynAsfN.js | 1 - ... => PageOAuth2RedirectFailure-Da-UeZbe.js} | 2 +- ... => PageOAuth2RedirectSuccess-BBB69FeN.js} | 2 +- ... PageRecordConfirmEmailChange-D9_-dnhk.js} | 4 +- ...ageRecordConfirmPasswordReset-CP5c1DP1.js} | 4 +- ...PageRecordConfirmVerification-CfCN5jko.js} | 2 +- ...dn0UuCF.js => RealtimeApiDocs-DlyauiFo.js} | 10 +- ....js => RequestEmailChangeDocs-DmKjgrzy.js} | 6 +- ...s => RequestPasswordResetDocs-CCrC-X-J.js} | 12 +- .../RequestVerificationDocs-B3KxCvqw.js | 44 + .../RequestVerificationDocs-BXzC-pWX.js | 44 - ui/dist/assets/SdkTabs-C9BIEbpG.js | 1 + ...Tabs-lBWmLVyw.css => SdkTabs-CSWLpEgj.css} | 0 ui/dist/assets/SdkTabs-DJGq8srX.js | 1 - ....js => UnlinkExternalAuthDocs-4JM4cUB_.js} | 12 +- ...-DGrQC-Ly.js => UpdateApiDocs-B4w33bkJ.js} | 16 +- ...cs-iCTJquUd.js => ViewApiDocs-Bt5koN3Z.js} | 16 +- .../assets/autocomplete.worker-CGnTjHzG.js | 4 + .../assets/autocomplete.worker-Dy9W6Fpj.js | 4 - .../{index-rLaTJP5R.js => index-B6GxOPDi.js} | 114 +-- ui/dist/assets/index-BJXhcZ8-.js | 14 + ui/dist/assets/index-BztyTJOx.js | 14 - ...{index-DpAp7TiX.css => index-CyfS9YzQ.css} | 0 ui/dist/index.html | 4 +- ui/package-lock.json | 952 +++++++++++++----- 45 files changed, 1006 insertions(+), 596 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-DOKfHUKA.js => AuthMethodsDocs-DifPdWR1.js} (62%) rename ui/dist/assets/{AuthRefreshDocs-DOQHyuHB.js => AuthRefreshDocs-CdUir8-r.js} (73%) rename ui/dist/assets/{AuthWithOAuth2Docs-sv1YgvnJ.js => AuthWithOAuth2Docs-C9IystLV.js} (78%) rename ui/dist/assets/{AuthWithPasswordDocs-Dpy8EoRc.js => AuthWithPasswordDocs-CaL3O2uX.js} (72%) create mode 100644 ui/dist/assets/CodeEditor-97oGZhvg.js delete mode 100644 ui/dist/assets/CodeEditor-C-zHBmhQ.js rename ui/dist/assets/{ConfirmEmailChangeDocs-DG3NuEPP.js => ConfirmEmailChangeDocs-T4e4Bmxi.js} (64%) rename ui/dist/assets/{ConfirmPasswordResetDocs-CFOUXiAS.js => ConfirmPasswordResetDocs-DCQFPDN7.js} (70%) rename ui/dist/assets/{ConfirmVerificationDocs-CPe-dhLl.js => ConfirmVerificationDocs-BKx9x0MU.js} (62%) create mode 100644 ui/dist/assets/CreateApiDocs-cTL4BTwH.js delete mode 100644 ui/dist/assets/CreateApiDocs-jPKcVL6M.js rename ui/dist/assets/{DeleteApiDocs-EnRun5cS.js => DeleteApiDocs-C521Da9d.js} (60%) rename ui/dist/assets/{FieldsQueryParam-Bw7BgfEJ.js => FieldsQueryParam-DB2XHXnv.js} (67%) rename ui/dist/assets/{FilterAutocompleteInput-BPeaOUvB.js => FilterAutocompleteInput-CFHe_5bb.js} (70%) rename ui/dist/assets/{ListApiDocs-DhdAtA7Y.css => ListApiDocs-ByASLUZu.css} (100%) rename ui/dist/assets/{ListApiDocs-bZ1-xl-p.js => ListApiDocs-CtNZ5G9D.js} (98%) rename ui/dist/assets/{ListExternalAuthsDocs-CGAfo9a0.js => ListExternalAuthsDocs-DCCFJUK6.js} (60%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-vRRTYNd2.js => PageAdminConfirmPasswordReset-C5ZKwumu.js} (53%) create mode 100644 ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js delete mode 100644 ui/dist/assets/PageAdminRequestPasswordReset-vLynAsfN.js rename ui/dist/assets/{PageOAuth2RedirectFailure-B-zxwuJd.js => PageOAuth2RedirectFailure-Da-UeZbe.js} (53%) rename ui/dist/assets/{PageOAuth2RedirectSuccess-BusSuTAQ.js => PageOAuth2RedirectSuccess-BBB69FeN.js} (73%) rename ui/dist/assets/{PageRecordConfirmEmailChange-B7npCYXU.js => PageRecordConfirmEmailChange-D9_-dnhk.js} (84%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-Bjhn5ho5.js => PageRecordConfirmPasswordReset-CP5c1DP1.js} (91%) rename ui/dist/assets/{PageRecordConfirmVerification-D66thJgG.js => PageRecordConfirmVerification-CfCN5jko.js} (74%) rename ui/dist/assets/{RealtimeApiDocs-Bdn0UuCF.js => RealtimeApiDocs-DlyauiFo.js} (90%) rename ui/dist/assets/{RequestEmailChangeDocs-BDG1xZdQ.js => RequestEmailChangeDocs-DmKjgrzy.js} (68%) rename ui/dist/assets/{RequestPasswordResetDocs-Csllfzv-.js => RequestPasswordResetDocs-CCrC-X-J.js} (57%) create mode 100644 ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js delete mode 100644 ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js create mode 100644 ui/dist/assets/SdkTabs-C9BIEbpG.js rename ui/dist/assets/{SdkTabs-lBWmLVyw.css => SdkTabs-CSWLpEgj.css} (100%) delete mode 100644 ui/dist/assets/SdkTabs-DJGq8srX.js rename ui/dist/assets/{UnlinkExternalAuthDocs-Cm7HyxiF.js => UnlinkExternalAuthDocs-4JM4cUB_.js} (56%) rename ui/dist/assets/{UpdateApiDocs-DGrQC-Ly.js => UpdateApiDocs-B4w33bkJ.js} (83%) rename ui/dist/assets/{ViewApiDocs-iCTJquUd.js => ViewApiDocs-Bt5koN3Z.js} (69%) create mode 100644 ui/dist/assets/autocomplete.worker-CGnTjHzG.js delete mode 100644 ui/dist/assets/autocomplete.worker-Dy9W6Fpj.js rename ui/dist/assets/{index-rLaTJP5R.js => index-B6GxOPDi.js} (60%) create mode 100644 ui/dist/assets/index-BJXhcZ8-.js delete mode 100644 ui/dist/assets/index-BztyTJOx.js rename ui/dist/assets/{index-DpAp7TiX.css => index-CyfS9YzQ.css} (100%) diff --git a/ui/.env b/ui/.env index fee840e230..768c582d51 100644 --- a/ui/.env +++ b/ui/.env @@ -9,4 +9,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/" PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk" PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk" PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases" -PB_VERSION = "v0.22.22" +PB_VERSION = "v0.22.23" diff --git a/ui/dist/assets/AuthMethodsDocs-DOKfHUKA.js b/ui/dist/assets/AuthMethodsDocs-DifPdWR1.js similarity index 62% rename from ui/dist/assets/AuthMethodsDocs-DOKfHUKA.js rename to ui/dist/assets/AuthMethodsDocs-DifPdWR1.js index c8ba1da674..1bc6986bca 100644 --- a/ui/dist/assets/AuthMethodsDocs-DOKfHUKA.js +++ b/ui/dist/assets/AuthMethodsDocs-DifPdWR1.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Ae,O as G,e as c,v as w,b as k,c as se,f as p,g as d,h as a,m as ae,w as U,P as ve,Q as Te,k as je,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,A as Qe,q as L,r as Ne,N as qe}from"./index-rLaTJP5R.js";import{S as He}from"./SdkTabs-DJGq8srX.js";import{F as Ke}from"./FieldsQueryParam-Bw7BgfEJ.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,q=n[0].name+"",E,ie,I,P,J,T,Y,$,H,ce,K,j,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,A,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new He({props:{js:` +import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-B6GxOPDi.js";import{S as Ke}from"./SdkTabs-C9BIEbpG.js";import{F as qe}from"./FieldsQueryParam-DB2XHXnv.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); @@ -14,7 +14,7 @@ import{S as Se,i as ye,s as Ae,O as G,e as c,v as w,b as k,c as se,f as p,g as d ... final result = await pb.collection('${(ke=n[0])==null?void 0:ke.name}').listAuthMethods(); - `}}),A=new Ke({});let D=G(n[2]);const pe=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description',ue=k(),te=c("tbody"),se(A.$$.fragment),le=k(),O=c("div"),O.textContent="Responses",oe=k(),S=c("div"),F=c("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description',ue=k(),te=c("tbody"),se(T.$$.fragment),le=k(),O=c("div"),O.textContent="Responses",oe=k(),S=c("div"),F=c("div");for(let e=0;eo(1,f=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Fe.getApiExampleUrl(Qe.baseUrl)),o(2,i=[{code:200,body:` + `),P.$set(r),(!y||t&1)&&z!==(z=e[0].name+"")&&U(X,z),t&6&&(D=G(e[2]),g=ve(g,t,pe,1,e,D,he,F,je,$e,null,Pe)),t&6&&(N=G(e[2]),Ae(),b=ve(b,t,_e,1,e,N,fe,Q,Be,Me,null,Ce),Oe())},i(e){if(!y){W(P.$$.fragment,e),W(T.$$.fragment,e);for(let t=0;to(1,f=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Fe.getApiExampleUrl(Qe.baseUrl)),o(2,i=[{code:200,body:` { "usernamePassword": true, "emailPassword": true, @@ -61,4 +61,4 @@ import{S as Se,i as ye,s as Ae,O as G,e as c,v as w,b as k,c as se,f as p,g as d } ] } - `}]),[_,f,i,s,h]}class Ve extends Se{constructor(l){super(),ye(this,l,De,ze,Ae,{collection:0})}}export{Ve as default}; + `}]),[_,f,i,s,h]}class Ve extends Se{constructor(l){super(),ye(this,l,De,ze,Te,{collection:0})}}export{Ve as default}; diff --git a/ui/dist/assets/AuthRefreshDocs-DOQHyuHB.js b/ui/dist/assets/AuthRefreshDocs-CdUir8-r.js similarity index 73% rename from ui/dist/assets/AuthRefreshDocs-DOQHyuHB.js rename to ui/dist/assets/AuthRefreshDocs-CdUir8-r.js index ea9ea4c894..cb6d34ed17 100644 --- a/ui/dist/assets/AuthRefreshDocs-DOQHyuHB.js +++ b/ui/dist/assets/AuthRefreshDocs-CdUir8-r.js @@ -1,4 +1,4 @@ -import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,v as k,b as p,c as K,f as b,g as d,h as o,m as I,w as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,A as Xe,q as G,r as Ye}from"./index-rLaTJP5R.js";import{S as Ze}from"./SdkTabs-DJGq8srX.js";import{F as et}from"./FieldsQueryParam-Bw7BgfEJ.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,z,ue,Q,M,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],qe=new Map,q;v=new Ze({props:{js:` +import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-B6GxOPDi.js";import{S as Ze}from"./SdkTabs-C9BIEbpG.js";import{F as et}from"./FieldsQueryParam-DB2XHXnv.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function xe(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,Q=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); @@ -24,15 +24,15 @@ import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,v as k,b as p,c as K,f as b print(pb.authStore.isValid); print(pb.authStore.token); print(pb.authStore.model.id); - `}}),R=new Ue({props:{content:"?expand=relField1,relField2.subRelField"}}),A=new et({props:{prefix:"record."}});let x=J(r[2]);const Be=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eReturns a new auth response (token and record data) for an + `}}),R=new Qe({props:{content:"?expand=relField1,relField2.subRelField"}}),A=new et({props:{prefix:"record."}});let j=J(r[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eReturns a new auth response (token and record data) for an already authenticated record.

    This method is usually called by users on page/screen reload to ensure that the previously stored - data in pb.authStore is still valid and up-to-date.

    `,g=p(),K(v.$$.fragment),w=p(),B=s("h6"),B.textContent="API details",X=p(),S=s("div"),z=s("strong"),z.textContent="POST",ue=p(),Q=s("div"),M=s("p"),pe=k("/api/collections/"),Y=s("strong"),Z=k(U),he=k("/auth-refresh"),fe=p(),j=s("p"),j.innerHTML="Requires record Authorization:TOKEN header",ee=p(),D=s("div"),D.textContent="Query parameters",te=p(),T=s("table"),oe=s("thead"),oe.innerHTML='Param Type Description',be=p(),F=s("tbody"),C=s("tr"),le=s("td"),le.textContent="expand",me=p(),ae=s("td"),ae.innerHTML='String',_e=p(),f=s("td"),ke=k(`Auto expand record relations. Ex.: + data in pb.authStore is still valid and up-to-date.

    `,g=p(),K(v.$$.fragment),w=p(),M=s("h6"),M.textContent="API details",X=p(),S=s("div"),x=s("strong"),x.textContent="POST",ue=p(),z=s("div"),q=s("p"),pe=k("/api/collections/"),Y=s("strong"),Z=k(Q),he=k("/auth-refresh"),fe=p(),U=s("p"),U.innerHTML="Requires record Authorization:TOKEN header",ee=p(),D=s("div"),D.textContent="Query parameters",te=p(),T=s("table"),oe=s("thead"),oe.innerHTML='Param Type Description',be=p(),F=s("tbody"),C=s("tr"),le=s("td"),le.textContent="expand",me=p(),ae=s("td"),ae.innerHTML='String',_e=p(),f=s("td"),ke=k(`Auto expand record relations. Ex.: `),K(R.$$.fragment),ge=k(` Supports up to 6-levels depth nested relations expansion. `),ve=s("br"),$e=k(` The expanded relations will be appended to the record under the `),se=s("code"),se.textContent="expand",ye=k(" property (eg. "),ne=s("code"),ne.textContent='"expand": {"relField1": {...}, ...}',Se=k(`). `),we=s("br"),Te=k(` - Only the relations to which the request user has permissions to `),re=s("strong"),re.textContent="view",Ce=k(" will be expanded."),Pe=p(),K(A.$$.fragment),ie=p(),O=s("div"),O.textContent="Responses",ce=p(),P=s("div"),H=s("div");for(let e=0;ea(1,_=g.code);return r.$$set=g=>{"collection"in g&&a(0,m=g.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Le.dummyCollectionRecord(m)},null,2)},{code:401,body:` + `),v.$set(c),(!B||t&1)&&Q!==(Q=e[0].name+"")&&de(Z,Q),t&6&&(j=J(e[2]),y=Ee(y,t,Me,1,e,j,Re,H,Ke,xe,null,Ve)),t&6&&(L=J(e[2]),Ie(),$=Ee($,t,qe,1,e,L,Be,E,We,ze,null,Ne),Ge())},i(e){if(!B){N(v.$$.fragment,e),N(R.$$.fragment,e),N(A.$$.fragment,e);for(let t=0;ta(1,_=g.code);return r.$$set=g=>{"collection"in g&&a(0,m=g.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Le.dummyCollectionRecord(m)},null,2)},{code:401,body:` { "code": 401, "message": "The request requires valid record authorization token to be set.", @@ -76,4 +76,4 @@ import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,v as k,b as p,c as K,f as b "message": "Missing auth record context.", "data": {} } - `}])},a(3,n=Le.getApiExampleUrl(Xe.baseUrl)),[m,_,i,n,h]}class nt extends je{constructor(l){super(),xe(this,l,ot,tt,Je,{collection:0})}}export{nt as default}; + `}])},a(3,n=Le.getApiExampleUrl(Xe.baseUrl)),[m,_,i,n,h]}class nt extends Ue{constructor(l){super(),je(this,l,ot,tt,Je,{collection:0})}}export{nt as default}; diff --git a/ui/dist/assets/AuthWithOAuth2Docs-sv1YgvnJ.js b/ui/dist/assets/AuthWithOAuth2Docs-C9IystLV.js similarity index 78% rename from ui/dist/assets/AuthWithOAuth2Docs-sv1YgvnJ.js rename to ui/dist/assets/AuthWithOAuth2Docs-C9IystLV.js index 0a114716f7..254813757b 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-sv1YgvnJ.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-C9IystLV.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,v as k,b as h,c as I,f as p,g as r,h as a,m as K,w as pe,P as Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,A as Ke,q as X,r as Ge}from"./index-rLaTJP5R.js";import{S as Xe}from"./SdkTabs-DJGq8srX.js";import{F as Ye}from"./FieldsQueryParam-Bw7BgfEJ.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,m;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(m=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,m()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,m){r(d,n,m),K(i,n,null),a(n,f),g=!0},p(d,m){l=d;const _={};m&4&&(_.content=l[5].body),i.$set(_),(!g||m&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,m,_,v,O,P,Y,A,J,me,N,R,be,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,b,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Ne,k as Qe,R as ze,n as Ie,t as L,a as x,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-B6GxOPDi.js";import{S as Xe}from"./SdkTabs-C9BIEbpG.js";import{F as Ye}from"./FieldsQueryParam-DB2XHXnv.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,E,be,J,R,me,Z,N=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); @@ -45,18 +45,18 @@ import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,v as k,b as h,c as I,f as p // "logout" the last authenticated model pb.authStore.clear(); - `}}),C=new Le({props:{content:"?expand=relField1,relField2.subRelField"}}),q=new Ye({props:{prefix:"record."}});let x=z(s[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthenticate with an OAuth2 provider and returns a new auth token and record data.

    For more details please check the + `}}),C=new Le({props:{content:"?expand=relField1,relField2.subRelField"}}),q=new Ye({props:{prefix:"record."}});let Q=z(s[2]);const Me=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthenticate with an OAuth2 provider and returns a new auth token and record data.

    For more details please check the OAuth2 integration documentation - .

    `,_=h(),I(v.$$.fragment),O=h(),P=o("h6"),P.textContent="API details",Y=h(),A=o("div"),J=o("strong"),J.textContent="POST",me=h(),N=o("div"),R=o("p"),be=k("/api/collections/"),Z=o("strong"),ee=k(Q),fe=k("/auth-with-oauth2"),te=h(),M=o("div"),M.textContent="Body Parameters",ae=h(),W=o("table"),W.innerHTML=`Param Type Description
    Required provider
    String The name of the OAuth2 client provider (eg. "google").
    Required code
    String The authorization code returned from the initial request.
    Required codeVerifier
    String The code verifier sent with the initial request as part of the code_challenge.
    Required redirectUrl
    String The redirect url sent with the initial request.
    Optional createData
    Object

    Optional data that will be used when creating the auth record on OAuth2 sign-up.

    The created auth record must comply with the same requirements and validations in the + .

    `,_=h(),I(v.$$.fragment),O=h(),P=o("h6"),P.textContent="API details",Y=h(),A=o("div"),E=o("strong"),E.textContent="POST",be=h(),J=o("div"),R=o("p"),me=k("/api/collections/"),Z=o("strong"),ee=k(N),fe=k("/auth-with-oauth2"),te=h(),M=o("div"),M.textContent="Body Parameters",ae=h(),W=o("table"),W.innerHTML=`Param Type Description
    Required provider
    String The name of the OAuth2 client provider (eg. "google").
    Required code
    String The authorization code returned from the initial request.
    Required codeVerifier
    String The code verifier sent with the initial request as part of the code_challenge.
    Required redirectUrl
    String The redirect url sent with the initial request.
    Optional createData
    Object

    Optional data that will be used when creating the auth record on OAuth2 sign-up.

    The created auth record must comply with the same requirements and validations in the regular create action.
    The data can only be in json, aka. multipart/form-data and files - upload currently are not supported during OAuth2 sign-ups.

    `,le=h(),U=o("div"),U.textContent="Query parameters",ne=h(),S=o("table"),oe=o("thead"),oe.innerHTML='Param Type Description',ge=h(),B=o("tbody"),y=o("tr"),se=o("td"),se.textContent="expand",ke=h(),ie=o("td"),ie.innerHTML='String',_e=h(),b=o("td"),ve=k(`Auto expand record relations. Ex.: + upload currently are not supported during OAuth2 sign-ups.

    `,le=h(),U=o("div"),U.textContent="Query parameters",ne=h(),S=o("table"),oe=o("thead"),oe.innerHTML='Param Type Description',ge=h(),B=o("tbody"),y=o("tr"),se=o("td"),se.textContent="expand",ke=h(),ie=o("td"),ie.innerHTML='String',_e=h(),m=o("td"),ve=k(`Auto expand record relations. Ex.: `),I(C.$$.fragment),we=k(` Supports up to 6-levels depth nested relations expansion. `),$e=o("br"),Oe=k(` The expanded relations will be appended to the record under the `),re=o("code"),re.textContent="expand",Ae=k(" property (eg. "),ce=o("code"),ce.textContent='"expand": {"relField1": {...}, ...}',Se=k(`). `),ye=o("br"),Te=k(` - Only the relations to which the request user has permissions to `),de=o("strong"),de.textContent="view",Ce=k(" will be expanded."),qe=h(),I(q.$$.fragment),ue=h(),F=o("div"),F.textContent="Responses",he=h(),T=o("div"),H=o("div");for(let e=0;e<$.length;e+=1)$[e].c();Pe=h(),j=o("div");for(let e=0;en(1,g=_.code);return s.$$set=_=>{"collection"in _&&n(0,f=_.collection)},s.$$.update=()=>{s.$$.dirty&1&&n(2,d=[{code:200,body:JSON.stringify({token:"JWT_AUTH_TOKEN",record:Be.dummyCollectionRecord(f),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png",accessToken:"...",refreshToken:"...",rawUser:{}}},null,2)},{code:400,body:` + `),v.$set(u),(!D||t&1)&&N!==(N=e[0].name+"")&&pe(ee,N),t&6&&(Q=z(e[2]),$=Ue($,t,Me,1,e,Q,De,H,Ne,je,null,He)),t&6&&(V=z(e[2]),Qe(),w=Ue(w,t,We,1,e,V,Re,j,ze,Ve,null,Fe),Ie())},i(e){if(!D){L(v.$$.fragment,e),L(C.$$.fragment,e),L(q.$$.fragment,e);for(let t=0;tn(1,g=_.code);return s.$$set=_=>{"collection"in _&&n(0,f=_.collection)},s.$$.update=()=>{s.$$.dirty&1&&n(2,d=[{code:200,body:JSON.stringify({token:"JWT_AUTH_TOKEN",record:Be.dummyCollectionRecord(f),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png",accessToken:"...",refreshToken:"...",rawUser:{}}},null,2)},{code:400,body:` { "code": 400, "message": "An error occurred while submitting the form.", @@ -114,4 +114,4 @@ import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,v as k,b as h,c as I,f as p } } } - `}])},n(3,i=Be.getApiExampleUrl(Ke.baseUrl)),[f,g,d,i,m]}class nt extends Ee{constructor(l){super(),Je(this,l,et,Ze,Ne,{collection:0})}}export{nt as default}; + `}])},n(3,i=Be.getApiExampleUrl(Ke.baseUrl)),[f,g,d,i,b]}class nt extends xe{constructor(l){super(),Ee(this,l,et,Ze,Je,{collection:0})}}export{nt as default}; diff --git a/ui/dist/assets/AuthWithPasswordDocs-Dpy8EoRc.js b/ui/dist/assets/AuthWithPasswordDocs-CaL3O2uX.js similarity index 72% rename from ui/dist/assets/AuthWithPasswordDocs-Dpy8EoRc.js rename to ui/dist/assets/AuthWithPasswordDocs-CaL3O2uX.js index e5697a8d68..f18cd0f8d1 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-Dpy8EoRc.js +++ b/ui/dist/assets/AuthWithPasswordDocs-CaL3O2uX.js @@ -1,4 +1,4 @@ -import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,v as p,b as d,c as ne,f as m,g as r,h as t,m as se,w as De,P as pt,Q as Pt,k as Rt,R as At,n as Ct,t as Z,a as x,o as c,d as ie,C as ft,A as Ot,q as re,r as Tt}from"./index-rLaTJP5R.js";import{S as Ut}from"./SdkTabs-DJGq8srX.js";import{F as Mt}from"./FieldsQueryParam-Bw7BgfEJ.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,A){r(R,a,A),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,A){l=R,A&16&&i!==(i=l[8].code+"")&&De(g,i),A&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,A,C,q,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,qe,he,V,be,M,me,Be,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ae,Qe,k,je,B,Je,Ke,ze,Ce,Ge,Oe,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,O=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` +import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as m,g as r,h as t,m as se,x as De,P as pt,Q as Pt,k as Rt,R as Ct,n as Ot,t as Z,a as x,o as c,d as ie,C as ft,p as At,r as re,u as Tt}from"./index-B6GxOPDi.js";import{S as Ut}from"./SdkTabs-C9BIEbpG.js";import{F as Mt}from"./FieldsQueryParam-DB2XHXnv.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&De(g,i),C&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,Be,he,V,be,M,me,qe,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ce,Qe,k,je,q,Je,Ke,ze,Oe,Ge,Ae,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,A=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); @@ -36,17 +36,17 @@ import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,v as p,b as d,c as ne,f as // "logout" the last authenticated account pb.authStore.clear(); - `}});let v=s[1]&&mt(),w=s[1]&&s[2]&&_t(),y=s[2]&&kt();B=new vt({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Mt({props:{prefix:"record."}});let ae=oe(s[4]);const st=e=>e[8].code;for(let e=0;ee[8].code;for(let e=0;eParam Type Description',Be=d(),Q=n("tbody"),D=n("tr"),_e=n("td"),_e.innerHTML='
    Required identity
    ',Fe=d(),ke=n("td"),ke.innerHTML='String',He=d(),$=n("td"),Ye=p(`The + `}});let v=s[1]&&mt(),w=s[1]&&s[2]&&_t(),y=s[2]&&kt();q=new vt({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Mt({props:{prefix:"record."}});let ae=oe(s[4]);const st=e=>e[8].code;for(let e=0;ee[8].code;for(let e=0;eParam Type Description',qe=d(),Q=n("tbody"),D=n("tr"),_e=n("td"),_e.innerHTML='
    Required identity
    ',Fe=d(),ke=n("td"),ke.innerHTML='String',He=d(),$=n("td"),Ye=p(`The `),v&&v.c(),ge=d(),w&&w.c(),Se=d(),y&&y.c(),ve=p(` - of the record to authenticate.`),Ne=d(),we=n("tr"),we.innerHTML='
    Required password
    String The auth record password.',ye=d(),j=n("div"),j.textContent="Query parameters",$e=d(),E=n("table"),Pe=n("thead"),Pe.innerHTML='Param Type Description',Ie=d(),J=n("tbody"),W=n("tr"),Re=n("td"),Re.textContent="expand",Ve=d(),Ae=n("td"),Ae.innerHTML='String',Qe=d(),k=n("td"),je=p(`Auto expand record relations. Ex.: - `),ne(B.$$.fragment),Je=p(` + of the record to authenticate.`),Ne=d(),we=n("tr"),we.innerHTML='
    Required password
    String The auth record password.',ye=d(),j=n("div"),j.textContent="Query parameters",$e=d(),E=n("table"),Pe=n("thead"),Pe.innerHTML='Param Type Description',Ie=d(),J=n("tbody"),W=n("tr"),Re=n("td"),Re.textContent="expand",Ve=d(),Ce=n("td"),Ce.innerHTML='String',Qe=d(),k=n("td"),je=p(`Auto expand record relations. Ex.: + `),ne(q.$$.fragment),Je=p(` Supports up to 6-levels depth nested relations expansion. `),Ke=n("br"),ze=p(` The expanded relations will be appended to the record under the - `),Ce=n("code"),Ce.textContent="expand",Ge=p(" property (eg. "),Oe=n("code"),Oe.textContent='"expand": {"relField1": {...}, ...}',Xe=p(`). + `),Oe=n("code"),Oe.textContent="expand",Ge=p(" property (eg. "),Ae=n("code"),Ae.textContent='"expand": {"relField1": {...}, ...}',Xe=p(`). `),Ze=n("br"),xe=p(` - Only the relations to which the request user has permissions to `),Te=n("strong"),Te.textContent="view",et=p(" will be expanded."),tt=d(),ne(F.$$.fragment),Ue=d(),K=n("div"),K.textContent="Responses",Me=d(),L=n("div"),z=n("div");for(let e=0;ea(3,_=C.code);return s.$$set=C=>{"collection"in C&&a(0,u=C.collection)},s.$$.update=()=>{var C,q;s.$$.dirty&1&&a(2,g=(C=u==null?void 0:u.options)==null?void 0:C.allowEmailAuth),s.$$.dirty&1&&a(1,b=(q=u==null?void 0:u.options)==null?void 0:q.allowUsernameAuth),s.$$.dirty&6&&a(5,f=b&&g?"YOUR_USERNAME_OR_EMAIL":b?"YOUR_USERNAME":"YOUR_EMAIL"),s.$$.dirty&1&&a(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:ft.dummyCollectionRecord(u)},null,2)},{code:400,body:` + `),T.$set(h),(!H||o&1)&&le!==(le=e[0].name+"")&&De(fe,le),e[1]?v||(v=mt(),v.c(),v.m($,ge)):v&&(v.d(1),v=null),e[1]&&e[2]?w||(w=_t(),w.c(),w.m($,Se)):w&&(w.d(1),w=null),e[2]?y||(y=kt(),y.c(),y.m($,ve)):y&&(y.d(1),y=null),o&24&&(ae=oe(e[4]),A=pt(A,o,st,1,e,ae,lt,z,Pt,gt,null,bt)),o&24&&(X=oe(e[4]),Rt(),S=pt(S,o,it,1,e,X,ot,G,Ct,St,null,ht),Ot())},i(e){if(!H){Z(T.$$.fragment,e),Z(q.$$.fragment,e),Z(F.$$.fragment,e);for(let o=0;oa(3,_=O.code);return s.$$set=O=>{"collection"in O&&a(0,u=O.collection)},s.$$.update=()=>{var O,B;s.$$.dirty&1&&a(2,g=(O=u==null?void 0:u.options)==null?void 0:O.allowEmailAuth),s.$$.dirty&1&&a(1,b=(B=u==null?void 0:u.options)==null?void 0:B.allowUsernameAuth),s.$$.dirty&6&&a(5,f=b&&g?"YOUR_USERNAME_OR_EMAIL":b?"YOUR_USERNAME":"YOUR_EMAIL"),s.$$.dirty&1&&a(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:ft.dummyCollectionRecord(u)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -95,4 +95,4 @@ import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,v as p,b as d,c as ne,f as } } } - `}])},a(6,i=ft.getApiExampleUrl(Ot.baseUrl)),[u,b,g,_,R,f,i,A]}class Yt extends wt{constructor(l){super(),yt(this,l,qt,Lt,$t,{collection:0})}}export{Yt as default}; + `}])},a(6,i=ft.getApiExampleUrl(At.baseUrl)),[u,b,g,_,R,f,i,C]}class Yt extends wt{constructor(l){super(),yt(this,l,Bt,Lt,$t,{collection:0})}}export{Yt as default}; diff --git a/ui/dist/assets/CodeEditor-97oGZhvg.js b/ui/dist/assets/CodeEditor-97oGZhvg.js new file mode 100644 index 0000000000..b56bb2ddf4 --- /dev/null +++ b/ui/dist/assets/CodeEditor-97oGZhvg.js @@ -0,0 +1,14 @@ +import{S as wt,i as vt,s as qt,e as Yt,f as Tt,U as OO,g as Rt,y as IO,o as Vt,J as _t,K as jt,L as zt,I as Gt,C as Ut,M as Ct}from"./index-B6GxOPDi.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-BJXhcZ8-.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),g("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),g(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),g(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),g('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),g('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Qi=tt.concat([g("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),g("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),g("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$e=new Re,at=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function A(e){return(O,t)=>{let a=O.node.getChild("VariableDefinition");return a&&t(a,e),!0}}const hi=["FunctionDeclaration"],ui={FunctionDeclaration:A("function"),ClassDeclaration:A("class"),ClassExpression:()=>!0,EnumDeclaration:A("constant"),TypeAliasDeclaration:A("type"),NamespaceDeclaration:A("namespace"),VariableDefinition(e,O){e.matchContext(hi)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function rt(e,O){let t=$e.get(O);if(t)return t;let a=[],r=!0;function s(i,l){let n=e.sliceString(i.from,i.to);a.push({label:n,type:l})}return O.cursor(_O.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=ui[i.name];if(l&&l(i,s)||at.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of rt(e,i.node))a.push(l);return!1}}),$e.set(O,a),a}const Pe=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,it=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function pi(e){let O=C(e.state).resolveInner(e.pos,-1);if(it.indexOf(O.name)>-1)return null;let t=O.name=="VariableName"||O.to-O.from<20&&Pe.test(e.state.sliceDoc(O.from,O.to));if(!t&&!e.explicit)return null;let a=[];for(let r=O;r;r=r.parent)at.has(r.name)&&(a=a.concat(rt(e.state.doc,r)));return{options:a,from:t?O.from:e.pos,validFor:Pe}}const y=B.define({name:"javascript",parser:ci.configure({props:[K.add({IfStatement:_({except:/^\s*({|else\b)/}),TryStatement:_({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Nt,SwitchBody:e=>{let O=e.textAfter,t=/^\s*\}/.test(O),a=/^\s*(case|default)\b/.test(O);return e.baseIndent+(t?0:a?1:2)*e.unit},Block:Dt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":_({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),J.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":jO,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),st={test:e=>/^JSX/.test(e.name),facet:It({commentTokens:{block:{open:"{/*",close:"*/}"}}})},lt=y.configure({dialect:"ts"},"typescript"),ot=y.configure({dialect:"jsx",props:[Ve.add(e=>e.isTop?[st]:void 0)]}),nt=y.configure({dialect:"jsx ts",props:[Ve.add(e=>e.isTop?[st]:void 0)]},"typescript");let ct=e=>({label:e,type:"keyword"});const Qt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ct),fi=Qt.concat(["declare","implements","private","protected","public"].map(ct));function ht(e={}){let O=e.jsx?e.typescript?nt:ot:e.typescript?lt:y,t=e.typescript?Qi.concat(fi):tt.concat(Qt);return new F(O,[y.data.of({autocomplete:_e(it,je(t))}),y.data.of({autocomplete:pi}),e.jsx?Pi:[]])}function di(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Se(e,O,t=e.length){for(let a=O==null?void 0:O.firstChild;a;a=a.nextSibling)if(a.name=="JSXIdentifier"||a.name=="JSXBuiltin"||a.name=="JSXNamespacedName"||a.name=="JSXMemberExpression")return e.sliceString(a.from,Math.min(a.to,t));return""}const $i=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Pi=V.inputHandler.of((e,O,t,a,r)=>{if(($i?e.composing:e.compositionStarted)||e.state.readOnly||O!=t||a!=">"&&a!="/"||!y.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(n=>{var Q;let{head:u}=n,c=C(i).resolveInner(u-1,-1),d;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(u-1,u)!=a||c.name=="JSXAttributeValue"&&c.to>u)){if(a==">"&&c.name=="JSXFragmentTag")return{range:n,changes:{from:u,insert:""}};if(a=="/"&&c.name=="JSXStartCloseTag"){let h=c.parent,f=h.parent;if(f&&h.from==u-2&&((d=Se(i.doc,f.firstChild,u))||((Q=f.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let P=`${d}>`;return{range:ze.cursor(u+P.length,-1),changes:{from:u,insert:P}}}}else if(a==">"){let h=di(c);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(u,u+2))&&(d=Se(i.doc,h,u)))return{range:n,changes:{from:u,insert:``}}}}return{range:n}});return l.changes.empty?!1:(e.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E=["_blank","_self","_top","_parent"],gO=["ascii","utf-8","utf-16","latin1","latin1"],ZO=["get","post","put","delete"],bO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],p={},Si={a:{attrs:{href:null,ping:null,type:null,media:null,target:E,hreflang:null}},abbr:p,address:p,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:p,aside:p,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:p,base:{attrs:{href:null,target:E}},bdi:p,bdo:p,blockquote:{attrs:{cite:null}},body:p,br:p,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:E,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:p,center:p,cite:p,code:p,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:p,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:p,div:p,dl:p,dt:p,em:p,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:p,figure:p,footer:p,form:{attrs:{action:null,name:null,"accept-charset":gO,autocomplete:["on","off"],enctype:bO,method:ZO,novalidate:["novalidate"],target:E}},h1:p,h2:p,h3:p,h4:p,h5:p,h6:p,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:p,hgroup:p,hr:p,html:{attrs:{manifest:null}},i:p,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:E,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:p,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:p,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:p,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:p,noscript:p,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p,param:{attrs:{name:null,value:null}},pre:p,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:p,rt:p,ruby:p,samp:p,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gO}},section:p,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:p,source:{attrs:{src:null,type:null,media:null}},span:p,strong:p,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:p,summary:p,sup:p,table:p,tbody:p,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:p,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:p,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:p,time:{attrs:{datetime:null}},title:p,tr:p,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:p,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:p},ut={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},pt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of pt)ut[e]=null;class hO{constructor(O,t){this.tags=Object.assign(Object.assign({},Si),O),this.globalAttrs=Object.assign(Object.assign({},ut),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}hO.default=new hO;function G(e,O,t=e.length){if(!O)return"";let a=O.firstChild,r=a&&a.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,t)):""}function U(e,O=!1){for(;e;e=e.parent)if(e.name=="Element")if(O)O=!1;else return e;return null}function ft(e,O,t){let a=t.tags[G(e,U(O))];return(a==null?void 0:a.children)||t.allTags}function UO(e,O){let t=[];for(let a=U(O);a&&!a.type.isTop;a=U(a.parent)){let r=G(e,a);if(r&&a.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(O.name=="EndTag"||O.from>=a.firstChild.to)&&t.push(r)}return t}const dt=/^[:\-\.\w\u00b7-\uffff]*$/;function me(e,O,t,a,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",i=U(t,!0);return{from:a,to:r,options:ft(e.doc,i,O).map(l=>({label:l,type:"type"})).concat(UO(e.doc,t).map((l,n)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function ge(e,O,t,a){let r=/\s*>/.test(e.sliceDoc(a,a+5))?"":">";return{from:t,to:a,options:UO(e.doc,O).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:dt}}function mi(e,O,t,a){let r=[],s=0;for(let i of ft(e.doc,t,O))r.push({label:"<"+i,type:"type"});for(let i of UO(e.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:a,to:a,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function gi(e,O,t,a,r){let s=U(t),i=s?O.tags[G(e.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],n=i&&i.globalAttrs===!1?l:l.length?l.concat(O.globalAttrNames):O.globalAttrNames;return{from:a,to:r,options:n.map(Q=>({label:Q,type:"property"})),validFor:dt}}function Zi(e,O,t,a,r){var s;let i=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],n;if(i){let Q=e.sliceDoc(i.from,i.to),u=O.globalAttrs[Q];if(!u){let c=U(t),d=c?O.tags[G(e.doc,c)]:null;u=(d==null?void 0:d.attrs)&&d.attrs[Q]}if(u){let c=e.sliceDoc(a,r).toLowerCase(),d='"',h='"';/^['"]/.test(c)?(n=c[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",h=e.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),a++):n=/^[^\s<>='"]*$/;for(let f of u)l.push({label:f,apply:d+f+h,type:"constant"})}}return{from:a,to:r,options:l,validFor:n}}function bi(e,O){let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.resolve(a);for(let i=a,l;s==r&&(l=r.childBefore(i));){let n=l.lastChild;if(!n||!n.type.isError||n.frombi(a,r)}const ki=y.parser.configure({top:"SingleExpression"}),$t=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:lt.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ot.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:nt.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:ki},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:y.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:QO.parser}],Pt=[{name:"style",parser:QO.parser.configure({top:"Styles"})}].concat(pt.map(e=>({name:e,parser:y.parser}))),St=B.define({name:"html",parser:rr.configure({props:[K.add({Element(e){let O=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+O[0].length?e.continue():e.lineIndent(e.node.from)+(O[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),iO=St.configure({wrap:Ke($t,Pt)});function Xi(e={}){let O="",t;e.matchClosingTags===!1&&(O="noMatch"),e.selfClosingTags===!0&&(O=(O?O+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(t=Ke((e.nestedLanguages||[]).concat($t),(e.nestedAttributes||[]).concat(Pt)));let a=t?St.configure({wrap:t,dialect:O}):O?iO.configure({dialect:O}):iO;return new F(a,[iO.data.of({autocomplete:xi(e)}),e.autoCloseTags!==!1?yi:[],ht().support,Rr().support])}const Ze=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yi=V.inputHandler.of((e,O,t,a,r)=>{if(e.composing||e.state.readOnly||O!=t||a!=">"&&a!="/"||!iO.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(n=>{var Q,u,c;let d=i.doc.sliceString(n.from-1,n.to)==a,{head:h}=n,f=C(i).resolveInner(h,-1),P;if(d&&a==">"&&f.name=="EndTag"){let S=f.parent;if(((u=(Q=S.parent)===null||Q===void 0?void 0:Q.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(P=G(i.doc,S.parent,h))&&!Ze.has(P)){let k=h+(i.doc.sliceString(h,h+1)===">"?1:0),X=``;return{range:n,changes:{from:h,to:k,insert:X}}}}else if(d&&a=="/"&&f.name=="IncompleteCloseTag"){let S=f.parent;if(f.from==h-2&&((c=S.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(P=G(i.doc,S,h))&&!Ze.has(P)){let k=h+(i.doc.sliceString(h,h+1)===">"?1:0),X=`${P}>`;return{range:ze.cursor(h+X.length,-1),changes:{from:h,to:k,insert:X}}}}return{range:n}});return l.changes.empty?!1:(e.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),wi=I({String:o.string,Number:o.number,"True False":o.bool,PropertyName:o.propertyName,Null:o.null,",":o.separator,"[ ]":o.squareBracket,"{ }":o.brace}),vi=Y.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[wi],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),qi=B.define({name:"json",parser:vi.configure({props:[K.add({Object:_({except:/^\s*\}/}),Array:_({except:/^\s*\]/})}),J.add({"Object Array":jO})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Yi(){return new F(qi)}const Ti=36,be=1,Ri=2,j=3,xO=4,Vi=5,_i=6,ji=7,zi=8,Gi=9,Ui=10,Ci=11,Wi=12,Ai=13,Ei=14,Mi=15,Li=16,Ni=17,xe=18,Di=19,mt=20,gt=21,ke=22,Ii=23,Bi=24;function qO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ki(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function R(e,O,t){for(let a=!1;;){if(e.next<0)return;if(e.next==O&&!a){e.advance();return}a=t&&!a&&e.next==92,e.advance()}}function Ji(e,O){O:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let t=0;t)".charCodeAt(t);for(;;){if(e.next<0)return;if(e.next==a&&e.peek(1)==39){e.advance(2);return}e.advance()}}function YO(e,O){for(;!(e.next!=95&&!qO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Hi(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),R(e,O,!1)}else YO(e)}function Xe(e,O){for(;e.next==48||e.next==49;)e.advance();O&&e.next==O&&e.advance()}function ye(e,O){for(;;){if(e.next==46){if(O)break;O=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function we(e){for(;!(e.next<0||e.next==10);)e.advance()}function T(e,O){for(let t=0;t!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Zt(es,Os)};function ts(e,O,t,a){let r={};for(let s in TO)r[s]=(e.hasOwnProperty(s)?e:TO)[s];return O&&(r.words=Zt(O,t||"",a)),r}function bt(e){return new x(O=>{var t;let{next:a}=O;if(O.advance(),T(a,kO)){for(;T(O.next,kO);)O.advance();O.acceptToken(Ti)}else if(a==36&&e.doubleDollarQuotedStrings){let r=YO(O,"");O.next==36&&(O.advance(),Ji(O,r),O.acceptToken(j))}else if(a==39||a==34&&e.doubleQuotedStrings)R(O,a,e.backslashEscapes),O.acceptToken(j);else if(a==35&&e.hashComments||a==47&&O.next==47&&e.slashComments)we(O),O.acceptToken(be);else if(a==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))we(O),O.acceptToken(be);else if(a==47&&O.next==42){O.advance();for(let r=1;;){let s=O.next;if(O.next<0)break;if(O.advance(),s==42&&O.next==47){if(r--,O.advance(),!r)break}else s==47&&O.next==42&&(r++,O.advance())}O.acceptToken(Ri)}else if((a==101||a==69)&&O.next==39)O.advance(),R(O,39,!0),O.acceptToken(j);else if((a==110||a==78)&&O.next==39&&e.charSetCasts)O.advance(),R(O,39,e.backslashEscapes),O.acceptToken(j);else if(a==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),R(O,39,e.backslashEscapes),O.acceptToken(j);break}if(!qO(O.next))break;O.advance()}else if(e.plsqlQuotingMechanism&&(a==113||a==81)&&O.next==39&&O.peek(1)>0&&!T(O.peek(1),kO)){let r=O.peek(1);O.advance(2),Fi(O,r),O.acceptToken(j)}else if(a==40)O.acceptToken(ji);else if(a==41)O.acceptToken(zi);else if(a==123)O.acceptToken(Gi);else if(a==125)O.acceptToken(Ui);else if(a==91)O.acceptToken(Ci);else if(a==93)O.acceptToken(Wi);else if(a==59)O.acceptToken(Ai);else if(e.unquotedBitLiterals&&a==48&&O.next==98)O.advance(),Xe(O),O.acceptToken(ke);else if((a==98||a==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(R(O,r,e.backslashEscapes),O.acceptToken(Ii)):(Xe(O,r),O.acceptToken(ke))}else if(a==48&&(O.next==120||O.next==88)||(a==120||a==88)&&O.next==39){let r=O.next==39;for(O.advance();Ki(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(xO)}else if(a==46&&O.next>=48&&O.next<=57)ye(O,!0),O.acceptToken(xO);else if(a==46)O.acceptToken(Ei);else if(a>=48&&a<=57)ye(O,!1),O.acceptToken(xO);else if(T(a,e.operatorChars)){for(;T(O.next,e.operatorChars);)O.advance();O.acceptToken(Mi)}else if(T(a,e.specialVar))O.next==a&&O.advance(),Hi(O),O.acceptToken(Ni);else if(T(a,e.identifierQuotes))R(O,a,!1),O.acceptToken(Di);else if(a==58||a==44)O.acceptToken(Li);else if(qO(a)){let r=YO(O,String.fromCharCode(a));O.acceptToken(O.next==46||O.peek(-r.length-1)==46?xe:(t=e.words[r.toLowerCase()])!==null&&t!==void 0?t:xe)}})}const xt=bt(TO),as=Y.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,xt],topRules:{Script:[0,25]},tokenPrec:0});function RO(e){let O=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(O.name);)O.moveTo(O.from,-1);return O.node}function N(e,O){let t=e.sliceString(O.from,O.to),a=/^([`'"])(.*)\1$/.exec(t);return a?a[2]:t}function uO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function rs(e,O){if(O.name=="CompositeIdentifier"){let t=[];for(let a=O.firstChild;a;a=a.nextSibling)uO(a)&&t.push(N(e,a));return t}return[N(e,O)]}function ve(e,O){for(let t=[];;){if(!O||O.name!=".")return t;let a=RO(O);if(!uO(a))return t;t.unshift(N(e,a)),O=RO(a)}}function is(e,O){let t=C(e).resolveInner(O,-1),a=ls(e.doc,t);return t.name=="Identifier"||t.name=="QuotedIdentifier"||t.name=="Keyword"?{from:t.from,quoted:t.name=="QuotedIdentifier"?e.doc.sliceString(t.from,t.from+1):null,parents:ve(e.doc,RO(t)),aliases:a}:t.name=="."?{from:O,quoted:null,parents:ve(e.doc,t),aliases:a}:{from:O,quoted:null,parents:[],empty:!0,aliases:a}}const ss=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function ls(e,O){let t;for(let r=O;!t;r=r.parent){if(!r)return null;r.name=="Statement"&&(t=r)}let a=null;for(let r=t.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?e.sliceString(r.from,r.to).toLowerCase():null,n=null;if(!s)s=l=="from";else if(l=="as"&&i&&uO(r.nextSibling))n=N(e,r.nextSibling);else{if(l&&ss.has(l))break;i&&uO(r)&&(n=N(e,r))}n&&(a||(a=Object.create(null)),a[n]=rs(e,i)),i=/Identifier$/.test(r.name)?r:null}return a}function os(e,O){return e?O.map(t=>Object.assign(Object.assign({},t),{label:t.label[0]==e?t.label:e+t.label+e,apply:void 0})):O}const ns=/^\w*$/,cs=/^[`'"]?\w*[`'"]?$/;function qe(e){return e.self&&typeof e.self.label=="string"}class CO{constructor(O,t){this.idQuote=O,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(O){let t=this.children||(this.children=Object.create(null)),a=t[O];return a||(O&&!this.list.some(r=>r.label==O)&&this.list.push(Ye(O,"type",this.idQuote,this.idCaseInsensitive)),t[O]=new CO(this.idQuote,this.idCaseInsensitive))}maybeChild(O){return this.children?this.children[O]:null}addCompletion(O){let t=this.list.findIndex(a=>a.label==O.label);t>-1?this.list[t]=O:this.list.push(O)}addCompletions(O){for(let t of O)this.addCompletion(typeof t=="string"?Ye(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(O){Array.isArray(O)?this.addCompletions(O):qe(O)?this.addNamespace(O.children):this.addNamespaceObject(O)}addNamespaceObject(O){for(let t of Object.keys(O)){let a=O[t],r=null,s=t.replace(/\\?\./g,l=>l=="."?"\0":l).split("\0"),i=this;qe(a)&&(r=a.self,a=a.children);for(let l=0;l{let{parents:c,from:d,quoted:h,empty:f,aliases:P}=is(u.state,u.pos);if(f&&!u.explicit)return null;P&&c.length==1&&(c=P[c[0]]||c);let S=n;for(let q of c){for(;!S.children||!S.children[q];)if(S==n&&Q)S=Q;else if(S==Q&&a)S=S.child(a);else return null;let H=S.maybeChild(q);if(!H)return null;S=H}let k=h&&u.state.sliceDoc(u.pos,u.pos+1)==h,X=S.list;return S==n&&P&&(X=X.concat(Object.keys(P).map(q=>({label:q,type:"constant"})))),{from:d,to:k?u.pos+1:void 0,options:os(h,X),validFor:h?cs:ns}}}function hs(e){return e==gt?"type":e==mt?"keyword":"variable"}function us(e,O,t){let a=Object.keys(e).map(r=>t(O?r.toUpperCase():r,hs(e[r])));return _e(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],je(a))}let ps=as.configure({props:[K.add({Statement:_()}),J.add({Statement(e,O){return{from:Math.min(e.from+100,O.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),I({Keyword:o.keyword,Type:o.typeName,Builtin:o.standard(o.name),Bits:o.number,Bytes:o.string,Bool:o.bool,Null:o.null,Number:o.number,String:o.string,Identifier:o.name,QuotedIdentifier:o.special(o.string),SpecialVar:o.special(o.name),LineComment:o.lineComment,BlockComment:o.blockComment,Operator:o.operator,"Semi Punctuation":o.punctuation,"( )":o.paren,"{ }":o.brace,"[ ]":o.squareBracket})]});class D{constructor(O,t,a){this.dialect=O,this.language=t,this.spec=a}get extension(){return this.language.extension}static define(O){let t=ts(O,O.keywords,O.types,O.builtin),a=B.define({name:"sql",parser:ps.configure({tokenizers:[{from:xt,to:bt(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new D(t,a,O)}}function fs(e,O){return{label:e,type:O,boost:-1}}function ds(e,O=!1,t){return us(e.dialect.words,O,t||fs)}function $s(e){return e.schema?Qs(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||WO):()=>null}function Ps(e){return e.schema?(e.dialect||WO).language.data.of({autocomplete:$s(e)}):[]}function Te(e={}){let O=e.dialect||WO;return new F(O.language,[Ps(e),O.language.data.of({autocomplete:ds(O,e.upperCaseKeywords,e.keywordCompletion)})])}const WO=D.define({});function Ss(e){let O;return{c(){O=Yt("div"),Tt(O,"class","code-editor"),OO(O,"min-height",e[0]?e[0]+"px":null),OO(O,"max-height",e[1]?e[1]+"px":"auto")},m(t,a){Rt(t,O,a),e[11](O)},p(t,[a]){a&1&&OO(O,"min-height",t[0]?t[0]+"px":null),a&2&&OO(O,"max-height",t[1]?t[1]+"px":"auto")},i:IO,o:IO,d(t){t&&Vt(O),e[11](null)}}}function ms(e,O,t){let a;_t(e,jt,$=>t(12,a=$));const r=zt();let{id:s=""}=O,{value:i=""}=O,{minHeight:l=null}=O,{maxHeight:n=null}=O,{disabled:Q=!1}=O,{placeholder:u=""}=O,{language:c="javascript"}=O,{singleLine:d=!1}=O,h,f,P=new eO,S=new eO,k=new eO,X=new eO;function q(){h==null||h.focus()}function H(){f==null||f.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function AO(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",q)}function EO(){if(!s)return;AO();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",q)}function MO(){switch(c){case"html":return Xi();case"json":return Yi();case"sql-create-index":return Te({dialect:D.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of a)$[m.name]=Ut.getAllCollectionIdentifiers(m);return Te({dialect:D.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text bool date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return ht()}}Gt(()=>{const $={key:"Enter",run:m=>{d&&r("submit",i)}};return EO(),t(10,h=new V({parent:f,state:W.create({doc:i,extensions:[Kt(),Jt(),Ft(),Ht(),Oa(),W.allowMultipleSelections.of(!0),ea(ta,{fallback:!0}),aa(),ra(),ia(),sa(),la.of([$,...oa,...na,ca.find(m=>m.key==="Mod-d"),...Qa,...ha]),V.lineWrapping,ua({icons:!1}),P.of(MO()),X.of(BO(u)),S.of(V.editable.of(!0)),k.of(W.readOnly.of(!1)),W.transactionFilter.of(m=>{var LO,NO,DO;if(d&&m.newDoc.lines>1){if(!((DO=(NO=(LO=m.changes)==null?void 0:LO.inserted)==null?void 0:NO.filter(Xt=>!!Xt.text.find(yt=>yt)))!=null&&DO.length))return[];m.newDoc.text=[m.newDoc.text.join(" ")]}return m}),V.updateListener.of(m=>{!m.docChanged||Q||(t(3,i=m.state.doc.toString()),H())})]})})),()=>{AO(),h==null||h.destroy()}});function kt($){Ct[$?"unshift":"push"](()=>{f=$,t(2,f)})}return e.$$set=$=>{"id"in $&&t(4,s=$.id),"value"in $&&t(3,i=$.value),"minHeight"in $&&t(0,l=$.minHeight),"maxHeight"in $&&t(1,n=$.maxHeight),"disabled"in $&&t(5,Q=$.disabled),"placeholder"in $&&t(6,u=$.placeholder),"language"in $&&t(7,c=$.language),"singleLine"in $&&t(8,d=$.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&s&&EO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[P.reconfigure(MO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&h.dispatch({effects:[S.reconfigure(V.editable.of(!Q)),k.reconfigure(W.readOnly.of(Q))]}),e.$$.dirty&1032&&h&&i!=h.state.doc.toString()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:i}}),e.$$.dirty&1088&&h&&typeof u<"u"&&h.dispatch({effects:[X.reconfigure(BO(u))]})},[l,n,f,i,s,Q,u,c,d,q,h,kt]}class bs extends wt{constructor(O){super(),vt(this,O,ms,Ss,qt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{bs as default}; diff --git a/ui/dist/assets/CodeEditor-C-zHBmhQ.js b/ui/dist/assets/CodeEditor-C-zHBmhQ.js deleted file mode 100644 index 170e8fefee..0000000000 --- a/ui/dist/assets/CodeEditor-C-zHBmhQ.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as wt,i as Rt,s as Yt,e as Tt,f as Wt,U as OO,g as _t,x as BO,o as qt,J as vt,K as Ut,L as zt,I as Vt,C as jt,M as Gt}from"./index-rLaTJP5R.js";import{P as Ct,N as At,w as Et,D as Nt,x as qO,T as tO,I as vO,y as B,z as l,A as Mt,L as J,B as L,F as v,G as K,H as UO,J as F,v as G,K as _e,M as qe,O as ve,E as q,Q as Ue,R as S,U as It,V as Dt,W as ze,X as Bt,Y as Jt,b as C,e as Lt,f as Kt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as oa,c as la,d as na,s as ca,h as Qa,a as ha,p as ua,q as JO,C as eO}from"./index-BztyTJOx.js";var LO={};class sO{constructor(O,a,t,r,s,i,o,n,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=o,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new sO(O,[],a,t,t,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p;this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(n==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(r,n)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new pa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&o==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-s;if(o>1){let n=i&65535,Q=this.stack.length-o*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return o<<19|65536|n}}else{let o=t(i,s+1);if(o!=null)return o}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class oO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new oO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new oO(this.stack,this.pos,this.index)}}function N(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,o=!0),s+=n,o)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class da{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class z{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ve(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?N(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ve(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ve(e,O,a,t,r,s){let i=0,o=1<0){let d=e[h];if(n.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let u=O.next,c=0,f=e[i+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535){i=e[Q+f*3-1];continue O}for(;c>1,d=Q+h+(h<<1),P=e[d],m=e[d+1]||65536;if(u=m)c=h+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function fa(e,O,a,t){let r=HO(a,t,O);return r<0||HO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class $a{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new aO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),o=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new aO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new aO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(o>>1)){o&1?O.extended=o>>1:O.value=o>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let s=0;sO.bufferLength*4?new $a(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(o);else{if(this.advanceStack(o,t,O))continue;{r||(r=[],s=[]),r.push(o);let n=this.tokens.getMainToken(o);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Sa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,n)=>n.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((o.score-Q.score||o.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(qO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let o=s.stateSlot(O.state,4);if(o>0)return O.reduce(o),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?a.push(d):t.push(d)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return ee(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Z&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let c=o.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of o.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>o.pos?(Q==o.pos&&(Q++,n=0),o.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(n)})`),ee(o,t)):(!r||r.scoree;class je{constructor(O){this.start=O.start,this.shift=O.shift||dO,this.reduce=O.reduce||dO,this.reuse=O.reuse||dO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ct{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;oO.topRules[o][1]),r=[];for(let o=0;o=0)s(u,n,o[Q++]);else{let c=o[Q+-u];for(let f=-u;f>0;f--)s(o[Q++],n,c);Q++}}}this.nodeSet=new At(a.map((o,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:o,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Nt;let i=N(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new z(i,o):o),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new ma(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],o=i&1,n=r[s++];if(o&&t)return n;for(let Q=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=w(this.data,s+2);else break;r=a(w(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=w(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(o=>o.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=te(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const Za=54,ba=1,ka=55,xa=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ge=7,Ce=8,Ae=9,Ee=10,Ra=11,Ya=12,Ta=13,fO=57,Wa=14,re=58,Ne=20,_a=22,Me=23,qa=24,XO=26,Ie=27,va=28,Ua=31,za=34,Va=36,ja=37,Ga=0,Ca=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,oe=null,le=0;function yO(e,O){let a=e.pos+O;if(le==a&&oe==e)return se;let t=e.peek(O);for(;De(t);)t=e.peek(++O);let r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return oe=e,le=a,se=r?r.toLowerCase():t==Ma||t==Ia?void 0:null}const Be=60,cO=62,zO=47,Ma=63,Ia=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ba=[nO,Ee,Ge,Ce,Ae],Ja=new je({start:null,shift(e,O,a,t){return Ba.indexOf(O)>-1?new ne(yO(t,1)||"",e):e},reduce(e,O){return O==Ne&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==nO||r==Va?new ne(yO(t,1)||"",e):e},strict:!1}),La=new k((e,O)=>{if(e.next!=Be){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==zO;a&&e.advance();let t=yO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Wa:nO);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ra);if(r&&Ea[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ga))return e.acceptToken(Ya);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(Ta)}else{if(t=="script")return e.acceptToken(Ge);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(t))return e.acceptToken(Ee);r&&ie[r]&&ie[r][t]?e.acceptToken(fO,-1):e.acceptToken(nO)}},{contextual:!0}),Ka=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){a>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new k((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let a=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(a?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function VO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(O);break}if(s==0&&r.next==Be||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=VO("script",Za,ba),er=VO("style",ka,xa),tr=VO("textarea",Xa,ya),ar=B({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),rr=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=o.type.id;if(Q==va)return $O(o,n,a);if(Q==Ua)return $O(o,n,t);if(Q==za)return $O(o,n,r);if(Q==Ne&&s.length){let u=o.node,c=u.firstChild,f=c&&ce(c,n),h;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(h||(h=Je(c,n))))){let P=u.lastChild,m=P.type.id==ja?P.from:u.to;if(m>c.to)return{parser:d.parser,overlay:[{from:c.to,to:m}]}}}}if(i&&Q==Me){let u=o.node,c;if(c=u.firstChild){let f=i[n.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let d=u.lastChild;if(d.type.id==XO){let P=d.from+1,m=d.lastChild,x=d.to-(m&&m.isError?0:1);if(x>P)return{parser:h.parser,overlay:[{from:P,to:x}]}}else if(d.type.id==Ie)return{parser:h.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,Qe=1,sr=100,or=101,he=2,Ke=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],lr=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,dr=92,fr=10;function M(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new k((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=e;if(M(s)||s==rO||s==Fe||a&&He(s))!a&&(s!=rO||r>0)&&(a=!0),t===r&&s==rO&&t++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),a=!0;else{a&&e.acceptToken(s==nr?sr:t==2&&O.canShift(he)?he:or);break}}}),Pr=new k(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(M(O)||O==Fe||O==hr||O==Qr||O==cr||O==lr&&M(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),mr=new k(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),M(O)){do e.advance();while(M(e.next)||He(e.next));e.acceptToken(Qe)}}}),gr=B({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,KeyframeRangeName:l.operatorKeyword,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ColorLiteral:l.color,"ParenthesizedContent StringLiteral":l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),Sr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},kr=T.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,mr,$r,1,2,3,4,new lO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>Sr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1200});let PO=null;function mO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));PO=O.sort().map(t=>({type:"property",label:t}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),xr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Y=/^(\w[\w-]*|-\w[\w-]*|)$/,Xr=/^-(-[\w-]*)?$/;function yr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const de=new _e,wr=["Declaration"];function Rr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,a){if(O.to-O.from>4096){let t=de.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(vO.IncludeAnonymous);if(i.firstChild())do for(let o of Ot(e,i.node,a))s.has(o.label)||(s.add(o.label),r.push(o));while(i.nextSibling());return de.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(wr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let o=e.sliceString(s.from,s.to);r.has(o)||(r.add(o),t.push({label:o,type:"variable"}))}}),t}}const Yr=e=>O=>{let{state:a,pos:t}=O,r=G(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:Y};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:Y};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:Y};if(e(r)||(O.explicit||s)&&yr(r,a.doc))return{from:e(r)||s?r.from:t,options:Ot(a.doc,Rr(r),e),validFor:Xr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:Y};return{from:r.from,options:xr,validFor:Y}}if(!O.explicit)return null;let i=r.resolve(t),o=i.childBefore(t);return o&&o.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:ue,validFor:Y}:o&&o.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:pe,validFor:Y}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:Y}:null},Tr=Yr(e=>e.name=="VariableName"),QO=J.define({name:"css",parser:kr.configure({props:[L.add({Declaration:v()}),K.add({"Block KeyframeList":UO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Wr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const _r=312,fe=1,qr=2,vr=3,Ur=4,zr=313,Vr=315,jr=316,Gr=5,Cr=6,Ar=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Er=59,RO=47,Nr=42,Mr=43,Ir=45,Dr=60,Br=44,Jr=63,Lr=46,Kr=new je({start:!1,shift(e,O){return O==Gr||O==Cr||O==Vr?e:O==jr},strict:!1}),Fr=new k((e,O)=>{let{next:a}=e;(a==et||a==-1||O.context)&&e.acceptToken(zr)},{contextual:!0,fallback:!0}),Hr=new k((e,O)=>{let{next:a}=e,t;wO.indexOf(a)>-1||a==RO&&((t=e.peek(1))==RO||t==Nr)||a!=et&&a!=Er&&a!=-1&&!O.context&&e.acceptToken(_r)},{contextual:!0}),Oi=new k((e,O)=>{let{next:a}=e;if(a==Mr||a==Ir){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift(fe);e.acceptToken(t?fe:qr)}}else a==Jr&&e.peek(1)==Lr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(vr))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ei=new k((e,O)=>{if(e.next!=Dr||!O.dialectEnabled(Ar)||(e.advance(),e.next==RO))return;let a=0;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;wO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==Br)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(Ur,-a)}),ti=B({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const using function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,"LineComment Hashbang":l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),ai={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},ri={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ii={__proto__:null,"<":187},si=T.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:Kr,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[ti],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-ai[e]||-1},{term:338,get:e=>ri[e]||-1},{term:92,get:e=>ii[e]||-1}],tokenPrec:14749}),tt=[S("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),S("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),S("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),S("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),S("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),S(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),S("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),S(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),S(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),S('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),S('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oi=tt.concat([S("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),S("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),S("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$e=new _e,at=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function A(e){return(O,a)=>{let t=O.node.getChild("VariableDefinition");return t&&a(t,e),!0}}const li=["FunctionDeclaration"],ni={FunctionDeclaration:A("function"),ClassDeclaration:A("class"),ClassExpression:()=>!0,EnumDeclaration:A("constant"),TypeAliasDeclaration:A("type"),NamespaceDeclaration:A("namespace"),VariableDefinition(e,O){e.matchContext(li)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function rt(e,O){let a=$e.get(O);if(a)return a;let t=[],r=!0;function s(i,o){let n=e.sliceString(i.from,i.to);t.push({label:n,type:o})}return O.cursor(vO.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let o=ni[i.name];if(o&&o(i,s)||at.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of rt(e,i.node))t.push(o);return!1}}),$e.set(O,t),t}const Pe=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,it=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function ci(e){let O=G(e.state).resolveInner(e.pos,-1);if(it.indexOf(O.name)>-1)return null;let a=O.name=="VariableName"||O.to-O.from<20&&Pe.test(e.state.sliceDoc(O.from,O.to));if(!a&&!e.explicit)return null;let t=[];for(let r=O;r;r=r.parent)at.has(r.name)&&(t=t.concat(rt(e.state.doc,r)));return{options:t,from:a?O.from:e.pos,validFor:Pe}}const y=J.define({name:"javascript",parser:si.configure({props:[L.add({IfStatement:v({except:/^\s*({|else\b)/}),TryStatement:v({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:It,SwitchBody:e=>{let O=e.textAfter,a=/^\s*\}/.test(O),t=/^\s*(case|default)\b/.test(O);return e.baseIndent+(a?0:t?1:2)*e.unit},Block:Dt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":v({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),K.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":UO,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),st={test:e=>/^JSX/.test(e.name),facet:Bt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},ot=y.configure({dialect:"ts"},"typescript"),lt=y.configure({dialect:"jsx",props:[ze.add(e=>e.isTop?[st]:void 0)]}),nt=y.configure({dialect:"jsx ts",props:[ze.add(e=>e.isTop?[st]:void 0)]},"typescript");let ct=e=>({label:e,type:"keyword"});const Qt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ct),Qi=Qt.concat(["declare","implements","private","protected","public"].map(ct));function ht(e={}){let O=e.jsx?e.typescript?nt:lt:e.typescript?ot:y,a=e.typescript?oi.concat(Qi):tt.concat(Qt);return new F(O,[y.data.of({autocomplete:qe(it,ve(a))}),y.data.of({autocomplete:ci}),e.jsx?pi:[]])}function hi(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function me(e,O,a=e.length){for(let t=O==null?void 0:O.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return e.sliceString(t.from,Math.min(t.to,a));return""}const ui=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),pi=q.inputHandler.of((e,O,a,t,r)=>{if((ui?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!y.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,o=i.changeByRange(n=>{var Q;let{head:u}=n,c=G(i).resolveInner(u-1,-1),f;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(u-1,u)!=t||c.name=="JSXAttributeValue"&&c.to>u)){if(t==">"&&c.name=="JSXFragmentTag")return{range:n,changes:{from:u,insert:""}};if(t=="/"&&c.name=="JSXStartCloseTag"){let h=c.parent,d=h.parent;if(d&&h.from==u-2&&((f=me(i.doc,d.firstChild,u))||((Q=d.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let P=`${f}>`;return{range:Ue.cursor(u+P.length,-1),changes:{from:u,insert:P}}}}else if(t==">"){let h=hi(c);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(u,u+2))&&(f=me(i.doc,h,u)))return{range:n,changes:{from:u,insert:``}}}}return{range:n}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E=["_blank","_self","_top","_parent"],SO=["ascii","utf-8","utf-16","latin1","latin1"],ZO=["get","post","put","delete"],bO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],p={},di={a:{attrs:{href:null,ping:null,type:null,media:null,target:E,hreflang:null}},abbr:p,address:p,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:p,aside:p,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:p,base:{attrs:{href:null,target:E}},bdi:p,bdo:p,blockquote:{attrs:{cite:null}},body:p,br:p,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:E,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:p,center:p,cite:p,code:p,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:p,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:p,div:p,dl:p,dt:p,em:p,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:p,figure:p,footer:p,form:{attrs:{action:null,name:null,"accept-charset":SO,autocomplete:["on","off"],enctype:bO,method:ZO,novalidate:["novalidate"],target:E}},h1:p,h2:p,h3:p,h4:p,h5:p,h6:p,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:p,hgroup:p,hr:p,html:{attrs:{manifest:null}},i:p,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:E,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:p,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:p,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:p,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:SO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:p,noscript:p,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p,param:{attrs:{name:null,value:null}},pre:p,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:p,rt:p,ruby:p,samp:p,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:SO}},section:p,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:p,source:{attrs:{src:null,type:null,media:null}},span:p,strong:p,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:p,summary:p,sup:p,table:p,tbody:p,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:p,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:p,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:p,time:{attrs:{datetime:null}},title:p,tr:p,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:p,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:p},ut={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},pt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of pt)ut[e]=null;class hO{constructor(O,a){this.tags=Object.assign(Object.assign({},di),O),this.globalAttrs=Object.assign(Object.assign({},ut),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}hO.default=new hO;function V(e,O,a=e.length){if(!O)return"";let t=O.firstChild,r=t&&t.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,a)):""}function j(e,O=!1){for(;e;e=e.parent)if(e.name=="Element")if(O)O=!1;else return e;return null}function dt(e,O,a){let t=a.tags[V(e,j(O))];return(t==null?void 0:t.children)||a.allTags}function jO(e,O){let a=[];for(let t=j(O);t&&!t.type.isTop;t=j(t.parent)){let r=V(e,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(O.name=="EndTag"||O.from>=t.firstChild.to)&&a.push(r)}return a}const ft=/^[:\-\.\w\u00b7-\uffff]*$/;function ge(e,O,a,t,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",i=j(a,!0);return{from:t,to:r,options:dt(e.doc,i,O).map(o=>({label:o,type:"type"})).concat(jO(e.doc,a).map((o,n)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Se(e,O,a,t){let r=/\s*>/.test(e.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:jO(e.doc,O).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:ft}}function fi(e,O,a,t){let r=[],s=0;for(let i of dt(e.doc,a,O))r.push({label:"<"+i,type:"type"});for(let i of jO(e.doc,a))r.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function $i(e,O,a,t,r){let s=j(a),i=s?O.tags[V(e.doc,s)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],n=i&&i.globalAttrs===!1?o:o.length?o.concat(O.globalAttrNames):O.globalAttrNames;return{from:t,to:r,options:n.map(Q=>({label:Q,type:"property"})),validFor:ft}}function Pi(e,O,a,t,r){var s;let i=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],n;if(i){let Q=e.sliceDoc(i.from,i.to),u=O.globalAttrs[Q];if(!u){let c=j(a),f=c?O.tags[V(e.doc,c)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[Q]}if(u){let c=e.sliceDoc(t,r).toLowerCase(),f='"',h='"';/^['"]/.test(c)?(n=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",h=e.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):n=/^[^\s<>='"]*$/;for(let d of u)o.push({label:d,apply:f+d+h,type:"constant"})}}return{from:t,to:r,options:o,validFor:n}}function mi(e,O){let{state:a,pos:t}=O,r=G(a).resolveInner(t,-1),s=r.resolve(t);for(let i=t,o;s==r&&(o=r.childBefore(i));){let n=o.lastChild;if(!n||!n.type.isError||n.frommi(t,r)}const Si=y.parser.configure({top:"SingleExpression"}),$t=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:ot.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:lt.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:nt.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Si},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:y.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:QO.parser}],Pt=[{name:"style",parser:QO.parser.configure({top:"Styles"})}].concat(pt.map(e=>({name:e,parser:y.parser}))),mt=J.define({name:"html",parser:rr.configure({props:[L.add({Element(e){let O=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+O[0].length?e.continue():e.lineIndent(e.node.from)+(O[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),iO=mt.configure({wrap:Le($t,Pt)});function Zi(e={}){let O="",a;e.matchClosingTags===!1&&(O="noMatch"),e.selfClosingTags===!0&&(O=(O?O+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(a=Le((e.nestedLanguages||[]).concat($t),(e.nestedAttributes||[]).concat(Pt)));let t=a?mt.configure({wrap:a,dialect:O}):O?iO.configure({dialect:O}):iO;return new F(t,[iO.data.of({autocomplete:gi(e)}),e.autoCloseTags!==!1?bi:[],ht().support,Wr().support])}const Ze=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),bi=q.inputHandler.of((e,O,a,t,r)=>{if(e.composing||e.state.readOnly||O!=a||t!=">"&&t!="/"||!iO.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,o=i.changeByRange(n=>{var Q,u,c;let f=i.doc.sliceString(n.from-1,n.to)==t,{head:h}=n,d=G(i).resolveInner(h,-1),P;if(f&&t==">"&&d.name=="EndTag"){let m=d.parent;if(((u=(Q=m.parent)===null||Q===void 0?void 0:Q.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(P=V(i.doc,m.parent,h))&&!Ze.has(P)){let x=h+(i.doc.sliceString(h,h+1)===">"?1:0),X=``;return{range:n,changes:{from:h,to:x,insert:X}}}}else if(f&&t=="/"&&d.name=="IncompleteCloseTag"){let m=d.parent;if(d.from==h-2&&((c=m.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(P=V(i.doc,m,h))&&!Ze.has(P)){let x=h+(i.doc.sliceString(h,h+1)===">"?1:0),X=`${P}>`;return{range:Ue.cursor(h+X.length,-1),changes:{from:h,to:x,insert:X}}}}return{range:n}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),ki=B({String:l.string,Number:l.number,"True False":l.bool,PropertyName:l.propertyName,Null:l.null,",":l.separator,"[ ]":l.squareBracket,"{ }":l.brace}),xi=T.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[ki],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Xi=J.define({name:"json",parser:xi.configure({props:[L.add({Object:v({except:/^\s*\}/}),Array:v({except:/^\s*\]/})}),K.add({"Object Array":UO})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function yi(){return new F(Xi)}const wi=36,be=1,Ri=2,U=3,kO=4,Yi=5,Ti=6,Wi=7,_i=8,qi=9,vi=10,Ui=11,zi=12,Vi=13,ji=14,Gi=15,Ci=16,Ai=17,ke=18,Ei=19,gt=20,St=21,xe=22,Ni=23,Mi=24;function YO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ii(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function _(e,O,a){for(let t=!1;;){if(e.next<0)return;if(e.next==O&&!t){e.advance();return}t=a&&!t&&e.next==92,e.advance()}}function Di(e,O){O:for(;;){if(e.next<0)return console.log("exit at end",e.pos);if(e.next==36){e.advance();for(let a=0;a)".charCodeAt(a);for(;;){if(e.next<0)return;if(e.next==t&&e.peek(1)==39){e.advance(2);return}e.advance()}}function TO(e,O){for(;!(e.next!=95&&!YO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Ji(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),_(e,O,!1)}else TO(e)}function Xe(e,O){for(;e.next==48||e.next==49;)e.advance();O&&e.next==O&&e.advance()}function ye(e,O){for(;;){if(e.next==46){if(O)break;O=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function we(e){for(;!(e.next<0||e.next==10);)e.advance()}function W(e,O){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Zt(Ki,Li)};function Fi(e,O,a,t){let r={};for(let s in WO)r[s]=(e.hasOwnProperty(s)?e:WO)[s];return O&&(r.words=Zt(O,a||"",t)),r}function bt(e){return new k(O=>{var a;let{next:t}=O;if(O.advance(),W(t,xO)){for(;W(O.next,xO);)O.advance();O.acceptToken(wi)}else if(t==36&&e.doubleDollarQuotedStrings){let r=TO(O,"");O.next==36&&(O.advance(),Di(O,r),O.acceptToken(U))}else if(t==39||t==34&&e.doubleQuotedStrings)_(O,t,e.backslashEscapes),O.acceptToken(U);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)we(O),O.acceptToken(be);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))we(O),O.acceptToken(be);else if(t==47&&O.next==42){O.advance();for(let r=1;;){let s=O.next;if(O.next<0)break;if(O.advance(),s==42&&O.next==47){if(r--,O.advance(),!r)break}else s==47&&O.next==42&&(r++,O.advance())}O.acceptToken(Ri)}else if((t==101||t==69)&&O.next==39)O.advance(),_(O,39,!0),O.acceptToken(U);else if((t==110||t==78)&&O.next==39&&e.charSetCasts)O.advance(),_(O,39,e.backslashEscapes),O.acceptToken(U);else if(t==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),_(O,39,e.backslashEscapes),O.acceptToken(U);break}if(!YO(O.next))break;O.advance()}else if(e.plsqlQuotingMechanism&&(t==113||t==81)&&O.next==39&&O.peek(1)>0&&!W(O.peek(1),xO)){let r=O.peek(1);O.advance(2),Bi(O,r),O.acceptToken(U)}else if(t==40)O.acceptToken(Wi);else if(t==41)O.acceptToken(_i);else if(t==123)O.acceptToken(qi);else if(t==125)O.acceptToken(vi);else if(t==91)O.acceptToken(Ui);else if(t==93)O.acceptToken(zi);else if(t==59)O.acceptToken(Vi);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),Xe(O),O.acceptToken(xe);else if((t==98||t==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(_(O,r,e.backslashEscapes),O.acceptToken(Ni)):(Xe(O,r),O.acceptToken(xe))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let r=O.next==39;for(O.advance();Ii(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(kO)}else if(t==46&&O.next>=48&&O.next<=57)ye(O,!0),O.acceptToken(kO);else if(t==46)O.acceptToken(ji);else if(t>=48&&t<=57)ye(O,!1),O.acceptToken(kO);else if(W(t,e.operatorChars)){for(;W(O.next,e.operatorChars);)O.advance();O.acceptToken(Gi)}else if(W(t,e.specialVar))O.next==t&&O.advance(),Ji(O),O.acceptToken(Ai);else if(W(t,e.identifierQuotes))_(O,t,!1),O.acceptToken(Ei);else if(t==58||t==44)O.acceptToken(Ci);else if(YO(t)){let r=TO(O,String.fromCharCode(t));O.acceptToken(O.next==46||O.peek(-r.length-1)==46?ke:(a=e.words[r.toLowerCase()])!==null&&a!==void 0?a:ke)}})}const kt=bt(WO),Hi=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,kt],topRules:{Script:[0,25]},tokenPrec:0});function _O(e){let O=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(O.name);)O.moveTo(O.from,-1);return O.node}function I(e,O){let a=e.sliceString(O.from,O.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function uO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function Os(e,O){if(O.name=="CompositeIdentifier"){let a=[];for(let t=O.firstChild;t;t=t.nextSibling)uO(t)&&a.push(I(e,t));return a}return[I(e,O)]}function Re(e,O){for(let a=[];;){if(!O||O.name!=".")return a;let t=_O(O);if(!uO(t))return a;a.unshift(I(e,t)),O=_O(t)}}function es(e,O){let a=G(e).resolveInner(O,-1),t=as(e.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?e.doc.sliceString(a.from,a.from+1):null,parents:Re(e.doc,_O(a)),aliases:t}:a.name=="."?{from:O,quoted:null,parents:Re(e.doc,a),aliases:t}:{from:O,quoted:null,parents:[],empty:!0,aliases:t}}const ts=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function as(e,O){let a;for(let r=O;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,s=!1,i=null;r;r=r.nextSibling){let o=r.name=="Keyword"?e.sliceString(r.from,r.to).toLowerCase():null,n=null;if(!s)s=o=="from";else if(o=="as"&&i&&uO(r.nextSibling))n=I(e,r.nextSibling);else{if(o&&ts.has(o))break;i&&uO(r)&&(n=I(e,r))}n&&(t||(t=Object.create(null)),t[n]=Os(e,i)),i=/Identifier$/.test(r.name)?r:null}return t}function rs(e,O){return e?O.map(a=>Object.assign(Object.assign({},a),{label:a.label[0]==e?a.label:e+a.label+e,apply:void 0})):O}const is=/^\w*$/,ss=/^[`'"]?\w*[`'"]?$/;function Ye(e){return e.self&&typeof e.self.label=="string"}class GO{constructor(O,a){this.idQuote=O,this.idCaseInsensitive=a,this.list=[],this.children=void 0}child(O){let a=this.children||(this.children=Object.create(null)),t=a[O];return t||(O&&!this.list.some(r=>r.label==O)&&this.list.push(Te(O,"type",this.idQuote,this.idCaseInsensitive)),a[O]=new GO(this.idQuote,this.idCaseInsensitive))}maybeChild(O){return this.children?this.children[O]:null}addCompletion(O){let a=this.list.findIndex(t=>t.label==O.label);a>-1?this.list[a]=O:this.list.push(O)}addCompletions(O){for(let a of O)this.addCompletion(typeof a=="string"?Te(a,"property",this.idQuote,this.idCaseInsensitive):a)}addNamespace(O){Array.isArray(O)?this.addCompletions(O):Ye(O)?this.addNamespace(O.children):this.addNamespaceObject(O)}addNamespaceObject(O){for(let a of Object.keys(O)){let t=O[a],r=null,s=a.replace(/\\?\./g,o=>o=="."?"\0":o).split("\0"),i=this;Ye(t)&&(r=t.self,t=t.children);for(let o=0;o{let{parents:c,from:f,quoted:h,empty:d,aliases:P}=es(u.state,u.pos);if(d&&!u.explicit)return null;P&&c.length==1&&(c=P[c[0]]||c);let m=n;for(let R of c){for(;!m.children||!m.children[R];)if(m==n&&Q)m=Q;else if(m==Q&&t)m=m.child(t);else return null;let H=m.maybeChild(R);if(!H)return null;m=H}let x=h&&u.state.sliceDoc(u.pos,u.pos+1)==h,X=m.list;return m==n&&P&&(X=X.concat(Object.keys(P).map(R=>({label:R,type:"constant"})))),{from:f,to:x?u.pos+1:void 0,options:rs(h,X),validFor:h?ss:is}}}function ls(e,O){let a=Object.keys(e).map(t=>({label:O?t.toUpperCase():t,type:e[t]==St?"type":e[t]==gt?"keyword":"variable",boost:-1}));return qe(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],ve(a))}let ns=Hi.configure({props:[L.add({Statement:v()}),K.add({Statement(e,O){return{from:Math.min(e.from+100,O.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),B({Keyword:l.keyword,Type:l.typeName,Builtin:l.standard(l.name),Bits:l.number,Bytes:l.string,Bool:l.bool,Null:l.null,Number:l.number,String:l.string,Identifier:l.name,QuotedIdentifier:l.special(l.string),SpecialVar:l.special(l.name),LineComment:l.lineComment,BlockComment:l.blockComment,Operator:l.operator,"Semi Punctuation":l.punctuation,"( )":l.paren,"{ }":l.brace,"[ ]":l.squareBracket})]});class D{constructor(O,a,t){this.dialect=O,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(O){let a=Fi(O,O.keywords,O.types,O.builtin),t=J.define({name:"sql",parser:ns.configure({tokenizers:[{from:kt,to:bt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new D(a,t,O)}}function cs(e,O=!1){return ls(e.dialect.words,O)}function Qs(e,O=!1){return e.language.data.of({autocomplete:cs(e,O)})}function hs(e){return e.schema?os(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||CO):()=>null}function us(e){return e.schema?(e.dialect||CO).language.data.of({autocomplete:hs(e)}):[]}function We(e={}){let O=e.dialect||CO;return new F(O.language,[us(e),Qs(O,!!e.upperCaseKeywords)])}const CO=D.define({});function ps(e){let O;return{c(){O=Tt("div"),Wt(O,"class","code-editor"),OO(O,"min-height",e[0]?e[0]+"px":null),OO(O,"max-height",e[1]?e[1]+"px":"auto")},m(a,t){_t(a,O,t),e[11](O)},p(a,[t]){t&1&&OO(O,"min-height",a[0]?a[0]+"px":null),t&2&&OO(O,"max-height",a[1]?a[1]+"px":"auto")},i:BO,o:BO,d(a){a&&qt(O),e[11](null)}}}function ds(e,O,a){let t;vt(e,Ut,$=>a(12,t=$));const r=zt();let{id:s=""}=O,{value:i=""}=O,{minHeight:o=null}=O,{maxHeight:n=null}=O,{disabled:Q=!1}=O,{placeholder:u=""}=O,{language:c="javascript"}=O,{singleLine:f=!1}=O,h,d,P=new eO,m=new eO,x=new eO,X=new eO;function R(){h==null||h.focus()}function H(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function AO(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let g of $)g.removeEventListener("click",R)}function EO(){if(!s)return;AO();const $=document.querySelectorAll('[for="'+s+'"]');for(let g of $)g.addEventListener("click",R)}function NO(){switch(c){case"html":return Zi();case"json":return yi();case"sql-create-index":return We({dialect:D.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let g of t)$[g.name]=jt.getAllCollectionIdentifiers(g);return We({dialect:D.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text bool date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return ht()}}Vt(()=>{const $={key:"Enter",run:g=>{f&&r("submit",i)}};return EO(),a(10,h=new q({parent:d,state:C.create({doc:i,extensions:[Lt(),Kt(),Ft(),Ht(),Oa(),C.allowMultipleSelections.of(!0),ea(ta,{fallback:!0}),aa(),ra(),ia(),sa(),oa.of([$,...la,...na,ca.find(g=>g.key==="Mod-d"),...Qa,...ha]),q.lineWrapping,ua({icons:!1}),P.of(NO()),X.of(JO(u)),m.of(q.editable.of(!0)),x.of(C.readOnly.of(!1)),C.transactionFilter.of(g=>{var MO,IO,DO;if(f&&g.newDoc.lines>1){if(!((DO=(IO=(MO=g.changes)==null?void 0:MO.inserted)==null?void 0:IO.filter(Xt=>!!Xt.text.find(yt=>yt)))!=null&&DO.length))return[];g.newDoc.text=[g.newDoc.text.join(" ")]}return g}),q.updateListener.of(g=>{!g.docChanged||Q||(a(3,i=g.state.doc.toString()),H())})]})})),()=>{AO(),h==null||h.destroy()}});function xt($){Gt[$?"unshift":"push"](()=>{d=$,a(2,d)})}return e.$$set=$=>{"id"in $&&a(4,s=$.id),"value"in $&&a(3,i=$.value),"minHeight"in $&&a(0,o=$.minHeight),"maxHeight"in $&&a(1,n=$.maxHeight),"disabled"in $&&a(5,Q=$.disabled),"placeholder"in $&&a(6,u=$.placeholder),"language"in $&&a(7,c=$.language),"singleLine"in $&&a(8,f=$.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&s&&EO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[P.reconfigure(NO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&h.dispatch({effects:[m.reconfigure(q.editable.of(!Q)),x.reconfigure(C.readOnly.of(Q))]}),e.$$.dirty&1032&&h&&i!=h.state.doc.toString()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:i}}),e.$$.dirty&1088&&h&&typeof u<"u"&&h.dispatch({effects:[X.reconfigure(JO(u))]})},[o,n,d,i,s,Q,u,c,f,R,h,xt]}class Ps extends wt{constructor(O){super(),Rt(this,O,ds,ps,Yt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Ps as default}; diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-DG3NuEPP.js b/ui/dist/assets/ConfirmEmailChangeDocs-T4e4Bmxi.js similarity index 64% rename from ui/dist/assets/ConfirmEmailChangeDocs-DG3NuEPP.js rename to ui/dist/assets/ConfirmEmailChangeDocs-T4e4Bmxi.js index 13aba19177..5f79a45479 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-DG3NuEPP.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-T4e4Bmxi.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Oe,O as Y,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as $e,w as j,P as _e,Q as ye,k as Re,R as Te,n as Ae,t as ee,a as te,o as m,d as we,C as Ee,A as qe,q as H,r as Be,N as Ue}from"./index-rLaTJP5R.js";import{S as De}from"./SdkTabs-DJGq8srX.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,A,Z,E,x,S,q,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` +import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-B6GxOPDi.js";import{S as De}from"./SdkTabs-C9BIEbpG.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -21,7 +21,7 @@ import{S as Pe,i as Se,s as Oe,O as Y,e as r,v,b as k,c as Ce,f as b,g as d,h as 'YOUR_PASSWORD', ); `}});let W=Y(o[2]);const de=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required token
    String The token from the change email request email.
    Required password
    String The account password to confirm the email change.',Z=k(),E=r("div"),E.textContent="Responses",x=k(),S=r("div"),q=r("div");for(let e=0;eParam Type Description
    Required token
    String The token from the change email request email.
    Required password
    String The account password to confirm the email change.',Z=k(),q=r("div"),q.textContent="Responses",x=k(),S=r("div"),A=r("div");for(let e=0;es(1,u=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=Ee.getApiExampleUrl(qe.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),w.$set(c),(!O||t&1)&&M!==(M=e[0].name+"")&&j(J,M),t&6&&(W=Y(e[2]),g=_e(g,t,de,1,e,W,ie,A,ye,ge,null,ke)),t&6&&(U=Y(e[2]),Re(),h=_e(h,t,me,1,e,U,re,B,Te,ve,null,he),Ee())},i(e){if(!O){ee(w.$$.fragment,e);for(let t=0;ts(1,u=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=qe.getApiExampleUrl(Ae.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-CFOUXiAS.js b/ui/dist/assets/ConfirmPasswordResetDocs-DCQFPDN7.js similarity index 70% rename from ui/dist/assets/ConfirmPasswordResetDocs-CFOUXiAS.js rename to ui/dist/assets/ConfirmPasswordResetDocs-DCQFPDN7.js index e6bffd8123..b53dd82c64 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-CFOUXiAS.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-DCQFPDN7.js @@ -1,4 +1,4 @@ -import{S as Ne,i as $e,s as Ce,O as K,e as c,v as w,b as k,c as Ae,f as b,g as r,h as n,m as Re,w as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,A as Be,q as j,r as Me,N as Fe}from"./index-rLaTJP5R.js";import{S as Ie}from"./SdkTabs-DJGq8srX.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Ae(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Re(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,A,y,v=[],ie=new Map,de,D,h=[],ce=new Map,R;W=new Ie({props:{js:` +import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-B6GxOPDi.js";import{S as Ie}from"./SdkTabs-C9BIEbpG.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -35,7 +35,7 @@ import{S as Ne,i as $e,s as Ce,O as K,e as c,v as w,b as k,c as Ae,f as b,g as r // (after the above call all previously issued tokens are invalidated) await pb.collection('${(be=o[0])==null?void 0:be.name}').authWithPassword(oldAuth.email, 'NEW_PASSWORD'); `}});let I=K(o[2]);const re=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required token
    String The token from the password reset request email.
    Required password
    String The new password to set.
    Required passwordConfirm
    String The new password confirmation.',Z=k(),E=c("div"),E.textContent="Responses",x=k(),A=c("div"),y=c("div");for(let e=0;eParam Type Description
    Required token
    String The token from the password reset request email.
    Required password
    String The new password to set.
    Required passwordConfirm
    String The new password confirmation.',Z=k(),E=c("div"),E.textContent="Responses",x=k(),R=c("div"),y=c("div");for(let e=0;es(1,m=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=qe.getApiExampleUrl(Be.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),W.$set(d),(!A||t&1)&&F!==(F=e[0].name+"")&&U(V,F),t&6&&(I=K(e[2]),v=we(v,t,re,1,e,I,ie,y,Ee,We,null,Pe)),t&6&&(T=K(e[2]),ye(),h=we(h,t,pe,1,e,T,ce,D,De,ge,null,Se),Te())},i(e){if(!A){ee(W.$$.fragment,e);for(let t=0;ts(1,m=f.code);return o.$$set=f=>{"collection"in f&&s(0,_=f.collection)},s(3,a=qe.getApiExampleUrl(Be.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/ConfirmVerificationDocs-CPe-dhLl.js b/ui/dist/assets/ConfirmVerificationDocs-BKx9x0MU.js similarity index 62% rename from ui/dist/assets/ConfirmVerificationDocs-CPe-dhLl.js rename to ui/dist/assets/ConfirmVerificationDocs-BKx9x0MU.js index a9fdd95a09..541db06853 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-CPe-dhLl.js +++ b/ui/dist/assets/ConfirmVerificationDocs-BKx9x0MU.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,v as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,w as H,P as ke,Q as qe,k as Re,R as Oe,n as Ae,t as x,a as ee,o as d,d as Pe,C as Ee,A as Ne,q as F,r as Ve,N as Ke}from"./index-rLaTJP5R.js";import{S as Me}from"./SdkTabs-DJGq8srX.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ve(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Ke({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,V=o[0].name+"",I,te,L,y,Q,T,z,C,K,le,M,B,se,G,U=o[0].name+"",J,ae,W,q,X,R,Y,O,Z,P,A,v=[],oe=new Map,ne,E,_=[],ie=new Map,S;y=new Me({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-B6GxOPDi.js";import{S as Ae}from"./SdkTabs-C9BIEbpG.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -20,7 +20,7 @@ import{S as Se,i as Te,s as Be,O as D,e as r,v as g,b as k,c as ye,f as h,g as f // optionally refresh the previous authStore state with the latest record changes await pb.collection('${(ue=o[0])==null?void 0:ue.name}').authRefresh(); - `}});let j=D(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required token
    String The token from the verification request email.',Y=k(),O=r("div"),O.textContent="Responses",Z=k(),P=r("div"),A=r("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required token
    String The token from the verification request email.',Y=k(),O=r("div"),O.textContent="Responses",Z=k(),P=r("div"),E=r("div");for(let e=0;es(1,m=u.code);return o.$$set=u=>{"collection"in u&&s(0,b=u.collection)},s(3,a=Ee.getApiExampleUrl(Ne.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + `),y.$set(c),(!S||t&1)&&U!==(U=e[0].name+"")&&H(J,U),t&6&&(j=D(e[2]),v=ke(v,t,ce,1,e,j,oe,E,Re,we,null,ge)),t&6&&(V=D(e[2]),qe(),_=ke(_,t,re,1,e,V,ie,N,Oe,$e,null,ve),Ee())},i(e){if(!S){x(y.$$.fragment,e);for(let t=0;ts(1,m=u.code);return o.$$set=u=>{"collection"in u&&s(0,b=u.collection)},s(3,a=Ne.getApiExampleUrl(Ve.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/CreateApiDocs-cTL4BTwH.js b/ui/dist/assets/CreateApiDocs-cTL4BTwH.js new file mode 100644 index 0000000000..4edca277b3 --- /dev/null +++ b/ui/dist/assets/CreateApiDocs-cTL4BTwH.js @@ -0,0 +1,92 @@ +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-B6GxOPDi.js";import{S as At}from"./SdkTabs-C9BIEbpG.js";import{F as Bt}from"./FieldsQueryParam-DB2XHXnv.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
    Optional username
    String The username of the auth record. +
    + If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
    Optional emailVisibility
    Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
    Required password
    String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
    Required passwordConfirm
    String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
    Optional verified
    Boolean Indicates whether the auth record is verified or not. +
    + This field can be set only by admins or auth records with "Manage" access.`,g=u(),b=i("tr"),b.innerHTML='Schema fields',v(p,"class","inline-flex")},m(h,C){r(h,e,C),r(h,t,C),r(h,a,C),r(h,f,C),r(h,m,C),n(m,c),n(c,p),F.m(p,null),n(p,y),n(p,S),n(m,T),n(m,w),n(m,H),n(m,D),r(h,E,C),r(h,P,C),r(h,I,C),r(h,j,C),r(h,B,C),r(h,$,C),r(h,N,C),r(h,q,C),r(h,g,C),r(h,b,C)},p(h,C){z!==(z=O(h))&&(F.d(1),F=z(h),F&&(F.c(),F.m(p,y)))},d(h){h&&(d(e),d(t),d(a),d(f),d(m),d(E),d(P),d(I),d(j),d(B),d($),d(N),d(q),d(g),d(b)),F.d()}}}function jt(o){let e;return{c(){e=i("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Dt(o){let e;return{c(){e=i("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Nt(o){let e;return{c(){e=i("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Vt(o){let e;return{c(){e=i("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Jt(o){var m;let e,t=((m=o[13].options)==null?void 0:m.maxSelect)===1?"id":"ids",a,f;return{c(){e=_("Relation record "),a=_(t),f=_(".")},m(c,p){r(c,e,p),r(c,a,p),r(c,f,p)},p(c,p){var y;p&1&&t!==(t=((y=c[13].options)==null?void 0:y.maxSelect)===1?"id":"ids")&&x(a,t)},d(c){c&&(d(e),d(a),d(f))}}}function Et(o){let e,t,a,f,m;return{c(){e=_("File object."),t=i("br"),a=_(` + Set to `),f=i("code"),f.textContent="null",m=_(" to delete already uploaded file(s).")},m(c,p){r(c,e,p),r(c,t,p),r(c,a,p),r(c,f,p),r(c,m,p)},p:ae,d(c){c&&(d(e),d(t),d(a),d(f),d(m))}}}function It(o){let e;return{c(){e=_("URL address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Ut(o){let e;return{c(){e=_("Email address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Qt(o){let e;return{c(){e=_("JSON array or object.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function zt(o){let e;return{c(){e=_("Number value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Kt(o){let e;return{c(){e=_("Plain text value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function $t(o,e){let t,a,f,m,c,p=e[13].name+"",y,S,T,w,H=Q.getFieldValueType(e[13])+"",D,E,P,I;function j(b,O){return b[13].required?Vt:Nt}let B=j(e),$=B(e);function N(b,O){if(b[13].type==="text")return Kt;if(b[13].type==="number")return zt;if(b[13].type==="json")return Qt;if(b[13].type==="email")return Ut;if(b[13].type==="url")return It;if(b[13].type==="file")return Et;if(b[13].type==="relation")return Jt}let q=N(e),g=q&&q(e);return{key:o,first:null,c(){t=i("tr"),a=i("td"),f=i("div"),$.c(),m=u(),c=i("span"),y=_(p),S=u(),T=i("td"),w=i("span"),D=_(H),E=u(),P=i("td"),g&&g.c(),I=u(),v(f,"class","inline-flex"),v(w,"class","label"),this.first=t},m(b,O){r(b,t,O),n(t,a),n(a,f),$.m(f,null),n(f,m),n(f,c),n(c,y),n(t,S),n(t,T),n(T,w),n(w,D),n(t,E),n(t,P),g&&g.m(P,null),n(t,I)},p(b,O){e=b,B!==(B=j(e))&&($.d(1),$=B(e),$&&($.c(),$.m(f,m))),O&1&&p!==(p=e[13].name+"")&&x(y,p),O&1&&H!==(H=Q.getFieldValueType(e[13])+"")&&x(D,H),q===(q=N(e))&&g?g.p(e,O):(g&&g.d(1),g=q&&q(e),g&&(g.c(),g.m(P,null)))},d(b){b&&d(t),$.d(),g&&g.d()}}}function Ct(o,e){let t,a=e[8].code+"",f,m,c,p;function y(){return e[7](e[8])}return{key:o,first:null,c(){t=i("button"),f=_(a),m=u(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(S,T){r(S,t,T),n(t,f),n(t,m),c||(p=Rt(t,"click",y),c=!0)},p(S,T){e=S,T&8&&a!==(a=e[8].code+"")&&x(f,a),T&12&&ye(t,"active",e[2]===e[8].code)},d(S){S&&d(t),c=!1,p()}}}function St(o,e){let t,a,f,m;return a=new Tt({props:{content:e[8].body}}),{key:o,first:null,c(){t=i("div"),_e(a.$$.fragment),f=u(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(c,p){r(c,t,p),he(a,t,null),n(t,f),m=!0},p(c,p){e=c;const y={};p&8&&(y.content=e[8].body),a.$set(y),(!m||p&12)&&ye(t,"active",e[2]===e[8].code)},i(c){m||(ue(a.$$.fragment,c),m=!0)},o(c){fe(a.$$.fragment,c),m=!1},d(c){c&&d(t),ke(a)}}}function Wt(o){var ot,rt,dt,ct,pt;let e,t,a=o[0].name+"",f,m,c,p,y,S,T,w=o[0].name+"",H,D,E,P,I,j,B,$,N,q,g,b,O,z,F,h,C,ee,K=o[0].name+"",ve,je,De,ge,se,we,W,$e,Ne,U,Ce,Ve,Se,V=[],Je=new Map,Te,ie,qe,Y,Oe,Ee,oe,G,Me,Ie,He,Ue,M,Qe,te,ze,Ke,We,Le,Ye,Pe,Ge,Xe,Ze,Fe,xe,et,le,Re,re,Ae,X,de,J=[],tt=new Map,lt,ce,R=[],nt=new Map,Z;$=new At({props:{js:` +import PocketBase from 'pocketbase'; + +const pb = new PocketBase('${o[5]}'); + +... + +// example create data +const data = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,4)}; + +const record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(data); +`+(o[1]?` +// (optional) send an email verification request +await pb.collection('${(rt=o[0])==null?void 0:rt.name}').requestVerification('test@example.com'); +`:""),dart:` +import 'package:pocketbase/pocketbase.dart'; + +final pb = PocketBase('${o[5]}'); + +... + +// example create body +final body = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,2)}; + +final record = await pb.collection('${(dt=o[0])==null?void 0:dt.name}').create(body: body); +`+(o[1]?` +// (optional) send an email verification request +await pb.collection('${(ct=o[0])==null?void 0:ct.name}').requestVerification('test@example.com'); +`:"")}});let A=o[6]&>(),L=o[1]&&wt(o),me=ne((pt=o[0])==null?void 0:pt.schema);const at=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;ll[8].code;for(let l=0;lapplication/json or + multipart/form-data.`,I=u(),j=i("p"),j.innerHTML=`File upload is supported only via multipart/form-data. +
    + For more info and examples you could check the detailed + Files upload and handling docs + .`,B=u(),_e($.$$.fragment),N=u(),q=i("h6"),q.textContent="API details",g=u(),b=i("div"),O=i("strong"),O.textContent="POST",z=u(),F=i("div"),h=i("p"),C=_("/api/collections/"),ee=i("strong"),ve=_(K),je=_("/records"),De=u(),A&&A.c(),ge=u(),se=i("div"),se.textContent="Body Parameters",we=u(),W=i("table"),$e=i("thead"),$e.innerHTML='Param Type Description',Ne=u(),U=i("tbody"),Ce=i("tr"),Ce.innerHTML=`
    Optional id
    String 15 characters string to store as record ID. +
    + If not set, it will be auto generated.`,Ve=u(),L&&L.c(),Se=u();for(let l=0;lParam Type Description',Ee=u(),oe=i("tbody"),G=i("tr"),Me=i("td"),Me.textContent="expand",Ie=u(),He=i("td"),He.innerHTML='String',Ue=u(),M=i("td"),Qe=_(`Auto expand relations when returning the created record. Ex.: + `),_e(te.$$.fragment),ze=_(` + Supports up to 6-levels depth nested relations expansion. `),Ke=i("br"),We=_(` + The expanded relations will be appended to the record under the + `),Le=i("code"),Le.textContent="expand",Ye=_(" property (eg. "),Pe=i("code"),Pe.textContent='"expand": {"relField1": {...}, ...}',Ge=_(`). + `),Xe=i("br"),Ze=_(` + Only the relations to which the request user has permissions to `),Fe=i("strong"),Fe.textContent="view",xe=_(" will be expanded."),et=u(),_e(le.$$.fragment),Re=u(),re=i("div"),re.textContent="Responses",Ae=u(),X=i("div"),de=i("div");for(let l=0;l${JSON.stringify(Object.assign({},l[4],Q.dummyCollectionSchemaData(l[0])),null,2)}; + +final record = await pb.collection('${(mt=l[0])==null?void 0:mt.name}').create(body: body); +`+(l[1]?` +// (optional) send an email verification request +await pb.collection('${(bt=l[0])==null?void 0:bt.name}').requestVerification('test@example.com'); +`:"")),$.$set(k),(!Z||s&1)&&K!==(K=l[0].name+"")&&x(ve,K),l[6]?A||(A=gt(),A.c(),A.m(b,null)):A&&(A.d(1),A=null),l[1]?L?L.p(l,s):(L=wt(l),L.c(),L.m(U,Se)):L&&(L.d(1),L=null),s&1&&(me=ne((_t=l[0])==null?void 0:_t.schema),V=Be(V,s,at,1,l,me,Je,U,ht,$t,null,vt)),s&12&&(be=ne(l[3]),J=Be(J,s,st,1,l,be,tt,de,ht,Ct,null,yt)),s&12&&(pe=ne(l[3]),Ht(),R=Be(R,s,it,1,l,pe,nt,ce,Lt,St,null,kt),Pt())},i(l){if(!Z){ue($.$$.fragment,l),ue(te.$$.fragment,l),ue(le.$$.fragment,l);for(let s=0;st(2,p=w.code);return o.$$set=w=>{"collection"in w&&t(0,c=w.collection)},o.$$.update=()=>{var w,H;o.$$.dirty&1&&t(1,a=c.type==="auth"),o.$$.dirty&1&&t(6,f=(c==null?void 0:c.createRule)===null),o.$$.dirty&1&&t(3,y=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(c),null,2)},{code:400,body:` + { + "code": 400, + "message": "Failed to create record.", + "data": { + "${(H=(w=c==null?void 0:c.schema)==null?void 0:w[0])==null?void 0:H.name}": { + "code": "validation_required", + "message": "Missing required value." + } + } + } + `},{code:403,body:` + { + "code": 403, + "message": "You are not allowed to perform this request.", + "data": {} + } + `}]),o.$$.dirty&2&&(a?t(4,S={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):t(4,S={}))},t(5,m=Q.getApiExampleUrl(Ft.baseUrl)),[c,a,p,y,S,m,f,T]}class xt extends qt{constructor(e){super(),Ot(this,e,Yt,Wt,Mt,{collection:0})}}export{xt as default}; diff --git a/ui/dist/assets/CreateApiDocs-jPKcVL6M.js b/ui/dist/assets/CreateApiDocs-jPKcVL6M.js deleted file mode 100644 index 82584a5123..0000000000 --- a/ui/dist/assets/CreateApiDocs-jPKcVL6M.js +++ /dev/null @@ -1,92 +0,0 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as s,v as _,b as f,c as _e,f as v,g as r,h as n,m as he,w as x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as fe,a as ue,o as d,d as ke,A as At,q as ye,r as Ft,x as ae}from"./index-rLaTJP5R.js";import{S as Rt}from"./SdkTabs-DJGq8srX.js";import{F as Bt}from"./FieldsQueryParam-Bw7BgfEJ.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=s("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,u,m,c,p,y,S,T,w,H,D,E,P,I,j,B,C,N,q,g,b;function O(h,$){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),A=z(o);return{c(){e=s("tr"),e.innerHTML='Auth fields',t=f(),a=s("tr"),a.innerHTML=`
    Optional username
    String The username of the auth record. -
    - If not set, it will be auto generated.`,u=f(),m=s("tr"),c=s("td"),p=s("div"),A.c(),y=f(),S=s("span"),S.textContent="email",T=f(),w=s("td"),w.innerHTML='String',H=f(),D=s("td"),D.textContent="Auth record email address.",E=f(),P=s("tr"),P.innerHTML='
    Optional emailVisibility
    Boolean Whether to show/hide the auth record email when fetching the record data.',I=f(),j=s("tr"),j.innerHTML='
    Required password
    String Auth record password.',B=f(),C=s("tr"),C.innerHTML='
    Required passwordConfirm
    String Auth record password confirmation.',N=f(),q=s("tr"),q.innerHTML=`
    Optional verified
    Boolean Indicates whether the auth record is verified or not. -
    - This field can be set only by admins or auth records with "Manage" access.`,g=f(),b=s("tr"),b.innerHTML='Schema fields',v(p,"class","inline-flex")},m(h,$){r(h,e,$),r(h,t,$),r(h,a,$),r(h,u,$),r(h,m,$),n(m,c),n(c,p),A.m(p,null),n(p,y),n(p,S),n(m,T),n(m,w),n(m,H),n(m,D),r(h,E,$),r(h,P,$),r(h,I,$),r(h,j,$),r(h,B,$),r(h,C,$),r(h,N,$),r(h,q,$),r(h,g,$),r(h,b,$)},p(h,$){z!==(z=O(h))&&(A.d(1),A=z(h),A&&(A.c(),A.m(p,y)))},d(h){h&&(d(e),d(t),d(a),d(u),d(m),d(E),d(P),d(I),d(j),d(B),d(C),d(N),d(q),d(g),d(b)),A.d()}}}function jt(o){let e;return{c(){e=s("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Dt(o){let e;return{c(){e=s("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Nt(o){let e;return{c(){e=s("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Vt(o){let e;return{c(){e=s("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function Jt(o){var m;let e,t=((m=o[13].options)==null?void 0:m.maxSelect)===1?"id":"ids",a,u;return{c(){e=_("Relation record "),a=_(t),u=_(".")},m(c,p){r(c,e,p),r(c,a,p),r(c,u,p)},p(c,p){var y;p&1&&t!==(t=((y=c[13].options)==null?void 0:y.maxSelect)===1?"id":"ids")&&x(a,t)},d(c){c&&(d(e),d(a),d(u))}}}function Et(o){let e,t,a,u,m;return{c(){e=_("File object."),t=s("br"),a=_(` - Set to `),u=s("code"),u.textContent="null",m=_(" to delete already uploaded file(s).")},m(c,p){r(c,e,p),r(c,t,p),r(c,a,p),r(c,u,p),r(c,m,p)},p:ae,d(c){c&&(d(e),d(t),d(a),d(u),d(m))}}}function It(o){let e;return{c(){e=_("URL address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Ut(o){let e;return{c(){e=_("Email address.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Qt(o){let e;return{c(){e=_("JSON array or object.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function zt(o){let e;return{c(){e=_("Number value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Kt(o){let e;return{c(){e=_("Plain text value.")},m(t,a){r(t,e,a)},p:ae,d(t){t&&d(e)}}}function Ct(o,e){let t,a,u,m,c,p=e[13].name+"",y,S,T,w,H=Q.getFieldValueType(e[13])+"",D,E,P,I;function j(b,O){return b[13].required?Vt:Nt}let B=j(e),C=B(e);function N(b,O){if(b[13].type==="text")return Kt;if(b[13].type==="number")return zt;if(b[13].type==="json")return Qt;if(b[13].type==="email")return Ut;if(b[13].type==="url")return It;if(b[13].type==="file")return Et;if(b[13].type==="relation")return Jt}let q=N(e),g=q&&q(e);return{key:o,first:null,c(){t=s("tr"),a=s("td"),u=s("div"),C.c(),m=f(),c=s("span"),y=_(p),S=f(),T=s("td"),w=s("span"),D=_(H),E=f(),P=s("td"),g&&g.c(),I=f(),v(u,"class","inline-flex"),v(w,"class","label"),this.first=t},m(b,O){r(b,t,O),n(t,a),n(a,u),C.m(u,null),n(u,m),n(u,c),n(c,y),n(t,S),n(t,T),n(T,w),n(w,D),n(t,E),n(t,P),g&&g.m(P,null),n(t,I)},p(b,O){e=b,B!==(B=j(e))&&(C.d(1),C=B(e),C&&(C.c(),C.m(u,m))),O&1&&p!==(p=e[13].name+"")&&x(y,p),O&1&&H!==(H=Q.getFieldValueType(e[13])+"")&&x(D,H),q===(q=N(e))&&g?g.p(e,O):(g&&g.d(1),g=q&&q(e),g&&(g.c(),g.m(P,null)))},d(b){b&&d(t),C.d(),g&&g.d()}}}function $t(o,e){let t,a=e[8].code+"",u,m,c,p;function y(){return e[7](e[8])}return{key:o,first:null,c(){t=s("button"),u=_(a),m=f(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(S,T){r(S,t,T),n(t,u),n(t,m),c||(p=Ft(t,"click",y),c=!0)},p(S,T){e=S,T&8&&a!==(a=e[8].code+"")&&x(u,a),T&12&&ye(t,"active",e[2]===e[8].code)},d(S){S&&d(t),c=!1,p()}}}function St(o,e){let t,a,u,m;return a=new Tt({props:{content:e[8].body}}),{key:o,first:null,c(){t=s("div"),_e(a.$$.fragment),u=f(),v(t,"class","tab-item"),ye(t,"active",e[2]===e[8].code),this.first=t},m(c,p){r(c,t,p),he(a,t,null),n(t,u),m=!0},p(c,p){e=c;const y={};p&8&&(y.content=e[8].body),a.$set(y),(!m||p&12)&&ye(t,"active",e[2]===e[8].code)},i(c){m||(fe(a.$$.fragment,c),m=!0)},o(c){ue(a.$$.fragment,c),m=!1},d(c){c&&d(t),ke(a)}}}function Wt(o){var ot,rt,dt,ct,pt;let e,t,a=o[0].name+"",u,m,c,p,y,S,T,w=o[0].name+"",H,D,E,P,I,j,B,C,N,q,g,b,O,z,A,h,$,ee,K=o[0].name+"",ve,je,De,ge,ie,we,W,Ce,Ne,U,$e,Ve,Se,V=[],Je=new Map,Te,se,qe,Y,Oe,Ee,oe,G,Me,Ie,He,Ue,M,Qe,te,ze,Ke,We,Le,Ye,Pe,Ge,Xe,Ze,Ae,xe,et,le,Fe,re,Re,X,de,J=[],tt=new Map,lt,ce,F=[],nt=new Map,Z;C=new Rt({props:{js:` -import PocketBase from 'pocketbase'; - -const pb = new PocketBase('${o[5]}'); - -... - -// example create data -const data = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,4)}; - -const record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(data); -`+(o[1]?` -// (optional) send an email verification request -await pb.collection('${(rt=o[0])==null?void 0:rt.name}').requestVerification('test@example.com'); -`:""),dart:` -import 'package:pocketbase/pocketbase.dart'; - -final pb = PocketBase('${o[5]}'); - -... - -// example create body -final body = ${JSON.stringify(Object.assign({},o[4],Q.dummyCollectionSchemaData(o[0])),null,2)}; - -final record = await pb.collection('${(dt=o[0])==null?void 0:dt.name}').create(body: body); -`+(o[1]?` -// (optional) send an email verification request -await pb.collection('${(ct=o[0])==null?void 0:ct.name}').requestVerification('test@example.com'); -`:"")}});let R=o[6]&>(),L=o[1]&&wt(o),me=ne((pt=o[0])==null?void 0:pt.schema);const at=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;ll[8].code;for(let l=0;lapplication/json or - multipart/form-data.`,I=f(),j=s("p"),j.innerHTML=`File upload is supported only via multipart/form-data. -
    - For more info and examples you could check the detailed - Files upload and handling docs - .`,B=f(),_e(C.$$.fragment),N=f(),q=s("h6"),q.textContent="API details",g=f(),b=s("div"),O=s("strong"),O.textContent="POST",z=f(),A=s("div"),h=s("p"),$=_("/api/collections/"),ee=s("strong"),ve=_(K),je=_("/records"),De=f(),R&&R.c(),ge=f(),ie=s("div"),ie.textContent="Body Parameters",we=f(),W=s("table"),Ce=s("thead"),Ce.innerHTML='Param Type Description',Ne=f(),U=s("tbody"),$e=s("tr"),$e.innerHTML=`
    Optional id
    String 15 characters string to store as record ID. -
    - If not set, it will be auto generated.`,Ve=f(),L&&L.c(),Se=f();for(let l=0;lParam Type Description',Ee=f(),oe=s("tbody"),G=s("tr"),Me=s("td"),Me.textContent="expand",Ie=f(),He=s("td"),He.innerHTML='String',Ue=f(),M=s("td"),Qe=_(`Auto expand relations when returning the created record. Ex.: - `),_e(te.$$.fragment),ze=_(` - Supports up to 6-levels depth nested relations expansion. `),Ke=s("br"),We=_(` - The expanded relations will be appended to the record under the - `),Le=s("code"),Le.textContent="expand",Ye=_(" property (eg. "),Pe=s("code"),Pe.textContent='"expand": {"relField1": {...}, ...}',Ge=_(`). - `),Xe=s("br"),Ze=_(` - Only the relations to which the request user has permissions to `),Ae=s("strong"),Ae.textContent="view",xe=_(" will be expanded."),et=f(),_e(le.$$.fragment),Fe=f(),re=s("div"),re.textContent="Responses",Re=f(),X=s("div"),de=s("div");for(let l=0;l${JSON.stringify(Object.assign({},l[4],Q.dummyCollectionSchemaData(l[0])),null,2)}; - -final record = await pb.collection('${(mt=l[0])==null?void 0:mt.name}').create(body: body); -`+(l[1]?` -// (optional) send an email verification request -await pb.collection('${(bt=l[0])==null?void 0:bt.name}').requestVerification('test@example.com'); -`:"")),C.$set(k),(!Z||i&1)&&K!==(K=l[0].name+"")&&x(ve,K),l[6]?R||(R=gt(),R.c(),R.m(b,null)):R&&(R.d(1),R=null),l[1]?L?L.p(l,i):(L=wt(l),L.c(),L.m(U,Se)):L&&(L.d(1),L=null),i&1&&(me=ne((_t=l[0])==null?void 0:_t.schema),V=Be(V,i,at,1,l,me,Je,U,ht,Ct,null,vt)),i&12&&(be=ne(l[3]),J=Be(J,i,it,1,l,be,tt,de,ht,$t,null,yt)),i&12&&(pe=ne(l[3]),Ht(),F=Be(F,i,st,1,l,pe,nt,ce,Lt,St,null,kt),Pt())},i(l){if(!Z){fe(C.$$.fragment,l),fe(te.$$.fragment,l),fe(le.$$.fragment,l);for(let i=0;it(2,p=w.code);return o.$$set=w=>{"collection"in w&&t(0,c=w.collection)},o.$$.update=()=>{var w,H;o.$$.dirty&1&&t(1,a=c.type==="auth"),o.$$.dirty&1&&t(6,u=(c==null?void 0:c.createRule)===null),o.$$.dirty&1&&t(3,y=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(c),null,2)},{code:400,body:` - { - "code": 400, - "message": "Failed to create record.", - "data": { - "${(H=(w=c==null?void 0:c.schema)==null?void 0:w[0])==null?void 0:H.name}": { - "code": "validation_required", - "message": "Missing required value." - } - } - } - `},{code:403,body:` - { - "code": 403, - "message": "You are not allowed to perform this request.", - "data": {} - } - `}]),o.$$.dirty&2&&(a?t(4,S={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):t(4,S={}))},t(5,m=Q.getApiExampleUrl(At.baseUrl)),[c,a,p,y,S,m,u,T]}class xt extends qt{constructor(e){super(),Ot(this,e,Yt,Wt,Mt,{collection:0})}}export{xt as default}; diff --git a/ui/dist/assets/DeleteApiDocs-EnRun5cS.js b/ui/dist/assets/DeleteApiDocs-C521Da9d.js similarity index 60% rename from ui/dist/assets/DeleteApiDocs-EnRun5cS.js rename to ui/dist/assets/DeleteApiDocs-C521Da9d.js index 0e9bc65d5a..d6b2fb078e 100644 --- a/ui/dist/assets/DeleteApiDocs-EnRun5cS.js +++ b/ui/dist/assets/DeleteApiDocs-C521Da9d.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,v as y,b as k,c as Ce,f as m,g as p,h as i,m as De,w as ee,P as he,Q as Oe,k as Te,R as Ae,n as Be,t as te,a as le,o as u,d as we,C as Ie,A as qe,q as N,r as Me,N as Se}from"./index-rLaTJP5R.js";import{S as He}from"./SdkTabs-DJGq8srX.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Me(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),Ce(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),De(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,C,z,M=a[0].name+"",F,se,K,D,Q,E,G,g,S,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,A,x,w,B,v=[],ce=new Map,de,I,b=[],re=new Map,R;D=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-B6GxOPDi.js";import{S as He}from"./SdkTabs-C9BIEbpG.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -14,7 +14,7 @@ import{S as Re,i as Pe,s as Ee,O as j,e as c,v as y,b as k,c as Ce,f as m,g as p ... await pb.collection('${(me=a[0])==null?void 0:me.name}').delete('RECORD_ID'); - `}});let _=a[1]&&ve(),U=j(a[4]);const fe=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to delete.',Z=k(),A=c("div"),A.textContent="Responses",x=k(),w=c("div"),B=c("div");for(let e=0;ee[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to delete.',Z=k(),B=c("div"),B.textContent="Responses",x=k(),w=c("div"),I=c("div");for(let e=0;es(2,n=C.code);return a.$$set=C=>{"collection"in C&&s(0,d=C.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,o=(d==null?void 0:d.deleteRule)===null),a.$$.dirty&3&&d!=null&&d.id&&(r.push({code:204,body:` + `),C.$set(f),(!R||t&1)&&L!==(L=e[0].name+"")&&ee(V,L),e[1]?_||(_=ve(),_.c(),_.m(g,null)):_&&(_.d(1),_=null),t&20&&(U=j(e[4]),v=he(v,t,fe,1,e,U,ce,I,Oe,ye,null,ge)),t&20&&(M=j(e[4]),Te(),b=he(b,t,pe,1,e,M,re,A,Be,$e,null,ke),Ie())},i(e){if(!R){te(C.$$.fragment,e);for(let t=0;ts(2,n=D.code);return a.$$set=D=>{"collection"in D&&s(0,d=D.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,o=(d==null?void 0:d.deleteRule)===null),a.$$.dirty&3&&d!=null&&d.id&&(r.push({code:204,body:` null `}),r.push({code:400,body:` { @@ -50,4 +50,4 @@ import{S as Re,i as Pe,s as Ee,O as j,e as c,v as y,b as k,c as Ce,f as m,g as p "message": "The requested resource wasn't found.", "data": {} } - `}))},s(3,h=Ie.getApiExampleUrl(qe.baseUrl)),[d,o,n,h,r,$]}class ze extends Re{constructor(l){super(),Pe(this,l,Ue,Le,Ee,{collection:0})}}export{ze as default}; + `}))},s(3,h=Ae.getApiExampleUrl(Me.baseUrl)),[d,o,n,h,r,$]}class ze extends Re{constructor(l){super(),Pe(this,l,Ue,Le,Ee,{collection:0})}}export{ze as default}; diff --git a/ui/dist/assets/FieldsQueryParam-Bw7BgfEJ.js b/ui/dist/assets/FieldsQueryParam-DB2XHXnv.js similarity index 67% rename from ui/dist/assets/FieldsQueryParam-Bw7BgfEJ.js rename to ui/dist/assets/FieldsQueryParam-DB2XHXnv.js index b73aba3b41..59e023d2d0 100644 --- a/ui/dist/assets/FieldsQueryParam-Bw7BgfEJ.js +++ b/ui/dist/assets/FieldsQueryParam-DB2XHXnv.js @@ -1,7 +1,7 @@ -import{S as J,i as O,s as P,N as Q,e as t,b as c,v as i,c as R,f as j,g as z,h as e,m as A,w as D,t as G,a as K,o as U,d as V}from"./index-rLaTJP5R.js";function W(f){let n,o,u,d,k,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,v,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',k=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as O,s as P,N as Q,e as t,b as c,w as i,c as R,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-B6GxOPDi.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,k,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),h=t("em"),h.textContent="(by default returns all fields)",y=i(`. Ex.: `),R(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. `),M=t("br"),N=i(` Ex.: - `),m=t("code"),T=i("?fields=*,"),v=i(f[0]),B=i("description:excerpt(200,true)"),j(o,"id","query-page")},m(l,g){z(l,n,g),e(n,o),e(n,u),e(n,d),e(n,k),e(n,s),e(s,p),e(p,w),e(p,h),e(p,y),A(r,p,null),e(s,F),e(s,_),e(s,S),e(s,b),e(s,E),e(s,C),e(C,a),e(a,$),e(a,L),e(a,q),e(a,H),e(a,M),e(a,N),e(a,m),e(m,T),e(m,v),e(m,B),x=!0},p(l,[g]){const I={};g&1&&(I.content="?fields=*,"+l[0]+"expand.relField.name"),r.$set(I),(!x||g&1)&&D(v,l[0])},i(l){x||(G(r.$$.fragment,l),x=!0)},o(l){K(r.$$.fragment,l),x=!1},d(l){l&&U(n),V(r)}}}function X(f,n,o){let{prefix:u=""}=n;return f.$$set=d=>{"prefix"in d&&o(0,u=d.prefix)},[u]}class Z extends J{constructor(n){super(),O(this,n,X,W,P,{prefix:0})}}export{Z as F}; + `),m=t("code"),T=i("?fields=*,"),k=i(f[0]),B=i("description:excerpt(200,true)"),j(o,"id","query-page")},m(l,g){z(l,n,g),e(n,o),e(n,u),e(n,d),e(n,v),e(n,s),e(s,p),e(p,w),e(p,h),e(p,y),A(r,p,null),e(s,F),e(s,_),e(s,S),e(s,b),e(s,E),e(s,C),e(C,a),e(a,$),e(a,L),e(a,q),e(a,H),e(a,M),e(a,N),e(a,m),e(m,T),e(m,k),e(m,B),x=!0},p(l,[g]){const I={};g&1&&(I.content="?fields=*,"+l[0]+"expand.relField.name"),r.$set(I),(!x||g&1)&&D(k,l[0])},i(l){x||(G(r.$$.fragment,l),x=!0)},o(l){K(r.$$.fragment,l),x=!1},d(l){l&&U(n),V(r)}}}function X(f,n,o){let{prefix:u=""}=n;return f.$$set=d=>{"prefix"in d&&o(0,u=d.prefix)},[u]}class Z extends J{constructor(n){super(),O(this,n,X,W,P,{prefix:0})}}export{Z as F}; diff --git a/ui/dist/assets/FilterAutocompleteInput-BPeaOUvB.js b/ui/dist/assets/FilterAutocompleteInput-CFHe_5bb.js similarity index 70% rename from ui/dist/assets/FilterAutocompleteInput-BPeaOUvB.js rename to ui/dist/assets/FilterAutocompleteInput-CFHe_5bb.js index ed30e48213..460290ff02 100644 --- a/ui/dist/assets/FilterAutocompleteInput-BPeaOUvB.js +++ b/ui/dist/assets/FilterAutocompleteInput-CFHe_5bb.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,e as ne,f as re,g as ae,x as O,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-rLaTJP5R.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as j,C as R,S as qe,t as We,u as ve,v as _e}from"./index-BztyTJOx.js";function De(e){return new Worker(""+new URL("autocomplete.worker-Dy9W6Fpj.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Oe(e){G(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,W=new De,B=[],H=[],T=[],K="",v="";function _(){d==null||d.focus()}let D=null;W.onmessage=n=>{T=n.data.baseKeys||[],B=n.data.requestKeys||[],H=n.data.collectionJoinKeys||[]};function V(){clearTimeout(D),D=setTimeout(()=>{W.postMessage({baseCollection:s,collections:z(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function z(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function N(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(T||[]),n&&(l=l.concat(B||[])),c&&(l=l.concat(H||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Oe({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(We),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(ve,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(j(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(D),U(),d==null||d.destroy(),W.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=Te(s)),e.$$.dirty[0]&25352&&!a&&(v!=K||b!==-1||m!==-1)&&(t(14,v=K),V()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(j(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,K,v,Y]}class Pe extends ${constructor(r){super(),ee(this,r,Fe,He,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; +import{S as $,i as ee,s as te,e as ne,f as re,g as ae,y as D,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-B6GxOPDi.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as P,C as R,S as qe,t as ve,u as We,v as _e}from"./index-BJXhcZ8-.js";function Oe(e){return new Worker(""+new URL("autocomplete.worker-CGnTjHzG.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,v=new Oe,H=[],T=[],B=[],C="",W="";function _(){d==null||d.focus()}let O=null;v.onmessage=n=>{B=n.data.baseKeys||[],H=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function z(){clearTimeout(O),O=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function G(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(H||[])),c&&(l=l.concat(T||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};G();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(P(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(O),U(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!a&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),z()),e.$$.dirty[0]&4&&f&&G(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(P(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,C,W,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; diff --git a/ui/dist/assets/ListApiDocs-DhdAtA7Y.css b/ui/dist/assets/ListApiDocs-ByASLUZu.css similarity index 100% rename from ui/dist/assets/ListApiDocs-DhdAtA7Y.css rename to ui/dist/assets/ListApiDocs-ByASLUZu.css diff --git a/ui/dist/assets/ListApiDocs-bZ1-xl-p.js b/ui/dist/assets/ListApiDocs-CtNZ5G9D.js similarity index 98% rename from ui/dist/assets/ListApiDocs-bZ1-xl-p.js rename to ui/dist/assets/ListApiDocs-CtNZ5G9D.js index 663421fcf1..7911ff556c 100644 --- a/ui/dist/assets/ListApiDocs-bZ1-xl-p.js +++ b/ui/dist/assets/ListApiDocs-CtNZ5G9D.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,r as ll,x as Qe,o as m,v as _,h as t,N as Fe,O as se,c as Qt,m as Ut,w as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,A as cl,q as Le}from"./index-rLaTJP5R.js";import{S as dl}from"./SdkTabs-DJGq8srX.js";import{F as pl}from"./FieldsQueryParam-Bw7BgfEJ.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-B6GxOPDi.js";import{S as dl}from"./SdkTabs-C9BIEbpG.js";import{F as pl}from"./FieldsQueryParam-DB2XHXnv.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-CGAfo9a0.js b/ui/dist/assets/ListExternalAuthsDocs-DCCFJUK6.js similarity index 60% rename from ui/dist/assets/ListExternalAuthsDocs-CGAfo9a0.js rename to ui/dist/assets/ListExternalAuthsDocs-DCCFJUK6.js index 37e85dbefc..42f19ea59d 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-CGAfo9a0.js +++ b/ui/dist/assets/ListExternalAuthsDocs-DCCFJUK6.js @@ -1,11 +1,11 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,v,b as m,c as pe,f as b,g as c,h as a,m as ue,w as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,A as Je,q as J,r as Ve,N as Xe}from"./index-rLaTJP5R.js";import{S as Ye}from"./SdkTabs-DJGq8srX.js";import{F as Ze}from"./FieldsQueryParam-Bw7BgfEJ.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Te,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,A,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,q,ae,B,oe,L,ne,C,ie,$e,ce,E,de,M,re,T,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-B6GxOPDi.js";import{S as Ye}from"./SdkTabs-C9BIEbpG.js";import{F as Ze}from"./FieldsQueryParam-DB2XHXnv.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); ... - await pb.collection('${(Te=o[0])==null?void 0:Te.name}').authWithPassword('test@example.com', '123456'); + await pb.collection('${(Ce=o[0])==null?void 0:Ce.name}').authWithPassword('test@example.com', '123456'); const result = await pb.collection('${(Se=o[0])==null?void 0:Se.name}').listExternalAuths( pb.authStore.model.id @@ -22,16 +22,16 @@ import{S as ze,i as Qe,s as Ue,O as F,e as i,v,b as m,c as pe,f as b,g as c,h as final result = await pb.collection('${(Ie=o[0])==null?void 0:Ie.name}').listExternalAuths( pb.authStore.model.id, ); - `}}),E=new Ze({});let j=F(o[2]);const Ae=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",se=m(),q=i("div"),q.textContent="Path Parameters",ae=m(),B=i("table"),B.innerHTML='Param Type Description id String ID of the auth record.',oe=m(),L=i("div"),L.textContent="Query parameters",ne=m(),C=i("table"),ie=i("thead"),ie.innerHTML='Param Type Description',$e=m(),ce=i("tbody"),pe(E.$$.fragment),de=m(),M=i("div"),M.textContent="Responses",re=m(),T=i("div"),O=i("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",se=m(),B=i("div"),B.textContent="Path Parameters",ae=m(),q=i("table"),q.innerHTML='Param Type Description id String ID of the auth record.',oe=m(),L=i("div"),L.textContent="Query parameters",ne=m(),A=i("table"),ie=i("thead"),ie.innerHTML='Param Type Description',$e=m(),ce=i("tbody"),pe(E.$$.fragment),de=m(),M=i("div"),M.textContent="Responses",re=m(),C=i("div"),O=i("div");for(let e=0;es(1,_=h.code);return o.$$set=h=>{"collection"in h&&s(0,f=h.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(2,r=[{code:200,body:` + `),P.$set(p),(!S||t&1)&&Q!==(Q=e[0].name+"")&&N(te,Q),t&6&&(j=F(e[2]),g=Oe(g,t,Te,1,e,j,we,O,je,Re,null,He)),t&6&&(H=F(e[2]),Fe(),k=Oe(k,t,Ae,1,e,H,Pe,D,Ne,We,null,De),Ge())},i(e){if(!S){G(P.$$.fragment,e),G(E.$$.fragment,e);for(let t=0;ts(1,_=h.code);return o.$$set=h=>{"collection"in h&&s(0,f=h.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(2,r=[{code:200,body:` [ { "id": "8171022dc95a4e8", diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-vRRTYNd2.js b/ui/dist/assets/PageAdminConfirmPasswordReset-C5ZKwumu.js similarity index 53% rename from ui/dist/assets/PageAdminConfirmPasswordReset-vRRTYNd2.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-C5ZKwumu.js index cb54878221..20d4051c0c 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-vRRTYNd2.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-C5ZKwumu.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as F,m as R,t as B,a as N,d as T,C as M,p as H,e as _,v as P,b as h,f,q as J,g as b,h as c,r as j,u as O,j as Q,l as U,o as w,z as V,A as L,B as X,D as Y,w as Z,y as q}from"./index-rLaTJP5R.js";function W(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,k,v,C,A,y,m=i[3]&&W(i);return u=new H({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new H({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password - `),m&&m.c(),t=h(),F(u.$$.fragment),p=h(),F(d.$$.fragment),r=h(),a=_("button"),g=_("span"),g.textContent="Set new password",S=h(),k=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],J(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(k,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),R(u,e,null),c(e,p),R(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,k,$),c(k,v),C=!0,A||(y=[j(e,"submit",O(i[4])),Q(U.call(null,v))],A=!0)},p(o,$){o[3]?m?m.p(o,$):(m=W(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:o}),u.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:o}),d.$set(D),(!C||$&4)&&(a.disabled=o[2]),(!C||$&4)&&J(a,"btn-loading",o[2])},i(o){C||(B(u.$$.fragment,o),B(d.$$.fragment,o),C=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),C=!1},d(o){o&&(w(e),w(S),w(k)),m&&m.d(),T(u),T(d),A=!1,V(y)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},m(s,l){R(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await L.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){L.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; +import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-B6GxOPDi.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password + `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js b/ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js new file mode 100644 index 0000000000..a4279bcda9 --- /dev/null +++ b/ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js @@ -0,0 +1 @@ +import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-B6GxOPDi.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

    Forgotten admin password

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

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

    Forgotten admin password

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

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

    Auth failed.

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

    Auth failed.

    You can close this window and go back to the app to try again.
    ',l(t,"class","content txt-hint txt-center p-base")},m(e,s){u(e,t,s)},p:a,i:a,o:a,d(e){e&&d(t)}}}function p(n){return h(()=>{window.close()}),[]}class g extends o{constructor(t){super(),i(this,t,p,f,c,{})}}export{g as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-BusSuTAQ.js b/ui/dist/assets/PageOAuth2RedirectSuccess-BBB69FeN.js similarity index 73% rename from ui/dist/assets/PageOAuth2RedirectSuccess-BusSuTAQ.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-BBB69FeN.js index d875197bf6..7eaf8fb285 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-BusSuTAQ.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-BBB69FeN.js @@ -1 +1 @@ -import{S as o,i as c,s as i,e as r,f as u,g as l,x as s,o as d,I as h}from"./index-rLaTJP5R.js";function p(n){let t;return{c(){t=r("div"),t.innerHTML='

    Auth completed.

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

    Auth completed.

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

    Successfully changed the user email address.

    You can now sign in with your new email address.

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

    Successfully changed the user email address.

    You can now sign in with your new email address.

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

    Successfully changed the user password.

    You can now sign in with your new password.

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

    Successfully changed the user password.

    You can now sign in with your new password.

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

    Invalid or expired verification token.

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

    Successfully verified email address.

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

    Invalid or expired verification token.

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

    Successfully verified email address.

    ',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
    Please wait...
    ',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-Bdn0UuCF.js b/ui/dist/assets/RealtimeApiDocs-DlyauiFo.js similarity index 90% rename from ui/dist/assets/RealtimeApiDocs-Bdn0UuCF.js rename to ui/dist/assets/RealtimeApiDocs-DlyauiFo.js index 1a0f11dc2a..e7d7ab07e6 100644 --- a/ui/dist/assets/RealtimeApiDocs-Bdn0UuCF.js +++ b/ui/dist/assets/RealtimeApiDocs-DlyauiFo.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as u,g as s,h as I,m as ne,w as ue,t as ie,a as ce,o as n,d as le,A as me}from"./index-rLaTJP5R.js";import{S as de}from"./SdkTabs-DJGq8srX.js";function he(t){var B,U,A,W,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,C,$,S,g,w,v,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-B6GxOPDi.js";import{S as de}from"./SdkTabs-C9BIEbpG.js";function he(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,w,v,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); @@ -15,13 +15,13 @@ import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as }, { /* other options like expand, custom headers, etc. */ }); // Subscribe to changes only in the specified record - pb.collection('${(A=t[0])==null?void 0:A.name}').subscribe('RECORD_ID', function (e) { + pb.collection('${(W=t[0])==null?void 0:W.name}').subscribe('RECORD_ID', function (e) { console.log(e.action); console.log(e.record); }, { /* other options like expand, custom headers, etc. */ }); // Unsubscribe - pb.collection('${(W=t[0])==null?void 0:W.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions + pb.collection('${(A=t[0])==null?void 0:A.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions pb.collection('${(H=t[0])==null?void 0:H.name}').unsubscribe('*'); // remove all '*' topic subscriptions pb.collection('${(L=t[0])==null?void 0:L.name}').unsubscribe(); // remove all subscriptions in the collection `,dart:` @@ -55,7 +55,7 @@ import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as ViewRule will be used to determine whether the subscriber has access to receive the event message.

    When you subscribe to an entire collection, the collection's ListRule will be used to determine whether the subscriber has access to receive the - event message.

    `,_=a(),se(l.$$.fragment),C=a(),$=p("h6"),$.textContent="API details",S=a(),g=p("div"),g.innerHTML='SSE

    /api/realtime

    ',w=a(),v=p("div"),v.textContent="Event data format",E=a(),se(r.$$.fragment),u(i,"class","m-b-sm"),u(h,"class","content txt-lg m-b-sm"),u(f,"class","alert alert-info m-t-10 m-b-sm"),u($,"class","m-b-xs"),u(g,"class","alert"),u(v,"class","section-title")},m(e,o){s(e,i,o),I(i,m),I(i,b),I(i,d),s(e,k,o),s(e,h,o),s(e,D,o),s(e,f,o),s(e,_,o),ne(l,e,o),s(e,C,o),s(e,$,o),s(e,S,o),s(e,g,o),s(e,w,o),s(e,v,o),s(e,E,o),ne(r,e,o),R=!0},p(e,[o]){var Y,z,F,G,K,Q,X,Z,x,ee,oe,te;(!R||o&1)&&c!==(c=e[0].name+"")&&ue(b,c);const O={};o&3&&(O.js=` + event message.

    `,_=a(),se(l.$$.fragment),S=a(),$=p("h6"),$.textContent="API details",C=a(),g=p("div"),g.innerHTML='SSE

    /api/realtime

    ',w=a(),v=p("div"),v.textContent="Event data format",E=a(),se(r.$$.fragment),u(i,"class","m-b-sm"),u(h,"class","content txt-lg m-b-sm"),u(f,"class","alert alert-info m-t-10 m-b-sm"),u($,"class","m-b-xs"),u(g,"class","alert"),u(v,"class","section-title")},m(e,o){s(e,i,o),I(i,m),I(i,b),I(i,d),s(e,k,o),s(e,h,o),s(e,D,o),s(e,f,o),s(e,_,o),ne(l,e,o),s(e,S,o),s(e,$,o),s(e,C,o),s(e,g,o),s(e,w,o),s(e,v,o),s(e,E,o),ne(r,e,o),R=!0},p(e,[o]){var Y,z,F,G,K,Q,X,Z,x,ee,oe,te;(!R||o&1)&&c!==(c=e[0].name+"")&&ue(b,c);const O={};o&3&&(O.js=` import PocketBase from 'pocketbase'; const pb = new PocketBase('${e[1]}'); @@ -107,4 +107,4 @@ import{S as re,i as ae,s as be,N as pe,C as P,e as p,v as y,b as a,c as se,f as pb.collection('${(ee=e[0])==null?void 0:ee.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions pb.collection('${(oe=e[0])==null?void 0:oe.name}').unsubscribe('*'); // remove all '*' topic subscriptions pb.collection('${(te=e[0])==null?void 0:te.name}').unsubscribe(); // remove all subscriptions in the collection - `),l.$set(O);const V={};o&1&&(V.content=JSON.stringify({action:"create",record:P.dummyCollectionRecord(e[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),r.$set(V)},i(e){R||(ie(l.$$.fragment,e),ie(r.$$.fragment,e),R=!0)},o(e){ce(l.$$.fragment,e),ce(r.$$.fragment,e),R=!1},d(e){e&&(n(i),n(k),n(h),n(D),n(f),n(_),n(C),n($),n(S),n(g),n(w),n(v),n(E)),le(l,e),le(r,e)}}}function fe(t,i,m){let c,{collection:b}=i;return t.$$set=d=>{"collection"in d&&m(0,b=d.collection)},m(1,c=P.getApiExampleUrl(me.baseUrl)),[b,c]}class ve extends re{constructor(i){super(),ae(this,i,fe,he,be,{collection:0})}}export{ve as default}; + `),l.$set(O);const V={};o&1&&(V.content=JSON.stringify({action:"create",record:P.dummyCollectionRecord(e[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),r.$set(V)},i(e){R||(ie(l.$$.fragment,e),ie(r.$$.fragment,e),R=!0)},o(e){ce(l.$$.fragment,e),ce(r.$$.fragment,e),R=!1},d(e){e&&(n(i),n(k),n(h),n(D),n(f),n(_),n(S),n($),n(C),n(g),n(w),n(v),n(E)),le(l,e),le(r,e)}}}function fe(t,i,m){let c,{collection:b}=i;return t.$$set=d=>{"collection"in d&&m(0,b=d.collection)},m(1,c=P.getApiExampleUrl(me.baseUrl)),[b,c]}class ve extends re{constructor(i){super(),ae(this,i,fe,he,be,{collection:0})}}export{ve as default}; diff --git a/ui/dist/assets/RequestEmailChangeDocs-BDG1xZdQ.js b/ui/dist/assets/RequestEmailChangeDocs-DmKjgrzy.js similarity index 68% rename from ui/dist/assets/RequestEmailChangeDocs-BDG1xZdQ.js rename to ui/dist/assets/RequestEmailChangeDocs-DmKjgrzy.js index b785de9484..88235c34e2 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-BDG1xZdQ.js +++ b/ui/dist/assets/RequestEmailChangeDocs-DmKjgrzy.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,v,b as k,c as Ce,f as b,g as d,h as n,m as ye,w as N,P as ve,Q as Ae,k as Re,R as Me,n as We,t as ee,a as te,o as m,d as Te,C as ze,A as He,q as F,r as Oe,N as Ue}from"./index-rLaTJP5R.js";import{S as je}from"./SdkTabs-DJGq8srX.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,A,x,C,R,g=[],ie=new Map,ce,M,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-B6GxOPDi.js";import{S as je}from"./SdkTabs-C9BIEbpG.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -18,7 +18,7 @@ import{S as Ee,i as Be,s as Se,O as L,e as r,v,b as k,c as Ce,f as b,g as d,h as await pb.collection('${(be=o[0])==null?void 0:be.name}').authWithPassword('test@example.com', '1234567890'); await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestEmailChange('new@example.com'); - `}});let D=L(o[2]);const de=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",X=k(),B=r("div"),B.textContent="Body Parameters",Y=k(),S=r("table"),S.innerHTML='Param Type Description
    Required newEmail
    String The new email address to send the change email request.',Z=k(),A=r("div"),A.textContent="Responses",x=k(),C=r("div"),R=r("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",X=k(),B=r("div"),B.textContent="Body Parameters",Y=k(),S=r("table"),S.innerHTML='Param Type Description
    Required newEmail
    String The new email address to send the change email request.',Z=k(),R=r("div"),R.textContent="Responses",x=k(),C=r("div"),M=r("div");for(let e=0;ea(1,f=u.code);return o.$$set=u=>{"collection"in u&&a(0,h=u.collection)},a(3,s=ze.getApiExampleUrl(He.baseUrl)),a(2,i=[{code:204,body:"null"},{code:400,body:` + `),P.$set(c),(!y||t&1)&&U!==(U=e[0].name+"")&&N(V,U),t&6&&(D=L(e[2]),g=ve(g,t,de,1,e,D,ie,M,Re,qe,null,$e)),t&6&&(W=L(e[2]),Me(),_=ve(_,t,me,1,e,W,re,A,Ae,Pe,null,we),We())},i(e){if(!y){ee(P.$$.fragment,e);for(let t=0;ta(1,f=u.code);return o.$$set=u=>{"collection"in u&&a(0,h=u.collection)},a(3,s=ze.getApiExampleUrl(He.baseUrl)),a(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/RequestPasswordResetDocs-Csllfzv-.js b/ui/dist/assets/RequestPasswordResetDocs-CCrC-X-J.js similarity index 57% rename from ui/dist/assets/RequestPasswordResetDocs-Csllfzv-.js rename to ui/dist/assets/RequestPasswordResetDocs-CCrC-X-J.js index 0ea4baea6c..5315d42730 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-Csllfzv-.js +++ b/ui/dist/assets/RequestPasswordResetDocs-CCrC-X-J.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as L,P as fe,Q as ye,k as Re,R as Ce,n as Be,t as x,a as ee,o as p,d as we,C as Se,A as Te,q as N,r as Ae,N as Me}from"./index-rLaTJP5R.js";import{S as Ue}from"./SdkTabs-DJGq8srX.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,m;function u(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(m=Ae(l,"click",u),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,m()}}}function he(o,s){let l,a,_,f;return a=new Me({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,m){d(i,l,m),ge(a,l,null),n(l,_),f=!0},p(i,m){s=i;const u={};m&4&&(u.content=s[5].body),a.$set(u),(!f||m&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,m,u,w,P,D=o[0].name+"",Q,te,z,$,G,C,J,q,H,se,O,B,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,A,Z,y,M,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-B6GxOPDi.js";import{S as Ue}from"./SdkTabs-C9BIEbpG.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); @@ -14,14 +14,14 @@ import{S as Pe,i as $e,s as qe,O as I,e as r,v as g,b as h,c as ve,f as b,g as d ... await pb.collection('${(pe=o[0])==null?void 0:pe.name}').requestPasswordReset('test@example.com'); - `}});let F=I(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required email
    String The auth record email address to send the password reset request (if exists).',Y=h(),A=r("div"),A.textContent="Responses",Z=h(),y=r("div"),M=r("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required email
    String The auth record email address to send the password reset request (if exists).',Y=h(),M=r("div"),M.textContent="Responses",Z=h(),y=r("div"),A=r("div");for(let e=0;el(1,f=u.code);return o.$$set=u=>{"collection"in u&&l(0,_=u.collection)},l(3,a=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` + await pb.collection('${(me=e[0])==null?void 0:me.name}').requestPasswordReset('test@example.com'); + `),$.$set(c),(!R||t&1)&&E!==(E=e[0].name+"")&&L(V,E),t&6&&(F=I(e[2]),v=fe(v,t,ce,1,e,F,oe,A,ye,ke,null,_e)),t&6&&(j=I(e[2]),Re(),k=fe(k,t,re,1,e,j,ie,U,Be,he,null,be),Ce())},i(e){if(!R){x($.$$.fragment,e);for(let t=0;tl(1,f=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", @@ -41,4 +41,4 @@ import{S as Pe,i as $e,s as qe,O as I,e as r,v as g,b as h,c as ve,f as b,g as d } } } - `}]),[_,f,i,a,m]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default}; + `}]),[_,f,i,a,u]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default}; diff --git a/ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js b/ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js new file mode 100644 index 0000000000..ecdfe13946 --- /dev/null +++ b/ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js @@ -0,0 +1,44 @@ +import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-B6GxOPDi.js";import{S as Ae}from"./SdkTabs-C9BIEbpG.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` + import PocketBase from 'pocketbase'; + + const pb = new PocketBase('${o[3]}'); + + ... + + await pb.collection('${(de=o[0])==null?void 0:de.name}').requestVerification('test@example.com'); + `,dart:` + import 'package:pocketbase/pocketbase.dart'; + + final pb = PocketBase('${o[3]}'); + + ... + + await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestVerification('test@example.com'); + `}});let E=F(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required email
    String The auth record email address to send the verification request (if exists).',Y=h(),V=r("div"),V.textContent="Responses",Z=h(),y=r("div"),M=r("div");for(let e=0;es(1,p=m.code);return o.$$set=m=>{"collection"in m&&s(0,_=m.collection)},s(3,a=Te.getApiExampleUrl(Re.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` + { + "code": 400, + "message": "Failed to authenticate.", + "data": { + "email": { + "code": "validation_required", + "message": "Missing required value." + } + } + } + `}]),[_,p,i,a,u]}class Oe extends qe{constructor(l){super(),we(this,l,je,Ue,Pe,{collection:0})}}export{Oe as default}; diff --git a/ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js b/ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js deleted file mode 100644 index 123b5f2345..0000000000 --- a/ui/dist/assets/RequestVerificationDocs-BXzC-pWX.js +++ /dev/null @@ -1,44 +0,0 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,v as g,b as h,c as ve,f as b,g as d,h as n,m as ge,w as I,P as pe,Q as ye,k as Ce,R as Be,n as Se,t as x,a as ee,o as f,d as $e,C as Te,A as Ae,q as L,r as Re,N as Ve}from"./index-rLaTJP5R.js";import{S as Me}from"./SdkTabs-DJGq8srX.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,m;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(m=Re(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,m()}}}function he(o,l){let s,a,_,p;return a=new Ve({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,m){d(i,s,m),ge(a,s,null),n(s,_),p=!0},p(i,m){l=i;const u={};m&4&&(u.content=l[5].body),a.$set(u),(!p||m&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,m,u,$,q,j=o[0].name+"",N,te,Q,w,z,B,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,A,Y,R,Z,y,V,v=[],oe=new Map,ne,M,k=[],ie=new Map,C;w=new Me({props:{js:` - import PocketBase from 'pocketbase'; - - const pb = new PocketBase('${o[3]}'); - - ... - - await pb.collection('${(de=o[0])==null?void 0:de.name}').requestVerification('test@example.com'); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final pb = PocketBase('${o[3]}'); - - ... - - await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestVerification('test@example.com'); - `}});let E=F(o[2]);const ce=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eParam Type Description
    Required email
    String The auth record email address to send the verification request (if exists).',Y=h(),R=r("div"),R.textContent="Responses",Z=h(),y=r("div"),V=r("div");for(let e=0;es(1,p=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=Te.getApiExampleUrl(Ae.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:` - { - "code": 400, - "message": "Failed to authenticate.", - "data": { - "email": { - "code": "validation_required", - "message": "Missing required value." - } - } - } - `}]),[_,p,i,a,m]}class Oe extends qe{constructor(l){super(),we(this,l,je,Ue,Pe,{collection:0})}}export{Oe as default}; diff --git a/ui/dist/assets/SdkTabs-C9BIEbpG.js b/ui/dist/assets/SdkTabs-C9BIEbpG.js new file mode 100644 index 0000000000..55dc8c28b0 --- /dev/null +++ b/ui/dist/assets/SdkTabs-C9BIEbpG.js @@ -0,0 +1 @@ +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as P,a as T,o as C,w,r as E,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-B6GxOPDi.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function I(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function M(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(P(s.$$.fragment,b),d=!0)},o(b){T(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(N,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/SdkTabs-lBWmLVyw.css b/ui/dist/assets/SdkTabs-CSWLpEgj.css similarity index 100% rename from ui/dist/assets/SdkTabs-lBWmLVyw.css rename to ui/dist/assets/SdkTabs-CSWLpEgj.css diff --git a/ui/dist/assets/SdkTabs-DJGq8srX.js b/ui/dist/assets/SdkTabs-DJGq8srX.js deleted file mode 100644 index 6b392cbb22..0000000000 --- a/ui/dist/assets/SdkTabs-DJGq8srX.js +++ /dev/null @@ -1 +0,0 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,v as w,q as E,r as A,w as T,N as G,c as H,m as L,d as U}from"./index-rLaTJP5R.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function q(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&T(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&T(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-Cm7HyxiF.js b/ui/dist/assets/UnlinkExternalAuthDocs-4JM4cUB_.js similarity index 56% rename from ui/dist/assets/UnlinkExternalAuthDocs-Cm7HyxiF.js rename to ui/dist/assets/UnlinkExternalAuthDocs-4JM4cUB_.js index c4b046746f..2eee24cf2a 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-Cm7HyxiF.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-4JM4cUB_.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,v as g,b as f,c as Be,f as h,g as d,h as a,m as qe,w as I,P as ye,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as Ue,C as Re,A as je,q as N,r as Ie,N as Ne}from"./index-rLaTJP5R.js";import{S as Ke}from"./SdkTabs-DJGq8srX.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,b,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),b=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,b),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,b;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),h(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),qe(s,o,null),a(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(oe(s.$$.fragment,c),b=!0)},o(c){ae(s.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,b,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,y,G,E,J,w,W,ie,z,A,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,q,le,C,U,v=[],pe=new Map,me,O,k=[],he=new Map,T;y=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-B6GxOPDi.js";import{S as Ke}from"./SdkTabs-C9BIEbpG.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); @@ -24,8 +24,8 @@ import{S as Oe,i as De,s as Me,O as j,e as i,v as g,b as f,c as Be,f as h,g as d pb.authStore.model.id, 'google', ); - `}});let R=j(n[2]);const be=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",x=f(),S=i("div"),S.textContent="Path Parameters",ee=f(),B=i("table"),B.innerHTML=`Param Type Description id String ID of the auth record. provider String The name of the auth provider to unlink, eg. google, twitter, - github, etc.`,te=f(),q=i("div"),q.textContent="Responses",le=f(),C=i("div"),U=i("div");for(let e=0;ee[5].code;for(let e=0;ee[5].code;for(let e=0;eAuthorization:TOKEN header",x=f(),S=i("div"),S.textContent="Path Parameters",ee=f(),B=i("table"),B.innerHTML=`Param Type Description id String ID of the auth record. provider String The name of the auth provider to unlink, eg. google, twitter, + github, etc.`,te=f(),U=i("div"),U.textContent="Responses",le=f(),C=i("div"),q=i("div");for(let e=0;eo(1,b=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:` + `),A.$set(r),(!T||t&1)&&H!==(H=e[0].name+"")&&I(X,H),t&6&&(R=j(e[2]),v=Ae(v,t,he,1,e,R,pe,q,We,Ee,null,Te)),t&6&&(D=j(e[2]),ze(),k=Ae(k,t,fe,1,e,D,be,O,He,Se,null,Ce),Le())},i(e){if(!T){oe(A.$$.fragment,e);for(let t=0;to(1,h=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:` { "code": 401, "message": "The request requires valid record authorization token to be set.", @@ -69,4 +69,4 @@ import{S as Oe,i as De,s as Me,O as j,e as i,v as g,b as f,c as Be,f as h,g as d "message": "The requested resource wasn't found.", "data": {} } - `}]),[_,b,c,s,p]}class Ve extends Oe{constructor(l){super(),De(this,l,Fe,Qe,Me,{collection:0})}}export{Ve as default}; + `}]),[_,h,c,s,p]}class Ve extends Oe{constructor(l){super(),De(this,l,Fe,Qe,Me,{collection:0})}}export{Ve as default}; diff --git a/ui/dist/assets/UpdateApiDocs-DGrQC-Ly.js b/ui/dist/assets/UpdateApiDocs-B4w33bkJ.js similarity index 83% rename from ui/dist/assets/UpdateApiDocs-DGrQC-Ly.js rename to ui/dist/assets/UpdateApiDocs-B4w33bkJ.js index 286bda1cbb..b45c2f0416 100644 --- a/ui/dist/assets/UpdateApiDocs-DGrQC-Ly.js +++ b/ui/dist/assets/UpdateApiDocs-B4w33bkJ.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,v as b,b as f,c as he,f as v,g as i,h as s,m as ye,w as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,A as Lt,q as ve,r as Pt,x as ee}from"./index-rLaTJP5R.js";import{S as Ft}from"./SdkTabs-DJGq8srX.js";import{F as At}from"./FieldsQueryParam-Bw7BgfEJ.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-B6GxOPDi.js";import{S as Ft}from"./SdkTabs-C9BIEbpG.js";import{F as Nt}from"./FieldsQueryParam-DB2XHXnv.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
    Optional username
    String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
    Optional email
    String The auth record email address.
    @@ -9,8 +9,8 @@ import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,v as b,b as f,c as h This field is required only when changing the record password. Admins and auth records with "Manage" access can skip this field.`,S=f(),g=r("tr"),g.innerHTML='
    Optional password
    String New auth record password.',$=f(),P=r("tr"),P.innerHTML='
    Optional passwordConfirm
    String New auth record password confirmation.',E=f(),M=r("tr"),M.innerHTML=`
    Optional verified
    Boolean Indicates whether the auth record is verified or not.
    - This field can be set only by admins or auth records with "Manage" access.`,U=f(),F=r("tr"),F.innerHTML='Schema fields'},m(y,_){i(y,e,_),i(y,t,_),i(y,n,_),i(y,u,_),i(y,m,_),i(y,o,_),i(y,p,_),i(y,h,_),i(y,w,_),i(y,S,_),i(y,g,_),i(y,$,_),i(y,P,_),i(y,E,_),i(y,M,_),i(y,U,_),i(y,F,_)},d(y){y&&(d(e),d(t),d(n),d(u),d(m),d(o),d(p),d(h),d(w),d(S),d(g),d($),d(P),d(E),d(M),d(U),d(F))}}}function Nt(c){let e;return{c(){e=r("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function Bt(c){let e;return{c(){e=r("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function jt(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("User "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Et(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("Relation record "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Ut(c){let e,t,n,u,m;return{c(){e=b("File object."),t=r("br"),n=b(` - Set to `),u=r("code"),u.textContent="null",m=b(" to delete already uploaded file(s).")},m(o,p){i(o,e,p),i(o,t,p),i(o,n,p),i(o,u,p),i(o,m,p)},p:ee,d(o){o&&(d(e),d(t),d(n),d(u),d(m))}}}function It(c){let e;return{c(){e=b("URL address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Jt(c){let e;return{c(){e=b("Email address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Vt(c){let e;return{c(){e=b("JSON array or object.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Qt(c){let e;return{c(){e=b("Number value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function xt(c){let e;return{c(){e=b("Plain text value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Tt(c,e){let t,n,u,m,o,p=e[13].name+"",h,w,S,g,$=I.getFieldValueType(e[13])+"",P,E,M,U;function F(C,O){return C[13].required?Bt:Nt}let y=F(e),_=y(e);function A(C,O){if(C[13].type==="text")return xt;if(C[13].type==="number")return Qt;if(C[13].type==="json")return Vt;if(C[13].type==="email")return Jt;if(C[13].type==="url")return It;if(C[13].type==="file")return Ut;if(C[13].type==="relation")return Et;if(C[13].type==="user")return jt}let N=A(e),T=N&&N(e);return{key:c,first:null,c(){t=r("tr"),n=r("td"),u=r("div"),_.c(),m=f(),o=r("span"),h=b(p),w=f(),S=r("td"),g=r("span"),P=b($),E=f(),M=r("td"),T&&T.c(),U=f(),v(u,"class","inline-flex"),v(g,"class","label"),this.first=t},m(C,O){i(C,t,O),s(t,n),s(n,u),_.m(u,null),s(u,m),s(u,o),s(o,h),s(t,w),s(t,S),s(S,g),s(g,P),s(t,E),s(t,M),T&&T.m(M,null),s(t,U)},p(C,O){e=C,y!==(y=F(e))&&(_.d(1),_=y(e),_&&(_.c(),_.m(u,m))),O&1&&p!==(p=e[13].name+"")&&J(h,p),O&1&&$!==($=I.getFieldValueType(e[13])+"")&&J(P,$),N===(N=A(e))&&T?T.p(e,O):(T&&T.d(1),T=N&&N(e),T&&(T.c(),T.m(M,null)))},d(C){C&&d(t),_.d(),T&&T.d()}}}function Ct(c,e){let t,n=e[8].code+"",u,m,o,p;function h(){return e[7](e[8])}return{key:c,first:null,c(){t=r("button"),u=b(n),m=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(w,S){i(w,t,S),s(t,u),s(t,m),o||(p=Pt(t,"click",h),o=!0)},p(w,S){e=w,S&4&&n!==(n=e[8].code+"")&&J(u,n),S&6&&ve(t,"active",e[1]===e[8].code)},d(w){w&&d(t),o=!1,p()}}}function St(c,e){let t,n,u,m;return n=new Ot({props:{content:e[8].body}}),{key:c,first:null,c(){t=r("div"),he(n.$$.fragment),u=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(o,p){i(o,t,p),ye(n,t,null),s(t,u),m=!0},p(o,p){e=o;const h={};p&4&&(h.content=e[8].body),n.$set(h),(!m||p&6)&&ve(t,"active",e[1]===e[8].code)},i(o){m||(ce(n.$$.fragment,o),m=!0)},o(o){pe(n.$$.fragment,o),m=!1},d(o){o&&d(t),ke(n)}}}function zt(c){var ct,pt,ut;let e,t,n=c[0].name+"",u,m,o,p,h,w,S,g=c[0].name+"",$,P,E,M,U,F,y,_,A,N,T,C,O,ue,Ue,fe,Y,Ie,ge,me=c[0].name+"",we,Je,Te,Ve,Ce,te,Se,le,Oe,ne,$e,V,Me,Qe,Q,qe,B=[],xe=new Map,He,ae,Re,x,De,ze,se,z,Le,Ke,Pe,We,q,Ye,G,Ge,Xe,Ze,Fe,et,Ae,tt,Ne,lt,nt,X,Be,ie,je,K,de,j=[],at=new Map,st,oe,H=[],it=new Map,W,R=c[6]&&vt();A=new Ft({props:{js:` + This field can be set only by admins or auth records with "Manage" access.`,U=f(),F=r("tr"),F.innerHTML='Schema fields'},m(y,_){i(y,e,_),i(y,t,_),i(y,n,_),i(y,u,_),i(y,m,_),i(y,o,_),i(y,p,_),i(y,h,_),i(y,w,_),i(y,S,_),i(y,g,_),i(y,$,_),i(y,P,_),i(y,E,_),i(y,M,_),i(y,U,_),i(y,F,_)},d(y){y&&(d(e),d(t),d(n),d(u),d(m),d(o),d(p),d(h),d(w),d(S),d(g),d($),d(P),d(E),d(M),d(U),d(F))}}}function Bt(c){let e;return{c(){e=r("span"),e.textContent="Optional",v(e,"class","label label-warning")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function jt(c){let e;return{c(){e=r("span"),e.textContent="Required",v(e,"class","label label-success")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function At(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("User "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Et(c){var m;let e,t=((m=c[13].options)==null?void 0:m.maxSelect)>1?"ids":"id",n,u;return{c(){e=b("Relation record "),n=b(t),u=b(".")},m(o,p){i(o,e,p),i(o,n,p),i(o,u,p)},p(o,p){var h;p&1&&t!==(t=((h=o[13].options)==null?void 0:h.maxSelect)>1?"ids":"id")&&J(n,t)},d(o){o&&(d(e),d(n),d(u))}}}function Ut(c){let e,t,n,u,m;return{c(){e=b("File object."),t=r("br"),n=b(` + Set to `),u=r("code"),u.textContent="null",m=b(" to delete already uploaded file(s).")},m(o,p){i(o,e,p),i(o,t,p),i(o,n,p),i(o,u,p),i(o,m,p)},p:ee,d(o){o&&(d(e),d(t),d(n),d(u),d(m))}}}function It(c){let e;return{c(){e=b("URL address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Jt(c){let e;return{c(){e=b("Email address.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Vt(c){let e;return{c(){e=b("JSON array or object.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Qt(c){let e;return{c(){e=b("Number value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function xt(c){let e;return{c(){e=b("Plain text value.")},m(t,n){i(t,e,n)},p:ee,d(t){t&&d(e)}}}function Tt(c,e){let t,n,u,m,o,p=e[13].name+"",h,w,S,g,$=I.getFieldValueType(e[13])+"",P,E,M,U;function F(C,O){return C[13].required?jt:Bt}let y=F(e),_=y(e);function N(C,O){if(C[13].type==="text")return xt;if(C[13].type==="number")return Qt;if(C[13].type==="json")return Vt;if(C[13].type==="email")return Jt;if(C[13].type==="url")return It;if(C[13].type==="file")return Ut;if(C[13].type==="relation")return Et;if(C[13].type==="user")return At}let B=N(e),T=B&&B(e);return{key:c,first:null,c(){t=r("tr"),n=r("td"),u=r("div"),_.c(),m=f(),o=r("span"),h=b(p),w=f(),S=r("td"),g=r("span"),P=b($),E=f(),M=r("td"),T&&T.c(),U=f(),v(u,"class","inline-flex"),v(g,"class","label"),this.first=t},m(C,O){i(C,t,O),s(t,n),s(n,u),_.m(u,null),s(u,m),s(u,o),s(o,h),s(t,w),s(t,S),s(S,g),s(g,P),s(t,E),s(t,M),T&&T.m(M,null),s(t,U)},p(C,O){e=C,y!==(y=F(e))&&(_.d(1),_=y(e),_&&(_.c(),_.m(u,m))),O&1&&p!==(p=e[13].name+"")&&J(h,p),O&1&&$!==($=I.getFieldValueType(e[13])+"")&&J(P,$),B===(B=N(e))&&T?T.p(e,O):(T&&T.d(1),T=B&&B(e),T&&(T.c(),T.m(M,null)))},d(C){C&&d(t),_.d(),T&&T.d()}}}function Ct(c,e){let t,n=e[8].code+"",u,m,o,p;function h(){return e[7](e[8])}return{key:c,first:null,c(){t=r("button"),u=b(n),m=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(w,S){i(w,t,S),s(t,u),s(t,m),o||(p=Pt(t,"click",h),o=!0)},p(w,S){e=w,S&4&&n!==(n=e[8].code+"")&&J(u,n),S&6&&ve(t,"active",e[1]===e[8].code)},d(w){w&&d(t),o=!1,p()}}}function St(c,e){let t,n,u,m;return n=new Ot({props:{content:e[8].body}}),{key:c,first:null,c(){t=r("div"),he(n.$$.fragment),u=f(),v(t,"class","tab-item"),ve(t,"active",e[1]===e[8].code),this.first=t},m(o,p){i(o,t,p),ye(n,t,null),s(t,u),m=!0},p(o,p){e=o;const h={};p&4&&(h.content=e[8].body),n.$set(h),(!m||p&6)&&ve(t,"active",e[1]===e[8].code)},i(o){m||(ce(n.$$.fragment,o),m=!0)},o(o){pe(n.$$.fragment,o),m=!1},d(o){o&&d(t),ke(n)}}}function zt(c){var ct,pt,ut;let e,t,n=c[0].name+"",u,m,o,p,h,w,S,g=c[0].name+"",$,P,E,M,U,F,y,_,N,B,T,C,O,ue,Ue,fe,Y,Ie,ge,me=c[0].name+"",we,Je,Te,Ve,Ce,te,Se,le,Oe,ne,$e,V,Me,Qe,Q,qe,j=[],xe=new Map,He,ae,Re,x,De,ze,se,z,Le,Ke,Pe,We,q,Ye,G,Ge,Xe,Ze,Fe,et,Ne,tt,Be,lt,nt,X,je,ie,Ae,K,de,A=[],at=new Map,st,oe,H=[],it=new Map,W,R=c[6]&&vt();N=new Ft({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${c[4]}'); @@ -32,17 +32,17 @@ final pb = PocketBase('${c[4]}'); final body = ${JSON.stringify(Object.assign({},c[3],I.dummyCollectionSchemaData(c[0])),null,2)}; final record = await pb.collection('${(pt=c[0])==null?void 0:pt.name}').update('RECORD_ID', body: body); - `}});let D=c[5]&>(),L=c[6]&&wt(),be=Z((ut=c[0])==null?void 0:ut.schema);const dt=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;l<_e.length;l+=1){let a=yt(c,_e,l),k=ot(a);at.set(k,j[l]=Ct(k,a))}let re=Z(c[2]);const rt=l=>l[8].code;for(let l=0;lapplication/json or + `}});let D=c[5]&>(),L=c[6]&&wt(),be=Z((ut=c[0])==null?void 0:ut.schema);const dt=l=>l[13].name;for(let l=0;ll[8].code;for(let l=0;l<_e.length;l+=1){let a=yt(c,_e,l),k=ot(a);at.set(k,A[l]=Ct(k,a))}let re=Z(c[2]);const rt=l=>l[8].code;for(let l=0;lapplication/json or multipart/form-data.`,U=f(),F=r("p"),F.innerHTML=`File upload is supported only via multipart/form-data.
    For more info and examples you could check the detailed Files upload and handling docs - .`,y=f(),R&&R.c(),_=f(),he(A.$$.fragment),N=f(),T=r("h6"),T.textContent="API details",C=f(),O=r("div"),ue=r("strong"),ue.textContent="PATCH",Ue=f(),fe=r("div"),Y=r("p"),Ie=b("/api/collections/"),ge=r("strong"),we=b(me),Je=b("/records/"),Te=r("strong"),Te.textContent=":id",Ve=f(),D&&D.c(),Ce=f(),te=r("div"),te.textContent="Path parameters",Se=f(),le=r("table"),le.innerHTML='Param Type Description id String ID of the record to update.',Oe=f(),ne=r("div"),ne.textContent="Body Parameters",$e=f(),V=r("table"),Me=r("thead"),Me.innerHTML='Param Type Description',Qe=f(),Q=r("tbody"),L&&L.c(),qe=f();for(let l=0;lParam Type Description',ze=f(),se=r("tbody"),z=r("tr"),Le=r("td"),Le.textContent="expand",Ke=f(),Pe=r("td"),Pe.innerHTML='String',We=f(),q=r("td"),Ye=b(`Auto expand relations when returning the updated record. Ex.: + .`,y=f(),R&&R.c(),_=f(),he(N.$$.fragment),B=f(),T=r("h6"),T.textContent="API details",C=f(),O=r("div"),ue=r("strong"),ue.textContent="PATCH",Ue=f(),fe=r("div"),Y=r("p"),Ie=b("/api/collections/"),ge=r("strong"),we=b(me),Je=b("/records/"),Te=r("strong"),Te.textContent=":id",Ve=f(),D&&D.c(),Ce=f(),te=r("div"),te.textContent="Path parameters",Se=f(),le=r("table"),le.innerHTML='Param Type Description id String ID of the record to update.',Oe=f(),ne=r("div"),ne.textContent="Body Parameters",$e=f(),V=r("table"),Me=r("thead"),Me.innerHTML='Param Type Description',Qe=f(),Q=r("tbody"),L&&L.c(),qe=f();for(let l=0;lParam Type Description',ze=f(),se=r("tbody"),z=r("tr"),Le=r("td"),Le.textContent="expand",Ke=f(),Pe=r("td"),Pe.innerHTML='String',We=f(),q=r("td"),Ye=b(`Auto expand relations when returning the updated record. Ex.: `),he(G.$$.fragment),Ge=b(` Supports up to 6-levels depth nested relations expansion. `),Xe=r("br"),Ze=b(` The expanded relations will be appended to the record under the - `),Fe=r("code"),Fe.textContent="expand",et=b(" property (eg. "),Ae=r("code"),Ae.textContent='"expand": {"relField1": {...}, ...}',tt=b(`). Only - the relations that the user has permissions to `),Ne=r("strong"),Ne.textContent="view",lt=b(" will be expanded."),nt=f(),he(X.$$.fragment),Be=f(),ie=r("div"),ie.textContent="Responses",je=f(),K=r("div"),de=r("div");for(let l=0;l${JSON.stringify(Object.assign({},l[3],I.dummyCollectionSchemaData(l[0])),null,2)}; final record = await pb.collection('${(mt=l[0])==null?void 0:mt.name}').update('RECORD_ID', body: body); - `),A.$set(k),(!W||a&1)&&me!==(me=l[0].name+"")&&J(we,me),l[5]?D||(D=gt(),D.c(),D.m(O,null)):D&&(D.d(1),D=null),l[6]?L||(L=wt(),L.c(),L.m(Q,qe)):L&&(L.d(1),L=null),a&1&&(be=Z((bt=l[0])==null?void 0:bt.schema),B=Ee(B,a,dt,1,l,be,xe,Q,_t,Tt,null,kt)),a&6&&(_e=Z(l[2]),j=Ee(j,a,ot,1,l,_e,at,de,_t,Ct,null,yt)),a&6&&(re=Z(l[2]),Ht(),H=Ee(H,a,rt,1,l,re,it,oe,Rt,St,null,ht),Dt())},i(l){if(!W){ce(A.$$.fragment,l),ce(G.$$.fragment,l),ce(X.$$.fragment,l);for(let a=0;at(1,p=g.code);return c.$$set=g=>{"collection"in g&&t(0,o=g.collection)},c.$$.update=()=>{var g,$;c.$$.dirty&1&&t(6,n=(o==null?void 0:o.type)==="auth"),c.$$.dirty&1&&t(5,u=(o==null?void 0:o.updateRule)===null),c.$$.dirty&1&&t(2,h=[{code:200,body:JSON.stringify(I.dummyCollectionRecord(o),null,2)},{code:400,body:` + `),N.$set(k),(!W||a&1)&&me!==(me=l[0].name+"")&&J(we,me),l[5]?D||(D=gt(),D.c(),D.m(O,null)):D&&(D.d(1),D=null),l[6]?L||(L=wt(),L.c(),L.m(Q,qe)):L&&(L.d(1),L=null),a&1&&(be=Z((bt=l[0])==null?void 0:bt.schema),j=Ee(j,a,dt,1,l,be,xe,Q,_t,Tt,null,kt)),a&6&&(_e=Z(l[2]),A=Ee(A,a,ot,1,l,_e,at,de,_t,Ct,null,yt)),a&6&&(re=Z(l[2]),Ht(),H=Ee(H,a,rt,1,l,re,it,oe,Rt,St,null,ht),Dt())},i(l){if(!W){ce(N.$$.fragment,l),ce(G.$$.fragment,l),ce(X.$$.fragment,l);for(let a=0;at(1,p=g.code);return c.$$set=g=>{"collection"in g&&t(0,o=g.collection)},c.$$.update=()=>{var g,$;c.$$.dirty&1&&t(6,n=(o==null?void 0:o.type)==="auth"),c.$$.dirty&1&&t(5,u=(o==null?void 0:o.updateRule)===null),c.$$.dirty&1&&t(2,h=[{code:200,body:JSON.stringify(I.dummyCollectionRecord(o),null,2)},{code:400,body:` { "code": 400, "message": "Failed to update record.", diff --git a/ui/dist/assets/ViewApiDocs-iCTJquUd.js b/ui/dist/assets/ViewApiDocs-Bt5koN3Z.js similarity index 69% rename from ui/dist/assets/ViewApiDocs-iCTJquUd.js rename to ui/dist/assets/ViewApiDocs-Bt5koN3Z.js index c3b322be42..4a6d21d6a6 100644 --- a/ui/dist/assets/ViewApiDocs-iCTJquUd.js +++ b/ui/dist/assets/ViewApiDocs-Bt5koN3Z.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,v as _,b as m,c as W,f as b,g as r,h as l,m as X,w as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,A as dt,q as Z,r as ct}from"./index-rLaTJP5R.js";import{S as pt}from"./SdkTabs-DJGq8srX.js";import{F as ut}from"./FieldsQueryParam-Bw7BgfEJ.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,S,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,q,ce,x,pe,R,ue,Re,I,O,fe,Oe,me,Pe,h,De,A,Te,Ae,Ee,be,Se,_e,Be,qe,xe,he,Ie,Me,E,ke,M,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-B6GxOPDi.js";import{S as pt}from"./SdkTabs-C9BIEbpG.js";import{F as ut}from"./FieldsQueryParam-DB2XHXnv.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); @@ -18,13 +18,13 @@ import{S as lt,i as nt,s as st,N as tt,O as K,e as o,v as _,b as m,c as W,f as b final record = await pb.collection('${(Ve=a[0])==null?void 0:Ve.name}').getOne('RECORD_ID', expand: 'relField1,relField2.subRelField', ); - `}});let g=a[1]&&Ye();A=new tt({props:{content:"?expand=relField1,relField2.subRelField"}}),E=new ut({});let J=K(a[4]);const Qe=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to view.',ce=m(),x=o("div"),x.textContent="Query parameters",pe=m(),R=o("table"),ue=o("thead"),ue.innerHTML='Param Type Description',Re=m(),I=o("tbody"),O=o("tr"),fe=o("td"),fe.textContent="expand",Oe=m(),me=o("td"),me.innerHTML='String',Pe=m(),h=o("td"),De=_(`Auto expand record relations. Ex.: - `),W(A.$$.fragment),Te=_(` - Supports up to 6-levels depth nested relations expansion. `),Ae=o("br"),Ee=_(` + `}});let g=a[1]&&Ye();E=new tt({props:{content:"?expand=relField1,relField2.subRelField"}}),S=new ut({});let J=K(a[4]);const Qe=e=>e[6].code;for(let e=0;ee[6].code;for(let e=0;eParam Type Description id String ID of the record to view.',ce=m(),I=o("div"),I.textContent="Query parameters",pe=m(),R=o("table"),ue=o("thead"),ue.innerHTML='Param Type Description',Re=m(),M=o("tbody"),O=o("tr"),fe=o("td"),fe.textContent="expand",Oe=m(),me=o("td"),me.innerHTML='String',Pe=m(),h=o("td"),De=_(`Auto expand record relations. Ex.: + `),W(E.$$.fragment),Te=_(` + Supports up to 6-levels depth nested relations expansion. `),Ee=o("br"),Se=_(` The expanded relations will be appended to the record under the - `),be=o("code"),be.textContent="expand",Se=_(" property (eg. "),_e=o("code"),_e.textContent='"expand": {"relField1": {...}, ...}',Be=_(`). - `),qe=o("br"),xe=_(` - Only the relations to which the request user has permissions to `),he=o("strong"),he.textContent="view",Ie=_(" will be expanded."),Me=m(),W(E.$$.fragment),ke=m(),M=o("div"),M.textContent="Responses",ge=m(),P=o("div"),H=o("div");for(let e=0;es(2,c=C.code);return a.$$set=C=>{"collection"in C&&s(0,p=C.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,i=(p==null?void 0:p.viewRule)===null),a.$$.dirty&3&&p!=null&&p.id&&(f.push({code:200,body:JSON.stringify(Ke.dummyCollectionRecord(p),null,2)}),i&&f.push({code:403,body:` + `),F.$set(u),(!D||t&1)&&G!==(G=e[0].name+"")&&ve(ae,G),e[1]?g||(g=Ye(),g.c(),g.m($,null)):g&&(g.d(1),g=null),t&20&&(J=K(e[4]),y=Je(y,t,Qe,1,e,J,He,H,ot,Ze,null,Xe)),t&20&&(N=K(e[4]),at(),k=Je(k,t,Ue,1,e,N,Ne,L,it,et,null,We),rt())},i(e){if(!D){Q(F.$$.fragment,e),Q(E.$$.fragment,e),Q(S.$$.fragment,e);for(let t=0;ts(2,c=C.code);return a.$$set=C=>{"collection"in C&&s(0,p=C.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(1,i=(p==null?void 0:p.viewRule)===null),a.$$.dirty&3&&p!=null&&p.id&&(f.push({code:200,body:JSON.stringify(Ke.dummyCollectionRecord(p),null,2)}),i&&f.push({code:403,body:` { "code": 403, "message": "Only admins can access this action.", diff --git a/ui/dist/assets/autocomplete.worker-CGnTjHzG.js b/ui/dist/assets/autocomplete.worker-CGnTjHzG.js new file mode 100644 index 0000000000..817d9773ba --- /dev/null +++ b/ui/dist/assets/autocomplete.worker-CGnTjHzG.js @@ -0,0 +1,4 @@ +(function(){"use strict";class Y extends Error{}class zn extends Y{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Pn extends Y{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Yn extends Y{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class j extends Y{}class lt extends Y{constructor(e){super(`Invalid unit ${e}`)}}class v extends Y{}class U extends Y{constructor(){super("Zone is an abstract class")}}const f="numeric",C="short",M="long",Se={year:f,month:f,day:f},ct={year:f,month:C,day:f},Jn={year:f,month:C,day:f,weekday:C},ft={year:f,month:M,day:f},dt={year:f,month:M,day:f,weekday:M},ht={hour:f,minute:f},mt={hour:f,minute:f,second:f},yt={hour:f,minute:f,second:f,timeZoneName:C},gt={hour:f,minute:f,second:f,timeZoneName:M},pt={hour:f,minute:f,hourCycle:"h23"},wt={hour:f,minute:f,second:f,hourCycle:"h23"},St={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:C},kt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:M},Tt={year:f,month:f,day:f,hour:f,minute:f},Ot={year:f,month:f,day:f,hour:f,minute:f,second:f},Nt={year:f,month:C,day:f,hour:f,minute:f},Et={year:f,month:C,day:f,hour:f,minute:f,second:f},Bn={year:f,month:C,day:f,weekday:C,hour:f,minute:f},xt={year:f,month:M,day:f,hour:f,minute:f,timeZoneName:C},bt={year:f,month:M,day:f,hour:f,minute:f,second:f,timeZoneName:C},vt={year:f,month:M,day:f,weekday:M,hour:f,minute:f,timeZoneName:M},It={year:f,month:M,day:f,weekday:M,hour:f,minute:f,second:f,timeZoneName:M};class oe{get type(){throw new U}get name(){throw new U}get ianaName(){return this.name}get isUniversal(){throw new U}offsetName(e,t){throw new U}formatOffset(e,t){throw new U}offset(e){throw new U}equals(e){throw new U}get isValid(){throw new U}}let $e=null;class ke extends oe{static get instance(){return $e===null&&($e=new ke),$e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Xt(e,t,n)}formatOffset(e,t){return fe(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Te={};function Gn(s){return Te[s]||(Te[s]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Te[s]}const jn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kn(s,e){const t=s.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,r,i,a,o,u,l,c]=n;return[a,r,i,o,u,l,c]}function Hn(s,e){const t=s.formatToParts(e),n=[];for(let r=0;r=0?N:1e3+N,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Dt={};function _n(s,e={}){const t=JSON.stringify([s,e]);let n=Dt[t];return n||(n=new Intl.ListFormat(s,e),Dt[t]=n),n}let Ue={};function qe(s,e={}){const t=JSON.stringify([s,e]);let n=Ue[t];return n||(n=new Intl.DateTimeFormat(s,e),Ue[t]=n),n}let Ze={};function Qn(s,e={}){const t=JSON.stringify([s,e]);let n=Ze[t];return n||(n=new Intl.NumberFormat(s,e),Ze[t]=n),n}let ze={};function Xn(s,e={}){const{base:t,...n}=e,r=JSON.stringify([s,n]);let i=ze[r];return i||(i=new Intl.RelativeTimeFormat(s,e),ze[r]=i),i}let ue=null;function es(){return ue||(ue=new Intl.DateTimeFormat().resolvedOptions().locale,ue)}let Mt={};function ts(s){let e=Mt[s];if(!e){const t=new Intl.Locale(s);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,Mt[s]=e}return e}function ns(s){const e=s.indexOf("-x-");e!==-1&&(s=s.substring(0,e));const t=s.indexOf("-u-");if(t===-1)return[s];{let n,r;try{n=qe(s).resolvedOptions(),r=s}catch{const u=s.substring(0,t);n=qe(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:a}=n;return[r,i,a]}}function ss(s,e,t){return(t||e)&&(s.includes("-u-")||(s+="-u"),t&&(s+=`-ca-${t}`),e&&(s+=`-nu-${e}`)),s}function rs(s){const e=[];for(let t=1;t<=12;t++){const n=y.utc(2009,t,1);e.push(s(n))}return e}function is(s){const e=[];for(let t=1;t<=7;t++){const n=y.utc(2016,11,13+t);e.push(s(n))}return e}function Ne(s,e,t,n){const r=s.listingMode();return r==="error"?null:r==="en"?t(e):n(e)}function as(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}class os{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...n};n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=Qn(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):He(e,3);return b(t,this.padTo)}}}class us{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&$.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=qe(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:n}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ls{constructor(e,t,n){this.opts={style:"long",...n},!t&&Kt()&&(this.rtf=Xn(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):Vs(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const cs={firstDay:1,minimalDays:4,weekend:[6,7]};class T{static fromOpts(e){return T.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const a=e||E.defaultLocale,o=a||(i?"en-US":es()),u=t||E.defaultNumberingSystem,l=n||E.defaultOutputCalendar,c=je(r)||E.defaultWeekSettings;return new T(o,u,l,c,a)}static resetCache(){ue=null,Ue={},Ze={},ze={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return T.create(e,t,n,r)}constructor(e,t,n,r,i){const[a,o,u]=ns(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||u||null,this.weekSettings=r,this.intl=ss(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=as(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:T.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,je(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ne(this,e,nn,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=rs(i=>this.extract(i,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1){return Ne(this,e,an,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=is(i=>this.extract(i,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return Ne(this,void 0,()=>on,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[y.utc(2016,11,13,9),y.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ne(this,e,un,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[y.utc(-40,1,1),y.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t),i=r.formatToParts(),a=i.find(o=>o.type.toLowerCase()===n);return a?a.value:null}numberFormatter(e={}){return new os(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new us(e,this.intl,t)}relFormatter(e={}){return new ls(this.intl,this.isEnglish(),e)}listFormatter(e={}){return _n(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ht()?ts(this.locale):cs}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Pe=null;class D extends oe{static get utcInstance(){return Pe===null&&(Pe=new D(0)),Pe}static instance(e){return e===0?D.utcInstance:new D(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new D(Ie(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${fe(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${fe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return fe(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class fs extends oe{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function q(s,e){if(g(s)||s===null)return e;if(s instanceof oe)return s;if(ps(s)){const t=s.toLowerCase();return t==="default"?e:t==="local"||t==="system"?ke.instance:t==="utc"||t==="gmt"?D.utcInstance:D.parseSpecifier(t)||$.create(s)}else return Z(s)?D.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new fs(s)}const Ye={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ft={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ds=Ye.hanidec.replace(/[\[|\]]/g,"").split("");function hs(s){let e=parseInt(s,10);if(isNaN(e)){e="";for(let t=0;t=i&&n<=a&&(e+=n-i)}}return parseInt(e,10)}else return e}let K={};function ms(){K={}}function W({numberingSystem:s},e=""){const t=s||"latn";return K[t]||(K[t]={}),K[t][e]||(K[t][e]=new RegExp(`${Ye[t]}${e}`)),K[t][e]}let Vt=()=>Date.now(),At="system",Ct=null,Wt=null,Lt=null,Rt=60,$t,Ut=null;class E{static get now(){return Vt}static set now(e){Vt=e}static set defaultZone(e){At=e}static get defaultZone(){return q(At,ke.instance)}static get defaultLocale(){return Ct}static set defaultLocale(e){Ct=e}static get defaultNumberingSystem(){return Wt}static set defaultNumberingSystem(e){Wt=e}static get defaultOutputCalendar(){return Lt}static set defaultOutputCalendar(e){Lt=e}static get defaultWeekSettings(){return Ut}static set defaultWeekSettings(e){Ut=je(e)}static get twoDigitCutoffYear(){return Rt}static set twoDigitCutoffYear(e){Rt=e%100}static get throwOnInvalid(){return $t}static set throwOnInvalid(e){$t=e}static resetCaches(){T.resetCache(),$.resetCache(),y.resetCache(),ms()}}class L{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const qt=[0,31,59,90,120,151,181,212,243,273,304,334],Zt=[0,31,60,91,121,152,182,213,244,274,305,335];function F(s,e){return new L("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${s}, which is invalid`)}function Je(s,e,t){const n=new Date(Date.UTC(s,e-1,t));s<100&&s>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return r===0?7:r}function zt(s,e,t){return t+(le(s)?Zt:qt)[e-1]}function Pt(s,e){const t=le(s)?Zt:qt,n=t.findIndex(i=>ice(n,e,t)?(l=n+1,u=1):l=n,{weekYear:l,weekNumber:u,weekday:o,...Me(s)}}function Yt(s,e=4,t=1){const{weekYear:n,weekNumber:r,weekday:i}=s,a=Be(Je(n,1,e),t),o=_(n);let u=r*7+i-a-7+e,l;u<1?(l=n-1,u+=_(l)):u>o?(l=n+1,u-=_(n)):l=n;const{month:c,day:h}=Pt(l,u);return{year:l,month:c,day:h,...Me(s)}}function Ge(s){const{year:e,month:t,day:n}=s,r=zt(e,t,n);return{year:e,ordinal:r,...Me(s)}}function Jt(s){const{year:e,ordinal:t}=s,{month:n,day:r}=Pt(e,t);return{year:e,month:n,day:r,...Me(s)}}function Bt(s,e){if(!g(s.localWeekday)||!g(s.localWeekNumber)||!g(s.localWeekYear)){if(!g(s.weekday)||!g(s.weekNumber)||!g(s.weekYear))throw new j("Cannot mix locale-based week fields with ISO-based week fields");return g(s.localWeekday)||(s.weekday=s.localWeekday),g(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),g(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ys(s,e=4,t=1){const n=xe(s.weekYear),r=V(s.weekNumber,1,ce(s.weekYear,e,t)),i=V(s.weekday,1,7);return n?r?i?!1:F("weekday",s.weekday):F("week",s.weekNumber):F("weekYear",s.weekYear)}function gs(s){const e=xe(s.year),t=V(s.ordinal,1,_(s.year));return e?t?!1:F("ordinal",s.ordinal):F("year",s.year)}function Gt(s){const e=xe(s.year),t=V(s.month,1,12),n=V(s.day,1,be(s.year,s.month));return e?t?n?!1:F("day",s.day):F("month",s.month):F("year",s.year)}function jt(s){const{hour:e,minute:t,second:n,millisecond:r}=s,i=V(e,0,23)||e===24&&t===0&&n===0&&r===0,a=V(t,0,59),o=V(n,0,59),u=V(r,0,999);return i?a?o?u?!1:F("millisecond",r):F("second",n):F("minute",t):F("hour",e)}function g(s){return typeof s>"u"}function Z(s){return typeof s=="number"}function xe(s){return typeof s=="number"&&s%1===0}function ps(s){return typeof s=="string"}function ws(s){return Object.prototype.toString.call(s)==="[object Date]"}function Kt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ht(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ss(s){return Array.isArray(s)?s:[s]}function _t(s,e,t){if(s.length!==0)return s.reduce((n,r)=>{const i=[e(r),r];return n&&t(n[0],i[0])===n[0]?n:i},null)[1]}function ks(s,e){return e.reduce((t,n)=>(t[n]=s[n],t),{})}function H(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function je(s){if(s==null)return null;if(typeof s!="object")throw new v("Week settings must be an object");if(!V(s.firstDay,1,7)||!V(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(e=>!V(e,1,7)))throw new v("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function V(s,e,t){return xe(s)&&s>=e&&s<=t}function Ts(s,e){return s-e*Math.floor(s/e)}function b(s,e=2){const t=s<0;let n;return t?n="-"+(""+-s).padStart(e,"0"):n=(""+s).padStart(e,"0"),n}function z(s){if(!(g(s)||s===null||s===""))return parseInt(s,10)}function J(s){if(!(g(s)||s===null||s===""))return parseFloat(s)}function Ke(s){if(!(g(s)||s===null||s==="")){const e=parseFloat("0."+s)*1e3;return Math.floor(e)}}function He(s,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(s*n)/n}function le(s){return s%4===0&&(s%100!==0||s%400===0)}function _(s){return le(s)?366:365}function be(s,e){const t=Ts(e-1,12)+1,n=s+(e-t)/12;return t===2?le(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ve(s){let e=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(e=new Date(e),e.setUTCFullYear(s.year,s.month-1,s.day)),+e}function Qt(s,e,t){return-Be(Je(s,1,e),t)+e-1}function ce(s,e=4,t=1){const n=Qt(s,e,t),r=Qt(s+1,e,t);return(_(s)-n+r)/7}function _e(s){return s>99?s:s>E.twoDigitCutoffYear?1900+s:2e3+s}function Xt(s,e,t,n=null){const r=new Date(s),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(i.timeZone=n);const a={timeZoneName:e,...i},o=new Intl.DateTimeFormat(t,a).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function Ie(s,e){let t=parseInt(s,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,r=t<0||Object.is(t,-0)?-n:n;return t*60+r}function en(s){const e=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(e))throw new v(`Invalid unit value ${s}`);return e}function De(s,e){const t={};for(const n in s)if(H(s,n)){const r=s[n];if(r==null)continue;t[e(n)]=en(r)}return t}function fe(s,e){const t=Math.trunc(Math.abs(s/60)),n=Math.trunc(Math.abs(s%60)),r=s>=0?"+":"-";switch(e){case"short":return`${r}${b(t,2)}:${b(n,2)}`;case"narrow":return`${r}${t}${n>0?`:${n}`:""}`;case"techie":return`${r}${b(t,2)}${b(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Me(s){return ks(s,["hour","minute","second","millisecond"])}const Os=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ns=["J","F","M","A","M","J","J","A","S","O","N","D"];function nn(s){switch(s){case"narrow":return[...Ns];case"short":return[...tn];case"long":return[...Os];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const sn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],rn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Es=["M","T","W","T","F","S","S"];function an(s){switch(s){case"narrow":return[...Es];case"short":return[...rn];case"long":return[...sn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const on=["AM","PM"],xs=["Before Christ","Anno Domini"],bs=["BC","AD"],vs=["B","A"];function un(s){switch(s){case"narrow":return[...vs];case"short":return[...bs];case"long":return[...xs];default:return null}}function Is(s){return on[s.hour<12?0:1]}function Ds(s,e){return an(e)[s.weekday-1]}function Ms(s,e){return nn(e)[s.month-1]}function Fs(s,e){return un(e)[s.year<0?0:1]}function Vs(s,e,t="always",n=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(s)===-1;if(t==="auto"&&i){const h=s==="days";switch(e){case 1:return h?"tomorrow":`next ${r[s][0]}`;case-1:return h?"yesterday":`last ${r[s][0]}`;case 0:return h?"today":`this ${r[s][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=r[s],c=n?u?l[1]:l[2]||l[1]:u?r[s][0]:s;return a?`${o} ${c} ago`:`in ${o} ${c}`}function ln(s,e){let t="";for(const n of s)n.literal?t+=n.val:t+=e(n.val);return t}const As={D:Se,DD:ct,DDD:ft,DDDD:dt,t:ht,tt:mt,ttt:yt,tttt:gt,T:pt,TT:wt,TTT:St,TTTT:kt,f:Tt,ff:Nt,fff:xt,ffff:vt,F:Ot,FF:Et,FFF:bt,FFFF:It};class I{static create(e,t={}){return new I(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let a=0;a0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return As[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return b(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,N)=>this.loc.extract(e,m,N),a=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>n?Is(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,N)=>n?Ms(e,m):i(N?{month:m}:{month:m,day:"numeric"},"month"),l=(m,N)=>n?Ds(e,m):i(N?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{const N=I.macroTokenToFormatOpts(m);return N?this.formatWithSystemDefault(e,N):m},h=m=>n?Fs(e,m):i({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return ln(I.parseFormat(t),p)}formatDurationFromString(e,t){const n=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=u=>l=>{const c=n(l);return c?this.num(u.get(c),l.length):l},i=I.parseFormat(t),a=i.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),o=e.shiftTo(...a.map(n).filter(u=>u));return ln(i,r(o))}}const cn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Q(...s){const e=s.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function X(...s){return e=>s.reduce(([t,n,r],i)=>{const[a,o,u]=i(e,r);return[{...t,...a},o||n,u]},[{},null,1]).slice(0,2)}function ee(s,...e){if(s==null)return[null,null];for(const[t,n]of e){const r=t.exec(s);if(r)return n(r)}return[null,null]}function fn(...s){return(e,t)=>{const n={};let r;for(r=0;rm!==void 0&&(N||m&&c)?-m:m;return[{years:p(J(t)),months:p(J(n)),weeks:p(J(r)),days:p(J(i)),hours:p(J(a)),minutes:p(J(o)),seconds:p(J(u),u==="-0"),milliseconds:p(Ke(l),h)}]}const Bs={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function et(s,e,t,n,r,i,a){const o={year:e.length===2?_e(z(e)):z(e),month:tn.indexOf(t)+1,day:z(n),hour:z(r),minute:z(i)};return a&&(o.second=z(a)),s&&(o.weekday=s.length>3?sn.indexOf(s)+1:rn.indexOf(s)+1),o}const Gs=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function js(s){const[,e,t,n,r,i,a,o,u,l,c,h]=s,p=et(e,r,n,t,i,a,o);let m;return u?m=Bs[u]:l?m=0:m=Ie(c,h),[p,new D(m)]}function Ks(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Hs=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,_s=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Qs=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function yn(s){const[,e,t,n,r,i,a,o]=s;return[et(e,r,n,t,i,a,o),D.utcInstance]}function Xs(s){const[,e,t,n,r,i,a,o]=s;return[et(e,o,t,n,r,i,a),D.utcInstance]}const er=Q(Ws,Xe),tr=Q(Ls,Xe),nr=Q(Rs,Xe),sr=Q(hn),gn=X(zs,ne,de,he),rr=X($s,ne,de,he),ir=X(Us,ne,de,he),ar=X(ne,de,he);function or(s){return ee(s,[er,gn],[tr,rr],[nr,ir],[sr,ar])}function ur(s){return ee(Ks(s),[Gs,js])}function lr(s){return ee(s,[Hs,yn],[_s,yn],[Qs,Xs])}function cr(s){return ee(s,[Ys,Js])}const fr=X(ne);function dr(s){return ee(s,[Ps,fr])}const hr=Q(qs,Zs),mr=Q(mn),yr=X(ne,de,he);function gr(s){return ee(s,[hr,gn],[mr,yr])}const pn="Invalid Duration",wn={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},pr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...wn},A=146097/400,se=146097/4800,wr={years:{quarters:4,months:12,weeks:A/7,days:A,hours:A*24,minutes:A*24*60,seconds:A*24*60*60,milliseconds:A*24*60*60*1e3},quarters:{months:3,weeks:A/28,days:A/4,hours:A*24/4,minutes:A*24*60/4,seconds:A*24*60*60/4,milliseconds:A*24*60*60*1e3/4},months:{weeks:se/7,days:se,hours:se*24,minutes:se*24*60,seconds:se*24*60*60,milliseconds:se*24*60*60*1e3},...wn},B=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Sr=B.slice(0).reverse();function P(s,e,t=!1){const n={values:t?e.values:{...s.values,...e.values||{}},loc:s.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||s.conversionAccuracy,matrix:e.matrix||s.matrix};return new w(n)}function Sn(s,e){let t=e.milliseconds??0;for(const n of Sr.slice(1))e[n]&&(t+=e[n]*s[n].milliseconds);return t}function kn(s,e){const t=Sn(s,e)<0?-1:1;B.reduceRight((n,r)=>{if(g(e[r]))return n;if(n){const i=e[n]*t,a=s[r][n],o=Math.floor(i/a);e[r]+=o*t,e[n]-=o*a*t}return r},null),B.reduce((n,r)=>{if(g(e[r]))return n;if(n){const i=e[n]%1;e[n]-=i,e[r]+=i*s[n][r]}return r},null)}function kr(s){const e={};for(const[t,n]of Object.entries(s))n!==0&&(e[t]=n);return e}class w{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?wr:pr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||T.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return w.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new v(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new w({values:De(e,w.normalizeUnit),loc:T.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Z(e))return w.fromMillis(e);if(w.isDuration(e))return e;if(typeof e=="object")return w.fromObject(e);throw new v(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=cr(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=dr(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new v("need to specify a reason the Duration is invalid");const n=e instanceof L?e:new L(e,t);if(E.throwOnInvalid)throw new Yn(n);return new w({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new lt(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?I.create(this.loc,n).formatDurationFromString(this,e):pn}toHuman(e={}){if(!this.isValid)return pn;const t=B.map(n=>{const r=this.values[n];return g(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=He(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},y.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Sn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e),n={};for(const r of B)(H(t.values,r)||H(this.values,r))&&(n[r]=t.get(r)+this.get(r));return P(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=en(e(this.values[n],n));return P(this,{values:t},!0)}get(e){return this[w.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...De(e,w.normalizeUnit)};return P(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return P(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return kn(this.matrix,e),P(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=kr(this.normalize().shiftToAll().toObject());return P(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>w.normalizeUnit(a));const t={},n={},r=this.toObject();let i;for(const a of B)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in n)o+=this.matrix[l][a]*n[l],n[l]=0;Z(r[a])&&(o+=r[a]);const u=Math.trunc(o);t[a]=u,n[a]=(o*1e3-u*1e3)/1e3}else Z(r[a])&&(n[a]=r[a]);for(const a in n)n[a]!==0&&(t[i]+=a===i?n[a]:n[a]/this.matrix[i][a]);return kn(this.matrix,t),P(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return P(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(n,r){return n===void 0||n===0?r===void 0||r===0:n===r}for(const n of B)if(!t(this.values[n],e.values[n]))return!1;return!0}}const re="Invalid Interval";function Tr(s,e){return!s||!s.isValid?x.invalid("missing or invalid start"):!e||!e.isValid?x.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?x.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ye).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),n=[];let{s:r}=this,i=0;for(;r+this.e?this.e:a;n.push(x.fromDateTimes(r,o)),r=o,i+=1}return n}splitBy(e){const t=w.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,r=1,i;const a=[];for(;nu*r));i=+o>+this.e?this.e:o,a.push(x.fromDateTimes(n,i)),n=i,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e=n?null:x.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return x.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((r,i)=>r.s-i.s).reduce(([r,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[r,i.union(a)]:[r.concat([i]),a]:[r,a],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)n+=u.type==="s"?1:-1,n===1?t=u.time:(t&&+t!=+u.time&&r.push(x.fromDateTimes(t,u.time)),t=null);return x.merge(r)}difference(...e){return x.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:re}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Se,t={}){return this.isValid?I.create(this.s.loc.clone(t),e).formatInterval(this):re}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:re}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:re}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:re}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:re}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):w.invalid(this.invalidReason)}mapEndpoints(e){return x.fromDateTimes(e(this.s),e(this.e))}}class Fe{static hasDST(e=E.defaultZone){const t=y.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $.isValidZone(e)}static normalizeZone(e){return q(e,E.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||T.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||T.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return T.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return T.create(t,null,"gregory").eras(e)}static features(){return{relative:Kt(),localeWeek:Ht()}}}function Tn(s,e){const t=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(s);return Math.floor(w.fromMillis(n).as("days"))}function Or(s,e,t){const n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const c=Tn(u,l);return(c-c%7)/7}],["days",Tn]],r={},i=s;let a,o;for(const[u,l]of n)t.indexOf(u)>=0&&(a=u,r[u]=l(s,e),o=i.plus(r),o>e?(r[u]--,s=i.plus(r),s>e&&(o=s,r[u]--,s=i.plus(r))):s=o);return[s,r,o,a]}function Nr(s,e,t,n){let[r,i,a,o]=Or(s,e,t);const u=e-r,l=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);l.length===0&&(a0?w.fromMillis(u,n).shiftTo(...l).plus(c):c}const Er="missing Intl.DateTimeFormat.formatToParts support";function S(s,e=t=>t){return{regex:s,deser:([t])=>e(hs(t))}}const On="[  ]",Nn=new RegExp(On,"g");function xr(s){return s.replace(/\./g,"\\.?").replace(Nn,On)}function En(s){return s.replace(/\./g,"").replace(Nn," ").toLowerCase()}function R(s,e){return s===null?null:{regex:RegExp(s.map(xr).join("|")),deser:([t])=>s.findIndex(n=>En(t)===En(n))+e}}function xn(s,e){return{regex:s,deser:([,t,n])=>Ie(t,n),groups:e}}function Ve(s){return{regex:s,deser:([e])=>e}}function br(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function vr(s,e){const t=W(e),n=W(e,"{2}"),r=W(e,"{3}"),i=W(e,"{4}"),a=W(e,"{6}"),o=W(e,"{1,2}"),u=W(e,"{1,3}"),l=W(e,"{1,6}"),c=W(e,"{1,9}"),h=W(e,"{2,4}"),p=W(e,"{4,6}"),m=k=>({regex:RegExp(br(k.val)),deser:([ae])=>ae,literal:!0}),O=(k=>{if(s.literal)return m(k);switch(k.val){case"G":return R(e.eras("short"),0);case"GG":return R(e.eras("long"),0);case"y":return S(l);case"yy":return S(h,_e);case"yyyy":return S(i);case"yyyyy":return S(p);case"yyyyyy":return S(a);case"M":return S(o);case"MM":return S(n);case"MMM":return R(e.months("short",!0),1);case"MMMM":return R(e.months("long",!0),1);case"L":return S(o);case"LL":return S(n);case"LLL":return R(e.months("short",!1),1);case"LLLL":return R(e.months("long",!1),1);case"d":return S(o);case"dd":return S(n);case"o":return S(u);case"ooo":return S(r);case"HH":return S(n);case"H":return S(o);case"hh":return S(n);case"h":return S(o);case"mm":return S(n);case"m":return S(o);case"q":return S(o);case"qq":return S(n);case"s":return S(o);case"ss":return S(n);case"S":return S(u);case"SSS":return S(r);case"u":return Ve(c);case"uu":return Ve(o);case"uuu":return S(t);case"a":return R(e.meridiems(),0);case"kkkk":return S(i);case"kk":return S(h,_e);case"W":return S(o);case"WW":return S(n);case"E":case"c":return S(t);case"EEE":return R(e.weekdays("short",!1),1);case"EEEE":return R(e.weekdays("long",!1),1);case"ccc":return R(e.weekdays("short",!0),1);case"cccc":return R(e.weekdays("long",!0),1);case"Z":case"ZZ":return xn(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return xn(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return Ve(/[a-z_+-/]{1,256}?/i);case" ":return Ve(/[^\S\n\r]/);default:return m(k)}})(s)||{invalidReason:Er};return O.token=s,O}const Ir={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Dr(s,e,t){const{type:n,value:r}=s;if(n==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=e[n];let a=n;n==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=t.hour12?"hour12":"hour24");let o=Ir[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function Mr(s){return[`^${s.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,s]}function Fr(s,e,t){const n=s.match(e);if(n){const r={};let i=1;for(const a in t)if(H(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(r[o.token.val[0]]=o.deser(n.slice(i,i+u))),i+=u}return[n,r]}else return[n,{}]}function Vr(s){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,n;return g(s.z)||(t=$.create(s.z)),g(s.Z)||(t||(t=new D(s.Z)),n=s.Z),g(s.q)||(s.M=(s.q-1)*3+1),g(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),g(s.u)||(s.S=Ke(s.u)),[Object.keys(s).reduce((i,a)=>{const o=e(a);return o&&(i[o]=s[a]),i},{}),t,n]}let tt=null;function Ar(){return tt||(tt=y.fromMillis(1555555555555)),tt}function Cr(s,e){if(s.literal)return s;const t=I.macroTokenToFormatOpts(s.val),n=Dn(t,e);return n==null||n.includes(void 0)?s:n}function bn(s,e){return Array.prototype.concat(...s.map(t=>Cr(t,e)))}class vn{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=bn(I.parseFormat(t),e),this.units=this.tokens.map(n=>vr(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,r]=Mr(this.units);this.regex=RegExp(n,"i"),this.handlers=r}}explainFromTokens(e){if(this.isValid){const[t,n]=Fr(e,this.regex,this.handlers),[r,i,a]=n?Vr(n):[null,null,void 0];if(H(n,"a")&&H(n,"H"))throw new j("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:a}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function In(s,e,t){return new vn(s,t).explainFromTokens(e)}function Wr(s,e,t){const{result:n,zone:r,specificOffset:i,invalidReason:a}=In(s,e,t);return[n,r,i,a]}function Dn(s,e){if(!s)return null;const n=I.create(e,s).dtFormatter(Ar()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(a=>Dr(a,s,i))}const nt="Invalid DateTime",Mn=864e13;function me(s){return new L("unsupported zone",`the zone "${s.name}" is not supported`)}function st(s){return s.weekData===null&&(s.weekData=Ee(s.c)),s.weekData}function rt(s){return s.localWeekData===null&&(s.localWeekData=Ee(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function G(s,e){const t={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new y({...t,...e,old:t})}function Fn(s,e,t){let n=s-e*60*1e3;const r=t.offset(n);if(e===r)return[n,e];n-=(r-e)*60*1e3;const i=t.offset(n);return r===i?[n,r]:[s-Math.min(r,i)*60*1e3,Math.max(r,i)]}function Ae(s,e){s+=e*60*1e3;const t=new Date(s);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Ce(s,e,t){return Fn(ve(s),e,t)}function Vn(s,e){const t=s.o,n=s.c.year+Math.trunc(e.years),r=s.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...s.c,year:n,month:r,day:Math.min(s.c.day,be(n,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=w.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=ve(i);let[u,l]=Fn(o,t,s.zone);return a!==0&&(u+=a,l=s.zone.offset(u)),{ts:u,o:l}}function ie(s,e,t,n,r,i){const{setZone:a,zone:o}=t;if(s&&Object.keys(s).length!==0||e){const u=e||o,l=y.fromObject(s,{...t,zone:u,specificOffset:i});return a?l:l.setZone(o)}else return y.invalid(new L("unparsable",`the input "${r}" can't be parsed as ${n}`))}function We(s,e,t=!0){return s.isValid?I.create(T.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(s,e):null}function it(s,e){const t=s.c.year>9999||s.c.year<0;let n="";return t&&s.c.year>=0&&(n+="+"),n+=b(s.c.year,t?6:4),e?(n+="-",n+=b(s.c.month),n+="-",n+=b(s.c.day)):(n+=b(s.c.month),n+=b(s.c.day)),n}function An(s,e,t,n,r,i){let a=b(s.c.hour);return e?(a+=":",a+=b(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=":")):a+=b(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=b(s.c.second),(s.c.millisecond!==0||!n)&&(a+=".",a+=b(s.c.millisecond,3))),r&&(s.isOffsetFixed&&s.offset===0&&!i?a+="Z":s.o<0?(a+="-",a+=b(Math.trunc(-s.o/60)),a+=":",a+=b(Math.trunc(-s.o%60))):(a+="+",a+=b(Math.trunc(s.o/60)),a+=":",a+=b(Math.trunc(s.o%60)))),i&&(a+="["+s.zone.ianaName+"]"),a}const Cn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Lr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Rr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Wn=["year","month","day","hour","minute","second","millisecond"],$r=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ur=["year","ordinal","hour","minute","second","millisecond"];function qr(s){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!e)throw new lt(s);return e}function Ln(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return qr(s)}}function Zr(s){return Re[s]||(Le===void 0&&(Le=E.now()),Re[s]=s.offset(Le)),Re[s]}function Rn(s,e){const t=q(e.zone,E.defaultZone);if(!t.isValid)return y.invalid(me(t));const n=T.fromObject(e);let r,i;if(g(s.year))r=E.now();else{for(const u of Wn)g(s[u])&&(s[u]=Cn[u]);const a=Gt(s)||jt(s);if(a)return y.invalid(a);const o=Zr(t);[r,i]=Ce(s,o,t)}return new y({ts:r,zone:t,loc:n,o:i})}function $n(s,e,t){const n=g(t.round)?!0:t.round,r=(a,o)=>(a=He(a,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(s,a)?0:e.startOf(a).diff(s.startOf(a),a).get(a):e.diff(s,a).get(a);if(t.unit)return r(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return r(o,a)}return r(s>e?-0:0,t.units[t.units.length-1])}function Un(s){let e={},t;return s.length>0&&typeof s[s.length-1]=="object"?(e=s[s.length-1],t=Array.from(s).slice(0,s.length-1)):t=Array.from(s),[e,t]}let Le,Re={};class y{constructor(e){const t=e.zone||E.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new L("invalid input"):null)||(t.isValid?null:me(t));this.ts=g(e.ts)?E.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const o=Z(e.o)&&!e.old?e.o:t.offset(this.ts);r=Ae(this.ts,o),n=Number.isNaN(r.year)?new L("invalid input"):null,r=n?null:r,i=n?null:o}this._zone=t,this.loc=e.loc||T.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new y({})}static local(){const[e,t]=Un(arguments),[n,r,i,a,o,u,l]=t;return Rn({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=Un(arguments),[n,r,i,a,o,u,l]=t;return e.zone=D.utcInstance,Rn({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const n=ws(e)?e.valueOf():NaN;if(Number.isNaN(n))return y.invalid("invalid input");const r=q(t.zone,E.defaultZone);return r.isValid?new y({ts:n,zone:r,loc:T.fromObject(t)}):y.invalid(me(r))}static fromMillis(e,t={}){if(Z(e))return e<-Mn||e>Mn?y.invalid("Timestamp out of range"):new y({ts:e,zone:q(t.zone,E.defaultZone),loc:T.fromObject(t)});throw new v(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Z(e))return new y({ts:e*1e3,zone:q(t.zone,E.defaultZone),loc:T.fromObject(t)});throw new v("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=q(t.zone,E.defaultZone);if(!n.isValid)return y.invalid(me(n));const r=T.fromObject(t),i=De(e,Ln),{minDaysInFirstWeek:a,startOfWeek:o}=Bt(i,r),u=E.now(),l=g(t.specificOffset)?n.offset(u):t.specificOffset,c=!g(i.ordinal),h=!g(i.year),p=!g(i.month)||!g(i.day),m=h||p,N=i.weekYear||i.weekNumber;if((m||c)&&N)throw new j("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new j("Can't mix ordinal dates with month/day");const O=N||i.weekday&&!m;let k,ae,ge=Ae(u,l);O?(k=$r,ae=Lr,ge=Ee(ge,a,o)):c?(k=Ur,ae=Rr,ge=Ge(ge)):(k=Wn,ae=Cn);let qn=!1;for(const we of k){const Hr=i[we];g(Hr)?qn?i[we]=ae[we]:i[we]=ge[we]:qn=!0}const Br=O?ys(i,a,o):c?gs(i):Gt(i),Zn=Br||jt(i);if(Zn)return y.invalid(Zn);const Gr=O?Yt(i,a,o):c?Jt(i):i,[jr,Kr]=Ce(Gr,l,n),pe=new y({ts:jr,zone:n,o:Kr,loc:r});return i.weekday&&m&&e.weekday!==pe.weekday?y.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${pe.toISO()}`):pe.isValid?pe:y.invalid(pe.invalid)}static fromISO(e,t={}){const[n,r]=or(e);return ie(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=ur(e);return ie(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=lr(e);return ie(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(g(e)||g(t))throw new v("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[o,u,l,c]=Wr(a,e,t);return c?y.invalid(c):ie(o,u,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return y.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=gr(e);return ie(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new v("need to specify a reason the DateTime is invalid");const n=e instanceof L?e:new L(e,t);if(E.throwOnInvalid)throw new zn(n);return new y({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=Dn(e,T.fromObject(t));return n?n.map(r=>r?r.val:null).join(""):null}static expandFormat(e,t={}){return bn(I.parseFormat(e),T.fromObject(t)).map(r=>r.val).join("")}static resetCache(){Le=void 0,Re={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?st(this).weekYear:NaN}get weekNumber(){return this.isValid?st(this).weekNumber:NaN}get weekday(){return this.isValid?st(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?rt(this).weekday:NaN}get localWeekNumber(){return this.isValid?rt(this).weekNumber:NaN}get localWeekYear(){return this.isValid?rt(this).weekYear:NaN}get ordinal(){return this.isValid?Ge(this.c).ordinal:NaN}get monthShort(){return this.isValid?Fe.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Fe.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Fe.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Fe.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=ve(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];const u=n-a*t,l=n-o*t,c=Ae(u,a),h=Ae(l,o);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[G(this,{ts:u}),G(this,{ts:l})]:[this]}get isInLeapYear(){return le(this.year)}get daysInMonth(){return be(this.year,this.month)}get daysInYear(){return this.isValid?_(this.year):NaN}get weeksInWeekYear(){return this.isValid?ce(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ce(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=I.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(D.instance(e),t)}toLocal(){return this.setZone(E.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=q(e,E.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const i=e.offset(this.ts),a=this.toObject();[r]=Ce(a,i,e)}return G(this,{ts:r,zone:e})}else return y.invalid(me(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return G(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=De(e,Ln),{minDaysInFirstWeek:n,startOfWeek:r}=Bt(t,this.loc),i=!g(t.weekYear)||!g(t.weekNumber)||!g(t.weekday),a=!g(t.ordinal),o=!g(t.year),u=!g(t.month)||!g(t.day),l=o||u,c=t.weekYear||t.weekNumber;if((l||a)&&c)throw new j("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new j("Can't mix ordinal dates with month/day");let h;i?h=Yt({...Ee(this.c,n,r),...t},n,r):g(t.ordinal)?(h={...this.toObject(),...t},g(t.day)&&(h.day=Math.min(be(h.year,h.month),h.day))):h=Jt({...Ge(this.c),...t});const[p,m]=Ce(h,this.o,this.zone);return G(this,{ts:p,o:m})}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return G(this,Vn(this,t))}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e).negate();return G(this,Vn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=w.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks")if(t){const i=this.loc.getStartOfWeek(),{weekday:a}=this;athis.valueOf(),o=a?this:e,u=a?e:this,l=Nr(o,u,i,r);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(y.now(),e,t)}until(e){return this.isValid?x.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||y.fromObject({},{zone:this.zone}),n=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(y.isDateTime))throw new v("max requires all arguments be DateTimes");return _t(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return In(a,e,t)}static fromStringExplain(e,t,n={}){return y.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:r=null}=t,i=T.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new vn(i,e)}static fromFormatParser(e,t,n={}){if(g(e)||g(t))throw new v("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!a.equals(t.locale))throw new v(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`);const{result:o,zone:u,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?y.invalid(c):ie(o,u,n,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Se}static get DATE_MED(){return ct}static get DATE_MED_WITH_WEEKDAY(){return Jn}static get DATE_FULL(){return ft}static get DATE_HUGE(){return dt}static get TIME_SIMPLE(){return ht}static get TIME_WITH_SECONDS(){return mt}static get TIME_WITH_SHORT_OFFSET(){return yt}static get TIME_WITH_LONG_OFFSET(){return gt}static get TIME_24_SIMPLE(){return pt}static get TIME_24_WITH_SECONDS(){return wt}static get TIME_24_WITH_SHORT_OFFSET(){return St}static get TIME_24_WITH_LONG_OFFSET(){return kt}static get DATETIME_SHORT(){return Tt}static get DATETIME_SHORT_WITH_SECONDS(){return Ot}static get DATETIME_MED(){return Nt}static get DATETIME_MED_WITH_SECONDS(){return Et}static get DATETIME_MED_WITH_WEEKDAY(){return Bn}static get DATETIME_FULL(){return xt}static get DATETIME_FULL_WITH_SECONDS(){return bt}static get DATETIME_HUGE(){return vt}static get DATETIME_HUGE_WITH_SECONDS(){return It}}function ye(s){if(y.isDateTime(s))return s;if(s&&s.valueOf&&Z(s.valueOf()))return y.fromJSDate(s);if(s&&typeof s=="object")return y.fromObject(s);throw new v(`Unknown datetime argument: ${s}, of type ${typeof s}`)}const zr=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Pr=[".mp4",".avi",".mov",".3gp",".wmv"],Yr=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Jr=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class d{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||d.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return d.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!d.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!d.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t){e.splice(n,1);break}}static pushUnique(e,t){d.inArray(e,t)||e.push(t)}static findByKey(e,t,n){e=Array.isArray(e)?e:[];for(let r in e)if(e[r][t]==n)return e[r];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const n={};for(let r in e)n[e[r][t]]=n[e[r][t]]||[],n[e[r][t]].push(e[r]);return n}static removeByKey(e,t,n){for(let r in e)if(e[r][t]==n){e.splice(r,1);break}}static pushOrReplaceByKey(e,t,n="id"){for(let r=e.length-1;r>=0;r--)if(e[r][n]==t[n]){e[r]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const n={};for(const r of e)n[r[t]]=r;return Object.values(n)}static filterRedactedProps(e,t="******"){const n=JSON.parse(JSON.stringify(e||{}));for(let r in n)typeof n[r]=="object"&&n[r]!==null?n[r]=d.filterRedactedProps(n[r],t):n[r]===t&&delete n[r];return n}static getNestedVal(e,t,n=null,r="."){let i=e||{},a=(t||"").split(r);for(const o of a){if(!d.isObject(i)&&!Array.isArray(i)||typeof i[o]>"u")return n;i=i[o]}return i}static setByPath(e,t,n,r="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let i=e,a=t.split(r),o=a.pop();for(const u of a)(!d.isObject(i)&&!Array.isArray(i)||!d.isObject(i[u])&&!Array.isArray(i[u]))&&(i[u]={}),i=i[u];i[o]=n}static deleteByPath(e,t,n="."){let r=e||{},i=(t||"").split(n),a=i.pop();for(const o of i)(!d.isObject(r)&&!Array.isArray(r)||!d.isObject(r[o])&&!Array.isArray(r[o]))&&(r[o]={}),r=r[o];Array.isArray(r)?r.splice(a,1):d.isObject(r)&&delete r[a],i.length>0&&(Array.isArray(r)&&!r.length||d.isObject(r)&&!Object.keys(r).length)&&(Array.isArray(e)&&e.length>0||d.isObject(e)&&Object.keys(e).length>0)&&d.deleteByPath(e,i.join(n),n)}static randomString(e=10){let t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r"u")return d.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const n="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;ii.replaceAll("{_PB_ESCAPED_}",t));for(let i of r)i=i.trim(),d.isEmpty(i)||n.push(i);return n}static joinNonEmpty(e,t=", "){e=e||[];const n=[],r=t.length>1?t.trim():t;for(let i of e)i=typeof i=="string"?i.trim():"",d.isEmpty(i)||n.push(i.replaceAll(r,"\\"+r));return n.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},n=t[e.length]||t[19];return y.fromFormat(e,n,{zone:"UTC"})}return y.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(n=>{console.warn("Failed to copy.",n)})}static download(e,t){const n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",t),n.setAttribute("target","_blank"),n.click(),n.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n);d.download(r,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const n=decodeURIComponent(atob(t));return JSON.parse(n)||{}}catch(n){console.warn("Failed to parse JWT payload data.",n)}return{}}static hasImageExtension(e){return e=e||"",!!zr.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Pr.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Yr.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Jr.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return d.hasImageExtension(e)?"image":d.hasDocumentExtension(e)?"document":d.hasVideoExtension(e)?"video":d.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,n=100){return new Promise(r=>{let i=new FileReader;i.onload=function(a){let o=new Image;o.onload=function(){let u=document.createElement("canvas"),l=u.getContext("2d"),c=o.width,h=o.height;return u.width=t,u.height=n,l.drawImage(o,c>h?(c-h)/2:0,0,c>h?h:c,c>h?h:c,0,0,t,n),r(u.toDataURL(e.type))},o.src=a.target.result},i.readAsDataURL(e)})}static addValueToFormData(e,t,n){if(!(typeof n>"u"))if(d.isEmpty(n))e.append(t,"");else if(Array.isArray(n))for(const r of n)d.addValueToFormData(e,t,r);else n instanceof File?e.append(t,n):n instanceof Date?e.append(t,n.toISOString()):d.isObject(n)?e.append(t,JSON.stringify(n)):e.append(t,""+n)}static dummyCollectionRecord(e){var u,l,c,h,p,m,N;const t=(e==null?void 0:e.schema)||[],n=(e==null?void 0:e.type)==="auth",r=(e==null?void 0:e.type)==="view",i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};n&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!r||d.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!r||d.extractColumnsFromQuery((l=e==null?void 0:e.options)==null?void 0:l.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const O of t){let k=null;O.type==="number"?k=123:O.type==="date"?k="2022-01-01 10:00:00.123Z":O.type==="bool"?k=!0:O.type==="email"?k="test@example.com":O.type==="url"?k="https://example.com":O.type==="json"?k="JSON":O.type==="file"?(k="filename.jpg",((c=O.options)==null?void 0:c.maxSelect)!==1&&(k=[k])):O.type==="select"?(k=(p=(h=O.options)==null?void 0:h.values)==null?void 0:p[0],((m=O.options)==null?void 0:m.maxSelect)!==1&&(k=[k])):O.type==="relation"?(k="RELATION_RECORD_ID",((N=O.options)==null?void 0:N.maxSelect)!==1&&(k=[k])):k="test",i[O.name]=k}return i}static dummyCollectionSchemaData(e){var r,i,a,o;const t=(e==null?void 0:e.schema)||[],n={};for(const u of t){let l=null;if(u.type==="number")l=123;else if(u.type==="date")l="2022-01-01 10:00:00.123Z";else if(u.type==="bool")l=!0;else if(u.type==="email")l="test@example.com";else if(u.type==="url")l="https://example.com";else if(u.type==="json")l="JSON";else{if(u.type==="file")continue;u.type==="select"?(l=(i=(r=u.options)==null?void 0:r.values)==null?void 0:i[0],((a=u.options)==null?void 0:a.maxSelect)!==1&&(l=[l])):u.type==="relation"?(l="RELATION_RECORD_ID",((o=u.options)==null?void 0:o.maxSelect)!==1&&(l=[l])):l="test"}n[u.name]=l}return n}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,n=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let l in e)if(l!=="schema"&&JSON.stringify(e[l])!==JSON.stringify(t[l]))return!0;const r=Array.isArray(e.schema)?e.schema:[],i=Array.isArray(t.schema)?t.schema:[],a=r.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(i,"id",l.id)),o=i.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(r,"id",l.id)),u=i.filter(l=>{const c=d.isObject(l)&&d.findByKey(r,"id",l.id);if(!c)return!1;for(let h in c)if(JSON.stringify(l[h])!=JSON.stringify(c[h]))return!0;return!1});return!!(o.length||u.length||n&&a.length)}static sortCollections(e=[]){const t=[],n=[],r=[];for(const a of e)a.type==="auth"?t.push(a):a.type==="base"?n.push(a):r.push(a);function i(a,o){return a.name>o.name?1:a.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(r){let i=r.parentNode;for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}function n(r){if(r){for(const i of r.children)n(i);e.includes(r.tagName)?(r.removeAttribute("style"),r.removeAttribute("class")):t(r)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(r,i)=>{n(i.node)},file_picker_types:"image",file_picker_callback:(r,i,a)=>{const o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("accept","image/*"),o.addEventListener("change",u=>{const l=u.target.files[0],c=new FileReader;c.addEventListener("load",()=>{if(!tinymce)return;const h="blobid"+new Date().getTime(),p=tinymce.activeEditor.editorUpload.blobCache,m=c.result.split(",")[1],N=p.create(h,l,m);p.add(N),r(N.blobUri(),{title:l.name})}),c.readAsDataURL(l)}),o.click()},setup:r=>{r.on("keydown",a=>{(a.ctrlKey||a.metaKey)&&a.code=="KeyS"&&r.formElement&&(a.preventDefault(),a.stopPropagation(),r.formElement.dispatchEvent(new KeyboardEvent("keydown",a)))});const i="tinymce_last_direction";r.on("init",()=>{var o;const a=(o=window==null?void 0:window.localStorage)==null?void 0:o.getItem(i);!r.isDirty()&&r.getContent()==""&&a=="rtl"&&r.execCommand("mceDirectionRTL")}),r.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:a=>{a([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"ltr"),r.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"rtl"),r.execCommand("mceDirectionRTL")}}])}}),r.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:a=>{a([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{r.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{r.execCommand("mceImage")}}])}})}}}static displayValue(e,t,n="N/A"){e=e||{},t=t||[];let r=[];for(const a of t){let o=e[a];typeof o>"u"||(o=d.stringifyValue(o,n),r.push(o))}if(r.length>0)return r.join(", ");const i=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const a of i){let o=d.stringifyValue(e[a],"");if(o)return o}return n}static stringifyValue(e,t="N/A",n=150){if(d.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?d.plainText(e):e,d.truncate(e,n)||t;if(Array.isArray(e)&&typeof e[0]!="object")return d.truncate(e.join(","),n);if(typeof e=="object")try{return d.truncate(JSON.stringify(e),n)||t}catch{return t}return e}static extractColumnsFromQuery(e){var a;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const n=e.match(/select\s+([\s\S]+)\s+from/),r=((a=n==null?void 0:n[1])==null?void 0:a.split(","))||[],i=[];for(let o of r){const u=o.trim().split(" ").pop();u!=""&&u!=t&&i.push(u.replace(/[\'\"\`\[\]\s]/g,""))}return i}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let n=[t+"id"];if(e.type==="view")for(let i of d.extractColumnsFromQuery(e.options.query))d.pushUnique(n,t+i);else e.type==="auth"?(n.push(t+"username"),n.push(t+"email"),n.push(t+"emailVisibility"),n.push(t+"verified"),n.push(t+"created"),n.push(t+"updated")):(n.push(t+"created"),n.push(t+"updated"));const r=e.schema||[];for(const i of r)d.pushUnique(n,t+i.name);return n}static getCollectionAutocompleteKeys(e,t,n="",r=0){var o,u,l;let i=e.find(c=>c.name==t||c.id==t);if(!i||r>=4)return[];i.schema=i.schema||[];let a=d.getAllCollectionIdentifiers(i,n);for(const c of i.schema){const h=n+c.name;if(c.type=="relation"&&((o=c.options)!=null&&o.collectionId)){const p=d.getCollectionAutocompleteKeys(e,c.options.collectionId,h+".",r+1);p.length&&(a=a.concat(p))}((u=c.options)==null?void 0:u.maxSelect)!=1&&["select","file","relation"].includes(c.type)&&(a.push(h+":each"),a.push(h+":length"))}for(const c of e){c.schema=c.schema||[];for(const h of c.schema)if(h.type=="relation"&&((l=h.options)==null?void 0:l.collectionId)==i.id){const p=n+c.name+"_via_"+h.name,m=d.getCollectionAutocompleteKeys(e,c.id,p+".",r+2);m.length&&(a=a.concat(m))}}return a}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const n of e){const r="@collection."+n.name+".",i=d.getCollectionAutocompleteKeys(e,n.name,r);for(const a of i)t.push(a)}return t}static getRequestAutocompleteKeys(e,t){const n=[];n.push("@request.context"),n.push("@request.method"),n.push("@request.query."),n.push("@request.data."),n.push("@request.headers."),n.push("@request.auth.id"),n.push("@request.auth.collectionId"),n.push("@request.auth.collectionName"),n.push("@request.auth.verified"),n.push("@request.auth.username"),n.push("@request.auth.email"),n.push("@request.auth.emailVisibility"),n.push("@request.auth.created"),n.push("@request.auth.updated");const r=e.filter(i=>i.type==="auth");for(const i of r){const a=d.getCollectionAutocompleteKeys(e,i.id,"@request.auth.");for(const o of a)d.pushUnique(n,o)}if(t){const i=["created","updated"],a=d.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const o of a){n.push(o);const u=o.split(".");u.length===3&&u[2].indexOf(":")===-1&&!i.includes(u[2])&&n.push(o+":isset")}}return n}static parseIndex(e){var u,l,c,h,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},r=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((r==null?void 0:r.length)!=7)return t;const i=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((u=r[1])==null?void 0:u.trim().toLowerCase())==="unique",t.optional=!d.isEmpty((l=r[2])==null?void 0:l.trim());const a=(r[3]||"").split(".");a.length==2?(t.schemaName=a[0].replace(i,""),t.indexName=a[1].replace(i,"")):(t.schemaName="",t.indexName=a[0].replace(i,"")),t.tableName=(r[4]||"").replace(i,"");const o=(r[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of o){m=m.trim().replaceAll("{PB_TEMP}",",");const O=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((O==null?void 0:O.length)!=4)continue;const k=(h=(c=O[1])==null?void 0:c.trim())==null?void 0:h.replace(i,"");k&&t.columns.push({name:k,collate:O[2]||"",sort:((p=O[3])==null?void 0:p.toUpperCase())||""})}return t.where=r[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+d.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const n=e.columns.filter(r=>!!(r!=null&&r.name));return n.length>1&&(t+=` + `),t+=n.map(r=>{let i="";return r.name.includes("(")||r.name.includes(" ")?i+=r.name:i+="`"+r.name+"`",r.collate&&(i+=" COLLATE "+r.collate),r.sort&&(i+=" "+r.sort.toUpperCase()),i}).join(`, + `),n.length>1&&(t+=` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const n=d.parseIndex(e);return n.tableName=t,d.buildIndex(n)}static replaceIndexColumn(e,t,n){if(t===n)return e;const r=d.parseIndex(e);let i=!1;for(let a of r.columns)a.name===t&&(a.name=n,i=!0);return i?d.buildIndex(r):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const n=["=","!=","~","!~",">",">=","<","<="];for(const r of n)if(e.includes(r))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(r=>`${r}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return d.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",n=window.location.hash;const r=n.indexOf("?");r>-1&&(t=n.substring(r+1),n=n.substring(0,r));const i=new URLSearchParams(t);for(let u in e){const l=e[u];l===null?i.delete(u):i.set(u,l)}t=i.toString(),t!=""&&(n+="?"+t);let a=window.location.href;const o=a.indexOf("#");o>-1&&(a=a.substring(0,o)),window.location.replace(a+n)}}const at=11e3;onmessage=s=>{var t,n;if(!s.data.collections)return;const e={};e.baseKeys=d.getCollectionAutocompleteKeys(s.data.collections,(t=s.data.baseCollection)==null?void 0:t.name),e.baseKeys=ut(e.baseKeys.sort(ot),at),s.data.disableRequestKeys||(e.requestKeys=d.getRequestAutocompleteKeys(s.data.collections,(n=s.data.baseCollection)==null?void 0:n.name),e.requestKeys=ut(e.requestKeys.sort(ot),at)),s.data.disableCollectionJoinKeys||(e.collectionJoinKeys=d.getCollectionJoinAutocompleteKeys(s.data.collections),e.collectionJoinKeys=ut(e.collectionJoinKeys.sort(ot),at)),postMessage(e)};function ot(s,e){return s.length-e.length}function ut(s,e){return s.length>e?s.slice(0,e):s}})(); diff --git a/ui/dist/assets/autocomplete.worker-Dy9W6Fpj.js b/ui/dist/assets/autocomplete.worker-Dy9W6Fpj.js deleted file mode 100644 index 68c8bfe71f..0000000000 --- a/ui/dist/assets/autocomplete.worker-Dy9W6Fpj.js +++ /dev/null @@ -1,4 +0,0 @@ -(function(){"use strict";class P extends Error{}class $n extends P{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Zn extends P{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Un extends P{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class G extends P{}class at extends P{constructor(e){super(`Invalid unit ${e}`)}}class D extends P{}class Z extends P{constructor(){super("Zone is an abstract class")}}const f="numeric",C="short",M="long",ge={year:f,month:f,day:f},ot={year:f,month:C,day:f},qn={year:f,month:C,day:f,weekday:C},ut={year:f,month:M,day:f},lt={year:f,month:M,day:f,weekday:M},ct={hour:f,minute:f},ft={hour:f,minute:f,second:f},dt={hour:f,minute:f,second:f,timeZoneName:C},ht={hour:f,minute:f,second:f,timeZoneName:M},mt={hour:f,minute:f,hourCycle:"h23"},yt={hour:f,minute:f,second:f,hourCycle:"h23"},gt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:C},pt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:M},wt={year:f,month:f,day:f,hour:f,minute:f},St={year:f,month:f,day:f,hour:f,minute:f,second:f},kt={year:f,month:C,day:f,hour:f,minute:f},Tt={year:f,month:C,day:f,hour:f,minute:f,second:f},zn={year:f,month:C,day:f,weekday:C,hour:f,minute:f},Ot={year:f,month:M,day:f,hour:f,minute:f,timeZoneName:C},Nt={year:f,month:M,day:f,hour:f,minute:f,second:f,timeZoneName:C},Et={year:f,month:M,day:f,weekday:M,hour:f,minute:f,timeZoneName:M},xt={year:f,month:M,day:f,weekday:M,hour:f,minute:f,second:f,timeZoneName:M};class ie{get type(){throw new Z}get name(){throw new Z}get ianaName(){return this.name}get isUniversal(){throw new Z}offsetName(e,t){throw new Z}formatOffset(e,t){throw new Z}offset(e){throw new Z}equals(e){throw new Z}get isValid(){throw new Z}}let Ce=null;class pe extends ie{static get instance(){return Ce===null&&(Ce=new pe),Ce}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Kt(e,t,n)}formatOffset(e,t){return le(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let we={};function Pn(s){return we[s]||(we[s]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),we[s]}const Yn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jn(s,e){const t=s.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,r,i,a,o,u,l,c]=n;return[a,r,i,o,u,l,c]}function Bn(s,e){const t=s.formatToParts(e),n=[];for(let r=0;r=0?N:1e3+N,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let bt={};function jn(s,e={}){const t=JSON.stringify([s,e]);let n=bt[t];return n||(n=new Intl.ListFormat(s,e),bt[t]=n),n}let We={};function Le(s,e={}){const t=JSON.stringify([s,e]);let n=We[t];return n||(n=new Intl.DateTimeFormat(s,e),We[t]=n),n}let Re={};function Gn(s,e={}){const t=JSON.stringify([s,e]);let n=Re[t];return n||(n=new Intl.NumberFormat(s,e),Re[t]=n),n}let $e={};function Kn(s,e={}){const{base:t,...n}=e,r=JSON.stringify([s,n]);let i=$e[r];return i||(i=new Intl.RelativeTimeFormat(s,e),$e[r]=i),i}let ae=null;function Hn(){return ae||(ae=new Intl.DateTimeFormat().resolvedOptions().locale,ae)}let It={};function _n(s){let e=It[s];if(!e){const t=new Intl.Locale(s);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,It[s]=e}return e}function Qn(s){const e=s.indexOf("-x-");e!==-1&&(s=s.substring(0,e));const t=s.indexOf("-u-");if(t===-1)return[s];{let n,r;try{n=Le(s).resolvedOptions(),r=s}catch{const u=s.substring(0,t);n=Le(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:a}=n;return[r,i,a]}}function Xn(s,e,t){return(t||e)&&(s.includes("-u-")||(s+="-u"),t&&(s+=`-ca-${t}`),e&&(s+=`-nu-${e}`)),s}function es(s){const e=[];for(let t=1;t<=12;t++){const n=g.utc(2009,t,1);e.push(s(n))}return e}function ts(s){const e=[];for(let t=1;t<=7;t++){const n=g.utc(2016,11,13+t);e.push(s(n))}return e}function ke(s,e,t,n){const r=s.listingMode();return r==="error"?null:r==="en"?t(e):n(e)}function ns(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}class ss{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...n};n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=Gn(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Je(e,3);return b(t,this.padTo)}}}class rs{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&$.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Le(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:n}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class is{constructor(e,t,n){this.opts={style:"long",...n},!t&&Jt()&&(this.rtf=Kn(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):xs(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const as={firstDay:1,minimalDays:4,weekend:[6,7]};class T{static fromOpts(e){return T.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const a=e||x.defaultLocale,o=a||(i?"en-US":Hn()),u=t||x.defaultNumberingSystem,l=n||x.defaultOutputCalendar,c=Pe(r)||x.defaultWeekSettings;return new T(o,u,l,c,a)}static resetCache(){ae=null,We={},Re={},$e={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return T.create(e,t,n,r)}constructor(e,t,n,r,i){const[a,o,u]=Qn(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||u||null,this.weekSettings=r,this.intl=Xn(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ns(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:T.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Pe(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return ke(this,e,Qt,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=es(i=>this.extract(i,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1){return ke(this,e,tn,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ts(i=>this.extract(i,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return ke(this,void 0,()=>nn,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[g.utc(2016,11,13,9),g.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return ke(this,e,sn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[g.utc(-40,1,1),g.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t),i=r.formatToParts(),a=i.find(o=>o.type.toLowerCase()===n);return a?a.value:null}numberFormatter(e={}){return new ss(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new rs(e,this.intl,t)}relFormatter(e={}){return new is(this.intl,this.isEnglish(),e)}listFormatter(e={}){return jn(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Bt()?_n(this.locale):as}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let Ze=null;class v extends ie{static get utcInstance(){return Ze===null&&(Ze=new v(0)),Ze}static instance(e){return e===0?v.utcInstance:new v(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new v(xe(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${le(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${le(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return le(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class os extends ie{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function U(s,e){if(y(s)||s===null)return e;if(s instanceof ie)return s;if(cs(s)){const t=s.toLowerCase();return t==="default"?e:t==="local"||t==="system"?pe.instance:t==="utc"||t==="gmt"?v.utcInstance:v.parseSpecifier(t)||$.create(s)}else return Y(s)?v.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new os(s)}let vt=()=>Date.now(),Dt="system",Mt=null,Ft=null,At=null,Vt=60,Ct,Wt=null;class x{static get now(){return vt}static set now(e){vt=e}static set defaultZone(e){Dt=e}static get defaultZone(){return U(Dt,pe.instance)}static get defaultLocale(){return Mt}static set defaultLocale(e){Mt=e}static get defaultNumberingSystem(){return Ft}static set defaultNumberingSystem(e){Ft=e}static get defaultOutputCalendar(){return At}static set defaultOutputCalendar(e){At=e}static get defaultWeekSettings(){return Wt}static set defaultWeekSettings(e){Wt=Pe(e)}static get twoDigitCutoffYear(){return Vt}static set twoDigitCutoffYear(e){Vt=e%100}static get throwOnInvalid(){return Ct}static set throwOnInvalid(e){Ct=e}static resetCaches(){T.resetCache(),$.resetCache()}}class W{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Lt=[0,31,59,90,120,151,181,212,243,273,304,334],Rt=[0,31,60,91,121,152,182,213,244,274,305,335];function F(s,e){return new W("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${s}, which is invalid`)}function Ue(s,e,t){const n=new Date(Date.UTC(s,e-1,t));s<100&&s>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return r===0?7:r}function $t(s,e,t){return t+(oe(s)?Rt:Lt)[e-1]}function Zt(s,e){const t=oe(s)?Rt:Lt,n=t.findIndex(i=>iue(n,e,t)?(l=n+1,u=1):l=n,{weekYear:l,weekNumber:u,weekday:o,...Ie(s)}}function Ut(s,e=4,t=1){const{weekYear:n,weekNumber:r,weekday:i}=s,a=qe(Ue(n,1,e),t),o=H(n);let u=r*7+i-a-7+e,l;u<1?(l=n-1,u+=H(l)):u>o?(l=n+1,u-=H(n)):l=n;const{month:c,day:h}=Zt(l,u);return{year:l,month:c,day:h,...Ie(s)}}function ze(s){const{year:e,month:t,day:n}=s,r=$t(e,t,n);return{year:e,ordinal:r,...Ie(s)}}function qt(s){const{year:e,ordinal:t}=s,{month:n,day:r}=Zt(e,t);return{year:e,month:n,day:r,...Ie(s)}}function zt(s,e){if(!y(s.localWeekday)||!y(s.localWeekNumber)||!y(s.localWeekYear)){if(!y(s.weekday)||!y(s.weekNumber)||!y(s.weekYear))throw new G("Cannot mix locale-based week fields with ISO-based week fields");return y(s.localWeekday)||(s.weekday=s.localWeekday),y(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),y(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function us(s,e=4,t=1){const n=Oe(s.weekYear),r=A(s.weekNumber,1,ue(s.weekYear,e,t)),i=A(s.weekday,1,7);return n?r?i?!1:F("weekday",s.weekday):F("week",s.weekNumber):F("weekYear",s.weekYear)}function ls(s){const e=Oe(s.year),t=A(s.ordinal,1,H(s.year));return e?t?!1:F("ordinal",s.ordinal):F("year",s.year)}function Pt(s){const e=Oe(s.year),t=A(s.month,1,12),n=A(s.day,1,Ne(s.year,s.month));return e?t?n?!1:F("day",s.day):F("month",s.month):F("year",s.year)}function Yt(s){const{hour:e,minute:t,second:n,millisecond:r}=s,i=A(e,0,23)||e===24&&t===0&&n===0&&r===0,a=A(t,0,59),o=A(n,0,59),u=A(r,0,999);return i?a?o?u?!1:F("millisecond",r):F("second",n):F("minute",t):F("hour",e)}function y(s){return typeof s>"u"}function Y(s){return typeof s=="number"}function Oe(s){return typeof s=="number"&&s%1===0}function cs(s){return typeof s=="string"}function fs(s){return Object.prototype.toString.call(s)==="[object Date]"}function Jt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Bt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function ds(s){return Array.isArray(s)?s:[s]}function jt(s,e,t){if(s.length!==0)return s.reduce((n,r)=>{const i=[e(r),r];return n&&t(n[0],i[0])===n[0]?n:i},null)[1]}function hs(s,e){return e.reduce((t,n)=>(t[n]=s[n],t),{})}function K(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function Pe(s){if(s==null)return null;if(typeof s!="object")throw new D("Week settings must be an object");if(!A(s.firstDay,1,7)||!A(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(e=>!A(e,1,7)))throw new D("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function A(s,e,t){return Oe(s)&&s>=e&&s<=t}function ms(s,e){return s-e*Math.floor(s/e)}function b(s,e=2){const t=s<0;let n;return t?n="-"+(""+-s).padStart(e,"0"):n=(""+s).padStart(e,"0"),n}function q(s){if(!(y(s)||s===null||s===""))return parseInt(s,10)}function J(s){if(!(y(s)||s===null||s===""))return parseFloat(s)}function Ye(s){if(!(y(s)||s===null||s==="")){const e=parseFloat("0."+s)*1e3;return Math.floor(e)}}function Je(s,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(s*n)/n}function oe(s){return s%4===0&&(s%100!==0||s%400===0)}function H(s){return oe(s)?366:365}function Ne(s,e){const t=ms(e-1,12)+1,n=s+(e-t)/12;return t===2?oe(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ee(s){let e=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(e=new Date(e),e.setUTCFullYear(s.year,s.month-1,s.day)),+e}function Gt(s,e,t){return-qe(Ue(s,1,e),t)+e-1}function ue(s,e=4,t=1){const n=Gt(s,e,t),r=Gt(s+1,e,t);return(H(s)-n+r)/7}function Be(s){return s>99?s:s>x.twoDigitCutoffYear?1900+s:2e3+s}function Kt(s,e,t,n=null){const r=new Date(s),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(i.timeZone=n);const a={timeZoneName:e,...i},o=new Intl.DateTimeFormat(t,a).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function xe(s,e){let t=parseInt(s,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,r=t<0||Object.is(t,-0)?-n:n;return t*60+r}function Ht(s){const e=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(e))throw new D(`Invalid unit value ${s}`);return e}function be(s,e){const t={};for(const n in s)if(K(s,n)){const r=s[n];if(r==null)continue;t[e(n)]=Ht(r)}return t}function le(s,e){const t=Math.trunc(Math.abs(s/60)),n=Math.trunc(Math.abs(s%60)),r=s>=0?"+":"-";switch(e){case"short":return`${r}${b(t,2)}:${b(n,2)}`;case"narrow":return`${r}${t}${n>0?`:${n}`:""}`;case"techie":return`${r}${b(t,2)}${b(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ie(s){return hs(s,["hour","minute","second","millisecond"])}const ys=["January","February","March","April","May","June","July","August","September","October","November","December"],_t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gs=["J","F","M","A","M","J","J","A","S","O","N","D"];function Qt(s){switch(s){case"narrow":return[...gs];case"short":return[..._t];case"long":return[...ys];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Xt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],en=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ps=["M","T","W","T","F","S","S"];function tn(s){switch(s){case"narrow":return[...ps];case"short":return[...en];case"long":return[...Xt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const nn=["AM","PM"],ws=["Before Christ","Anno Domini"],Ss=["BC","AD"],ks=["B","A"];function sn(s){switch(s){case"narrow":return[...ks];case"short":return[...Ss];case"long":return[...ws];default:return null}}function Ts(s){return nn[s.hour<12?0:1]}function Os(s,e){return tn(e)[s.weekday-1]}function Ns(s,e){return Qt(e)[s.month-1]}function Es(s,e){return sn(e)[s.year<0?0:1]}function xs(s,e,t="always",n=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(s)===-1;if(t==="auto"&&i){const h=s==="days";switch(e){case 1:return h?"tomorrow":`next ${r[s][0]}`;case-1:return h?"yesterday":`last ${r[s][0]}`;case 0:return h?"today":`this ${r[s][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=r[s],c=n?u?l[1]:l[2]||l[1]:u?r[s][0]:s;return a?`${o} ${c} ago`:`in ${o} ${c}`}function rn(s,e){let t="";for(const n of s)n.literal?t+=n.val:t+=e(n.val);return t}const bs={D:ge,DD:ot,DDD:ut,DDDD:lt,t:ct,tt:ft,ttt:dt,tttt:ht,T:mt,TT:yt,TTT:gt,TTTT:pt,f:wt,ff:kt,fff:Ot,ffff:Et,F:St,FF:Tt,FFF:Nt,FFFF:xt};class I{static create(e,t={}){return new I(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let a=0;a0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return bs[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return b(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,N)=>this.loc.extract(e,m,N),a=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>n?Ts(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,N)=>n?Ns(e,m):i(N?{month:m}:{month:m,day:"numeric"},"month"),l=(m,N)=>n?Os(e,m):i(N?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{const N=I.macroTokenToFormatOpts(m);return N?this.formatWithSystemDefault(e,N):m},h=m=>n?Es(e,m):i({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return rn(I.parseFormat(t),p)}formatDurationFromString(e,t){const n=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=u=>l=>{const c=n(l);return c?this.num(u.get(c),l.length):l},i=I.parseFormat(t),a=i.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),o=e.shiftTo(...a.map(n).filter(u=>u));return rn(i,r(o))}}const an=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function _(...s){const e=s.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function Q(...s){return e=>s.reduce(([t,n,r],i)=>{const[a,o,u]=i(e,r);return[{...t,...a},o||n,u]},[{},null,1]).slice(0,2)}function X(s,...e){if(s==null)return[null,null];for(const[t,n]of e){const r=t.exec(s);if(r)return n(r)}return[null,null]}function on(...s){return(e,t)=>{const n={};let r;for(r=0;rm!==void 0&&(N||m&&c)?-m:m;return[{years:p(J(t)),months:p(J(n)),weeks:p(J(r)),days:p(J(i)),hours:p(J(a)),minutes:p(J(o)),seconds:p(J(u),u==="-0"),milliseconds:p(Ye(l),h)}]}const Zs={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ke(s,e,t,n,r,i,a){const o={year:e.length===2?Be(q(e)):q(e),month:_t.indexOf(t)+1,day:q(n),hour:q(r),minute:q(i)};return a&&(o.second=q(a)),s&&(o.weekday=s.length>3?Xt.indexOf(s)+1:en.indexOf(s)+1),o}const Us=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function qs(s){const[,e,t,n,r,i,a,o,u,l,c,h]=s,p=Ke(e,r,n,t,i,a,o);let m;return u?m=Zs[u]:l?m=0:m=xe(c,h),[p,new v(m)]}function zs(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ps=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ys=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Js=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function fn(s){const[,e,t,n,r,i,a,o]=s;return[Ke(e,r,n,t,i,a,o),v.utcInstance]}function Bs(s){const[,e,t,n,r,i,a,o]=s;return[Ke(e,o,t,n,r,i,a),v.utcInstance]}const js=_(vs,Ge),Gs=_(Ds,Ge),Ks=_(Ms,Ge),Hs=_(ln),dn=Q(Ws,te,ce,fe),_s=Q(Fs,te,ce,fe),Qs=Q(As,te,ce,fe),Xs=Q(te,ce,fe);function er(s){return X(s,[js,dn],[Gs,_s],[Ks,Qs],[Hs,Xs])}function tr(s){return X(zs(s),[Us,qs])}function nr(s){return X(s,[Ps,fn],[Ys,fn],[Js,Bs])}function sr(s){return X(s,[Rs,$s])}const rr=Q(te);function ir(s){return X(s,[Ls,rr])}const ar=_(Vs,Cs),or=_(cn),ur=Q(te,ce,fe);function lr(s){return X(s,[ar,dn],[or,ur])}const hn="Invalid Duration",mn={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...mn},V=146097/400,ne=146097/4800,fr={years:{quarters:4,months:12,weeks:V/7,days:V,hours:V*24,minutes:V*24*60,seconds:V*24*60*60,milliseconds:V*24*60*60*1e3},quarters:{months:3,weeks:V/28,days:V/4,hours:V*24/4,minutes:V*24*60/4,seconds:V*24*60*60/4,milliseconds:V*24*60*60*1e3/4},months:{weeks:ne/7,days:ne,hours:ne*24,minutes:ne*24*60,seconds:ne*24*60*60,milliseconds:ne*24*60*60*1e3},...mn},B=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],dr=B.slice(0).reverse();function z(s,e,t=!1){const n={values:t?e.values:{...s.values,...e.values||{}},loc:s.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||s.conversionAccuracy,matrix:e.matrix||s.matrix};return new w(n)}function yn(s,e){let t=e.milliseconds??0;for(const n of dr.slice(1))e[n]&&(t+=e[n]*s[n].milliseconds);return t}function gn(s,e){const t=yn(s,e)<0?-1:1;B.reduceRight((n,r)=>{if(y(e[r]))return n;if(n){const i=e[n]*t,a=s[r][n],o=Math.floor(i/a);e[r]+=o*t,e[n]-=o*a*t}return r},null),B.reduce((n,r)=>{if(y(e[r]))return n;if(n){const i=e[n]%1;e[n]-=i,e[r]+=i*s[n][r]}return r},null)}function hr(s){const e={};for(const[t,n]of Object.entries(s))n!==0&&(e[t]=n);return e}class w{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?fr:cr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||T.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return w.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new D(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new w({values:be(e,w.normalizeUnit),loc:T.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Y(e))return w.fromMillis(e);if(w.isDuration(e))return e;if(typeof e=="object")return w.fromObject(e);throw new D(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=sr(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=ir(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new D("need to specify a reason the Duration is invalid");const n=e instanceof W?e:new W(e,t);if(x.throwOnInvalid)throw new Un(n);return new w({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new at(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?I.create(this.loc,n).formatDurationFromString(this,e):hn}toHuman(e={}){if(!this.isValid)return hn;const t=B.map(n=>{const r=this.values[n];return y(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Je(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},g.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?yn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e),n={};for(const r of B)(K(t.values,r)||K(this.values,r))&&(n[r]=t.get(r)+this.get(r));return z(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=Ht(e(this.values[n],n));return z(this,{values:t},!0)}get(e){return this[w.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...be(e,w.normalizeUnit)};return z(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return z(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return gn(this.matrix,e),z(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=hr(this.normalize().shiftToAll().toObject());return z(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>w.normalizeUnit(a));const t={},n={},r=this.toObject();let i;for(const a of B)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in n)o+=this.matrix[l][a]*n[l],n[l]=0;Y(r[a])&&(o+=r[a]);const u=Math.trunc(o);t[a]=u,n[a]=(o*1e3-u*1e3)/1e3}else Y(r[a])&&(n[a]=r[a]);for(const a in n)n[a]!==0&&(t[i]+=a===i?n[a]:n[a]/this.matrix[i][a]);return gn(this.matrix,t),z(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return z(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(n,r){return n===void 0||n===0?r===void 0||r===0:n===r}for(const n of B)if(!t(this.values[n],e.values[n]))return!1;return!0}}const se="Invalid Interval";function mr(s,e){return!s||!s.isValid?E.invalid("missing or invalid start"):!e||!e.isValid?E.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?E.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(he).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),n=[];let{s:r}=this,i=0;for(;r+this.e?this.e:a;n.push(E.fromDateTimes(r,o)),r=o,i+=1}return n}splitBy(e){const t=w.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,r=1,i;const a=[];for(;nu*r));i=+o>+this.e?this.e:o,a.push(E.fromDateTimes(n,i)),n=i,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e=n?null:E.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return E.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((r,i)=>r.s-i.s).reduce(([r,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[r,i.union(a)]:[r.concat([i]),a]:[r,a],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)n+=u.type==="s"?1:-1,n===1?t=u.time:(t&&+t!=+u.time&&r.push(E.fromDateTimes(t,u.time)),t=null);return E.merge(r)}difference(...e){return E.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:se}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=ge,t={}){return this.isValid?I.create(this.s.loc.clone(t),e).formatInterval(this):se}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:se}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:se}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:se}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:se}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):w.invalid(this.invalidReason)}mapEndpoints(e){return E.fromDateTimes(e(this.s),e(this.e))}}class ve{static hasDST(e=x.defaultZone){const t=g.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $.isValidZone(e)}static normalizeZone(e){return U(e,x.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||T.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||T.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return T.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return T.create(t,null,"gregory").eras(e)}static features(){return{relative:Jt(),localeWeek:Bt()}}}function pn(s,e){const t=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(s);return Math.floor(w.fromMillis(n).as("days"))}function yr(s,e,t){const n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const c=pn(u,l);return(c-c%7)/7}],["days",pn]],r={},i=s;let a,o;for(const[u,l]of n)t.indexOf(u)>=0&&(a=u,r[u]=l(s,e),o=i.plus(r),o>e?(r[u]--,s=i.plus(r),s>e&&(o=s,r[u]--,s=i.plus(r))):s=o);return[s,r,o,a]}function gr(s,e,t,n){let[r,i,a,o]=yr(s,e,t);const u=e-r,l=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);l.length===0&&(a0?w.fromMillis(u,n).shiftTo(...l).plus(c):c}const He={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wn={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},pr=He.hanidec.replace(/[\[|\]]/g,"").split("");function wr(s){let e=parseInt(s,10);if(isNaN(e)){e="";for(let t=0;t=i&&n<=a&&(e+=n-i)}}return parseInt(e,10)}else return e}function L({numberingSystem:s},e=""){return new RegExp(`${He[s||"latn"]}${e}`)}const Sr="missing Intl.DateTimeFormat.formatToParts support";function S(s,e=t=>t){return{regex:s,deser:([t])=>e(wr(t))}}const Sn="[  ]",kn=new RegExp(Sn,"g");function kr(s){return s.replace(/\./g,"\\.?").replace(kn,Sn)}function Tn(s){return s.replace(/\./g,"").replace(kn," ").toLowerCase()}function R(s,e){return s===null?null:{regex:RegExp(s.map(kr).join("|")),deser:([t])=>s.findIndex(n=>Tn(t)===Tn(n))+e}}function On(s,e){return{regex:s,deser:([,t,n])=>xe(t,n),groups:e}}function De(s){return{regex:s,deser:([e])=>e}}function Tr(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Or(s,e){const t=L(e),n=L(e,"{2}"),r=L(e,"{3}"),i=L(e,"{4}"),a=L(e,"{6}"),o=L(e,"{1,2}"),u=L(e,"{1,3}"),l=L(e,"{1,6}"),c=L(e,"{1,9}"),h=L(e,"{2,4}"),p=L(e,"{4,6}"),m=k=>({regex:RegExp(Tr(k.val)),deser:([re])=>re,literal:!0}),O=(k=>{if(s.literal)return m(k);switch(k.val){case"G":return R(e.eras("short"),0);case"GG":return R(e.eras("long"),0);case"y":return S(l);case"yy":return S(h,Be);case"yyyy":return S(i);case"yyyyy":return S(p);case"yyyyyy":return S(a);case"M":return S(o);case"MM":return S(n);case"MMM":return R(e.months("short",!0),1);case"MMMM":return R(e.months("long",!0),1);case"L":return S(o);case"LL":return S(n);case"LLL":return R(e.months("short",!1),1);case"LLLL":return R(e.months("long",!1),1);case"d":return S(o);case"dd":return S(n);case"o":return S(u);case"ooo":return S(r);case"HH":return S(n);case"H":return S(o);case"hh":return S(n);case"h":return S(o);case"mm":return S(n);case"m":return S(o);case"q":return S(o);case"qq":return S(n);case"s":return S(o);case"ss":return S(n);case"S":return S(u);case"SSS":return S(r);case"u":return De(c);case"uu":return De(o);case"uuu":return S(t);case"a":return R(e.meridiems(),0);case"kkkk":return S(i);case"kk":return S(h,Be);case"W":return S(o);case"WW":return S(n);case"E":case"c":return S(t);case"EEE":return R(e.weekdays("short",!1),1);case"EEEE":return R(e.weekdays("long",!1),1);case"ccc":return R(e.weekdays("short",!0),1);case"cccc":return R(e.weekdays("long",!0),1);case"Z":case"ZZ":return On(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return On(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return De(/[a-z_+-/]{1,256}?/i);case" ":return De(/[^\S\n\r]/);default:return m(k)}})(s)||{invalidReason:Sr};return O.token=s,O}const Nr={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Er(s,e,t){const{type:n,value:r}=s;if(n==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=e[n];let a=n;n==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=t.hour12?"hour12":"hour24");let o=Nr[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function xr(s){return[`^${s.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,s]}function br(s,e,t){const n=s.match(e);if(n){const r={};let i=1;for(const a in t)if(K(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(r[o.token.val[0]]=o.deser(n.slice(i,i+u))),i+=u}return[n,r]}else return[n,{}]}function Ir(s){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,n;return y(s.z)||(t=$.create(s.z)),y(s.Z)||(t||(t=new v(s.Z)),n=s.Z),y(s.q)||(s.M=(s.q-1)*3+1),y(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),y(s.u)||(s.S=Ye(s.u)),[Object.keys(s).reduce((i,a)=>{const o=e(a);return o&&(i[o]=s[a]),i},{}),t,n]}let _e=null;function vr(){return _e||(_e=g.fromMillis(1555555555555)),_e}function Dr(s,e){if(s.literal)return s;const t=I.macroTokenToFormatOpts(s.val),n=xn(t,e);return n==null||n.includes(void 0)?s:n}function Nn(s,e){return Array.prototype.concat(...s.map(t=>Dr(t,e)))}function En(s,e,t){const n=Nn(I.parseFormat(t),s),r=n.map(a=>Or(a,s)),i=r.find(a=>a.invalidReason);if(i)return{input:e,tokens:n,invalidReason:i.invalidReason};{const[a,o]=xr(r),u=RegExp(a,"i"),[l,c]=br(e,u,o),[h,p,m]=c?Ir(c):[null,null,void 0];if(K(c,"a")&&K(c,"H"))throw new G("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:u,rawMatches:l,matches:c,result:h,zone:p,specificOffset:m}}}function Mr(s,e,t){const{result:n,zone:r,specificOffset:i,invalidReason:a}=En(s,e,t);return[n,r,i,a]}function xn(s,e){if(!s)return null;const n=I.create(e,s).dtFormatter(vr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(a=>Er(a,s,i))}const Qe="Invalid DateTime",bn=864e13;function Me(s){return new W("unsupported zone",`the zone "${s.name}" is not supported`)}function Xe(s){return s.weekData===null&&(s.weekData=Te(s.c)),s.weekData}function et(s){return s.localWeekData===null&&(s.localWeekData=Te(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function j(s,e){const t={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new g({...t,...e,old:t})}function In(s,e,t){let n=s-e*60*1e3;const r=t.offset(n);if(e===r)return[n,e];n-=(r-e)*60*1e3;const i=t.offset(n);return r===i?[n,r]:[s-Math.min(r,i)*60*1e3,Math.max(r,i)]}function Fe(s,e){s+=e*60*1e3;const t=new Date(s);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Ae(s,e,t){return In(Ee(s),e,t)}function vn(s,e){const t=s.o,n=s.c.year+Math.trunc(e.years),r=s.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...s.c,year:n,month:r,day:Math.min(s.c.day,Ne(n,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=w.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=Ee(i);let[u,l]=In(o,t,s.zone);return a!==0&&(u+=a,l=s.zone.offset(u)),{ts:u,o:l}}function de(s,e,t,n,r,i){const{setZone:a,zone:o}=t;if(s&&Object.keys(s).length!==0||e){const u=e||o,l=g.fromObject(s,{...t,zone:u,specificOffset:i});return a?l:l.setZone(o)}else return g.invalid(new W("unparsable",`the input "${r}" can't be parsed as ${n}`))}function Ve(s,e,t=!0){return s.isValid?I.create(T.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(s,e):null}function tt(s,e){const t=s.c.year>9999||s.c.year<0;let n="";return t&&s.c.year>=0&&(n+="+"),n+=b(s.c.year,t?6:4),e?(n+="-",n+=b(s.c.month),n+="-",n+=b(s.c.day)):(n+=b(s.c.month),n+=b(s.c.day)),n}function Dn(s,e,t,n,r,i){let a=b(s.c.hour);return e?(a+=":",a+=b(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=":")):a+=b(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=b(s.c.second),(s.c.millisecond!==0||!n)&&(a+=".",a+=b(s.c.millisecond,3))),r&&(s.isOffsetFixed&&s.offset===0&&!i?a+="Z":s.o<0?(a+="-",a+=b(Math.trunc(-s.o/60)),a+=":",a+=b(Math.trunc(-s.o%60))):(a+="+",a+=b(Math.trunc(s.o/60)),a+=":",a+=b(Math.trunc(s.o%60)))),i&&(a+="["+s.zone.ianaName+"]"),a}const Mn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Fr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ar={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Fn=["year","month","day","hour","minute","second","millisecond"],Vr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cr=["year","ordinal","hour","minute","second","millisecond"];function Wr(s){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!e)throw new at(s);return e}function An(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Wr(s)}}function Vn(s,e){const t=U(e.zone,x.defaultZone),n=T.fromObject(e),r=x.now();let i,a;if(y(s.year))i=r;else{for(const l of Fn)y(s[l])&&(s[l]=Mn[l]);const o=Pt(s)||Yt(s);if(o)return g.invalid(o);const u=t.offset(r);[i,a]=Ae(s,u,t)}return new g({ts:i,zone:t,loc:n,o:a})}function Cn(s,e,t){const n=y(t.round)?!0:t.round,r=(a,o)=>(a=Je(a,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(s,a)?0:e.startOf(a).diff(s.startOf(a),a).get(a):e.diff(s,a).get(a);if(t.unit)return r(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return r(o,a)}return r(s>e?-0:0,t.units[t.units.length-1])}function Wn(s){let e={},t;return s.length>0&&typeof s[s.length-1]=="object"?(e=s[s.length-1],t=Array.from(s).slice(0,s.length-1)):t=Array.from(s),[e,t]}class g{constructor(e){const t=e.zone||x.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new W("invalid input"):null)||(t.isValid?null:Me(t));this.ts=y(e.ts)?x.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const o=t.offset(this.ts);r=Fe(this.ts,o),n=Number.isNaN(r.year)?new W("invalid input"):null,r=n?null:r,i=n?null:o}this._zone=t,this.loc=e.loc||T.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new g({})}static local(){const[e,t]=Wn(arguments),[n,r,i,a,o,u,l]=t;return Vn({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=Wn(arguments),[n,r,i,a,o,u,l]=t;return e.zone=v.utcInstance,Vn({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const n=fs(e)?e.valueOf():NaN;if(Number.isNaN(n))return g.invalid("invalid input");const r=U(t.zone,x.defaultZone);return r.isValid?new g({ts:n,zone:r,loc:T.fromObject(t)}):g.invalid(Me(r))}static fromMillis(e,t={}){if(Y(e))return e<-bn||e>bn?g.invalid("Timestamp out of range"):new g({ts:e,zone:U(t.zone,x.defaultZone),loc:T.fromObject(t)});throw new D(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Y(e))return new g({ts:e*1e3,zone:U(t.zone,x.defaultZone),loc:T.fromObject(t)});throw new D("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=U(t.zone,x.defaultZone);if(!n.isValid)return g.invalid(Me(n));const r=T.fromObject(t),i=be(e,An),{minDaysInFirstWeek:a,startOfWeek:o}=zt(i,r),u=x.now(),l=y(t.specificOffset)?n.offset(u):t.specificOffset,c=!y(i.ordinal),h=!y(i.year),p=!y(i.month)||!y(i.day),m=h||p,N=i.weekYear||i.weekNumber;if((m||c)&&N)throw new G("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new G("Can't mix ordinal dates with month/day");const O=N||i.weekday&&!m;let k,re,me=Fe(u,l);O?(k=Vr,re=Fr,me=Te(me,a,o)):c?(k=Cr,re=Ar,me=ze(me)):(k=Fn,re=Mn);let Ln=!1;for(const ye of k){const Yr=i[ye];y(Yr)?Ln?i[ye]=re[ye]:i[ye]=me[ye]:Ln=!0}const Ur=O?us(i,a,o):c?ls(i):Pt(i),Rn=Ur||Yt(i);if(Rn)return g.invalid(Rn);const qr=O?Ut(i,a,o):c?qt(i):i,[zr,Pr]=Ae(qr,l,n),it=new g({ts:zr,zone:n,o:Pr,loc:r});return i.weekday&&m&&e.weekday!==it.weekday?g.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${it.toISO()}`):it}static fromISO(e,t={}){const[n,r]=er(e);return de(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=tr(e);return de(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=nr(e);return de(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(y(e)||y(t))throw new D("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[o,u,l,c]=Mr(a,e,t);return c?g.invalid(c):de(o,u,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return g.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=lr(e);return de(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new D("need to specify a reason the DateTime is invalid");const n=e instanceof W?e:new W(e,t);if(x.throwOnInvalid)throw new $n(n);return new g({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=xn(e,T.fromObject(t));return n?n.map(r=>r?r.val:null).join(""):null}static expandFormat(e,t={}){return Nn(I.parseFormat(e),T.fromObject(t)).map(r=>r.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Xe(this).weekYear:NaN}get weekNumber(){return this.isValid?Xe(this).weekNumber:NaN}get weekday(){return this.isValid?Xe(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?et(this).weekday:NaN}get localWeekNumber(){return this.isValid?et(this).weekNumber:NaN}get localWeekYear(){return this.isValid?et(this).weekYear:NaN}get ordinal(){return this.isValid?ze(this.c).ordinal:NaN}get monthShort(){return this.isValid?ve.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ve.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ve.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ve.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=Ee(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];const u=n-a*t,l=n-o*t,c=Fe(u,a),h=Fe(l,o);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[j(this,{ts:u}),j(this,{ts:l})]:[this]}get isInLeapYear(){return oe(this.year)}get daysInMonth(){return Ne(this.year,this.month)}get daysInYear(){return this.isValid?H(this.year):NaN}get weeksInWeekYear(){return this.isValid?ue(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ue(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=I.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(v.instance(e),t)}toLocal(){return this.setZone(x.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=U(e,x.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const i=e.offset(this.ts),a=this.toObject();[r]=Ae(a,i,e)}return j(this,{ts:r,zone:e})}else return g.invalid(Me(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return j(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=be(e,An),{minDaysInFirstWeek:n,startOfWeek:r}=zt(t,this.loc),i=!y(t.weekYear)||!y(t.weekNumber)||!y(t.weekday),a=!y(t.ordinal),o=!y(t.year),u=!y(t.month)||!y(t.day),l=o||u,c=t.weekYear||t.weekNumber;if((l||a)&&c)throw new G("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new G("Can't mix ordinal dates with month/day");let h;i?h=Ut({...Te(this.c,n,r),...t},n,r):y(t.ordinal)?(h={...this.toObject(),...t},y(t.day)&&(h.day=Math.min(Ne(h.year,h.month),h.day))):h=qt({...ze(this.c),...t});const[p,m]=Ae(h,this.o,this.zone);return j(this,{ts:p,o:m})}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return j(this,vn(this,t))}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e).negate();return j(this,vn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=w.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks")if(t){const i=this.loc.getStartOfWeek(),{weekday:a}=this;athis.valueOf(),o=a?this:e,u=a?e:this,l=gr(o,u,i,r);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(g.now(),e,t)}until(e){return this.isValid?E.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||g.fromObject({},{zone:this.zone}),n=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(g.isDateTime))throw new D("max requires all arguments be DateTimes");return jt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return En(a,e,t)}static fromStringExplain(e,t,n={}){return g.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return ge}static get DATE_MED(){return ot}static get DATE_MED_WITH_WEEKDAY(){return qn}static get DATE_FULL(){return ut}static get DATE_HUGE(){return lt}static get TIME_SIMPLE(){return ct}static get TIME_WITH_SECONDS(){return ft}static get TIME_WITH_SHORT_OFFSET(){return dt}static get TIME_WITH_LONG_OFFSET(){return ht}static get TIME_24_SIMPLE(){return mt}static get TIME_24_WITH_SECONDS(){return yt}static get TIME_24_WITH_SHORT_OFFSET(){return gt}static get TIME_24_WITH_LONG_OFFSET(){return pt}static get DATETIME_SHORT(){return wt}static get DATETIME_SHORT_WITH_SECONDS(){return St}static get DATETIME_MED(){return kt}static get DATETIME_MED_WITH_SECONDS(){return Tt}static get DATETIME_MED_WITH_WEEKDAY(){return zn}static get DATETIME_FULL(){return Ot}static get DATETIME_FULL_WITH_SECONDS(){return Nt}static get DATETIME_HUGE(){return Et}static get DATETIME_HUGE_WITH_SECONDS(){return xt}}function he(s){if(g.isDateTime(s))return s;if(s&&s.valueOf&&Y(s.valueOf()))return g.fromJSDate(s);if(s&&typeof s=="object")return g.fromObject(s);throw new D(`Unknown datetime argument: ${s}, of type ${typeof s}`)}const Lr=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Rr=[".mp4",".avi",".mov",".3gp",".wmv"],$r=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Zr=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class d{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||d.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return d.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!d.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!d.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t){e.splice(n,1);break}}static pushUnique(e,t){d.inArray(e,t)||e.push(t)}static findByKey(e,t,n){e=Array.isArray(e)?e:[];for(let r in e)if(e[r][t]==n)return e[r];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const n={};for(let r in e)n[e[r][t]]=n[e[r][t]]||[],n[e[r][t]].push(e[r]);return n}static removeByKey(e,t,n){for(let r in e)if(e[r][t]==n){e.splice(r,1);break}}static pushOrReplaceByKey(e,t,n="id"){for(let r=e.length-1;r>=0;r--)if(e[r][n]==t[n]){e[r]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const n={};for(const r of e)n[r[t]]=r;return Object.values(n)}static filterRedactedProps(e,t="******"){const n=JSON.parse(JSON.stringify(e||{}));for(let r in n)typeof n[r]=="object"&&n[r]!==null?n[r]=d.filterRedactedProps(n[r],t):n[r]===t&&delete n[r];return n}static getNestedVal(e,t,n=null,r="."){let i=e||{},a=(t||"").split(r);for(const o of a){if(!d.isObject(i)&&!Array.isArray(i)||typeof i[o]>"u")return n;i=i[o]}return i}static setByPath(e,t,n,r="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let i=e,a=t.split(r),o=a.pop();for(const u of a)(!d.isObject(i)&&!Array.isArray(i)||!d.isObject(i[u])&&!Array.isArray(i[u]))&&(i[u]={}),i=i[u];i[o]=n}static deleteByPath(e,t,n="."){let r=e||{},i=(t||"").split(n),a=i.pop();for(const o of i)(!d.isObject(r)&&!Array.isArray(r)||!d.isObject(r[o])&&!Array.isArray(r[o]))&&(r[o]={}),r=r[o];Array.isArray(r)?r.splice(a,1):d.isObject(r)&&delete r[a],i.length>0&&(Array.isArray(r)&&!r.length||d.isObject(r)&&!Object.keys(r).length)&&(Array.isArray(e)&&e.length>0||d.isObject(e)&&Object.keys(e).length>0)&&d.deleteByPath(e,i.join(n),n)}static randomString(e=10){let t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r"u")return d.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const n="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;ii.replaceAll("{_PB_ESCAPED_}",t));for(let i of r)i=i.trim(),d.isEmpty(i)||n.push(i);return n}static joinNonEmpty(e,t=", "){e=e||[];const n=[],r=t.length>1?t.trim():t;for(let i of e)i=typeof i=="string"?i.trim():"",d.isEmpty(i)||n.push(i.replaceAll(r,"\\"+r));return n.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},n=t[e.length]||t[19];return g.fromFormat(e,n,{zone:"UTC"})}return g.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(n=>{console.warn("Failed to copy.",n)})}static download(e,t){const n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",t),n.setAttribute("target","_blank"),n.click(),n.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n);d.download(r,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const n=decodeURIComponent(atob(t));return JSON.parse(n)||{}}catch(n){console.warn("Failed to parse JWT payload data.",n)}return{}}static hasImageExtension(e){return e=e||"",!!Lr.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Rr.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!$r.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Zr.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return d.hasImageExtension(e)?"image":d.hasDocumentExtension(e)?"document":d.hasVideoExtension(e)?"video":d.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,n=100){return new Promise(r=>{let i=new FileReader;i.onload=function(a){let o=new Image;o.onload=function(){let u=document.createElement("canvas"),l=u.getContext("2d"),c=o.width,h=o.height;return u.width=t,u.height=n,l.drawImage(o,c>h?(c-h)/2:0,0,c>h?h:c,c>h?h:c,0,0,t,n),r(u.toDataURL(e.type))},o.src=a.target.result},i.readAsDataURL(e)})}static addValueToFormData(e,t,n){if(!(typeof n>"u"))if(d.isEmpty(n))e.append(t,"");else if(Array.isArray(n))for(const r of n)d.addValueToFormData(e,t,r);else n instanceof File?e.append(t,n):n instanceof Date?e.append(t,n.toISOString()):d.isObject(n)?e.append(t,JSON.stringify(n)):e.append(t,""+n)}static dummyCollectionRecord(e){var u,l,c,h,p,m,N;const t=(e==null?void 0:e.schema)||[],n=(e==null?void 0:e.type)==="auth",r=(e==null?void 0:e.type)==="view",i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};n&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!r||d.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!r||d.extractColumnsFromQuery((l=e==null?void 0:e.options)==null?void 0:l.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const O of t){let k=null;O.type==="number"?k=123:O.type==="date"?k="2022-01-01 10:00:00.123Z":O.type==="bool"?k=!0:O.type==="email"?k="test@example.com":O.type==="url"?k="https://example.com":O.type==="json"?k="JSON":O.type==="file"?(k="filename.jpg",((c=O.options)==null?void 0:c.maxSelect)!==1&&(k=[k])):O.type==="select"?(k=(p=(h=O.options)==null?void 0:h.values)==null?void 0:p[0],((m=O.options)==null?void 0:m.maxSelect)!==1&&(k=[k])):O.type==="relation"?(k="RELATION_RECORD_ID",((N=O.options)==null?void 0:N.maxSelect)!==1&&(k=[k])):k="test",i[O.name]=k}return i}static dummyCollectionSchemaData(e){var r,i,a,o;const t=(e==null?void 0:e.schema)||[],n={};for(const u of t){let l=null;if(u.type==="number")l=123;else if(u.type==="date")l="2022-01-01 10:00:00.123Z";else if(u.type==="bool")l=!0;else if(u.type==="email")l="test@example.com";else if(u.type==="url")l="https://example.com";else if(u.type==="json")l="JSON";else{if(u.type==="file")continue;u.type==="select"?(l=(i=(r=u.options)==null?void 0:r.values)==null?void 0:i[0],((a=u.options)==null?void 0:a.maxSelect)!==1&&(l=[l])):u.type==="relation"?(l="RELATION_RECORD_ID",((o=u.options)==null?void 0:o.maxSelect)!==1&&(l=[l])):l="test"}n[u.name]=l}return n}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,n=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let l in e)if(l!=="schema"&&JSON.stringify(e[l])!==JSON.stringify(t[l]))return!0;const r=Array.isArray(e.schema)?e.schema:[],i=Array.isArray(t.schema)?t.schema:[],a=r.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(i,"id",l.id)),o=i.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(r,"id",l.id)),u=i.filter(l=>{const c=d.isObject(l)&&d.findByKey(r,"id",l.id);if(!c)return!1;for(let h in c)if(JSON.stringify(l[h])!=JSON.stringify(c[h]))return!0;return!1});return!!(o.length||u.length||n&&a.length)}static sortCollections(e=[]){const t=[],n=[],r=[];for(const a of e)a.type==="auth"?t.push(a):a.type==="base"?n.push(a):r.push(a);function i(a,o){return a.name>o.name?1:a.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(r){let i=r.parentNode;for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}function n(r){if(r){for(const i of r.children)n(i);e.includes(r.tagName)?(r.removeAttribute("style"),r.removeAttribute("class")):t(r)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(r,i)=>{n(i.node)},file_picker_types:"image",file_picker_callback:(r,i,a)=>{const o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("accept","image/*"),o.addEventListener("change",u=>{const l=u.target.files[0],c=new FileReader;c.addEventListener("load",()=>{if(!tinymce)return;const h="blobid"+new Date().getTime(),p=tinymce.activeEditor.editorUpload.blobCache,m=c.result.split(",")[1],N=p.create(h,l,m);p.add(N),r(N.blobUri(),{title:l.name})}),c.readAsDataURL(l)}),o.click()},setup:r=>{r.on("keydown",a=>{(a.ctrlKey||a.metaKey)&&a.code=="KeyS"&&r.formElement&&(a.preventDefault(),a.stopPropagation(),r.formElement.dispatchEvent(new KeyboardEvent("keydown",a)))});const i="tinymce_last_direction";r.on("init",()=>{var o;const a=(o=window==null?void 0:window.localStorage)==null?void 0:o.getItem(i);!r.isDirty()&&r.getContent()==""&&a=="rtl"&&r.execCommand("mceDirectionRTL")}),r.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:a=>{a([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"ltr"),r.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"rtl"),r.execCommand("mceDirectionRTL")}}])}}),r.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:a=>{a([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{r.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{r.execCommand("mceImage")}}])}})}}}static displayValue(e,t,n="N/A"){e=e||{},t=t||[];let r=[];for(const a of t){let o=e[a];typeof o>"u"||(o=d.stringifyValue(o,n),r.push(o))}if(r.length>0)return r.join(", ");const i=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const a of i){let o=d.stringifyValue(e[a],"");if(o)return o}return n}static stringifyValue(e,t="N/A",n=150){if(d.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?d.plainText(e):e,d.truncate(e,n)||t;if(Array.isArray(e)&&typeof e[0]!="object")return d.truncate(e.join(","),n);if(typeof e=="object")try{return d.truncate(JSON.stringify(e),n)||t}catch{return t}return e}static extractColumnsFromQuery(e){var a;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const n=e.match(/select\s+([\s\S]+)\s+from/),r=((a=n==null?void 0:n[1])==null?void 0:a.split(","))||[],i=[];for(let o of r){const u=o.trim().split(" ").pop();u!=""&&u!=t&&i.push(u.replace(/[\'\"\`\[\]\s]/g,""))}return i}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let n=[t+"id"];if(e.type==="view")for(let i of d.extractColumnsFromQuery(e.options.query))d.pushUnique(n,t+i);else e.type==="auth"?(n.push(t+"username"),n.push(t+"email"),n.push(t+"emailVisibility"),n.push(t+"verified"),n.push(t+"created"),n.push(t+"updated")):(n.push(t+"created"),n.push(t+"updated"));const r=e.schema||[];for(const i of r)d.pushUnique(n,t+i.name);return n}static getCollectionAutocompleteKeys(e,t,n="",r=0){var o,u,l;let i=e.find(c=>c.name==t||c.id==t);if(!i||r>=4)return[];i.schema=i.schema||[];let a=d.getAllCollectionIdentifiers(i,n);for(const c of i.schema){const h=n+c.name;if(c.type=="relation"&&((o=c.options)!=null&&o.collectionId)){const p=d.getCollectionAutocompleteKeys(e,c.options.collectionId,h+".",r+1);p.length&&(a=a.concat(p))}((u=c.options)==null?void 0:u.maxSelect)!=1&&["select","file","relation"].includes(c.type)&&(a.push(h+":each"),a.push(h+":length"))}for(const c of e){c.schema=c.schema||[];for(const h of c.schema)if(h.type=="relation"&&((l=h.options)==null?void 0:l.collectionId)==i.id){const p=n+c.name+"_via_"+h.name,m=d.getCollectionAutocompleteKeys(e,c.id,p+".",r+2);m.length&&(a=a.concat(m))}}return a}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const n of e){const r="@collection."+n.name+".",i=d.getCollectionAutocompleteKeys(e,n.name,r);for(const a of i)t.push(a)}return t}static getRequestAutocompleteKeys(e,t){const n=[];n.push("@request.context"),n.push("@request.method"),n.push("@request.query."),n.push("@request.data."),n.push("@request.headers."),n.push("@request.auth.id"),n.push("@request.auth.collectionId"),n.push("@request.auth.collectionName"),n.push("@request.auth.verified"),n.push("@request.auth.username"),n.push("@request.auth.email"),n.push("@request.auth.emailVisibility"),n.push("@request.auth.created"),n.push("@request.auth.updated");const r=e.filter(i=>i.type==="auth");for(const i of r){const a=d.getCollectionAutocompleteKeys(e,i.id,"@request.auth.");for(const o of a)d.pushUnique(n,o)}if(t){const i=["created","updated"],a=d.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const o of a){n.push(o);const u=o.split(".");u.length===3&&u[2].indexOf(":")===-1&&!i.includes(u[2])&&n.push(o+":isset")}}return n}static parseIndex(e){var u,l,c,h,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},r=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((r==null?void 0:r.length)!=7)return t;const i=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((u=r[1])==null?void 0:u.trim().toLowerCase())==="unique",t.optional=!d.isEmpty((l=r[2])==null?void 0:l.trim());const a=(r[3]||"").split(".");a.length==2?(t.schemaName=a[0].replace(i,""),t.indexName=a[1].replace(i,"")):(t.schemaName="",t.indexName=a[0].replace(i,"")),t.tableName=(r[4]||"").replace(i,"");const o=(r[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of o){m=m.trim().replaceAll("{PB_TEMP}",",");const O=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((O==null?void 0:O.length)!=4)continue;const k=(h=(c=O[1])==null?void 0:c.trim())==null?void 0:h.replace(i,"");k&&t.columns.push({name:k,collate:O[2]||"",sort:((p=O[3])==null?void 0:p.toUpperCase())||""})}return t.where=r[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+d.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const n=e.columns.filter(r=>!!(r!=null&&r.name));return n.length>1&&(t+=` - `),t+=n.map(r=>{let i="";return r.name.includes("(")||r.name.includes(" ")?i+=r.name:i+="`"+r.name+"`",r.collate&&(i+=" COLLATE "+r.collate),r.sort&&(i+=" "+r.sort.toUpperCase()),i}).join(`, - `),n.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const n=d.parseIndex(e);return n.tableName=t,d.buildIndex(n)}static replaceIndexColumn(e,t,n){if(t===n)return e;const r=d.parseIndex(e);let i=!1;for(let a of r.columns)a.name===t&&(a.name=n,i=!0);return i?d.buildIndex(r):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const n=["=","!=","~","!~",">",">=","<","<="];for(const r of n)if(e.includes(r))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(r=>`${r}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return d.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",n=window.location.hash;const r=n.indexOf("?");r>-1&&(t=n.substring(r+1),n=n.substring(0,r));const i=new URLSearchParams(t);for(let u in e){const l=e[u];l===null?i.delete(u):i.set(u,l)}t=i.toString(),t!=""&&(n+="?"+t);let a=window.location.href;const o=a.indexOf("#");o>-1&&(a=a.substring(0,o)),window.location.replace(a+n)}}const nt=11e3;onmessage=s=>{var t,n;if(!s.data.collections)return;const e={};e.baseKeys=d.getCollectionAutocompleteKeys(s.data.collections,(t=s.data.baseCollection)==null?void 0:t.name),e.baseKeys=rt(e.baseKeys.sort(st),nt),s.data.disableRequestKeys||(e.requestKeys=d.getRequestAutocompleteKeys(s.data.collections,(n=s.data.baseCollection)==null?void 0:n.name),e.requestKeys=rt(e.requestKeys.sort(st),nt)),s.data.disableCollectionJoinKeys||(e.collectionJoinKeys=d.getCollectionJoinAutocompleteKeys(s.data.collections),e.collectionJoinKeys=rt(e.collectionJoinKeys.sort(st),nt)),postMessage(e)};function st(s,e){return s.length-e.length}function rt(s,e){return s.length>e?s.slice(0,e):s}})(); diff --git a/ui/dist/assets/index-rLaTJP5R.js b/ui/dist/assets/index-B6GxOPDi.js similarity index 60% rename from ui/dist/assets/index-rLaTJP5R.js rename to ui/dist/assets/index-B6GxOPDi.js index 0e3dd41839..7ded84a769 100644 --- a/ui/dist/assets/index-rLaTJP5R.js +++ b/ui/dist/assets/index-B6GxOPDi.js @@ -1,123 +1,123 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-BPeaOUvB.js","./index-BztyTJOx.js","./CodeEditor-C-zHBmhQ.js","./ListApiDocs-bZ1-xl-p.js","./SdkTabs-DJGq8srX.js","./SdkTabs-lBWmLVyw.css","./FieldsQueryParam-Bw7BgfEJ.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-iCTJquUd.js","./CreateApiDocs-jPKcVL6M.js","./UpdateApiDocs-DGrQC-Ly.js","./DeleteApiDocs-EnRun5cS.js","./RealtimeApiDocs-Bdn0UuCF.js","./AuthWithPasswordDocs-Dpy8EoRc.js","./AuthWithOAuth2Docs-sv1YgvnJ.js","./AuthRefreshDocs-DOQHyuHB.js","./RequestVerificationDocs-BXzC-pWX.js","./ConfirmVerificationDocs-CPe-dhLl.js","./RequestPasswordResetDocs-Csllfzv-.js","./ConfirmPasswordResetDocs-CFOUXiAS.js","./RequestEmailChangeDocs-BDG1xZdQ.js","./ConfirmEmailChangeDocs-DG3NuEPP.js","./AuthMethodsDocs-DOKfHUKA.js","./ListExternalAuthsDocs-CGAfo9a0.js","./UnlinkExternalAuthDocs-Cm7HyxiF.js"])))=>i.map(i=>d[i]); -var f0=Object.defineProperty;var u0=(n,e,t)=>e in n?f0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>u0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const gs=n=>n;function Ie(n,e){for(const t in e)n[t]=e[t];return n}function c0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Tg(n){return n()}function Za(){return Object.create(null)}function $e(n){n.forEach(Tg)}function Ct(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ds;function en(n,e){return n===e?!0:(Ds||(Ds=document.createElement("a")),Ds.href=e,n===Ds.href)}function d0(n){return Object.keys(n).length===0}function oa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Cg(n){let e;return oa(n,t=>e=t)(),e}function Ue(n,e,t){n.$$.on_destroy.push(oa(e,t))}function wt(n,e,t,i){if(n){const l=Og(n,e,t,i);return n[0](l)}}function Og(n,e,t,i){return n[1]&&i?Ie(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ra=Mg?n=>requestAnimationFrame(n):Q;const bl=new Set;function Dg(n){bl.forEach(e=>{e.c(n)||(bl.delete(e),e.f())}),bl.size!==0&&ra(Dg)}function Ro(n){let e;return bl.size===0&&ra(Dg),{promise:new Promise(t=>{bl.add(e={c:n,f:t})}),abort(){bl.delete(e)}}}function k(n,e){n.appendChild(e)}function Eg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function p0(n){const e=b("style");return e.textContent="/* empty */",m0(Eg(n),e),e.sheet}function m0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const h0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&h0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function _0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function g0(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function b0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Ig(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const bo=new Map;let ko=0;function k0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function y0(n,e){const t={stylesheet:p0(e),rules:{}};return bo.set(n,t),t}function is(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-CFHe_5bb.js","./index-BJXhcZ8-.js","./CodeEditor-97oGZhvg.js","./ListApiDocs-CtNZ5G9D.js","./SdkTabs-C9BIEbpG.js","./SdkTabs-CSWLpEgj.css","./FieldsQueryParam-DB2XHXnv.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-Bt5koN3Z.js","./CreateApiDocs-cTL4BTwH.js","./UpdateApiDocs-B4w33bkJ.js","./DeleteApiDocs-C521Da9d.js","./RealtimeApiDocs-DlyauiFo.js","./AuthWithPasswordDocs-CaL3O2uX.js","./AuthWithOAuth2Docs-C9IystLV.js","./AuthRefreshDocs-CdUir8-r.js","./RequestVerificationDocs-B3KxCvqw.js","./ConfirmVerificationDocs-BKx9x0MU.js","./RequestPasswordResetDocs-CCrC-X-J.js","./ConfirmPasswordResetDocs-DCQFPDN7.js","./RequestEmailChangeDocs-DmKjgrzy.js","./ConfirmEmailChangeDocs-T4e4Bmxi.js","./AuthMethodsDocs-DifPdWR1.js","./ListExternalAuthsDocs-DCCFJUK6.js","./UnlinkExternalAuthDocs-4JM4cUB_.js"])))=>i.map(i=>d[i]); +var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>p0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const ks=n=>n;function Ie(n,e){for(const t in e)n[t]=e[t];return n}function m0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Og(n){return n()}function Qa(){return Object.create(null)}function $e(n){n.forEach(Og)}function Ct(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Is;function en(n,e){return n===e?!0:(Is||(Is=document.createElement("a")),Is.href=e,n===Is.href)}function h0(n){return Object.keys(n).length===0}function fa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Mg(n){let e;return fa(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(fa(e,t))}function wt(n,e,t,i){if(n){const l=Dg(n,e,t,i);return n[0](l)}}function Dg(n,e,t,i){return n[1]&&i?Ie(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ua=Eg?n=>requestAnimationFrame(n):Q;const yl=new Set;function Ig(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ua(Ig)}function jo(n){let e;return yl.size===0&&ua(Ig),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function k(n,e){n.appendChild(e)}function Ag(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function _0(n){const e=b("style");return e.textContent="/* empty */",g0(Ag(n),e),e.sheet}function g0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const b0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&b0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function k0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function y0(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function v0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Lg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const yo=new Map;let vo=0;function w0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function S0(n,e){const t={stylesheet:_0(e),rules:{}};return yo.set(n,t),t}function ss(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ `;for(let g=0;g<=1;g+=a){const y=e+(t-e)*s(g);f+=g*100+`%{${o(y,1-y)}} `}const u=f+`100% {${o(t,1-t)}} -}`,c=`__svelte_${k0(u)}_${r}`,d=Eg(n),{stylesheet:m,rules:h}=bo.get(d)||y0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,ko+=1,c}function ls(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),ko-=l,ko||v0())}function v0(){ra(()=>{ko||(bo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),bo.clear())})}function w0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=gs,start:a=Fo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=is(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&ls(n,h),d=!1}return Ro(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function S0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ag(n,l)}}function Ag(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ss;function di(n){ss=n}function bs(){if(!ss)throw new Error("Function called outside component initialization");return ss}function Ht(n){bs().$$.on_mount.push(n)}function $0(n){bs().$$.after_update.push(n)}function ks(n){bs().$$.on_destroy.push(n)}function lt(){const n=bs();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Ig(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _l=[],ee=[];let kl=[];const Fr=[],Lg=Promise.resolve();let Rr=!1;function Ng(){Rr||(Rr=!0,Lg.then(aa))}function Qt(){return Ng(),Lg}function Ke(n){kl.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let cl=0;function aa(){if(cl!==0)return;const n=ss;do{try{for(;cl<_l.length;){const e=_l[cl];cl++,di(e),T0(e.$$)}}catch(e){throw _l.length=0,cl=0,e}for(di(null),_l.length=0,cl=0;ee.length;)ee.pop()();for(let e=0;en.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),kl=e}let Rl;function fa(){return Rl||(Rl=Promise.resolve(),Rl.then(()=>{Rl=null})),Rl}function Ki(n,e,t){n.dispatchEvent(Ig(`${e?"intro":"outro"}${t}`))}const io=new Set;let xn;function le(){xn={r:0,c:[],p:xn}}function se(){xn.r||$e(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),xn.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Pg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&ls(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=gs,tick:_=Q,css:g}=l||ua;g&&(o=is(n,0,1,m,d,h,g,a++)),_(0,1);const y=Fo()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Ki(n,!0,"start")),r=Ro(T=>{if(s){if(T>=S)return _(1,0),Ki(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,ls(n),Ct(l)?(l=l(i),fa().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ca(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=gs,tick:m=Q,css:h}=l||ua;h&&(o=is(n,1,0,c,u,d,h));const _=Fo()+u,g=_+c;Ke(()=>Ki(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Ro(y=>{if(s){if(y>=g)return m(0,1),Ki(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Ct(l)?fa().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&ls(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&ls(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=gs,tick:S=Q,css:T}=s||ua,$={start:Fo()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=is(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Ki(n,h,"start")),Ro(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ki(n,r.b,"start"),T&&(c(),f=is(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Ct(s)?fa().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function Xa(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(le(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),se())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&aa()}if(c0(n)){const l=bs();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function O0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function ue(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ii(n,e){n.d(1),e.delete(n.key)}function Et(n,e){A(n,1,1,()=>{e.delete(n.key)})}function M0(n,e){n.f(),Et(n,e)}function at(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return $e(T),g}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ot(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Tg).filter(Ct);n.$$.on_destroy?n.$$.on_destroy.push(...s):$e(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(C0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function D0(n,e){n.$$.dirty[0]===-1&&(_l.push(n),Ng(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&D0(n,c)),d}):[],f.update(),u=!0,$e(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=g0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),z(n,e.target,e.anchor),aa()}di(a)}class ge{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!Ct(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!d0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const E0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(E0);const dl=[];function Fg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function Rg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Fg(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Ct(h)?h:Q},m=l.map((h,_)=>oa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){$e(m),c(),a=!1}})}function qg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function I0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&4?pt(l,[Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function A0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function L0(n){let e,t,i,l;const s=[A0,I0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Qa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qo=Fg(null,function(e){e(Qa());const t=()=>{e(Qa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Rg(qo,n=>n.location);const jo=Rg(qo,n=>n.querystring),xa=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function nn(n,e){if(e=tf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return ef(n,e),{update(t){t=tf(t),ef(n,t)}}}function N0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function ef(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||P0(i.currentTarget.getAttribute("href"))})}function tf(n){return n&&typeof n=="string"?{href:n}:n||{}}function P0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function F0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=qg(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),$0(()=>{N0(m)}));let _=null,g=null;const y=qo.subscribe(async $=>{_=$;let C=0;for(;C{xa.set(f)});return}t(0,a=null),g=null,xa.set(void 0)});ks(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class R0 extends ge{constructor(e){super(),_e(this,e,F0,L0,me,{routes:3,prefix:4,restoreScrollState:5})}}const lo=[];let jg;function Hg(n){const e=n.pattern.test(jg);nf(n,n.className,e),nf(n,n.inactiveClassName,!e)}function nf(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{jg=n.location+(n.querystring?"?"+n.querystring:""),lo.map(Hg)});function Ln(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?qg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return lo.push(i),Hg(i),{destroy(){lo.splice(lo.indexOf(i),1)}}}const q0="modulepreload",j0=function(n,e){return new URL(n,e).href},lf={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const s=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),r=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));l=Promise.all(t.map(a=>{if(a=j0(a,i),a in lf)return;lf[a]=!0;const f=a.endsWith(".css"),u=f?'[rel="stylesheet"]':"";if(!!i)for(let m=s.length-1;m>=0;m--){const h=s[m];if(h.href===a&&(!f||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${u}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":q0,f||(d.as="script",d.crossOrigin=""),d.href=a,r&&d.setAttribute("nonce",r),document.head.appendChild(d),f)return new Promise((m,h)=>{d.addEventListener("load",m),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}return l.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function At(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}zg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const of="pb_auth";class B0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!da(this.token)}get isAdmin(){return so(this.token).type==="admin"}get isAuthRecord(){return so(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=of){const i=H0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=of){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=so(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=sf(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=sf(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Vg extends B0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class U0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class pa extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function nr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class W0 extends pa{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||nr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){nr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&nr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&da(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&f.authStore.token){$[O]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Y0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Bg(n){if(n){n.query=n.query||{};for(let e in n)Y0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Ug extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Bg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class K0 extends pa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Ug(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=rf(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new gn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=rf(h)})(d)}catch(c){r(),f(new gn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function rf(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class J0 extends pa{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class Z0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class G0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class X0 extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Q0 extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Ho{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Vg,this.admins=new W0(this),this.collections=new J0(this),this.files=new X0(this),this.logs=new Z0(this),this.settings=new U0(this),this.realtime=new Ug(this),this.health=new G0(this),this.backups=new Q0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new K0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Bg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class x0 extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ek extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class tk extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class gl extends il{}class Wg extends il{constructor(e){super(`Invalid unit ${e}`)}}class mn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Me="numeric",Wn="short",$n="long",yo={year:Me,month:Me,day:Me},Yg={year:Me,month:Wn,day:Me},nk={year:Me,month:Wn,day:Me,weekday:Wn},Kg={year:Me,month:$n,day:Me},Jg={year:Me,month:$n,day:Me,weekday:$n},Zg={hour:Me,minute:Me},Gg={hour:Me,minute:Me,second:Me},Xg={hour:Me,minute:Me,second:Me,timeZoneName:Wn},Qg={hour:Me,minute:Me,second:Me,timeZoneName:$n},xg={hour:Me,minute:Me,hourCycle:"h23"},e1={hour:Me,minute:Me,second:Me,hourCycle:"h23"},t1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:Wn},n1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:$n},i1={year:Me,month:Me,day:Me,hour:Me,minute:Me},l1={year:Me,month:Me,day:Me,hour:Me,minute:Me,second:Me},s1={year:Me,month:Wn,day:Me,hour:Me,minute:Me},o1={year:Me,month:Wn,day:Me,hour:Me,minute:Me,second:Me},ik={year:Me,month:Wn,day:Me,weekday:Wn,hour:Me,minute:Me},r1={year:Me,month:$n,day:Me,hour:Me,minute:Me,timeZoneName:Wn},a1={year:Me,month:$n,day:Me,hour:Me,minute:Me,second:Me,timeZoneName:Wn},f1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,timeZoneName:$n},u1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,second:Me,timeZoneName:$n};class ys{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let ir=null;class zo extends ys{static get instance(){return ir===null&&(ir=new zo),ir}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return k1(e,t,i)}formatOffset(e,t){return Zl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let oo={};function lk(n){return oo[n]||(oo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oo[n]}const sk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ok(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function rk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let af={};function ak(n,e={}){const t=JSON.stringify([n,e]);let i=af[t];return i||(i=new Intl.ListFormat(n,e),af[t]=i),i}let qr={};function jr(n,e={}){const t=JSON.stringify([n,e]);let i=qr[t];return i||(i=new Intl.DateTimeFormat(n,e),qr[t]=i),i}let Hr={};function fk(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.NumberFormat(n,e),Hr[t]=i),i}let zr={};function uk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=zr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),zr[l]=s),s}let Wl=null;function ck(){return Wl||(Wl=new Intl.DateTimeFormat().resolvedOptions().locale,Wl)}let ff={};function dk(n){let e=ff[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,ff[n]=e}return e}function pk(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=jr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=jr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function mk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function hk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function _k(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function As(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function gk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class bk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=fk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ga(e,3);return Vt(t,this.padTo)}}}class kk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=jr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class yk{constructor(e,t,i){this.opts={style:"long",...i},!t&&g1()&&(this.rtf=uk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Hk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const vk={firstDay:1,minimalDays:4,weekend:[6,7]};class kt{static fromOpts(e){return kt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||qt.defaultLocale,r=o||(s?"en-US":ck()),a=t||qt.defaultNumberingSystem,f=i||qt.defaultOutputCalendar,u=Vr(l)||qt.defaultWeekSettings;return new kt(r,a,f,u,o)}static resetCache(){Wl=null,qr={},Hr={},zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return kt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=pk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=mk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=gk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:kt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Vr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return As(this,e,w1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=hk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return As(this,e,T1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=_k(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return As(this,void 0,()=>C1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return As(this,e,O1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new bk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new kk(e,this.intl,t)}relFormatter(e={}){return new yk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ak(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:b1()?dk(this.locale):vk}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let lr=null;class un extends ys{static get utcInstance(){return lr===null&&(lr=new un(0)),lr}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Uo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Zl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Zl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Zl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class wk extends ys{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(We(n)||n===null)return e;if(n instanceof ys)return n;if(Tk(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?zo.instance:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||pi.create(n)}else return Ji(n)?un.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new wk(n)}let uf=()=>Date.now(),cf="system",df=null,pf=null,mf=null,hf=60,_f,gf=null;class qt{static get now(){return uf}static set now(e){uf=e}static set defaultZone(e){cf=e}static get defaultZone(){return Si(cf,zo.instance)}static get defaultLocale(){return df}static set defaultLocale(e){df=e}static get defaultNumberingSystem(){return pf}static set defaultNumberingSystem(e){pf=e}static get defaultOutputCalendar(){return mf}static set defaultOutputCalendar(e){mf=e}static get defaultWeekSettings(){return gf}static set defaultWeekSettings(e){gf=Vr(e)}static get twoDigitCutoffYear(){return hf}static set twoDigitCutoffYear(e){hf=e%100}static get throwOnInvalid(){return _f}static set throwOnInvalid(e){_f=e}static resetCaches(){kt.resetCache(),pi.resetCache()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const c1=[0,31,59,90,120,151,181,212,243,273,304,334],d1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ma(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function p1(n,e,t){return t+(vs(n)?d1:c1)[e-1]}function m1(n,e){const t=vs(n)?d1:c1,i=t.findIndex(s=>sos(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Wo(n)}}function bf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ha(ma(i,1,e),t),r=yl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=yl(f)):a>r?(f=i+1,a-=yl(i)):f=i;const{month:u,day:c}=m1(f,a);return{year:f,month:u,day:c,...Wo(n)}}function sr(n){const{year:e,month:t,day:i}=n,l=p1(e,t,i);return{year:e,ordinal:l,...Wo(n)}}function kf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=m1(e,t);return{year:e,month:i,day:l,...Wo(n)}}function yf(n,e){if(!We(n.localWeekday)||!We(n.localWeekNumber)||!We(n.localWeekYear)){if(!We(n.weekday)||!We(n.weekNumber)||!We(n.weekYear))throw new gl("Cannot mix locale-based week fields with ISO-based week fields");return We(n.localWeekday)||(n.weekday=n.localWeekday),We(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),We(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Sk(n,e=4,t=1){const i=Vo(n.weekYear),l=Pn(n.weekNumber,1,os(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function $k(n){const e=Vo(n.year),t=Pn(n.ordinal,1,yl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function h1(n){const e=Vo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,wo(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function _1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function We(n){return typeof n>"u"}function Ji(n){return typeof n=="number"}function Vo(n){return typeof n=="number"&&n%1===0}function Tk(n){return typeof n=="string"}function Ck(n){return Object.prototype.toString.call(n)==="[object Date]"}function g1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function b1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ok(n){return Array.isArray(n)?n:[n]}function vf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Mk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Tl(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Vr(n){if(n==null)return null;if(typeof n!="object")throw new mn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new mn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return Vo(n)&&n>=e&&n<=t}function Dk(n,e){return n-e*Math.floor(n/e)}function Vt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(We(n)||n===null||n===""))return parseInt(n,10)}function Ni(n){if(!(We(n)||n===null||n===""))return parseFloat(n)}function _a(n){if(!(We(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ga(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function vs(n){return n%4===0&&(n%100!==0||n%400===0)}function yl(n){return vs(n)?366:365}function wo(n,e){const t=Dk(e-1,12)+1,i=n+(e-t)/12;return t===2?vs(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Bo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function wf(n,e,t){return-ha(ma(n,1,e),t)+e-1}function os(n,e=4,t=1){const i=wf(n,e,t),l=wf(n+1,e,t);return(yl(n)-i+l)/7}function Br(n){return n>99?n:n>qt.twoDigitCutoffYear?1900+n:2e3+n}function k1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Uo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function y1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new mn(`Invalid unit value ${n}`);return e}function So(n,e){const t={};for(const i in n)if(Tl(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=y1(l)}return t}function Zl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Vt(t,2)}:${Vt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Vt(t,2)}${Vt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Wo(n){return Mk(n,["hour","minute","second","millisecond"])}const Ek=["January","February","March","April","May","June","July","August","September","October","November","December"],v1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ik=["J","F","M","A","M","J","J","A","S","O","N","D"];function w1(n){switch(n){case"narrow":return[...Ik];case"short":return[...v1];case"long":return[...Ek];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const S1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ak=["M","T","W","T","F","S","S"];function T1(n){switch(n){case"narrow":return[...Ak];case"short":return[...$1];case"long":return[...S1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const C1=["AM","PM"],Lk=["Before Christ","Anno Domini"],Nk=["BC","AD"],Pk=["B","A"];function O1(n){switch(n){case"narrow":return[...Pk];case"short":return[...Nk];case"long":return[...Lk];default:return null}}function Fk(n){return C1[n.hour<12?0:1]}function Rk(n,e){return T1(e)[n.weekday-1]}function qk(n,e){return w1(e)[n.month-1]}function jk(n,e){return O1(e)[n.year<0?0:1]}function Hk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function Sf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const zk={D:yo,DD:Yg,DDD:Kg,DDDD:Jg,t:Zg,tt:Gg,ttt:Xg,tttt:Qg,T:xg,TT:e1,TTT:t1,TTTT:n1,f:i1,ff:s1,fff:r1,ffff:f1,F:l1,FF:o1,FFF:a1,FFFF:u1};class ln{static create(e,t={}){return new ln(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return zk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Vt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Fk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?qk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Rk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=ln.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?jk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Sf(ln.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=ln.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Sf(s,l(r))}}const M1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function El(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Il(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Al(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function D1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Ni(t)),months:d(Ni(i)),weeks:d(Ni(l)),days:d(Ni(s)),hours:d(Ni(o)),minutes:d(Ni(r)),seconds:d(Ni(a),a==="-0"),milliseconds:d(_a(f),c)}]}const ey={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ya(n,e,t,i,l,s,o){const r={year:e.length===2?Br(vi(e)):vi(e),month:v1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?S1.indexOf(n)+1:$1.indexOf(n)+1),r}const ty=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ny(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=ya(e,l,i,t,s,o,r);let m;return a?m=ey[a]:f?m=0:m=Uo(u,c),[d,new un(m)]}function iy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ly=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,sy=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,oy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function $f(n){const[,e,t,i,l,s,o,r]=n;return[ya(e,l,i,t,s,o,r),un.utcInstance]}function ry(n){const[,e,t,i,l,s,o,r]=n;return[ya(e,r,t,i,l,s,o),un.utcInstance]}const ay=El(Bk,ka),fy=El(Uk,ka),uy=El(Wk,ka),cy=El(I1),L1=Il(Gk,Ll,ws,Ss),dy=Il(Yk,Ll,ws,Ss),py=Il(Kk,Ll,ws,Ss),my=Il(Ll,ws,Ss);function hy(n){return Al(n,[ay,L1],[fy,dy],[uy,py],[cy,my])}function _y(n){return Al(iy(n),[ty,ny])}function gy(n){return Al(n,[ly,$f],[sy,$f],[oy,ry])}function by(n){return Al(n,[Qk,xk])}const ky=Il(Ll);function yy(n){return Al(n,[Xk,ky])}const vy=El(Jk,Zk),wy=El(A1),Sy=Il(Ll,ws,Ss);function $y(n){return Al(n,[vy,L1],[wy,Sy])}const Tf="Invalid Duration",N1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ty={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...N1},Dn=146097/400,pl=146097/4800,Cy={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...N1},Ui=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Oy=Ui.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function P1(n,e){let t=e.milliseconds??0;for(const i of Oy.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Cf(n,e){const t=P1(n,e)<0?-1:1;Ui.reduceRight((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Ui.reduce((i,l)=>{if(We(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function My(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Cy:Ty;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||kt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new mn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:So(e,st.normalizeUnit),loc:kt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ji(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new mn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=by(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=yy(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new mn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(qt.throwOnInvalid)throw new tk(i);return new st({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Wg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?ln.create(this.loc,i).formatDurationFromString(this,e):Tf}toHuman(e={}){if(!this.isValid)return Tf;const t=Ui.map(i=>{const l=this.values[i];return We(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ga(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?P1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Ui)(Tl(t.values,l)||Tl(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=y1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...So(e,st.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Cf(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=My(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Ui)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Ji(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Ji(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Cf(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Ui)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Dy(n,e){return!n||!n.isValid?Ft.invalid("missing or invalid start"):!e||!e.isValid?Ft.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ft.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(jl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Ft.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Ft.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ft.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ft.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Ft.fromDateTimes(t,a.time)),t=null);return Ft.merge(l)}difference(...e){return Ft.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=yo,t={}){return this.isValid?ln.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return Ft.fromDateTimes(e(this.s),e(this.e))}}class Ls{static hasDST(e=qt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,qt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||kt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||kt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||kt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||kt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||kt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||kt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||kt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return kt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return kt.create(t,null,"gregory").eras(e)}static features(){return{relative:g1(),localeWeek:b1()}}}function Of(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function Ey(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=Of(a,f);return(u-u%7)/7}],["days",Of]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Iy(n,e,t,i){let[l,s,o,r]=Ey(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?st.fromMillis(a,i).shiftTo(...f).plus(u):u}const va={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ay=va.hanidec.replace(/[\[|\]]/g,"").split("");function Ly(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function jn({numberingSystem:n},e=""){return new RegExp(`${va[n||"latn"]}${e}`)}const Ny="missing Intl.DateTimeFormat.formatToParts support";function ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Ly(t))}}const Py=" ",F1=`[ ${Py}]`,R1=new RegExp(F1,"g");function Fy(n){return n.replace(/\./g,"\\.?").replace(R1,F1)}function Df(n){return n.replace(/\./g,"").replace(R1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Fy).join("|")),deser:([t])=>n.findIndex(i=>Df(t)===Df(i))+e}}function Ef(n,e){return{regex:n,deser:([,t,i])=>Uo(t,i),groups:e}}function Ns(n){return{regex:n,deser:([e])=>e}}function Ry(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function qy(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(Ry(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ct(f);case"yy":return ct(c,Br);case"yyyy":return ct(s);case"yyyyy":return ct(d);case"yyyyyy":return ct(o);case"M":return ct(r);case"MM":return ct(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ct(r);case"LL":return ct(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ct(r);case"dd":return ct(i);case"o":return ct(a);case"ooo":return ct(l);case"HH":return ct(i);case"H":return ct(r);case"hh":return ct(i);case"h":return ct(r);case"mm":return ct(i);case"m":return ct(r);case"q":return ct(r);case"qq":return ct(i);case"s":return ct(r);case"ss":return ct(i);case"S":return ct(a);case"SSS":return ct(l);case"u":return Ns(u);case"uu":return Ns(r);case"uuu":return ct(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ct(s);case"kk":return ct(c,Br);case"W":return ct(r);case"WW":return ct(i);case"E":case"c":return ct(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ef(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ef(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Ns(/[a-z_+-/]{1,256}?/i);case" ":return Ns(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:Ny};return _.token=n,_}const jy={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Hy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=jy[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function zy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Vy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Tl(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function By(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return We(n.z)||(t=pi.create(n.z)),We(n.Z)||(t||(t=new un(n.Z)),i=n.Z),We(n.q)||(n.M=(n.q-1)*3+1),We(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),We(n.u)||(n.S=_a(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let or=null;function Uy(){return or||(or=je.fromMillis(1555555555555)),or}function Wy(n,e){if(n.literal)return n;const t=ln.macroTokenToFormatOpts(n.val),i=H1(t,e);return i==null||i.includes(void 0)?n:i}function q1(n,e){return Array.prototype.concat(...n.map(t=>Wy(t,e)))}function j1(n,e,t){const i=q1(ln.parseFormat(t),n),l=i.map(o=>qy(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=zy(l),a=RegExp(o,"i"),[f,u]=Vy(e,a,r),[c,d,m]=u?By(u):[null,null,void 0];if(Tl(u,"a")&&Tl(u,"H"))throw new gl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:f,matches:u,result:c,zone:d,specificOffset:m}}}function Yy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=j1(n,e,t);return[i,l,s,o]}function H1(n,e){if(!n)return null;const i=ln.create(e,n).dtFormatter(Uy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Hy(o,n,s))}const rr="Invalid DateTime",If=864e13;function Ps(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ar(n){return n.weekData===null&&(n.weekData=vo(n.c)),n.weekData}function fr(n){return n.localWeekData===null&&(n.localWeekData=vo(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Pi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function z1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Fs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ro(n,e,t){return z1(Bo(n),e,t)}function Af(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,wo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Bo(s);let[a,f]=z1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function ql(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Rs(n,e,t=!0){return n.isValid?ln.create(kt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ur(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Vt(n.c.year,t?6:4),e?(i+="-",i+=Vt(n.c.month),i+="-",i+=Vt(n.c.day)):(i+=Vt(n.c.month),i+=Vt(n.c.day)),i}function Lf(n,e,t,i,l,s){let o=Vt(n.c.hour);return e?(o+=":",o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Vt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Vt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Vt(Math.trunc(-n.o/60)),o+=":",o+=Vt(Math.trunc(-n.o%60))):(o+="+",o+=Vt(Math.trunc(n.o/60)),o+=":",o+=Vt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const V1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ky={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Jy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},B1=["year","month","day","hour","minute","second","millisecond"],Zy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Gy=["year","ordinal","hour","minute","second","millisecond"];function Xy(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Wg(n);return e}function Nf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Xy(n)}}function Pf(n,e){const t=Si(e.zone,qt.defaultZone),i=kt.fromObject(e),l=qt.now();let s,o;if(We(n.year))s=l;else{for(const f of B1)We(n[f])&&(n[f]=V1[f]);const r=h1(n)||_1(n);if(r)return je.invalid(r);const a=t.offset(l);[s,o]=ro(n,a,t)}return new je({ts:s,zone:t,loc:i,o})}function Ff(n,e,t){const i=We(t.round)?!0:t.round,l=(o,r)=>(o=ga(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Rf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class je{constructor(e){const t=e.zone||qt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Ps(t));this.ts=We(e.ts)?qt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Fs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||kt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Rf(arguments),[i,l,s,o,r,a,f]=t;return Pf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Rf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=un.utcInstance,Pf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Ck(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,qt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:kt.fromObject(t)}):je.invalid(Ps(l))}static fromMillis(e,t={}){if(Ji(e))return e<-If||e>If?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,qt.defaultZone),loc:kt.fromObject(t)});throw new mn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new je({ts:e*1e3,zone:Si(t.zone,qt.defaultZone),loc:kt.fromObject(t)});throw new mn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,qt.defaultZone);if(!i.isValid)return je.invalid(Ps(i));const l=kt.fromObject(t),s=So(e,Nf),{minDaysInFirstWeek:o,startOfWeek:r}=yf(s,l),a=qt.now(),f=We(t.specificOffset)?i.offset(a):t.specificOffset,u=!We(s.ordinal),c=!We(s.year),d=!We(s.month)||!We(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new gl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Fs(a,f);_?(g=Zy,y=Ky,S=vo(S,o,r)):u?(g=Gy,y=Jy,S=sr(S)):(g=B1,y=V1);let T=!1;for(const R of g){const F=s[R];We(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Sk(s,o,r):u?$k(s):h1(s),C=$||_1(s);if(C)return je.invalid(C);const O=_?bf(s,o,r):u?kf(s):s,[D,I]=ro(O,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L}static fromISO(e,t={}){const[i,l]=hy(e);return ql(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=_y(e);return ql(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=gy(e);return ql(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(We(e)||We(t))throw new mn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=kt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Yy(o,e,t);return u?je.invalid(u):ql(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=$y(e);return ql(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new mn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(qt.throwOnInvalid)throw new x0(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=H1(e,kt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return q1(ln.parseFormat(e),kt.fromObject(t)).map(l=>l.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ar(this).weekYear:NaN}get weekNumber(){return this.isValid?ar(this).weekNumber:NaN}get weekday(){return this.isValid?ar(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fr(this).weekday:NaN}get localWeekNumber(){return this.isValid?fr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fr(this).weekYear:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ls.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ls.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ls.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ls.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Bo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Fs(a,o),c=Fs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Pi(this,{ts:a}),Pi(this,{ts:f})]:[this]}get isInLeapYear(){return vs(this.year)}get daysInMonth(){return wo(this.year,this.month)}get daysInYear(){return this.isValid?yl(this.year):NaN}get weeksInWeekYear(){return this.isValid?os(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?os(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=ln.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(qt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,qt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ro(o,s,e)}return Pi(this,{ts:l,zone:e})}else return je.invalid(Ps(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Pi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=So(e,Nf),{minDaysInFirstWeek:i,startOfWeek:l}=yf(t,this.loc),s=!We(t.weekYear)||!We(t.weekNumber)||!We(t.weekday),o=!We(t.ordinal),r=!We(t.year),a=!We(t.month)||!We(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new gl("Can't mix ordinal dates with month/day");let c;s?c=bf({...vo(this.c,i,l),...t},i,l):We(t.ordinal)?(c={...this.toObject(),...t},We(t.day)&&(c.day=Math.min(wo(c.year,c.month),c.day))):c=kf({...sr(this.c),...t});const[d,m]=ro(c,this.o,this.zone);return Pi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Pi(this,Af(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Pi(this,Af(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Iy(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Ft.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new mn("max requires all arguments be DateTimes");return vf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=kt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return j1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return yo}static get DATE_MED(){return Yg}static get DATE_MED_WITH_WEEKDAY(){return nk}static get DATE_FULL(){return Kg}static get DATE_HUGE(){return Jg}static get TIME_SIMPLE(){return Zg}static get TIME_WITH_SECONDS(){return Gg}static get TIME_WITH_SHORT_OFFSET(){return Xg}static get TIME_WITH_LONG_OFFSET(){return Qg}static get TIME_24_SIMPLE(){return xg}static get TIME_24_WITH_SECONDS(){return e1}static get TIME_24_WITH_SHORT_OFFSET(){return t1}static get TIME_24_WITH_LONG_OFFSET(){return n1}static get DATETIME_SHORT(){return i1}static get DATETIME_SHORT_WITH_SECONDS(){return l1}static get DATETIME_MED(){return s1}static get DATETIME_MED_WITH_SECONDS(){return o1}static get DATETIME_MED_WITH_WEEKDAY(){return ik}static get DATETIME_FULL(){return r1}static get DATETIME_FULL_WITH_SECONDS(){return a1}static get DATETIME_HUGE(){return f1}static get DATETIME_HUGE_WITH_SECONDS(){return u1}}function jl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new mn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Qy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],xy=[".mp4",".avi",".mov",".3gp",".wmv"],ev=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],tv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],U1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Qy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!xy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!ev.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!tv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,f;let s=e.find(u=>u.name==t||u.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const u of s.schema){const c=i+u.name;if(u.type=="relation"&&((r=u.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,u.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=u.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(u.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const u of e){u.schema=u.schema||[];for(const c of u.schema)if(c.type=="relation"&&((f=c.options)==null?void 0:f.collectionId)==s.id){const d=i+u.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,u.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` +}`,c=`__svelte_${w0(u)}_${r}`,d=Ag(n),{stylesheet:m,rules:h}=yo.get(d)||S0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,vo+=1,c}function os(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),vo-=l,vo||$0())}function $0(){ua(()=>{vo||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function T0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=ks,start:a=qo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=ss(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&os(n,h),d=!1}return jo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function C0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ng(n,l)}}function Ng(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let rs;function di(n){rs=n}function ys(){if(!rs)throw new Error("Function called outside component initialization");return rs}function Ht(n){ys().$$.on_mount.push(n)}function O0(n){ys().$$.after_update.push(n)}function vs(n){ys().$$.on_destroy.push(n)}function lt(){const n=ys();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Lg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gl=[],ee=[];let vl=[];const jr=[],Pg=Promise.resolve();let Hr=!1;function Fg(){Hr||(Hr=!0,Pg.then(ca))}function Qt(){return Fg(),Pg}function Ke(n){vl.push(n)}function ke(n){jr.push(n)}const ir=new Set;let cl=0;function ca(){if(cl!==0)return;const n=rs;do{try{for(;cln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vl=e}let jl;function da(){return jl||(jl=Promise.resolve(),jl.then(()=>{jl=null})),jl}function Ji(n,e,t){n.dispatchEvent(Lg(`${e?"intro":"outro"}${t}`))}const lo=new Set;let xn;function le(){xn={r:0,c:[],p:xn}}function se(){xn.r||$e(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(lo.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(lo.has(n))return;lo.add(n),xn.c.push(()=>{lo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Rg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&os(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=ks,tick:_=Q,css:g}=l||pa;g&&(o=ss(n,0,1,m,d,h,g,a++)),_(0,1);const y=qo()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Ji(n,!0,"start")),r=jo(T=>{if(s){if(T>=S)return _(1,0),Ji(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,os(n),Ct(l)?(l=l(i),da().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ma(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=ks,tick:m=Q,css:h}=l||pa;h&&(o=ss(n,1,0,c,u,d,h));const _=qo()+u,g=_+c;Ke(()=>Ji(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),jo(y=>{if(s){if(y>=g)return m(0,1),Ji(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Ct(l)?da().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&os(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&os(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=ks,tick:S=Q,css:T}=s||pa,$={start:qo()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=ss(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Ji(n,h,"start")),jo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ji(n,r.b,"start"),T&&(c(),f=ss(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ji(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Ct(s)?da().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function ef(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(le(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),se())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&ca()}if(m0(n)){const l=ys();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function E0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function ue(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ai(n,e){n.d(1),e.delete(n.key)}function Et(n,e){A(n,1,1,()=>{e.delete(n.key)})}function I0(n,e){n.f(),Et(n,e)}function at(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return $e(T),g}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ot(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Og).filter(Ct);n.$$.on_destroy?n.$$.on_destroy.push(...s):$e(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(D0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function A0(n,e){n.$$.dirty[0]===-1&&(gl.push(n),Fg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&A0(n,c)),d}):[],f.update(),u=!0,$e(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=y0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),z(n,e.target,e.anchor),ca()}di(a)}class ge{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!Ct(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!h0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const L0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(L0);const dl=[];function qg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function jg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return qg(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Ct(h)?h:Q},m=l.map((h,_)=>fa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){$e(m),c(),a=!1}})}function Hg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function N0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&4?pt(l,[Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function P0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function F0(n){let e,t,i,l;const s=[P0,N0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function tf(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ho=qg(null,function(e){e(tf());const t=()=>{e(tf())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});jg(Ho,n=>n.location);const zo=jg(Ho,n=>n.querystring),nf=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function ln(n,e){if(e=sf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return lf(n,e),{update(t){t=sf(t),lf(n,t)}}}function R0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function lf(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||q0(i.currentTarget.getAttribute("href"))})}function sf(n){return n&&typeof n=="string"?{href:n}:n||{}}function q0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function j0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Hg(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),O0(()=>{R0(m)}));let _=null,g=null;const y=Ho.subscribe(async $=>{_=$;let C=0;for(;C{nf.set(f)});return}t(0,a=null),g=null,nf.set(void 0)});vs(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class H0 extends ge{constructor(e){super(),_e(this,e,j0,F0,me,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let zg;function Vg(n){const e=n.pattern.test(zg);of(n,n.className,e),of(n,n.inactiveClassName,!e)}function of(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ho.subscribe(n=>{zg=n.location+(n.querystring?"?"+n.querystring:""),so.map(Vg)});function Ln(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Hg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Vg(i),{destroy(){so.splice(so.indexOf(i),1)}}}const z0="modulepreload",V0=function(n,e){return new URL(n,e).href},rf={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(f=>{if(f=V0(f,i),f in rf)return;rf[f]=!0;const u=f.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===f&&(!u||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${c}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":z0,u||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),u)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function At(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}Bg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const ff="pb_auth";class Y0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ha(this.token)}get isAdmin(){return oo(this.token).type==="admin"}get isAuthRecord(){return oo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ff){const i=B0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=ff){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=oo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=af(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=af(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Ug extends Y0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class K0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class _a extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function lr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class J0 extends _a{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||lr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){lr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&lr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&ha(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&f.authStore.token){$[O]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Z0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Wg(n){if(n){n.query=n.query||{};for(let e in n)Z0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Yg extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Wg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class G0 extends _a{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Yg(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=uf(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new gn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=uf(h)})(d)}catch(c){r(),f(new gn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function uf(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class X0 extends _a{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class Q0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class x0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class ek extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class tk extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Vo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Ug,this.admins=new J0(this),this.collections=new X0(this),this.files=new ek(this),this.logs=new Q0(this),this.settings=new K0(this),this.realtime=new Yg(this),this.health=new x0(this),this.backups=new tk(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new G0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Wg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class nk extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ik extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class lk extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class kl extends il{}class Kg extends il{constructor(e){super(`Invalid unit ${e}`)}}class tn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Me="numeric",Wn="short",$n="long",wo={year:Me,month:Me,day:Me},Jg={year:Me,month:Wn,day:Me},sk={year:Me,month:Wn,day:Me,weekday:Wn},Zg={year:Me,month:$n,day:Me},Gg={year:Me,month:$n,day:Me,weekday:$n},Xg={hour:Me,minute:Me},Qg={hour:Me,minute:Me,second:Me},xg={hour:Me,minute:Me,second:Me,timeZoneName:Wn},e1={hour:Me,minute:Me,second:Me,timeZoneName:$n},t1={hour:Me,minute:Me,hourCycle:"h23"},n1={hour:Me,minute:Me,second:Me,hourCycle:"h23"},i1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:Wn},l1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:$n},s1={year:Me,month:Me,day:Me,hour:Me,minute:Me},o1={year:Me,month:Me,day:Me,hour:Me,minute:Me,second:Me},r1={year:Me,month:Wn,day:Me,hour:Me,minute:Me},a1={year:Me,month:Wn,day:Me,hour:Me,minute:Me,second:Me},ok={year:Me,month:Wn,day:Me,weekday:Wn,hour:Me,minute:Me},f1={year:Me,month:$n,day:Me,hour:Me,minute:Me,timeZoneName:Wn},u1={year:Me,month:$n,day:Me,hour:Me,minute:Me,second:Me,timeZoneName:Wn},c1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,timeZoneName:$n},d1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,second:Me,timeZoneName:$n};class ws{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let sr=null;class Bo extends ws{static get instance(){return sr===null&&(sr=new Bo),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return v1(e,t,i)}formatOffset(e,t){return Xl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ro={};function rk(n){return ro[n]||(ro[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ro[n]}const ak={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function fk(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function uk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let cf={};function ck(n,e={}){const t=JSON.stringify([n,e]);let i=cf[t];return i||(i=new Intl.ListFormat(n,e),cf[t]=i),i}let zr={};function Vr(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Br={};function dk(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.NumberFormat(n,e),Br[t]=i),i}let Ur={};function pk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Ur[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Ur[l]=s),s}let Yl=null;function mk(){return Yl||(Yl=new Intl.DateTimeFormat().resolvedOptions().locale,Yl)}let df={};function hk(n){let e=df[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,df[n]=e}return e}function _k(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Vr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Vr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function gk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function bk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function kk(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function Ns(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function yk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class vk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=dk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):va(e,3);return Vt(t,this.padTo)}}}class wk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Vr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Sk{constructor(e,t,i){this.opts={style:"long",...i},!t&&k1()&&(this.rtf=pk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Yk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const $k={firstDay:1,minimalDays:4,weekend:[6,7]};class mt{static fromOpts(e){return mt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Rt.defaultLocale,r=o||(s?"en-US":mk()),a=t||Rt.defaultNumberingSystem,f=i||Rt.defaultOutputCalendar,u=Wr(l)||Rt.defaultWeekSettings;return new mt(r,a,f,u,o)}static resetCache(){Yl=null,zr={},Br={},Ur={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return mt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=_k(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=gk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=yk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:mt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Wr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ns(this,e,$1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=bk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Ns(this,e,O1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=kk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Ns(this,void 0,()=>M1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ns(this,e,D1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new vk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new wk(e,this.intl,t)}relFormatter(e={}){return new Sk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ck(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:y1()?hk(this.locale):$k}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let or=null;class cn extends ws{static get utcInstance(){return or===null&&(or=new cn(0)),or}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(Yo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Xl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Xl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Xl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Tk extends ws{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(Ue(n)||n===null)return e;if(n instanceof ws)return n;if(Ik(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Bo.instance:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||pi.create(n)}else return Oi(n)?cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Tk(n)}const ga={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},pf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ck=ga.hanidec.replace(/[\[|\]]/g,"").split("");function Ok(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let bl={};function Mk(){bl={}}function jn({numberingSystem:n},e=""){const t=n||"latn";return bl[t]||(bl[t]={}),bl[t][e]||(bl[t][e]=new RegExp(`${ga[t]}${e}`)),bl[t][e]}let mf=()=>Date.now(),hf="system",_f=null,gf=null,bf=null,kf=60,yf,vf=null;class Rt{static get now(){return mf}static set now(e){mf=e}static set defaultZone(e){hf=e}static get defaultZone(){return Si(hf,Bo.instance)}static get defaultLocale(){return _f}static set defaultLocale(e){_f=e}static get defaultNumberingSystem(){return gf}static set defaultNumberingSystem(e){gf=e}static get defaultOutputCalendar(){return bf}static set defaultOutputCalendar(e){bf=e}static get defaultWeekSettings(){return vf}static set defaultWeekSettings(e){vf=Wr(e)}static get twoDigitCutoffYear(){return kf}static set twoDigitCutoffYear(e){kf=e%100}static get throwOnInvalid(){return yf}static set throwOnInvalid(e){yf=e}static resetCaches(){mt.resetCache(),pi.resetCache(),je.resetCache(),Mk()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const p1=[0,31,59,90,120,151,181,212,243,273,304,334],m1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ba(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function h1(n,e,t){return t+(Ss(n)?m1:p1)[e-1]}function _1(n,e){const t=Ss(n)?m1:p1,i=t.findIndex(s=>sas(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Ko(n)}}function wf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ka(ba(i,1,e),t),r=wl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=wl(f)):a>r?(f=i+1,a-=wl(i)):f=i;const{month:u,day:c}=_1(f,a);return{year:f,month:u,day:c,...Ko(n)}}function rr(n){const{year:e,month:t,day:i}=n,l=h1(e,t,i);return{year:e,ordinal:l,...Ko(n)}}function Sf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=_1(e,t);return{year:e,month:i,day:l,...Ko(n)}}function $f(n,e){if(!Ue(n.localWeekday)||!Ue(n.localWeekNumber)||!Ue(n.localWeekYear)){if(!Ue(n.weekday)||!Ue(n.weekNumber)||!Ue(n.weekYear))throw new kl("Cannot mix locale-based week fields with ISO-based week fields");return Ue(n.localWeekday)||(n.weekday=n.localWeekday),Ue(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),Ue(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Dk(n,e=4,t=1){const i=Uo(n.weekYear),l=Pn(n.weekNumber,1,as(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function Ek(n){const e=Uo(n.year),t=Pn(n.ordinal,1,wl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function g1(n){const e=Uo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,$o(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function b1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function Ue(n){return typeof n>"u"}function Oi(n){return typeof n=="number"}function Uo(n){return typeof n=="number"&&n%1===0}function Ik(n){return typeof n=="string"}function Ak(n){return Object.prototype.toString.call(n)==="[object Date]"}function k1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function y1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Lk(n){return Array.isArray(n)?n:[n]}function Tf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Nk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ol(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Wr(n){if(n==null)return null;if(typeof n!="object")throw new tn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new tn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return Uo(n)&&n>=e&&n<=t}function Pk(n,e){return n-e*Math.floor(n/e)}function Vt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(Ue(n)||n===null||n===""))return parseInt(n,10)}function Pi(n){if(!(Ue(n)||n===null||n===""))return parseFloat(n)}function ya(n){if(!(Ue(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function va(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ss(n){return n%4===0&&(n%100!==0||n%400===0)}function wl(n){return Ss(n)?366:365}function $o(n,e){const t=Pk(e-1,12)+1,i=n+(e-t)/12;return t===2?Ss(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Wo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Cf(n,e,t){return-ka(ba(n,1,e),t)+e-1}function as(n,e=4,t=1){const i=Cf(n,e,t),l=Cf(n+1,e,t);return(wl(n)-i+l)/7}function Yr(n){return n>99?n:n>Rt.twoDigitCutoffYear?1900+n:2e3+n}function v1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Yo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function w1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new tn(`Invalid unit value ${n}`);return e}function To(n,e){const t={};for(const i in n)if(Ol(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=w1(l)}return t}function Xl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Vt(t,2)}:${Vt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Vt(t,2)}${Vt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ko(n){return Nk(n,["hour","minute","second","millisecond"])}const Fk=["January","February","March","April","May","June","July","August","September","October","November","December"],S1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Rk=["J","F","M","A","M","J","J","A","S","O","N","D"];function $1(n){switch(n){case"narrow":return[...Rk];case"short":return[...S1];case"long":return[...Fk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const T1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],C1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qk=["M","T","W","T","F","S","S"];function O1(n){switch(n){case"narrow":return[...qk];case"short":return[...C1];case"long":return[...T1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const M1=["AM","PM"],jk=["Before Christ","Anno Domini"],Hk=["BC","AD"],zk=["B","A"];function D1(n){switch(n){case"narrow":return[...zk];case"short":return[...Hk];case"long":return[...jk];default:return null}}function Vk(n){return M1[n.hour<12?0:1]}function Bk(n,e){return O1(e)[n.weekday-1]}function Uk(n,e){return $1(e)[n.month-1]}function Wk(n,e){return D1(e)[n.year<0?0:1]}function Yk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function Of(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Kk={D:wo,DD:Jg,DDD:Zg,DDDD:Gg,t:Xg,tt:Qg,ttt:xg,tttt:e1,T:t1,TT:n1,TTT:i1,TTTT:l1,f:s1,ff:r1,fff:f1,ffff:c1,F:o1,FF:a1,FFF:u1,FFFF:d1};class sn{static create(e,t={}){return new sn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Kk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Vt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Vk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Uk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Bk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=sn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Wk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Of(sn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=sn.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Of(s,l(r))}}const E1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Al(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ll(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Nl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function I1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Pi(t)),months:d(Pi(i)),weeks:d(Pi(l)),days:d(Pi(s)),hours:d(Pi(o)),minutes:d(Pi(r)),seconds:d(Pi(a),a==="-0"),milliseconds:d(ya(f),c)}]}const oy={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function $a(n,e,t,i,l,s,o){const r={year:e.length===2?Yr(vi(e)):vi(e),month:S1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?T1.indexOf(n)+1:C1.indexOf(n)+1),r}const ry=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ay(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=$a(e,l,i,t,s,o,r);let m;return a?m=oy[a]:f?m=0:m=Yo(u,c),[d,new cn(m)]}function fy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const uy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cy=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,dy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mf(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,l,i,t,s,o,r),cn.utcInstance]}function py(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,r,t,i,l,s,o),cn.utcInstance]}const my=Al(Zk,Sa),hy=Al(Gk,Sa),_y=Al(Xk,Sa),gy=Al(L1),P1=Ll(ny,Pl,$s,Ts),by=Ll(Qk,Pl,$s,Ts),ky=Ll(xk,Pl,$s,Ts),yy=Ll(Pl,$s,Ts);function vy(n){return Nl(n,[my,P1],[hy,by],[_y,ky],[gy,yy])}function wy(n){return Nl(fy(n),[ry,ay])}function Sy(n){return Nl(n,[uy,Mf],[cy,Mf],[dy,py])}function $y(n){return Nl(n,[ly,sy])}const Ty=Ll(Pl);function Cy(n){return Nl(n,[iy,Ty])}const Oy=Al(ey,ty),My=Al(N1),Dy=Ll(Pl,$s,Ts);function Ey(n){return Nl(n,[Oy,P1],[My,Dy])}const Df="Invalid Duration",F1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Iy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...F1},Dn=146097/400,pl=146097/4800,Ay={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...F1},Wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ly=Wi.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function R1(n,e){let t=e.milliseconds??0;for(const i of Ly.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Ef(n,e){const t=R1(n,e)<0?-1:1;Wi.reduceRight((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Wi.reduce((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function Ny(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Ay:Iy;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||mt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new tn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:To(e,st.normalizeUnit),loc:mt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Oi(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new tn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=$y(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Cy(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new lk(i);return new st({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Kg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?sn.create(this.loc,i).formatDurationFromString(this,e):Df}toHuman(e={}){if(!this.isValid)return Df;const t=Wi.map(i=>{const l=this.values[i];return Ue(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=va(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?R1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Wi)(Ol(t.values,l)||Ol(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=w1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...To(e,st.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ef(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Ny(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Wi)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Oi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Oi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Ef(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Wi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Py(n,e){return!n||!n.isValid?Ft.invalid("missing or invalid start"):!e||!e.isValid?Ft.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ft.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Ft.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Ft.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ft.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ft.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Ft.fromDateTimes(t,a.time)),t=null);return Ft.merge(l)}difference(...e){return Ft.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=wo,t={}){return this.isValid?sn.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return Ft.fromDateTimes(e(this.s),e(this.e))}}class Ps{static hasDST(e=Rt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,Rt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||mt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||mt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||mt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||mt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return mt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return mt.create(t,null,"gregory").eras(e)}static features(){return{relative:k1(),localeWeek:y1()}}}function If(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function Fy(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=If(a,f);return(u-u%7)/7}],["days",If]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Ry(n,e,t,i){let[l,s,o,r]=Fy(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?st.fromMillis(a,i).shiftTo(...f).plus(u):u}const qy="missing Intl.DateTimeFormat.formatToParts support";function ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Ok(t))}}const jy=" ",q1=`[ ${jy}]`,j1=new RegExp(q1,"g");function Hy(n){return n.replace(/\./g,"\\.?").replace(j1,q1)}function Af(n){return n.replace(/\./g,"").replace(j1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Hy).join("|")),deser:([t])=>n.findIndex(i=>Af(t)===Af(i))+e}}function Lf(n,e){return{regex:n,deser:([,t,i])=>Yo(t,i),groups:e}}function Fs(n){return{regex:n,deser:([e])=>e}}function zy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vy(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(zy(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ct(f);case"yy":return ct(c,Yr);case"yyyy":return ct(s);case"yyyyy":return ct(d);case"yyyyyy":return ct(o);case"M":return ct(r);case"MM":return ct(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ct(r);case"LL":return ct(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ct(r);case"dd":return ct(i);case"o":return ct(a);case"ooo":return ct(l);case"HH":return ct(i);case"H":return ct(r);case"hh":return ct(i);case"h":return ct(r);case"mm":return ct(i);case"m":return ct(r);case"q":return ct(r);case"qq":return ct(i);case"s":return ct(r);case"ss":return ct(i);case"S":return ct(a);case"SSS":return ct(l);case"u":return Fs(u);case"uu":return Fs(r);case"uuu":return ct(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ct(s);case"kk":return ct(c,Yr);case"W":return ct(r);case"WW":return ct(i);case"E":case"c":return ct(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Lf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Lf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Fs(/[a-z_+-/]{1,256}?/i);case" ":return Fs(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:qy};return _.token=n,_}const By={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Uy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=By[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Wy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Yy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Ol(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Ky(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return Ue(n.z)||(t=pi.create(n.z)),Ue(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),Ue(n.q)||(n.M=(n.q-1)*3+1),Ue(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),Ue(n.u)||(n.S=ya(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let ar=null;function Jy(){return ar||(ar=je.fromMillis(1555555555555)),ar}function Zy(n,e){if(n.literal)return n;const t=sn.macroTokenToFormatOpts(n.val),i=B1(t,e);return i==null||i.includes(void 0)?n:i}function H1(n,e){return Array.prototype.concat(...n.map(t=>Zy(t,e)))}class z1{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=H1(sn.parseFormat(t),e),this.units=this.tokens.map(i=>Vy(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=Wy(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=Yy(e,this.regex,this.handlers),[l,s,o]=i?Ky(i):[null,null,void 0];if(Ol(i,"a")&&Ol(i,"H"))throw new kl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function V1(n,e,t){return new z1(n,t).explainFromTokens(e)}function Gy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=V1(n,e,t);return[i,l,s,o]}function B1(n,e){if(!n)return null;const i=sn.create(e,n).dtFormatter(Jy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Uy(o,n,s))}const fr="Invalid DateTime",Nf=864e13;function Kl(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ur(n){return n.weekData===null&&(n.weekData=So(n.c)),n.weekData}function cr(n){return n.localWeekData===null&&(n.localWeekData=So(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Fi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function U1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Rs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ao(n,e,t){return U1(Wo(n),e,t)}function Pf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,$o(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Wo(s);let[a,f]=U1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function hl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function qs(n,e,t=!0){return n.isValid?sn.create(mt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function dr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Vt(n.c.year,t?6:4),e?(i+="-",i+=Vt(n.c.month),i+="-",i+=Vt(n.c.day)):(i+=Vt(n.c.month),i+=Vt(n.c.day)),i}function Ff(n,e,t,i,l,s){let o=Vt(n.c.hour);return e?(o+=":",o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Vt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Vt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Vt(Math.trunc(-n.o/60)),o+=":",o+=Vt(Math.trunc(-n.o%60))):(o+="+",o+=Vt(Math.trunc(n.o/60)),o+=":",o+=Vt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const W1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Xy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Y1=["year","month","day","hour","minute","second","millisecond"],xy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ev=["year","ordinal","hour","minute","second","millisecond"];function tv(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Kg(n);return e}function Rf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return tv(n)}}function nv(n){return uo[n]||(fo===void 0&&(fo=Rt.now()),uo[n]=n.offset(fo)),uo[n]}function qf(n,e){const t=Si(e.zone,Rt.defaultZone);if(!t.isValid)return je.invalid(Kl(t));const i=mt.fromObject(e);let l,s;if(Ue(n.year))l=Rt.now();else{for(const a of Y1)Ue(n[a])&&(n[a]=W1[a]);const o=g1(n)||b1(n);if(o)return je.invalid(o);const r=nv(t);[l,s]=ao(n,r,t)}return new je({ts:l,zone:t,loc:i,o:s})}function jf(n,e,t){const i=Ue(t.round)?!0:t.round,l=(o,r)=>(o=va(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Hf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let fo,uo={};class je{constructor(e){const t=e.zone||Rt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Kl(t));this.ts=Ue(e.ts)?Rt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=Oi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Rs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||mt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=cn.utcInstance,qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Ak(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,Rt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:mt.fromObject(t)}):je.invalid(Kl(l))}static fromMillis(e,t={}){if(Oi(e))return e<-Nf||e>Nf?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,Rt.defaultZone),loc:mt.fromObject(t)});throw new tn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Oi(e))return new je({ts:e*1e3,zone:Si(t.zone,Rt.defaultZone),loc:mt.fromObject(t)});throw new tn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,Rt.defaultZone);if(!i.isValid)return je.invalid(Kl(i));const l=mt.fromObject(t),s=To(e,Rf),{minDaysInFirstWeek:o,startOfWeek:r}=$f(s,l),a=Rt.now(),f=Ue(t.specificOffset)?i.offset(a):t.specificOffset,u=!Ue(s.ordinal),c=!Ue(s.year),d=!Ue(s.month)||!Ue(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new kl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Rs(a,f);_?(g=xy,y=Xy,S=So(S,o,r)):u?(g=ev,y=Qy,S=rr(S)):(g=Y1,y=W1);let T=!1;for(const R of g){const F=s[R];Ue(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Dk(s,o,r):u?Ek(s):g1(s),C=$||b1(s);if(C)return je.invalid(C);const O=_?wf(s,o,r):u?Sf(s):s,[D,I]=ao(O,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L.isValid?L:je.invalid(L.invalid)}static fromISO(e,t={}){const[i,l]=vy(e);return hl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=wy(e);return hl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=Sy(e);return hl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Gy(o,e,t);return u?je.invalid(u):hl(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=Ey(e);return hl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new nk(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=B1(e,mt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return H1(sn.parseFormat(e),mt.fromObject(t)).map(l=>l.val).join("")}static resetCache(){fo=void 0,uo={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ur(this).weekYear:NaN}get weekNumber(){return this.isValid?ur(this).weekNumber:NaN}get weekday(){return this.isValid?ur(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cr(this).weekday:NaN}get localWeekNumber(){return this.isValid?cr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cr(this).weekYear:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ps.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ps.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ps.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ps.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Wo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Rs(a,o),c=Rs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Fi(this,{ts:a}),Fi(this,{ts:f})]:[this]}get isInLeapYear(){return Ss(this.year)}get daysInMonth(){return $o(this.year,this.month)}get daysInYear(){return this.isValid?wl(this.year):NaN}get weeksInWeekYear(){return this.isValid?as(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?as(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=sn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(Rt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,Rt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ao(o,s,e)}return Fi(this,{ts:l,zone:e})}else return je.invalid(Kl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Fi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=To(e,Rf),{minDaysInFirstWeek:i,startOfWeek:l}=$f(t,this.loc),s=!Ue(t.weekYear)||!Ue(t.weekNumber)||!Ue(t.weekday),o=!Ue(t.ordinal),r=!Ue(t.year),a=!Ue(t.month)||!Ue(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new kl("Can't mix ordinal dates with month/day");let c;s?c=wf({...So(this.c,i,l),...t},i,l):Ue(t.ordinal)?(c={...this.toObject(),...t},Ue(t.day)&&(c.day=Math.min($o(c.year,c.month),c.day))):c=Sf({...rr(this.c),...t});const[d,m]=ao(c,this.o,this.zone);return Fi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Fi(this,Pf(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Fi(this,Pf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Ry(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Ft.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new tn("max requires all arguments be DateTimes");return Tf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return V1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=mt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new z1(s,e)}static fromFormatParser(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new tn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:f,invalidReason:u}=t.explainFromTokens(e);return u?je.invalid(u):hl(r,a,i,`format ${t.format}`,e,f)}static get DATE_SHORT(){return wo}static get DATE_MED(){return Jg}static get DATE_MED_WITH_WEEKDAY(){return sk}static get DATE_FULL(){return Zg}static get DATE_HUGE(){return Gg}static get TIME_SIMPLE(){return Xg}static get TIME_WITH_SECONDS(){return Qg}static get TIME_WITH_SHORT_OFFSET(){return xg}static get TIME_WITH_LONG_OFFSET(){return e1}static get TIME_24_SIMPLE(){return t1}static get TIME_24_WITH_SECONDS(){return n1}static get TIME_24_WITH_SHORT_OFFSET(){return i1}static get TIME_24_WITH_LONG_OFFSET(){return l1}static get DATETIME_SHORT(){return s1}static get DATETIME_SHORT_WITH_SECONDS(){return o1}static get DATETIME_MED(){return r1}static get DATETIME_MED_WITH_SECONDS(){return a1}static get DATETIME_MED_WITH_WEEKDAY(){return ok}static get DATETIME_FULL(){return f1}static get DATETIME_FULL_WITH_SECONDS(){return u1}static get DATETIME_HUGE(){return c1}static get DATETIME_HUGE_WITH_SECONDS(){return d1}}function Hl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Oi(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new tn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const iv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],lv=[".mp4",".avi",".mov",".3gp",".wmv"],sv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ov=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],K1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!iv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!ov.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,f;let s=e.find(u=>u.name==t||u.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const u of s.schema){const c=i+u.name;if(u.type=="relation"&&((r=u.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,u.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=u.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(u.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const u of e){u.schema=u.schema||[];for(const c of u.schema)if(c.type=="relation"&&((f=c.options)==null?void 0:f.collectionId)==s.id){const d=i+u.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,u.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Yo=Cn([]);function $o(n,e=4e3){return Ko(n,"info",e)}function Lt(n,e=3e3){return Ko(n,"success",e)}function ii(n,e=4500){return Ko(n,"error",e)}function nv(n,e=4500){return Ko(n,"warning",e)}function Ko(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{W1(i)},t)};Yo.update(l=>(Sa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function W1(n){Yo.update(e=>(Sa(e,n),e))}function wa(){Yo.update(n=>{for(let e of n)Sa(n,e);return[]})}function Sa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const $a=Cn({});function Ur(n){$a.set(n||{})}const Rn=Cn([]),Yn=Cn({}),To=Cn(!1),Y1=Cn({});let Gl;typeof BroadcastChannel<"u"&&(Gl=new BroadcastChannel("collections"),Gl.onmessage=()=>{var n;J1((n=Cg(Yn))==null?void 0:n.id)});function K1(){Gl==null||Gl.postMessage("reload")}function iv(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function lv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ta(),K1(),j.sortCollections(e)))}function sv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ta(),K1(),e))}async function J1(n=null){To.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ta()}catch(e){ae.error(e)}To.set(!1)}function Ta(){Y1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const cr="pb_admin_file_token";Ho.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Ho.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Ho.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Cg(Y1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||da(t,10))&&(t&&localStorage.removeItem(cr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(cr,t),this._adminFileTokenRequest=null),t};class ov extends Vg{save(e,t){super.save(e,t),t&&!t.collectionId&&Ur(t)}clear(){super.clear(),Ur(null)}}const ao=new Ho("../",new ov("pb_admin_auth"));ao.authStore.model&&!ao.authStore.model.collectionId&&Ur(ao.authStore.model);const ae=ao,rv=n=>({}),qf=n=>({});function av(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],qf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.22",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,rv):Tt(S[2]),qf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function fv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,fv,av,me,{center:0,class:1})}}function jf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function uv(n){let e,t,i,l=!n[0]&&jf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=jf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function cv(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[uv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Z1 extends ge{constructor(e){super(),_e(this,e,dv,cv,me,{nobranding:0})}}function Jo(n){const e=n-1;return e*e*e+1}function rs(n,{delay:e=0,duration:t=400,easing:i=gs}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Jo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=Ga(l),[m,h]=Ga(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Cn([]);function Co(n,e=4e3){return Zo(n,"info",e)}function Lt(n,e=3e3){return Zo(n,"success",e)}function ii(n,e=4500){return Zo(n,"error",e)}function rv(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ca(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ca(e,n),e))}function Ta(){Jo.update(n=>{for(let e of n)Ca(n,e);return[]})}function Ca(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const Oa=Cn({});function Kr(n){Oa.set(n||{})}const Rn=Cn([]),Yn=Cn({}),Oo=Cn(!1),Z1=Cn({});let Ql;typeof BroadcastChannel<"u"&&(Ql=new BroadcastChannel("collections"),Ql.onmessage=()=>{var n;X1((n=Mg(Yn))==null?void 0:n.id)});function G1(){Ql==null||Ql.postMessage("reload")}function av(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function fv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ma(),G1(),j.sortCollections(e)))}function uv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ma(),G1(),e))}async function X1(n=null){Oo.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ma()}catch(e){ae.error(e)}Oo.set(!1)}function Ma(){Z1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const pr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Mg(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ha(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class cv extends Ug{save(e,t){super.save(e,t),t&&!t.collectionId&&Kr(t)}clear(){super.clear(),Kr(null)}}const ae=new Vo("../",new cv("pb_admin_auth"));ae.authStore.model&&!ae.authStore.model.collectionId&&Kr(ae.authStore.model);const dv=n=>({}),zf=n=>({});function pv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],zf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.23",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,dv):Tt(S[2]),zf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function mv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,mv,pv,me,{center:0,class:1})}}function Vf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function hv(n){let e,t,i,l=!n[0]&&Vf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Vf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[hv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,gv,_v,me,{nobranding:0})}}function Go(n){const e=n-1;return e*e*e+1}function fs(n,{delay:e=0,duration:t=400,easing:i=ks}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Go,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=xa(l),[m,h]=xa(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` transform: ${f} translate(${(1-_)*c}${d}, ${(1-_)*m}${h}); - opacity: ${a-u*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Jo,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Wt(n,{delay:e=0,duration:t=400,easing:i=Jo,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` + opacity: ${a-u*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Go,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Wt(n,{delay:e=0,duration:t=400,easing:i=Go,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-f*d}); opacity: ${r-u*d} - `}}let Wr,Fi;const Yr="app-tooltip";function Hf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return Fi=Fi||document.querySelector("."+Yr),Fi||(Fi=document.createElement("div"),Fi.classList.add(Yr),document.body.appendChild(Fi)),Fi}function G1(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Kr();return}t.textContent=e.text,t.className=Yr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Kr(){clearTimeout(Wr),Oi().classList.remove("active"),Oi().activeNode=void 0}function pv(n,e){Oi().activeNode=n,clearTimeout(Wr),Wr=setTimeout(()=>{Oi().classList.add("active"),G1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Hf(e);function i(){pv(n,t)}function l(){Kr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Oi(),{update(s){var o,r;t=Hf(s),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&G1(n,t)},destroy(){var s,o;(o=(s=Oi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Kr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function zf(n,e,t){const i=n.slice();return i[12]=e[t],i}const mv=n=>({}),Vf=n=>({uniqueId:n[4]});function hv(n){let e,t,i=ue(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Bf(n){let e,t,i=Co(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Co(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function gv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Vf),u=[_v,hv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,mv):Tt(m[8]),Vf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Uf="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Uf:n||Uf}function bv(n,e,t){let i;Ue(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,bv,gv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function kv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function yv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function vv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function wv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[kv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[yv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[vv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Sv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class $v extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{})}}function Wf(n){let e,t;return e=new Z1({props:{$$slots:{default:[Tv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Tv(n){let e,t;return e=new $v({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Cv(n){let e,t,i=n[0]&&Wf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Wf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ov(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Mv extends ge{constructor(e){super(),_e(this,e,Ov,Cv,me,{})}}const It=Cn(""),Oo=Cn(""),Xi=Cn(!1);function Dv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Ev(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Yf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Kf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Iv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Ev,Dv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Yf(),g=(n[0].length||n[7].length)&&Kf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Yf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Kf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Av(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-BPeaOUvB.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class $s extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Lv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function Nv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Zo extends ge{constructor(e){super(),_e(this,e,Nv,Lv,me,{tooltip:0,class:1})}}function Pv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function Fv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,Fv,Pv,me,{class:1,name:2,sort:0,disable:3})}}const Rv=n=>({}),Jf=n=>({}),qv=n=>({}),Zf=n=>({});function jv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Zf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Jf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,qv):Tt(_[10]),Zf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Rv):Tt(_[10]),Jf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Hv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Go extends ge{constructor(e){super(),_e(this,e,Hv,jv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function zv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Vv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=U1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class X1 extends ge{constructor(e){super(),_e(this,e,Vv,zv,me,{level:0})}}function Bv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Uv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,Uv,Bv,me,{date:0})}}function Gf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=n2(i[31]);return i[33]=s,i}function Xf(n,e,t){const i=n.slice();return i[36]=e[t],i}function Wv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Yv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Zv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qf(n){let e;function t(s,o){return s[7]?Xv:Gv}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Gv(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&xf(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=xf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Xv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=eu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function e2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Yv:Wv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Kv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[Jv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Zv]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,nu,null,Gf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=Qf(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function lu(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function t2(n){let e,t,i,l,s;e=new Go({props:{class:"table-wrapper",$$slots:{default:[e2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&iu(n),r=n[5]&&lu(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=iu(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=lu(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const su=50,dr=/[-:\. ]/gi;function n2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function i2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,su,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(dr,"")+".json");const Y=U[0].created.replaceAll(dr,""),ie=U[U.length-1].created.replaceAll(dr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=su),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class l2 extends ge{constructor(e){super(),_e(this,e,i2,t2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! + `}}let Jr,Ri;const Zr="app-tooltip";function Bf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Mi(){return Ri=Ri||document.querySelector("."+Zr),Ri||(Ri=document.createElement("div"),Ri.classList.add(Zr),document.body.appendChild(Ri)),Ri}function x1(n,e){let t=Mi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Gr();return}t.textContent=e.text,t.className=Zr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Gr(){clearTimeout(Jr),Mi().classList.remove("active"),Mi().activeNode=void 0}function bv(n,e){Mi().activeNode=n,clearTimeout(Jr),Jr=setTimeout(()=>{Mi().classList.add("active"),x1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Bf(e);function i(){bv(n,t)}function l(){Gr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Mi(),{update(s){var o,r;t=Bf(s),(r=(o=Mi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&x1(n,t)},destroy(){var s,o;(o=(s=Mi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Gr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Uf(n,e,t){const i=n.slice();return i[12]=e[t],i}const kv=n=>({}),Wf=n=>({uniqueId:n[4]});function yv(n){let e,t,i=ue(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Yf(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Mo(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function wv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Wf),u=[vv,yv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,kv):Tt(m[8]),Wf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Kf="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Kf:n||Kf}function Sv(n,e,t){let i;We(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Tv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[Tv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Cv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Mv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class Dv extends ge{constructor(e){super(),_e(this,e,Mv,Ov,me,{})}}function Jf(n){let e,t;return e=new Q1({props:{$$slots:{default:[Ev]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ev(n){let e,t;return e=new Dv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Jf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Jf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Av(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Lv extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{})}}const It=Cn(""),Do=Cn(""),Xi=Cn(!1);function Nv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Pv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Zf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Gf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Fv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Pv,Nv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zf(),g=(n[0].length||n[7].length)&&Gf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Zf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Gf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Rv(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CFHe_5bb.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class Cs extends ge{constructor(e){super(),_e(this,e,Rv,Fv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function qv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function jv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Xo extends ge{constructor(e){super(),_e(this,e,jv,qv,me,{tooltip:0,class:1})}}function Hv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function zv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,zv,Hv,me,{class:1,name:2,sort:0,disable:3})}}const Vv=n=>({}),Xf=n=>({}),Bv=n=>({}),Qf=n=>({});function Uv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Qf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Xf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,Bv):Tt(_[10]),Qf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Vv):Tt(_[10]),Xf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Wv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Qo extends ge{constructor(e){super(),_e(this,e,Wv,Uv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Yv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Kv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=K1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class eb extends ge{constructor(e){super(),_e(this,e,Kv,Yv,me,{level:0})}}function Jv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Zv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class tb extends ge{constructor(e){super(),_e(this,e,Zv,Jv,me,{date:0})}}function xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=r2(i[31]);return i[33]=s,i}function eu(n,e,t){const i=n.slice();return i[36]=e[t],i}function Gv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Xv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tu(n){let e;function t(s,o){return s[7]?n2:t2}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function t2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&nu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function n2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function iu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=iu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function s2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Xv:Gv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Qv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,su,null,xf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=tu(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function ru(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function o2(n){let e,t,i,l,s;e=new Qo({props:{class:"table-wrapper",$$slots:{default:[s2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ou(n),r=n[5]&&ru(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=ou(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=ru(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const au=50,mr=/[-:\. ]/gi;function r2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function a2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,au,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(mr,"")+".json");const Y=U[0].created.replaceAll(mr,""),ie=U[U.length-1].created.replaceAll(mr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=au),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class f2 extends ge{constructor(e){super(),_e(this,e,a2,o2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function Ts(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Yl(n){return $i(Ts(n*2.55),0,255)}function Mi(n){return $i(Ts(n*255),0,255)}function ui(n){return $i(Ts(n/2.55)/100,0,1)}function ou(n){return $i(Ts(n*100),0,100)}const En={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"],s2=n=>Jr[n&15],o2=n=>Jr[(n&240)>>4]+Jr[n&15],qs=n=>(n&240)>>4===(n&15),r2=n=>qs(n.r)&&qs(n.g)&&qs(n.b)&&qs(n.a);function a2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const f2=(n,e)=>n<255?e(n):"";function u2(n){var e=r2(n)?s2:o2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+f2(n.a,e):void 0}const c2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x1(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function d2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function p2(n,e,t){const i=x1(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function m2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?u/(2-s-o):u/(s+o),a=m2(t,i,l,u,s),a=a*60+.5),[a|0,f||0,r]}function Oa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Mi)}function Ma(n,e,t){return Oa(x1,n,e,t)}function h2(n,e,t){return Oa(p2,n,e,t)}function _2(n,e,t){return Oa(d2,n,e,t)}function eb(n){return(n%360+360)%360}function g2(n){const e=c2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Yl(+e[5]):Mi(+e[5]));const l=eb(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=h2(l,s,o):e[1]==="hsv"?i=_2(l,s,o):i=Ma(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function b2(n,e){var t=Ca(n);t[0]=eb(t[0]+e),t=Ma(t),n.r=t[0],n.g=t[1],n.b=t[2]}function k2(n){if(!n)return;const e=Ca(n),t=e[0],i=ou(e[1]),l=ou(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const ru={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"},au={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 y2(){const n={},e=Object.keys(au),t=Object.keys(ru);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let js;function v2(n){js||(js=y2(),js.transparent=[0,0,0,0]);const e=js[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const w2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function S2(n){const e=w2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Yl(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Yl(i):$i(i,0,255)),l=255&(e[4]?Yl(l):$i(l,0,255)),s=255&(e[6]?Yl(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function $2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ui(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function T2(n,e,t){const i=hl(ui(n.r)),l=hl(ui(n.g)),s=hl(ui(n.b));return{r:Mi(pr(i+t*(hl(ui(e.r))-i))),g:Mi(pr(l+t*(hl(ui(e.g))-l))),b:Mi(pr(s+t*(hl(ui(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Hs(n,e,t){if(n){let i=Ca(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ma(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function tb(n,e){return n&&Object.assign(e||{},n)}function fu(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Mi(n[3]))):(e=tb(n,{r:0,g:0,b:0,a:1}),e.a=Mi(e.a)),e}function C2(n){return n.charAt(0)==="r"?S2(n):g2(n)}class as{constructor(e){if(e instanceof as)return e;const t=typeof e;let i;t==="object"?i=fu(e):t==="string"&&(i=a2(e)||v2(e)||C2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=tb(this._rgb);return e&&(e.a=ui(e.a)),e}set rgb(e){this._rgb=fu(e)}rgbString(){return this._valid?$2(this._rgb):void 0}hexString(){return this._valid?u2(this._rgb):void 0}hslString(){return this._valid?k2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,f=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-f,i.r=255&f*i.r+s*l.r+.5,i.g=255&f*i.g+s*l.g+.5,i.b=255&f*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=T2(this._rgb,e._rgb,t)),this}clone(){return new as(this.rgb)}alpha(e){return this._rgb.a=Mi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Ts(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Hs(this._rgb,2,e),this}darken(e){return Hs(this._rgb,2,-e),this}saturate(e){return Hs(this._rgb,1,e),this}desaturate(e){return Hs(this._rgb,1,-e),this}rotate(e){return b2(this._rgb,e),this}}/*! - * Chart.js v4.4.3 + */function Os(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Jl(n){return $i(Os(n*2.55),0,255)}function Di(n){return $i(Os(n*255),0,255)}function ui(n){return $i(Os(n/2.55)/100,0,1)}function fu(n){return $i(Os(n*100),0,100)}const En={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},Xr=[..."0123456789ABCDEF"],u2=n=>Xr[n&15],c2=n=>Xr[(n&240)>>4]+Xr[n&15],js=n=>(n&240)>>4===(n&15),d2=n=>js(n.r)&&js(n.g)&&js(n.b)&&js(n.a);function p2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const m2=(n,e)=>n<255?e(n):"";function h2(n){var e=d2(n)?u2:c2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+m2(n.a,e):void 0}const _2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function nb(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function g2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function b2(n,e,t){const i=nb(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function k2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?u/(2-s-o):u/(s+o),a=k2(t,i,l,u,s),a=a*60+.5),[a|0,f||0,r]}function Ea(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Di)}function Ia(n,e,t){return Ea(nb,n,e,t)}function y2(n,e,t){return Ea(b2,n,e,t)}function v2(n,e,t){return Ea(g2,n,e,t)}function ib(n){return(n%360+360)%360}function w2(n){const e=_2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Jl(+e[5]):Di(+e[5]));const l=ib(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=y2(l,s,o):e[1]==="hsv"?i=v2(l,s,o):i=Ia(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function S2(n,e){var t=Da(n);t[0]=ib(t[0]+e),t=Ia(t),n.r=t[0],n.g=t[1],n.b=t[2]}function $2(n){if(!n)return;const e=Da(n),t=e[0],i=fu(e[1]),l=fu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const uu={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"},cu={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 T2(){const n={},e=Object.keys(cu),t=Object.keys(uu);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let Hs;function C2(n){Hs||(Hs=T2(),Hs.transparent=[0,0,0,0]);const e=Hs[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const O2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function M2(n){const e=O2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Jl(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Jl(i):$i(i,0,255)),l=255&(e[4]?Jl(l):$i(l,0,255)),s=255&(e[6]?Jl(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function D2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ui(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const hr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,_l=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function E2(n,e,t){const i=_l(ui(n.r)),l=_l(ui(n.g)),s=_l(ui(n.b));return{r:Di(hr(i+t*(_l(ui(e.r))-i))),g:Di(hr(l+t*(_l(ui(e.g))-l))),b:Di(hr(s+t*(_l(ui(e.b))-s))),a:n.a+t*(e.a-n.a)}}function zs(n,e,t){if(n){let i=Da(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ia(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function lb(n,e){return n&&Object.assign(e||{},n)}function du(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Di(n[3]))):(e=lb(n,{r:0,g:0,b:0,a:1}),e.a=Di(e.a)),e}function I2(n){return n.charAt(0)==="r"?M2(n):w2(n)}class us{constructor(e){if(e instanceof us)return e;const t=typeof e;let i;t==="object"?i=du(e):t==="string"&&(i=p2(e)||C2(e)||I2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=lb(this._rgb);return e&&(e.a=ui(e.a)),e}set rgb(e){this._rgb=du(e)}rgbString(){return this._valid?D2(this._rgb):void 0}hexString(){return this._valid?h2(this._rgb):void 0}hslString(){return this._valid?$2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,f=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-f,i.r=255&f*i.r+s*l.r+.5,i.g=255&f*i.g+s*l.g+.5,i.b=255&f*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=E2(this._rgb,e._rgb,t)),this}clone(){return new us(this.rgb)}alpha(e){return this._rgb.a=Di(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Os(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return zs(this._rgb,2,e),this}darken(e){return zs(this._rgb,2,-e),this}saturate(e){return zs(this._rgb,1,e),this}desaturate(e){return zs(this._rgb,1,-e),this}rotate(e){return S2(this._rgb,e),this}}/*! + * Chart.js v4.4.6 * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function ri(){}const O2=(()=>{let n=0;return()=>n++})();function jt(n){return n===null||typeof n>"u"}function Xt(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 nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function on(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Zn(n,e){return on(n)?n:e}function vt(n,e){return typeof n>"u"?e:n}const M2=(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 _t(n,e,t,i){let l,s,o;if(Xt(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function I2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function A2(n){const e=I2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Eo(n,e){return(uu[e]||(uu[e]=A2(e)))(n)}function Da(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Io=n=>typeof n<"u",Di=n=>typeof n=="function",cu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function L2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const sn=Math.PI,ti=2*sn,N2=ti+sn,Ao=Number.POSITIVE_INFINITY,P2=sn/180,Vn=sn/2,Ri=sn/4,du=sn*2/3,Zr=Math.log10,Cl=Math.sign;function Ql(n,e,t){return Math.abs(n-e)l-s).pop(),e}function us(n){return!isNaN(parseFloat(n))&&isFinite(n)}function R2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function q2(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ea(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Yi=(n,e,t,i)=>Ea(n,t,i?l=>{const s=n[l][e];return sn[l][e]Ea(n,t,i=>n[i][e]>=t);function U2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Da(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function hu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(sb.forEach(s=>{delete n[s]}),delete n._chartjs)}function Y2(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const ob=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function rb(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,ob.call(window,()=>{i=!1,n.apply(e,t)}))}}function K2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const J2=n=>n==="start"?"left":n==="end"?"right":"center",_u=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Z2(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=Bn(Math.min(Yi(r,a,f).lo,t?i:Yi(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?s=Bn(Math.max(Yi(r,o.axis,u,!0).hi+1,t?0:Yi(e,a,o.getPixelForValue(u),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function G2(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const zs=n=>n===0||n===1,gu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ti/t)),bu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ti/t)+1,xl={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*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(sn*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>zs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>zs(n)?n:gu(n,.075,.3),easeOutElastic:n=>zs(n)?n:bu(n,.075,.3),easeInOutElastic(n){return zs(n)?n:n<.5?.5*gu(n*2,.1125,.45):.5+.5*bu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-xl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?xl.easeInBounce(n*2)*.5:xl.easeOutBounce(n*2-1)*.5+.5};function Ia(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function ku(n){return Ia(n)?n:new as(n)}function mr(n){return Ia(n)?n:new as(n).saturate(.5).darken(.1).hexString()}const X2=["x","y","borderWidth","radius","tension"],Q2=["color","borderColor","backgroundColor"];function x2(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:Q2},numbers:{type:"number",properties:X2}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function ew(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const yu=new Map;function tw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=yu.get(t);return i||(i=new Intl.NumberFormat(n,e),yu.set(t,i)),i}function ab(n,e,t){return tw(e,t).format(n)}const fb={values(n){return Xt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(l="scientific"),s=nw(n,t)}const o=Zr(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),ab(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Zr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?fb.numeric.call(this,n,e,t):""}};function nw(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var ub={formatters:fb};function iw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ub.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Qi=Object.create(null),Xr=Object.create(null);function es(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>mr(l.backgroundColor),this.hoverBorderColor=(i,l)=>mr(l.borderColor),this.hoverColor=(i,l)=>mr(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return hr(this,e,t)}get(e){return es(this,e)}describe(e,t){return hr(Xr,e,t)}override(e,t){return hr(Qi,e,t)}route(e,t,i,l){const s=es(this,e),o=es(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[l];return nt(a)?Object.assign({},f,a):vt(a,f)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Ut=new lw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[x2,ew,iw]);function sw(n){return!n||jt(n.size)||jt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function vu(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function qi(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function wu(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Qr(n,e,t,i){ow(n,e,t,i)}function ow(n,e,t,i,l){let s,o,r,a,f,u,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*P2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,ti),n.closePath();break;case"triangle":u=_,n.moveTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=du,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=du,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":f=_*.516,a=_-f,o=Math.cos(g+Ri)*a,c=Math.cos(g+Ri)*a,r=Math.sin(g+Ri)*a,d=Math.sin(g+Ri)*a,n.arc(t-c,i-r,f,g-sn,g-Vn),n.arc(t+d,i-o,f,g-Vn,g),n.arc(t+c,i+r,f,g,g+Vn),n.arc(t-d,i+o,f,g+Vn,g+sn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,u=a,n.rect(t-u,i-a,2*u,2*a);break}g+=Ri;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=Ri;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=Ri,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function cs(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,f;for(n.save(),n.font=l.string,fw(n,s),a=0;a+n||0;function cb(n,e){const t={},i=nt(e),l=i?Object.keys(e):e,s=nt(n)?i?o=>vt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=hw(s(o));return t}function _w(n){return cb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function fo(n){return cb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ei(n){const e=_w(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ei(n,e){n=n||{},e=e||Ut.font;let t=vt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=vt(n.style,e.style);i&&!(""+i).match(pw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:vt(n.family,e.family),lineHeight:mw(vt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:vt(n.weight,e.weight),string:""};return l.string=sw(l),l}function Vs(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function ll(n,e){return Object.assign(Object.create(n),e)}function Na(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=hb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Na([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return pb(r,a,()=>Tw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Cu(r).includes(a)},ownKeys(r){return Cu(r)},set(r,a,f){const u=r._storage||(r._storage=l());return r[a]=u[a]=f,delete r._keys,!0}})}function Ol(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:db(n,i),setContext:s=>Ol(n,s,t,i),override:s=>Ol(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return pb(s,o,()=>kw(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function db(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Di(t)?t:()=>t,isIndexable:Di(i)?i:()=>i}}const bw=(n,e)=>n?n+Da(e):e,Pa=(n,e)=>nt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function pb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function kw(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Di(r)&&o.isScriptable(e)&&(r=yw(e,r,n,t)),Xt(r)&&r.length&&(r=vw(e,r,n,o.isIndexable)),Pa(e,r)&&(r=Ol(r,l,s&&s[e],o)),r}function yw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Pa(n,a)&&(a=Fa(l._scopes,l,n,a)),a}function vw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(nt(e[0])){const a=e,f=l._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=Fa(f,l,n,u);e.push(Ol(c,s,o&&o[n],r))}}return e}function mb(n,e,t){return Di(n)?n(e,t):n}const ww=(n,e)=>n===!0?e:typeof n=="string"?Eo(e,n):void 0;function Sw(n,e,t,i,l){for(const s of e){const o=ww(t,s);if(o){n.add(o);const r=mb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Fa(n,e,t,i){const l=e._rootScopes,s=mb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Tu(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Tu(r,o,s,a,i),a===null)?!1:Na(Array.from(r),[""],l,s,()=>$w(e,t,i))}function Tu(n,e,t,i,l){for(;t;)t=Sw(n,e,t,i,l);return t}function $w(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Xt(l)&&nt(t)?t:l||{}}function Tw(n,e,t,i){let l;for(const s of e)if(l=hb(bw(s,n),t),typeof l<"u")return Pa(n,l)?Fa(t,i,n,l):l}function hb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Cu(n){let e=n._keys;return e||(e=n._keys=Cw(n._scopes)),e}function Cw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const Ow=Number.EPSILON||1e-14,Ml=(n,e)=>en==="x"?"y":"x";function Mw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Gr(s,l),a=Gr(o,s);let f=r/(r+a),u=a/(r+a);f=isNaN(f)?0:f,u=isNaN(u)?0:u;const c=i*f,d=i*u;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Dw(n,e,t){const i=n.length;let l,s,o,r,a,f=Ml(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")Iw(n,l);else{let f=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function Nw(n,e){return Xo(n).getPropertyValue(e)}const Pw=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Pw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Rw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Fw(l,s,n.target))r=l,a=s;else{const f=e.getBoundingClientRect();r=i.clientX-f.left,a=i.clientY-f.top,o=!0}return{x:r,y:a,box:o}}function zi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=Xo(t),s=l.boxSizing==="border-box",o=Zi(l,"padding"),r=Zi(l,"border","width"),{x:a,y:f,box:u}=Rw(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/h*t.height/i)}}function qw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&qa(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=Xo(s),a=Zi(r,"border","width"),f=Zi(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Lo(r.maxWidth,s,"clientWidth"),l=Lo(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Ao,maxHeight:l||Ao}}const Us=n=>Math.round(n*10)/10;function jw(n,e,t,i){const l=Xo(n),s=Zi(l,"margin"),o=Lo(l.maxWidth,n,"clientWidth")||Ao,r=Lo(l.maxHeight,n,"clientHeight")||Ao,a=qw(n,e,t);let{width:f,height:u}=a;if(l.boxSizing==="content-box"){const d=Zi(l,"border","width"),m=Zi(l,"padding");f-=m.width+d.width,u-=m.height+d.height}return f=Math.max(0,f-s.width),u=Math.max(0,i?f/i:u-s.height),f=Us(Math.min(f,o,a.maxWidth)),u=Us(Math.min(u,r,a.maxHeight)),f&&!u&&(u=Us(f/2)),(e!==void 0||t!==void 0)&&i&&a.height&&u>a.height&&(u=a.height,f=Us(Math.floor(u*i))),{width:f,height:u}}function Ou(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Hw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ra()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Mu(n,e){const t=Nw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function zw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Vw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Vi(n,l,t),r=Vi(l,s,t),a=Vi(s,e,t),f=Vi(o,r,t),u=Vi(r,a,t);return Vi(f,u,t)}const Bw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Uw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function _r(n,e,t){return n?Bw(e,t):Uw()}function Ww(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Yw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function gb(n){return n==="angle"?{between:ib,compare:z2,normalize:Qn}:{between:lb,compare:(e,t)=>e-t,normalize:e=>e}}function Du({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Kw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=gb(i),a=e.length;let{start:f,end:u,loop:c}=n,d,m;if(c){for(f+=a,u+=a,d=0,m=a;da(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),O=()=>_||$(),D=()=>!_||C();for(let I=u,L=u;I<=c;++I)S=e[I%o],!S.skip&&(y=f(S[i]),y!==T&&(_=a(y,l,s),g===null&&O()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Du({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Du({start:g,end:c,loop:d,count:o,style:m})),h}function kb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function Zw(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%l];f.skip||f.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function Gw(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=Jw(t,l,s,i);if(i===!0)return Eu(n,[{start:o,end:r,loop:s}],t,e);const a=r{let n=0;return()=>n++})();function jt(n){return n===null||typeof n>"u"}function Xt(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 nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function rn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Zn(n,e){return rn(n)?n:e}function vt(n,e){return typeof n>"u"?e:n}const L2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let l,s,o;if(Xt(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function F2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function R2(n){const e=F2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ao(n,e){return(pu[e]||(pu[e]=R2(e)))(n)}function Aa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Lo=n=>typeof n<"u",Ei=n=>typeof n=="function",mu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function q2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const on=Math.PI,ti=2*on,j2=ti+on,No=Number.POSITIVE_INFINITY,H2=on/180,Vn=on/2,qi=on/4,hu=on*2/3,Qr=Math.log10,Ml=Math.sign;function es(n,e,t){return Math.abs(n-e)l-s).pop(),e}function ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function V2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function B2(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Ki=(n,e,t,i)=>La(n,t,i?l=>{const s=n[l][e];return sn[l][e]La(n,t,i=>n[i][e]>=t);function Z2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Aa(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function bu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(ab.forEach(s=>{delete n[s]}),delete n._chartjs)}function X2(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const fb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ub(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,fb.call(window,()=>{i=!1,n.apply(e,t)}))}}function Q2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const x2=n=>n==="start"?"left":n==="end"?"right":"center",ku=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ew(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=Bn(Math.min(Ki(r,a,f).lo,t?i:Ki(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?s=Bn(Math.max(Ki(r,o.axis,u,!0).hi+1,t?0:Ki(e,a,o.getPixelForValue(u),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function tw(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Vs=n=>n===0||n===1,yu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ti/t)),vu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ti/t)+1,ts={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*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(on*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Vs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Vs(n)?n:yu(n,.075,.3),easeOutElastic:n=>Vs(n)?n:vu(n,.075,.3),easeInOutElastic(n){return Vs(n)?n:n<.5?.5*yu(n*2,.1125,.45):.5+.5*vu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-ts.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ts.easeInBounce(n*2)*.5:ts.easeOutBounce(n*2-1)*.5+.5};function Na(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wu(n){return Na(n)?n:new us(n)}function _r(n){return Na(n)?n:new us(n).saturate(.5).darken(.1).hexString()}const nw=["x","y","borderWidth","radius","tension"],iw=["color","borderColor","backgroundColor"];function lw(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:iw},numbers:{type:"number",properties:nw}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function sw(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Su=new Map;function ow(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Su.get(t);return i||(i=new Intl.NumberFormat(n,e),Su.set(t,i)),i}function cb(n,e,t){return ow(e,t).format(n)}const db={values(n){return Xt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(l="scientific"),s=rw(n,t)}const o=Qr(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),cb(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Qr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?db.numeric.call(this,n,e,t):""}};function rw(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var pb={formatters:db};function aw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:pb.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Qi=Object.create(null),ea=Object.create(null);function ns(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>_r(l.backgroundColor),this.hoverBorderColor=(i,l)=>_r(l.borderColor),this.hoverColor=(i,l)=>_r(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return gr(this,e,t)}get(e){return ns(this,e)}describe(e,t){return gr(ea,e,t)}override(e,t){return gr(Qi,e,t)}route(e,t,i,l){const s=ns(this,e),o=ns(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[l];return nt(a)?Object.assign({},f,a):vt(a,f)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Ut=new fw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lw,sw,aw]);function uw(n){return!n||jt(n.size)||jt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function $u(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function ji(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Tu(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function ta(n,e,t,i){cw(n,e,t,i)}function cw(n,e,t,i,l){let s,o,r,a,f,u,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*H2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,ti),n.closePath();break;case"triangle":u=_,n.moveTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=hu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=hu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":f=_*.516,a=_-f,o=Math.cos(g+qi)*a,c=Math.cos(g+qi)*a,r=Math.sin(g+qi)*a,d=Math.sin(g+qi)*a,n.arc(t-c,i-r,f,g-on,g-Vn),n.arc(t+d,i-o,f,g-Vn,g),n.arc(t+c,i+r,f,g,g+Vn),n.arc(t-d,i+o,f,g+Vn,g+on),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,u=a,n.rect(t-u,i-a,2*u,2*a);break}g+=qi;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=qi;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=qi,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ps(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,f;for(n.save(),n.font=l.string,mw(n,s),a=0;a+n||0;function mb(n,e){const t={},i=nt(e),l=i?Object.keys(e):e,s=nt(n)?i?o=>vt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=yw(s(o));return t}function vw(n){return mb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function co(n){return mb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ii(n){const e=vw(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ei(n,e){n=n||{},e=e||Ut.font;let t=vt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=vt(n.style,e.style);i&&!(""+i).match(bw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:vt(n.family,e.family),lineHeight:kw(vt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:vt(n.weight,e.weight),string:""};return l.string=uw(l),l}function Bs(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function ll(n,e){return Object.assign(Object.create(n),e)}function Ra(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=bb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Ra([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return _b(r,a,()=>Ew(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Du(r).includes(a)},ownKeys(r){return Du(r)},set(r,a,f){const u=r._storage||(r._storage=l());return r[a]=u[a]=f,delete r._keys,!0}})}function Dl(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:hb(n,i),setContext:s=>Dl(n,s,t,i),override:s=>Dl(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return _b(s,o,()=>$w(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function hb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Ei(t)?t:()=>t,isIndexable:Ei(i)?i:()=>i}}const Sw=(n,e)=>n?n+Aa(e):e,qa=(n,e)=>nt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _b(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function $w(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Ei(r)&&o.isScriptable(e)&&(r=Tw(e,r,n,t)),Xt(r)&&r.length&&(r=Cw(e,r,n,o.isIndexable)),qa(e,r)&&(r=Dl(r,l,s&&s[e],o)),r}function Tw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),qa(n,a)&&(a=ja(l._scopes,l,n,a)),a}function Cw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(nt(e[0])){const a=e,f=l._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=ja(f,l,n,u);e.push(Dl(c,s,o&&o[n],r))}}return e}function gb(n,e,t){return Ei(n)?n(e,t):n}const Ow=(n,e)=>n===!0?e:typeof n=="string"?Ao(e,n):void 0;function Mw(n,e,t,i,l){for(const s of e){const o=Ow(t,s);if(o){n.add(o);const r=gb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function ja(n,e,t,i){const l=e._rootScopes,s=gb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Mu(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Mu(r,o,s,a,i),a===null)?!1:Ra(Array.from(r),[""],l,s,()=>Dw(e,t,i))}function Mu(n,e,t,i,l){for(;t;)t=Mw(n,e,t,i,l);return t}function Dw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Xt(l)&&nt(t)?t:l||{}}function Ew(n,e,t,i){let l;for(const s of e)if(l=bb(Sw(s,n),t),typeof l<"u")return qa(n,l)?ja(t,i,n,l):l}function bb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Du(n){let e=n._keys;return e||(e=n._keys=Iw(n._scopes)),e}function Iw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const Aw=Number.EPSILON||1e-14,El=(n,e)=>en==="x"?"y":"x";function Lw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=xr(s,l),a=xr(o,s);let f=r/(r+a),u=a/(r+a);f=isNaN(f)?0:f,u=isNaN(u)?0:u;const c=i*f,d=i*u;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Nw(n,e,t){const i=n.length;let l,s,o,r,a,f=El(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")Fw(n,l);else{let f=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function jw(n,e){return xo(n).getPropertyValue(e)}const Hw=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Hw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Vw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(zw(l,s,n.target))r=l,a=s;else{const f=e.getBoundingClientRect();r=i.clientX-f.left,a=i.clientY-f.top,o=!0}return{x:r,y:a,box:o}}function Vi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=xo(t),s=l.boxSizing==="border-box",o=Zi(l,"padding"),r=Zi(l,"border","width"),{x:a,y:f,box:u}=Vw(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/h*t.height/i)}}function Bw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&za(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=xo(s),a=Zi(r,"border","width"),f=Zi(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Po(r.maxWidth,s,"clientWidth"),l=Po(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||No,maxHeight:l||No}}const Ws=n=>Math.round(n*10)/10;function Uw(n,e,t,i){const l=xo(n),s=Zi(l,"margin"),o=Po(l.maxWidth,n,"clientWidth")||No,r=Po(l.maxHeight,n,"clientHeight")||No,a=Bw(n,e,t);let{width:f,height:u}=a;if(l.boxSizing==="content-box"){const d=Zi(l,"border","width"),m=Zi(l,"padding");f-=m.width+d.width,u-=m.height+d.height}return f=Math.max(0,f-s.width),u=Math.max(0,i?f/i:u-s.height),f=Ws(Math.min(f,o,a.maxWidth)),u=Ws(Math.min(u,r,a.maxHeight)),f&&!u&&(u=Ws(f/2)),(e!==void 0||t!==void 0)&&i&&a.height&&u>a.height&&(u=a.height,f=Ws(Math.floor(u*i))),{width:f,height:u}}function Eu(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ww=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ha()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Iu(n,e){const t=jw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Yw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Kw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Bi(n,l,t),r=Bi(l,s,t),a=Bi(s,e,t),f=Bi(o,r,t),u=Bi(r,a,t);return Bi(f,u,t)}const Jw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Zw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function br(n,e,t){return n?Jw(e,t):Zw()}function Gw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Xw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function yb(n){return n==="angle"?{between:ob,compare:Y2,normalize:Qn}:{between:rb,compare:(e,t)=>e-t,normalize:e=>e}}function Au({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Qw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=yb(i),a=e.length;let{start:f,end:u,loop:c}=n,d,m;if(c){for(f+=a,u+=a,d=0,m=a;da(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),O=()=>_||$(),D=()=>!_||C();for(let I=u,L=u;I<=c;++I)S=e[I%o],!S.skip&&(y=f(S[i]),y!==T&&(_=a(y,l,s),g===null&&O()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Au({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Au({start:g,end:c,loop:d,count:o,style:m})),h}function wb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function e3(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%l];f.skip||f.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function t3(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=xw(t,l,s,i);if(i===!0)return Lu(n,[{start:o,end:r,loop:s}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ob.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new xw;const Au="transparent",e3={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=ku(n||Au),l=i.valid&&ku(e||Au);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class t3{constructor(e,t,i,l){const s=t[i];l=Vs([e.to,l,s,e.from]);const o=Vs([e.from,s,l]);this._active=!0,this._fn=e.fn||e3[e.type||typeof o],this._easing=xl[e.easing]||xl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Vs([e.to,t,l,e.from]),this._from=Vs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!nt(s))return;const o={};for(const r of t)o[r]=s[r];(Xt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=i3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&n3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new t3(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function n3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function Ru(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,f=o.axis,u=r3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function u3(n,e){return ll(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function c3(n,e,t){return ll(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Hl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const br=n=>n==="reset"||n==="none",qu=(n,e)=>e?n:Object.assign({},n),d3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:vb(t,!0),values:null};class ts{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Pu(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Hl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=vt(i.xAxisID,gr(e,"x")),o=t.yAxisID=vt(i.yAxisID,gr(e,"y")),r=t.rAxisID=vt(i.rAxisID,gr(e,"r")),a=t.indexAxis,f=t.iAxisID=l(a,s,o,r),u=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&hu(this._data,this),e._stacked&&Hl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(nt(t)){const l=this._cachedMeta;this._data=o3(t,l)}else if(i!==t){if(i){hu(i,this);const l=this._cachedMeta;Hl(l),l._parsed=[]}t&&Object.isExtensible(t)&&W2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=Pu(t.vScale,t),t.stack!==i.stack&&(l=!0,Hl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&Ru(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Xt(l[e])?d=this.parseArrayData(i,l,e,t):nt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||f&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=f.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(qu(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const u=this.chart.config,c=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),c);a=u.createResolver(d,this.getContext(e,i,t))}const f=new yb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||br(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){br(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!br(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,f]of this._syncList)this[r](a,f);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let C=0;C=S){D.skip=!0;continue}const I=this.getParsed(C),L=jt(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=f.data[C]),c&&(D.options=u||this.resolveDataElementOptions(C,O.active?"active":l)),y||this.updateElement(O,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ze(uo,"id","line"),Ze(uo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ze(uo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ja{constructor(e){Ze(this,"options");this.options=e||{}}static override(e){Object.assign(ja.prototype,e)}init(){}formats(){return ji()}parse(){return ji()}format(){return ji()}add(){return ji()}diff(){return ji()}startOf(){return ji()}endOf(){return ji()}}var wb={_date:ja};function p3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?B2:Yi;if(i){if(l._sharedOptions){const f=s[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(s,e,t-u),d=a(s,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function Cs(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o](e[t],l)&&(s.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var g3={evaluateInteractionItems:Cs,modes:{index(n,e,t,i){const l=zi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?kr(n,l,s,i,o):yr(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const u=r[0].index,c=f.data[u];c&&!c.skip&&a.push({element:c,datasetIndex:f.index,index:u})}),a):[]},dataset(n,e,t,i){const l=zi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?kr(n,l,s,i,o):yr(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,f=n.getDatasetMeta(a).data;r=[];for(let u=0;ut.pos===e)}function Hu(n,e){return n.filter(t=>Sb.indexOf(t.pos)===-1&&t.box.axis===e)}function Vl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function b3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Vl(zl(e,"left"),!0),l=Vl(zl(e,"right")),s=Vl(zl(e,"top"),!0),o=Vl(zl(e,"bottom")),r=Hu(e,"x"),a=Hu(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:zl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function zu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function $b(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function w3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!nt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&$b(o,s.getPadding());const r=Math.max(0,e.outerWidth-zu(o,n,"left","right")),a=Math.max(0,e.outerHeight-zu(o,n,"top","bottom")),f=r!==n.w,u=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:f,other:u}:{same:u,other:f}}function S3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function $3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Kl(n,e,t,i){const l=[];let s,o,r,a,f,u;for(s=0,o=n.length,f=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},l);$b(d,Ei(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=y3(a.concat(f),c);Kl(r.fullSize,m,c,h),Kl(a,m,c,h),Kl(f,m,c,h)&&Kl(a,m,c,h),S3(m),Vu(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Vu(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Tb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class T3 extends Tb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",C3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bu=n=>n===null||n==="";function O3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[co]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Bu(l)){const s=Mu(n,"width");s!==void 0&&(n.width=s)}if(Bu(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Mu(n,"height");s!==void 0&&(n.height=s)}return n}const Cb=Hw?{passive:!0}:!1;function M3(n,e,t){n&&n.addEventListener(e,t,Cb)}function D3(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Cb)}function E3(n,e){const t=C3[n.type]||n.type,{x:i,y:l}=zi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function No(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function I3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||No(r.addedNodes,i),o=o&&!No(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function A3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||No(r.removedNodes,i),o=o&&!No(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const ds=new Map;let Uu=0;function Ob(){const n=window.devicePixelRatio;n!==Uu&&(Uu=n,ds.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function L3(n,e){ds.size||window.addEventListener("resize",Ob),ds.set(n,e)}function N3(n){ds.delete(n),ds.size||window.removeEventListener("resize",Ob)}function P3(n,e,t){const i=n.canvas,l=i&&qa(i);if(!l)return;const s=rb((r,a)=>{const f=l.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||s(f,u)});return o.observe(l),L3(n,s),o}function vr(n,e,t){t&&t.disconnect(),e==="resize"&&N3(n)}function F3(n,e,t){const i=n.canvas,l=rb(s=>{n.ctx!==null&&t(E3(s,n))},n);return M3(i,e,l),l}class R3 extends Tb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(O3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(s=>{const o=i[s];jt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:I3,detach:A3,resize:P3}[t]||F3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:vr,detach:vr,resize:vr}[t]||D3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return jw(e,t,i,l)}isAttached(e){const t=e&&qa(e);return!!(t&&t.isConnected)}}function q3(n){return!Ra()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?T3:R3}class xi{constructor(){Ze(this,"x");Ze(this,"y");Ze(this,"active",!1);Ze(this,"options");Ze(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return us(this.x)&&us(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ze(xi,"defaults",{}),Ze(xi,"defaultRoutes");function j3(n,e){const t=n.options.ticks,i=H3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?V3(e):[],o=s.length,r=s[0],a=s[o-1],f=[];if(o>l)return B3(e,f,s,o/l),f;const u=z3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Ks(e,f,u,jt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function V3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Wu=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Yu=(n,e)=>Math.min(e||n,n);function Ku(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function K3(n,e){_t(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:Zn(t,Zn(i,t)),max:Zn(i,Zn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Bl(e.grid)-t.padding-Ju(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=j2(Math.min(Math.asin(Bn((u.highest.height+6)/r,-1,1)),Math.asin(Bn(a/f,-1,1))-Math.asin(Bn(d/f,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Ju(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Bl(s)+a):(e.height=this.maxHeight,e.width=Bl(s)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Wi(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,f=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?f?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let u=t.height/2,c=e.height/2;s==="start"?(u=0,c=e.height):s==="end"&&(u=t.height,c=0),this.paddingTop=u+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Rt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(O),highest:I(D),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return V2(this._alignToPixels?qi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,f=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Bl(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(W){return qi(i,W,_)};let S,T,$,C,O,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),O=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,O=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}O=S-g,I=O-d,R=e.left,N=e.right}const q=vt(l.ticks.maxTicksLimit,c),H=Math.max(1,Math.ceil(c/q));for(T=0;T0&&(xe-=He/2);break}te={left:xe,top:Xe,width:He+pe.width,height:Ne+pe.height,color:H.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:G,strokeColor:U,strokeWidth:Y,textAlign:ie,textBaseline:P,translation:[C,O],backdrop:te}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Wi(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let f,u;return t==="left"?l?(u=this.right+s,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u+=a)):(u=this.right-r,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u=this.left)):t==="right"?l?(u=this.left+s,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u-=a)):(u=this.left+r,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u=this.right)):f="right",{textAlign:f,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,f,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Ut.route(s,l,a,r)})}function e4(n){return"id"in n&&"defaults"in n}class t4{constructor(){this.controllers=new Js(ts,"datasets",!0),this.elements=new Js(xi,"elements"),this.plugins=new Js(Object,"plugins"),this.scales=new Js(Os,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Da(e);Rt(i["before"+l],[],i),t[e](i),Rt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function i4(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let s=0;s1&&Zu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Gu(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function u4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Gu(n,"x",t[0])||Gu(n,"y",t[0])}return{}}function c4(n,e){const t=Qi[n.type]||{scales:{}},i=e.scales||{},l=xr(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!nt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ea(o,r,u4(o,n),Ut.scales[r.type]),f=a4(a,l),u=t.scales||{};s[o]=Xl(Object.create(null),[{axis:a},r,u[a],u[f]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||xr(r,e),u=(Qi[r]||{}).scales||{};Object.keys(u).forEach(c=>{const d=r4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Xl(s[m],[{axis:d},i[m],u[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Xl(r,[Ut.scales[r.type],Ut.scale])}),s}function Mb(n){const e=n.options||(n.options={});e.plugins=vt(e.plugins,{}),e.scales=c4(n,e)}function Db(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function d4(n){return n=n||{},n.data=Db(n.data),Mb(n),n}const Xu=new Map,Eb=new Set;function Zs(n,e){let t=Xu.get(n);return t||(t=e(),Xu.set(n,t),Eb.add(t)),t}const Ul=(n,e,t)=>{const i=Eo(e,t);i!==void 0&&n.add(i)};class p4{constructor(e){this._config=d4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Db(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Mb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Zs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Zs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Zs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Zs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(u=>{e&&(a.add(e),u.forEach(c=>Ul(a,e,c))),u.forEach(c=>Ul(a,l,c)),u.forEach(c=>Ul(a,Qi[s]||{},c)),u.forEach(c=>Ul(a,Ut,c)),u.forEach(c=>Ul(a,Xr,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Eb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,Qi[t]||{},Ut.datasets[t]||{},{type:t},Ut,Xr]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Qu(this._resolverCache,e,l);let a=o;if(h4(o,t)){s.$shared=!1,i=Di(i)?i():i;const f=this.createResolver(e,i,r);a=Ol(o,i,f)}for(const f of t)s[f]=a[f];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Qu(this._resolverCache,e,i);return nt(t)?Ol(s,t,void 0,l):s}}function Qu(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Na(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const m4=n=>nt(n)&&Object.getOwnPropertyNames(n).some(e=>Di(n[e]));function h4(n,e){const{isScriptable:t,isIndexable:i}=db(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Di(r)||m4(r))||o&&Xt(r))return!0}return!1}var _4="4.4.3";const g4=["top","bottom","left","right","chartArea"];function xu(n,e){return n==="top"||n==="bottom"||g4.indexOf(n)===-1&&e==="x"}function ec(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function tc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Rt(t&&t.onComplete,[n],e)}function b4(n){const e=n.chart,t=e.options.animation;Rt(t&&t.onProgress,[n],e)}function Ib(n){return Ra()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const po={},nc=n=>{const e=Ib(n);return Object.values(po).filter(t=>t.canvas===e).pop()};function k4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function y4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Gs(n,e,t){return n.options.clip?n[t]:e[t]}function v4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Gs(t,e,"left"),right:Gs(t,e,"right"),top:Gs(i,e,"top"),bottom:Gs(i,e,"bottom")}:e}class ci{static register(...e){Xn.add(...e),ic()}static unregister(...e){Xn.remove(...e),ic()}constructor(e,t){const i=this.config=new p4(t),l=Ib(e),s=nc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||q3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=O2(),this.ctx=r,this.canvas=a,this.width=u,this.height=f,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new n4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=K2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],po[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",tc),ai.listen(this,"progress",b4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return jt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ou(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wu(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ou(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=ea(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,f=ea(a,r),u=vt(r.type,o.dtype);(r.position===void 0||xu(r.position,f)!==xu(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=Xn.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),_t(l,(o,r)=>{o||delete i[r]}),_t(i,o=>{Ys.configure(this,o,o.options),Ys.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let f=0,u=this.data.datasets.length;f{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ec("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{Ys.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!cu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;k4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ys.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=v4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Aa(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&La(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return cs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=g3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=ll(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Io(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},l=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},s=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Mo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=L2(e),f=y4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Rt(s.onHover,[e,r,this],this),a&&Rt(s.onClick,[e,r,this],this));const u=!Mo(r,l);return(u||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ze(ci,"defaults",Ut),Ze(ci,"instances",po),Ze(ci,"overrides",Qi),Ze(ci,"registry",Xn),Ze(ci,"version",_4),Ze(ci,"getChart",nc);function ic(){return _t(ci.instances,n=>n._plugins.invalidate())}function Ab(n,e,t=e){n.lineCap=vt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(vt(t.borderDash,e.borderDash)),n.lineDashOffset=vt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=vt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=vt(t.borderWidth,e.borderWidth),n.strokeStyle=vt(t.borderColor,e.borderColor)}function w4(n,e,t){n.lineTo(t.x,t.y)}function S4(n){return n.stepped?rw:n.tension||n.cubicInterpolationMode==="monotone"?aw:w4}function Lb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),f=Math.min(s,r),u=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(u,g),n.lineTo(u,_),n.lineTo(u,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,O=$|0;O===h?(C<_?_=C:C>g&&(g=C),u=(c*u+$)/++c):(T(),n.lineTo($,C),h=O,c=0,_=g=C),y=C}T()}function ta(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?T4:$4}function C4(n){return n.stepped?zw:n.tension||n.cubicInterpolationMode==="monotone"?Vw:Vi}function O4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Ab(n,e.options),n.stroke(l)}function M4(n,e,t,i){const{segments:l,options:s}=e,o=ta(e);for(const r of l)Ab(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const D4=typeof Path2D=="function";function E4(n,e,t,i){D4&&!e.options.segment?O4(n,e,t,i):M4(n,e,t,i)}class Ti extends xi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;Lw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Gw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=kb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=C4(i);let f,u;for(f=0,u=o.length;fe!=="borderDash"&&e!=="fill"});function lc(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Ha(o,r,l);const a=l[o],f=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:f.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:f.y}))}),s}function Ha(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function sc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Nb(n,e){let t=[],i=!1;return Xt(n)?(i=!0,t=n):t=A4(n,e),t.length?new Ti({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function oc(n){return n&&n.fill!==!1}function L4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!on(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function N4(n,e,t){const i=q4(n);if(nt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return on(l)&&Math.floor(l)===l?P4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function P4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function F4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:nt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function R4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:nt(n)?i=n.value:i=e.getBaseValue(),i}function q4(n){const e=n.options,t=e.fill;let i=vt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function j4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=H4(e,t);r.push(Nb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&wr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;oc(s)&&wr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!oc(i)||t.drawTime!=="beforeDatasetDraw"||wr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jl={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;sr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=fb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new l3;const Pu="transparent",s3={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=wu(n||Pu),l=i.valid&&wu(e||Pu);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class o3{constructor(e,t,i,l){const s=t[i];l=Bs([e.to,l,s,e.from]);const o=Bs([e.from,s,l]);this._active=!0,this._fn=e.fn||s3[e.type||typeof o],this._easing=ts[e.easing]||ts.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Bs([e.to,t,l,e.from]),this._from=Bs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!nt(s))return;const o={};for(const r of t)o[r]=s[r];(Xt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=a3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&r3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new o3(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function r3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function ju(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,f=o.axis,u=d3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function h3(n,e){return ll(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function _3(n,e,t){return ll(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function zl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const vr=n=>n==="reset"||n==="none",Hu=(n,e)=>e?n:Object.assign({},n),g3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:$b(t,!0),values:null};class is{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=kr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&zl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=vt(i.xAxisID,yr(e,"x")),o=t.yAxisID=vt(i.yAxisID,yr(e,"y")),r=t.rAxisID=vt(i.rAxisID,yr(e,"r")),a=t.indexAxis,f=t.iAxisID=l(a,s,o,r),u=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&bu(this._data,this),e._stacked&&zl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(nt(t)){const l=this._cachedMeta;this._data=c3(t,l)}else if(i!==t){if(i){bu(i,this);const l=this._cachedMeta;zl(l),l._parsed=[]}t&&Object.isExtensible(t)&&G2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=kr(t.vScale,t),t.stack!==i.stack&&(l=!0,zl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(ju(this,t._parsed),t._stacked=kr(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Xt(l[e])?d=this.parseArrayData(i,l,e,t):nt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||f&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=f.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(Hu(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const u=this.chart.config,c=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),c);a=u.createResolver(d,this.getContext(e,i,t))}const f=new Sb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){vr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,f]of this._syncList)this[r](a,f);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let C=0;C=S){D.skip=!0;continue}const I=this.getParsed(C),L=jt(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=f.data[C]),c&&(D.options=u||this.resolveDataElementOptions(C,O.active?"active":l)),y||this.updateElement(O,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ze(po,"id","line"),Ze(po,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ze(po,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Va{constructor(e){Ze(this,"options");this.options=e||{}}static override(e){Object.assign(Va.prototype,e)}init(){}formats(){return Hi()}parse(){return Hi()}format(){return Hi()}add(){return Hi()}diff(){return Hi()}startOf(){return Hi()}endOf(){return Hi()}}var Tb={_date:Va};function b3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?J2:Ki;if(i){if(l._sharedOptions){const f=s[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(s,e,t-u),d=a(s,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function Ms(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var w3={evaluateInteractionItems:Ms,modes:{index(n,e,t,i){const l=Vi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const u=r[0].index,c=f.data[u];c&&!c.skip&&a.push({element:c,datasetIndex:f.index,index:u})}),a):[]},dataset(n,e,t,i){const l=Vi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,f=n.getDatasetMeta(a).data;r=[];for(let u=0;ut.pos===e)}function Vu(n,e){return n.filter(t=>Cb.indexOf(t.pos)===-1&&t.box.axis===e)}function Bl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function S3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Bl(Vl(e,"left"),!0),l=Bl(Vl(e,"right")),s=Bl(Vl(e,"top"),!0),o=Bl(Vl(e,"bottom")),r=Vu(e,"x"),a=Vu(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Vl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Bu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Ob(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function O3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!nt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Ob(o,s.getPadding());const r=Math.max(0,e.outerWidth-Bu(o,n,"left","right")),a=Math.max(0,e.outerHeight-Bu(o,n,"top","bottom")),f=r!==n.w,u=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:f,other:u}:{same:u,other:f}}function M3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function D3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Zl(n,e,t,i){const l=[];let s,o,r,a,f,u;for(s=0,o=n.length,f=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},l);Ob(d,Ii(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=T3(a.concat(f),c);Zl(r.fullSize,m,c,h),Zl(a,m,c,h),Zl(f,m,c,h)&&Zl(a,m,c,h),M3(m),Uu(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Uu(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Mb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class E3 extends Mb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const mo="$chartjs",I3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Wu=n=>n===null||n==="";function A3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[mo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Wu(l)){const s=Iu(n,"width");s!==void 0&&(n.width=s)}if(Wu(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Iu(n,"height");s!==void 0&&(n.height=s)}return n}const Db=Ww?{passive:!0}:!1;function L3(n,e,t){n&&n.addEventListener(e,t,Db)}function N3(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Db)}function P3(n,e){const t=I3[n.type]||n.type,{x:i,y:l}=Vi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Fo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function F3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Fo(r.addedNodes,i),o=o&&!Fo(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function R3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Fo(r.removedNodes,i),o=o&&!Fo(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const ms=new Map;let Yu=0;function Eb(){const n=window.devicePixelRatio;n!==Yu&&(Yu=n,ms.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function q3(n,e){ms.size||window.addEventListener("resize",Eb),ms.set(n,e)}function j3(n){ms.delete(n),ms.size||window.removeEventListener("resize",Eb)}function H3(n,e,t){const i=n.canvas,l=i&&za(i);if(!l)return;const s=ub((r,a)=>{const f=l.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||s(f,u)});return o.observe(l),q3(n,s),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&j3(n)}function z3(n,e,t){const i=n.canvas,l=ub(s=>{n.ctx!==null&&t(P3(s,n))},n);return L3(i,e,l),l}class V3 extends Mb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(A3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[mo])return!1;const i=t[mo].initial;["height","width"].forEach(s=>{const o=i[s];jt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[mo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:F3,detach:R3,resize:H3}[t]||z3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:$r,detach:$r,resize:$r}[t]||N3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Uw(e,t,i,l)}isAttached(e){const t=e&&za(e);return!!(t&&t.isConnected)}}function B3(n){return!Ha()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?E3:V3}class xi{constructor(){Ze(this,"x");Ze(this,"y");Ze(this,"active",!1);Ze(this,"options");Ze(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return ds(this.x)&&ds(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ze(xi,"defaults",{}),Ze(xi,"defaultRoutes");function U3(n,e){const t=n.options.ticks,i=W3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?K3(e):[],o=s.length,r=s[0],a=s[o-1],f=[];if(o>l)return J3(e,f,s,o/l),f;const u=Y3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Js(e,f,u,jt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function K3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Ku=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Ju=(n,e)=>Math.min(e||n,n);function Zu(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function Q3(n,e){gt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:Zn(t,Zn(i,t)),max:Zn(i,Zn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){qt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ww(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ul(e.grid)-t.padding-Gu(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=U2(Math.min(Math.asin(Bn((u.highest.height+6)/r,-1,1)),Math.asin(Bn(a/f,-1,1))-Math.asin(Bn(d/f,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Gu(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ul(s)+a):(e.height=this.maxHeight,e.width=Ul(s)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Yi(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,f=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?f?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let u=t.height/2,c=e.height/2;s==="start"?(u=0,c=e.height):s==="end"&&(u=t.height,c=0),this.paddingTop=u+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){qt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(O),highest:I(D),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return K2(this._alignToPixels?ji(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,f=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ul(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(W){return ji(i,W,_)};let S,T,$,C,O,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),O=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,O=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}O=S-g,I=O-d,R=e.left,N=e.right}const q=vt(l.ticks.maxTicksLimit,c),H=Math.max(1,Math.ceil(c/q));for(T=0;T0&&(xe-=He/2);break}te={left:xe,top:Xe,width:He+pe.width,height:Ne+pe.height,color:H.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:G,strokeColor:U,strokeWidth:Y,textAlign:ie,textBaseline:P,translation:[C,O],backdrop:te}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Yi(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let f,u;return t==="left"?l?(u=this.right+s,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u+=a)):(u=this.right-r,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u=this.left)):t==="right"?l?(u=this.left+s,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u-=a)):(u=this.left+r,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u=this.right)):f="right",{textAlign:f,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,f,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Ut.route(s,l,a,r)})}function s4(n){return"id"in n&&"defaults"in n}class o4{constructor(){this.controllers=new Zs(is,"datasets",!0),this.elements=new Zs(xi,"elements"),this.plugins=new Zs(Object,"plugins"),this.scales=new Zs(Ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):gt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Aa(e);qt(i["before"+l],[],i),t[e](i),qt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function a4(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let s=0;s1&&Xu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Qu(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function h4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Qu(n,"x",t[0])||Qu(n,"y",t[0])}return{}}function _4(n,e){const t=Qi[n.type]||{scales:{}},i=e.scales||{},l=na(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!nt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ia(o,r,h4(o,n),Ut.scales[r.type]),f=p4(a,l),u=t.scales||{};s[o]=xl(Object.create(null),[{axis:a},r,u[a],u[f]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||na(r,e),u=(Qi[r]||{}).scales||{};Object.keys(u).forEach(c=>{const d=d4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),xl(s[m],[{axis:d},i[m],u[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];xl(r,[Ut.scales[r.type],Ut.scale])}),s}function Ib(n){const e=n.options||(n.options={});e.plugins=vt(e.plugins,{}),e.scales=_4(n,e)}function Ab(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function g4(n){return n=n||{},n.data=Ab(n.data),Ib(n),n}const xu=new Map,Lb=new Set;function Gs(n,e){let t=xu.get(n);return t||(t=e(),xu.set(n,t),Lb.add(t)),t}const Wl=(n,e,t)=>{const i=Ao(e,t);i!==void 0&&n.add(i)};class b4{constructor(e){this._config=g4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ab(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Ib(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(u=>{e&&(a.add(e),u.forEach(c=>Wl(a,e,c))),u.forEach(c=>Wl(a,l,c)),u.forEach(c=>Wl(a,Qi[s]||{},c)),u.forEach(c=>Wl(a,Ut,c)),u.forEach(c=>Wl(a,ea,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Lb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,Qi[t]||{},Ut.datasets[t]||{},{type:t},Ut,ea]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=ec(this._resolverCache,e,l);let a=o;if(y4(o,t)){s.$shared=!1,i=Ei(i)?i():i;const f=this.createResolver(e,i,r);a=Dl(o,i,f)}for(const f of t)s[f]=a[f];return s}createResolver(e,t,i=[""],l){const{resolver:s}=ec(this._resolverCache,e,i);return nt(t)?Dl(s,t,void 0,l):s}}function ec(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Ra(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const k4=n=>nt(n)&&Object.getOwnPropertyNames(n).some(e=>Ei(n[e]));function y4(n,e){const{isScriptable:t,isIndexable:i}=hb(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Ei(r)||k4(r))||o&&Xt(r))return!0}return!1}var v4="4.4.6";const w4=["top","bottom","left","right","chartArea"];function tc(n,e){return n==="top"||n==="bottom"||w4.indexOf(n)===-1&&e==="x"}function nc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function ic(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),qt(t&&t.onComplete,[n],e)}function S4(n){const e=n.chart,t=e.options.animation;qt(t&&t.onProgress,[n],e)}function Nb(n){return Ha()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ho={},lc=n=>{const e=Nb(n);return Object.values(ho).filter(t=>t.canvas===e).pop()};function $4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function T4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Xs(n,e,t){return n.options.clip?n[t]:e[t]}function C4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Xs(t,e,"left"),right:Xs(t,e,"right"),top:Xs(i,e,"top"),bottom:Xs(i,e,"bottom")}:e}class ci{static register(...e){Xn.add(...e),sc()}static unregister(...e){Xn.remove(...e),sc()}constructor(e,t){const i=this.config=new b4(t),l=Nb(e),s=lc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||B3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=A2(),this.ctx=r,this.canvas=a,this.width=u,this.height=f,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new r4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Q2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ho[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",ic),ai.listen(this,"progress",S4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return jt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Eu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Tu(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Eu(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),qt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=ia(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),gt(s,o=>{const r=o.options,a=r.id,f=ia(a,r),u=vt(r.type,o.dtype);(r.position===void 0||tc(r.position,f)!==tc(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=Xn.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(l,(o,r)=>{o||delete i[r]}),gt(i,o=>{Ks.configure(this,o,o.options),Ks.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let f=0,u=this.data.datasets.length;f{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(nc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{Ks.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!mu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;$4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ks.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=C4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Pa(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Fa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ps(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=w3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=ll(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Lo(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};gt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},l=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},s=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Eo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=q2(e),f=T4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,qt(s.onHover,[e,r,this],this),a&&qt(s.onClick,[e,r,this],this));const u=!Eo(r,l);return(u||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ze(ci,"defaults",Ut),Ze(ci,"instances",ho),Ze(ci,"overrides",Qi),Ze(ci,"registry",Xn),Ze(ci,"version",v4),Ze(ci,"getChart",lc);function sc(){return gt(ci.instances,n=>n._plugins.invalidate())}function Pb(n,e,t=e){n.lineCap=vt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(vt(t.borderDash,e.borderDash)),n.lineDashOffset=vt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=vt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=vt(t.borderWidth,e.borderWidth),n.strokeStyle=vt(t.borderColor,e.borderColor)}function O4(n,e,t){n.lineTo(t.x,t.y)}function M4(n){return n.stepped?dw:n.tension||n.cubicInterpolationMode==="monotone"?pw:O4}function Fb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),f=Math.min(s,r),u=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(u,g),n.lineTo(u,_),n.lineTo(u,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,O=$|0;O===h?(C<_?_=C:C>g&&(g=C),u=(c*u+$)/++c):(T(),n.lineTo($,C),h=O,c=0,_=g=C),y=C}T()}function la(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?E4:D4}function I4(n){return n.stepped?Yw:n.tension||n.cubicInterpolationMode==="monotone"?Kw:Bi}function A4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Pb(n,e.options),n.stroke(l)}function L4(n,e,t,i){const{segments:l,options:s}=e,o=la(e);for(const r of l)Pb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const N4=typeof Path2D=="function";function P4(n,e,t,i){N4&&!e.options.segment?A4(n,e,t,i):L4(n,e,t,i)}class Ti extends xi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;qw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=t3(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=wb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=I4(i);let f,u;for(f=0,u=o.length;fe!=="borderDash"&&e!=="fill"});function oc(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Ba(o,r,l);const a=l[o],f=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:f.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:f.y}))}),s}function Ba(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function rc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Rb(n,e){let t=[],i=!1;return Xt(n)?(i=!0,t=n):t=R4(n,e),t.length?new Ti({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ac(n){return n&&n.fill!==!1}function q4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!rn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function j4(n,e,t){const i=B4(n);if(nt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return rn(l)&&Math.floor(l)===l?H4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function H4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function z4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:nt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function V4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:nt(n)?i=n.value:i=e.getBaseValue(),i}function B4(n){const e=n.options,t=e.fill;let i=vt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function U4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=W4(e,t);r.push(Rb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Tr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;ac(s)&&Tr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ac(i)||t.drawTime!=="beforeDatasetDraw"||Tr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gl={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;s-1?n.split(` -`):n}function X4(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function uc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ei(e.bodyFont),f=ei(e.titleFont),u=ei(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ei(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=f.string,_t(n.title,T),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,_t(i,$=>{_t($.before,T),_t($.lines,T),_t($.after,T)}),S=0,t.font=u.string,_t(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function Q4(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function x4(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function eS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),x4(f,n,e,t)&&(f="center"),f}function cc(n,e,t){const i=t.yAlign||e.yAlign||Q4(n,t);return{xAlign:t.xAlign||e.xAlign||eS(n,e,t,i),yAlign:i}}function tS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function nS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function dc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=fo(o);let h=tS(e,r);const _=nS(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Xs(n,e,t){const i=Ei(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function pc(n){return Gn([],fi(n))}function iS(n,e,t){return ll(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function mc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Fb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?Fb[e].call(t,i):l}class ia extends xi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new yb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=iS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=dn(i,"beforeTitle",this,e),s=dn(i,"title",this,e),o=dn(i,"afterTitle",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}getBeforeBody(e,t){return pc(dn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=mc(i,s);Gn(o.before,fi(dn(r,"beforeLabel",this,s))),Gn(o.lines,dn(r,"label",this,s)),Gn(o.after,fi(dn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return pc(dn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=dn(i,"beforeFooter",this,e),s=dn(i,"footer",this,e),o=dn(i,"afterFooter",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,f;for(a=0,f=t.length;ae.filter(u,c,d,i))),e.itemSort&&(r=r.sort((u,c)=>e.itemSort(u,c,i))),_t(r,u=>{const c=mc(e.callbacks,u);l.push(dn(c,"labelColor",this,u)),s.push(dn(c,"labelPointStyle",this,u)),o.push(dn(c,"labelTextColor",this,u))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Jl[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=uc(this,i),f=Object.assign({},r,a),u=cc(this.chart,i,f),c=dc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=fo(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,u)+o:l==="right"?y=d+h-Math.max(f,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const f=_r(i.rtl,this.x,this.width);for(e.x=Xs(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=ei(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,$u(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),$u(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ei(i.bodyFont);let d=c.lineHeight,m=0;const h=_r(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,O,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xs(this,g,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,O=l.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Jl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=uc(this,e),a=Object.assign({},o,this._size),f=cc(t,e,a),u=dc(e,a,f,t);(l._to!==u.x||s._to!==u.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ei(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),Ww(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Yw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const f=this.chart.getDatasetMeta(r);if(!f)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:f.data[a],index:a}}),s=!Mo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Mo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Jl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ze(ia,"positioners",Jl);var lS={id:"tooltip",_element:ia,positioners:Jl,afterInit(n,e,t){t&&(n.tooltip=new ia({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Fb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function sS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=s||1,h=u-1,{min:_,max:g}=e,y=!jt(o),S=!jt(r),T=!jt(f),$=(g-_)/(c+1);let C=pu((g-_)/h/m)*m,O,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=pu(L*C/h/m)*m),jt(a)||(O=Math.pow(10,a),C=Math.ceil(C*O)/O),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&R2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,u)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=f-1,C=(I-D)/L):(L=(I-D)/C,Ql(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(mu(C),mu(D));O=Math.pow(10,jt(a)?R:a),D=Math.round(D*O)/O,I=Math.round(I*O)/O;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),Dr)break;t.push({value:N})}return S&&d&&I!==r?t.length&&Ql(t[t.length-1].value,r,hc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function hc(n,e,{horizontal:t,minRotation:i}){const l=Wi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class oS extends Os{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return jt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Cl(l),f=Cl(s);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=sS(l,s);return e.bounds==="ticks"&&q2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return ab(e,this.chart.options.locale,this.options.ticks.format)}}class la extends oS{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=on(e)?e:0,this.max=on(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Wi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ze(la,"id","linear"),Ze(la,"defaults",{ticks:{callback:ub.formatters.numeric}});const Qo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_n=Object.keys(Qo);function _c(n,e){return n-e}function gc(n,e){if(jt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),on(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(us(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function bc(n,e,t,i){const l=_n.length;for(let s=_n.indexOf(n);s=_n.indexOf(t);s--){const o=_n[s];if(Qo[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return _n[t?_n.indexOf(t):0]}function aS(n){for(let e=_n.indexOf(n)+1,t=_n.length;e=e?t[i]:t[l];n[s]=!0}}function fS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function yc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||bc(s.minUnit,t,i,this._getLabelCapacity(t)),r=vt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=us(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return Rt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Yi(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Yi(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class vc extends ps{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Qs(t,this.min),this._tableRange=Qs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&l.push(f);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Qs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Qs(this._table,i*this._tableRange+this._minPos,!0)}}Ze(vc,"id","timeseries"),Ze(vc,"defaults",ps.defaults);/*! +`):n}function nS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function dc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ei(e.bodyFont),f=ei(e.titleFont),u=ei(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ii(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=f.string,gt(n.title,T),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,gt(i,$=>{gt($.before,T),gt($.lines,T),gt($.after,T)}),S=0,t.font=u.string,gt(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function iS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function lS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function sS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),lS(f,n,e,t)&&(f="center"),f}function pc(n,e,t){const i=t.yAlign||e.yAlign||iS(n,t);return{xAlign:t.xAlign||e.xAlign||sS(n,e,t,i),yAlign:i}}function oS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function rS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function mc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=co(o);let h=oS(e,r);const _=rS(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Qs(n,e,t){const i=Ii(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function hc(n){return Gn([],fi(n))}function aS(n,e,t){return ll(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function _c(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const jb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?jb[e].call(t,i):l}class oa extends xi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Sb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=aS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),o=pn(i,"afterTitle",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}getBeforeBody(e,t){return hc(pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return gt(e,s=>{const o={before:[],lines:[],after:[]},r=_c(i,s);Gn(o.before,fi(pn(r,"beforeLabel",this,s))),Gn(o.lines,pn(r,"label",this,s)),Gn(o.after,fi(pn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return hc(pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),o=pn(i,"afterFooter",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,f;for(a=0,f=t.length;ae.filter(u,c,d,i))),e.itemSort&&(r=r.sort((u,c)=>e.itemSort(u,c,i))),gt(r,u=>{const c=_c(e.callbacks,u);l.push(pn(c,"labelColor",this,u)),s.push(pn(c,"labelPointStyle",this,u)),o.push(pn(c,"labelTextColor",this,u))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Gl[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=dc(this,i),f=Object.assign({},r,a),u=pc(this.chart,i,f),c=mc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=co(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,u)+o:l==="right"?y=d+h-Math.max(f,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const f=br(i.rtl,this.x,this.width);for(e.x=Qs(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=ei(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Ou(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Ou(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ei(i.bodyFont);let d=c.lineHeight,m=0;const h=br(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,O,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Qs(this,g,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,O=l.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Gl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=dc(this,e),a=Object.assign({},o,this._size),f=pc(t,e,a),u=mc(e,a,f,t);(l._to!==u.x||s._to!==u.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ii(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),Gw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Xw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const f=this.chart.getDatasetMeta(r);if(!f)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:f.data[a],index:a}}),s=!Eo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Eo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Gl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ze(oa,"positioners",Gl);var fS={id:"tooltip",_element:oa,positioners:Gl,afterInit(n,e,t){t&&(n.tooltip=new oa({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function uS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=s||1,h=u-1,{min:_,max:g}=e,y=!jt(o),S=!jt(r),T=!jt(f),$=(g-_)/(c+1);let C=_u((g-_)/h/m)*m,O,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=_u(L*C/h/m)*m),jt(a)||(O=Math.pow(10,a),C=Math.ceil(C*O)/O),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&V2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,u)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=f-1,C=(I-D)/L):(L=(I-D)/C,es(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(gu(C),gu(D));O=Math.pow(10,jt(a)?R:a),D=Math.round(D*O)/O,I=Math.round(I*O)/O;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),Dr)break;t.push({value:N})}return S&&d&&I!==r?t.length&&es(t[t.length-1].value,r,gc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function gc(n,e,{horizontal:t,minRotation:i}){const l=Yi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class cS extends Ds{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return jt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Ml(l),f=Ml(s);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=uS(l,s);return e.bounds==="ticks"&&B2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return cb(e,this.chart.options.locale,this.options.ticks.format)}}class ra extends cS{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=rn(e)?e:0,this.max=rn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Yi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ze(ra,"id","linear"),Ze(ra,"defaults",{ticks:{callback:pb.formatters.numeric}});const er={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_n=Object.keys(er);function bc(n,e){return n-e}function kc(n,e){if(jt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),rn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(ds(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function yc(n,e,t,i){const l=_n.length;for(let s=_n.indexOf(n);s=_n.indexOf(t);s--){const o=_n[s];if(er[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return _n[t?_n.indexOf(t):0]}function pS(n){for(let e=_n.indexOf(n)+1,t=_n.length;e=e?t[i]:t[l];n[s]=!0}}function mS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function wc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||yc(s.minUnit,t,i,this._getLabelCapacity(t)),r=vt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=ds(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return qt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Ki(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Ki(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class Sc extends hs{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=xs(t,this.min),this._tableRange=xs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&l.push(f);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(xs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return xs(this._table,i*this._tableRange+this._minPos,!0)}}Ze(Sc,"id","timeseries"),Ze(Sc,"defaults",hs.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license - */const uS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};wb._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return uS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function wc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function cS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&wc();return{c(){e=b("div"),t=b("div"),i=K("Found "),l=K(n[1]),s=M(),r=K(o),a=M(),c&&c.c(),f=M(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&oe(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&oe(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=wc(),c.c(),E(c,1),c.m(e,f)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function dS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}Ht(()=>(ci.register(Ti,mo,uo,la,ps,G4,lS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class pS extends ge{constructor(e){super(),_e(this,e,dS,cS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function mS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function hS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Rb extends ge{constructor(e){super(),_e(this,e,hS,mS,me,{content:2,language:3,class:0})}}const _S=n=>({}),Sc=n=>({}),gS=n=>({}),$c=n=>({});function Tc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Cc(n);const $=n[19].header,C=wt($,n,n[18],$c);let O=n[4]&&n[2]&&Oc(n);const D=n[19].default,I=wt(D,n,n[18],null),L=n[19].footer,R=wt(L,n,n[18],Sc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),f=M(),u=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[J(t,"click",Be(n[20])),J(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Cc(n),T.c(),E(T,1),T.m(o,r)):T&&(le(),A(T,1,1,()=>{T=null}),se()),C&&C.p&&(!g||N[0]&262144)&&$t(C,$,n,n[18],g?St($,n[18],N,gS):Tt(n[18]),$c),n[4]&&n[2]?O?O.p(n,N):(O=Oc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&$t(I,D,n,n[18],g?St(D,n[18],N,null):Tt(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&$t(R,L,n,n[18],g?St(L,n[18],N,_S):Tt(n[18]),Sc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,rs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=Pg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,rs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ca(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,$e(S)}}}function Cc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,rs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,rs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Oc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function bS(n){let e,t,i,l,s=n[0]&&Tc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Tc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,$e(l)}}}let Hi,Sr=[];function qb(){return Hi=Hi||document.querySelector(".overlays"),Hi||(Hi=document.createElement("div"),Hi.classList.add("overlays"),document.body.appendChild(Hi)),Hi}let wi=150;function Mc(){return 1e3+qb().querySelectorAll(".overlay-panel-container.active").length}function kS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Mc(),_):t(6,_.style="",_))}function R(){j.pushUnique(Sr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Sr,h),Sr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Mc()&&(Y.preventDefault(),O())}function P(Y){o&&q(g)}function q(Y,ie){ie&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Ht(()=>(qb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const H=()=>a?O():!0;function W(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function U(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,O,_,g,T,N,P,q,u,c,d,C,D,$,l,i,H,W,G,U]}class Zt extends ge{constructor(e){super(),_e(this,e,kS,bS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function yS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[Se(i=Pe.call(null,e,n[3]?void 0:n[0])),J(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Ct(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function vS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function f(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Ht(()=>()=>{a&&clearTimeout(a)}),n.$$set=u=>{"value"in u&&t(5,i=u.value),"tooltip"in u&&t(0,l=u.tooltip),"idleClasses"in u&&t(1,s=u.idleClasses),"successClasses"in u&&t(2,o=u.successClasses),"successDuration"in u&&t(6,r=u.successDuration)},[l,s,o,a,f,i,r]}class sl extends ge{constructor(e){super(),_e(this,e,vS,yS,me,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Dc(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function wS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new X1({props:{level:n[1].level}}),I=new Q1({props:{date:n[1].created}});let N=!n[4]&&Ec(n),P=ue(n[5](n[1].data)),q=[];for(let W=0;WA(q[W],1,1,()=>{q[W]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("div"),d=K(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),B(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),B(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let W=0;W',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ec(n){let e,t,i,l;function s(a,f){return a[1].message?TS:$S}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function $S(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TS(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&oe(i,t)},d(l){l&&v(e)}}}function CS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=K(t),s=K(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function OS(n){let e,t;return e=new Rb({props:{content:n[17],language:"html"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function MS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function DS(n){let e,t;return e=new Rb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ES(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ic(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[ES,DS,MS,OS,CS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=K("data."),s=K(l),o=M(),r=b("td"),u.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&oe(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function IS(n){let e,t,i,l;const s=[SS,wS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(le(),A(o[u],1,1,()=>{o[u]=null}),se()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function AS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[J(e,"click",n[9]),J(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,$e(a)}}}function NS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[LS],header:[AS],default:[IS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}const Ac="log_view";function PS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Ac),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Ac})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class FS extends ge{constructor(e){super(),_e(this,e,PS,NS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function RS(n,e,t){const i=n.slice();return i[1]=e[t],i}function qS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function jS(n){let e,t,i,l=ue(U1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class jb extends ge{constructor(e){super(),_e(this,e,HS,jS,me,{class:0})}}function zS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[BS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[US,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[WS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function VS(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function BS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function US(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new jb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function WS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function YS(n){let e,t,i,l;const s=[VS,zS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function KS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function ZS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[JS],header:[KS],default:[YS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function GS(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class XS extends ge{constructor(e){super(),_e(this,e,GS,ZS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function QS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Lc(n){let e,t;return e=new pS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Nc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new l2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function xS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Zo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[QS,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new $s({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new jb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Lc(n),N=Nc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Lc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Nc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function e$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[xS]},$$scope:{ctx:n}}});let r={};i=new FS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new XS({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const xs="logId",Pc="adminRequests",Fc="adminLogRequests";function t$(n,e,t){var L;let i,l,s;Ue(n,jo,R=>t(19,l=R)),Ue(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Pc)||((L=window.localStorage)==null?void 0:L.getItem(Fc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Pc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[xs]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[xs]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(xs)&&r&&r.show(o.get(xs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Fc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{})}}function i$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function l$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class s$ extends ge{constructor(e){super(),_e(this,e,l$,i$,me,{tolerance:3})}}function o$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new s$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const Rc="@adminSidebarWidth";function r$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Rc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Rc,a))},[s,o,a,r,l,i,f,u,c,d]}class Hb extends ge{constructor(e){super(),_e(this,e,r$,o$,me,{class:0})}}const za=Cn({});function fn(n,e,t){za.set({text:n,yesCallback:e,noCallback:t})}function zb(){za.set({})}function qc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function a$(n){let e,t,i,l,s=n[0]&&qc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=qc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function f$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function jc(n,e,t){const i=n.slice();return i[27]=e[t],i}function u$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function c$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function d$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function p$(n){let e,t,i,l;const s=[d$,c$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Hc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[p$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Hc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Hc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function h$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Vc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function _$(n){let e,t,i,l,s,o,r=n[5]!=""&&Vc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Vc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function g$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[_$],header:[h$],default:[m$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-C-zHBmhQ.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class k$ extends ge{constructor(e){super(),_e(this,e,b$,g$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Bc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Uc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Wc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Yc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Uc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Uc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Yc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function y$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Yc=n=>n.name;function v$(n,e,t){let i;Ue(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class w$ extends ge{constructor(e){super(),_e(this,e,v$,y$,me,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Jc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function S$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class C$ extends ge{constructor(e){super(),_e(this,e,T$,$$,me,{class:0})}}const O$=n=>({interactive:n&64,hasErrors:n&32}),Zc=n=>({interactive:n[6],hasErrors:n[5]}),M$=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]}),D$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]});function Qc(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xc(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function E$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&xc(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=xc(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function I$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function A$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function L$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function ed(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Gc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[N$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[P$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Zc);let g=!n[0].toDelete&&td(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,M$):Tt(y[19]),Gc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,O$):Tt(y[19]),Zc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=td(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function N$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function td(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[F$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function F$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function R$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qc();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[E$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],Xc),m=d||I$();function h(S,T){if(S[0].toDelete)return L$;if(S[6])return A$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&ed(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=Qc(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,D$):Tt(S[19]),Xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=ed(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let $r=[];function q$(n,e,t){let i,l,s,o;Ue(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of $r)N.id!=f&&N.collapse()}Ht(()=>($r.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey($r,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,q$,R$,me,{key:1,field:0})}}function j$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function H$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function z$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function V$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[j$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[H$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[z$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function B$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[V$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function U$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class W$ extends ge{constructor(e){super(),_e(this,e,U$,B$,me,{field:0,key:1})}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function J$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[Y$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[K$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function Z$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function G$(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[Z$,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function X$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[G$],options:[J$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Q$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class x$ extends ge{constructor(e){super(),_e(this,e,Q$,X$,me,{field:0,key:1})}}function eT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function tT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class nT extends ge{constructor(e){super(),_e(this,e,tT,eT,me,{field:0,key:1})}}function iT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Nl extends ge{constructor(e){super(),_e(this,e,lT,iT,me,{value:0,separator:1,readonly:2,disabled:3})}}function sT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function oT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function rT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[sT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[oT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function aT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[rT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function fT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Vb extends ge{constructor(e){super(),_e(this,e,fT,aT,me,{field:0,key:1})}}function uT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function cT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class dT extends ge{constructor(e){super(),_e(this,e,cT,uT,me,{field:0,key:1})}}function pT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function mT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[pT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function hT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[mT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function _T(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class gT extends ge{constructor(e){super(),_e(this,e,_T,hT,me,{field:0,key:1})}}var Tr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],wl={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ms={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function nd(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Cr=function(n){return n instanceof Array?n:[n]};function an(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function dt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Bb(n,e){if(e(n))return n;if(n.parentNode)return Bb(n.parentNode,e)}function to(n,e){var t=dt("div","numInputWrapper"),i=dt("input","numInput "+n),l=dt("span","arrowUp"),s=dt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Or=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},bT={D:Or,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Or,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Or,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Bi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ns={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ns.w(n,e,t)]},F:function(n,e,t){return Po(ns.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(ns.h(n,e,t))},H:function(n){return pn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Ub=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ms:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ns[c]&&m[d-1]!=="\\"?ns[c](r,u,t):c!=="\\"?c:""}).join("")}},sa=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?ms:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||wl).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Dr(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var fe=t._input.value;c(),Kt(),t._input.value!==fe&&t._debouncedChange()}function f(Z,X){return Z%12+12*In(X===t.l10n.amPM[1])}function u(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=f(Z,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Mr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Mr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Mr(Z,X,ne);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(ne)))}function h(Z){var X=yn(Z),ne=parseInt(X.value)+(Z.delta||0);(ne/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&Mt(ne)}function _(Z,X,ne,fe){if(X instanceof Array)return X.forEach(function(Te){return _(Z,Te,ne,fe)});if(Z instanceof Array)return Z.forEach(function(Te){return _(Te,X,ne,fe)});Z.addEventListener(X,ne,fe),t._handlers.push({remove:function(){return Z.removeEventListener(X,ne,fe)}})}function g(){bt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(fe){return _(fe,"click",t[ne])})}),t.isMobile){al();return}var Z=nd(ze,50);if(t._debouncedChange=nd(g,wT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ae(yn(ne))}),_(t._input,"keydown",De),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",De),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ut),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(Z,X){var ne=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=dt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Z,X,ne,fe){var Te=ft(X,!0),Le=dt("span",Z,X.getDate().toString());return Le.dateObj=X,Le.$i=fe,Le.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Te?(Le.tabIndex=-1,Mn(X)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(an(Le,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),an(Le,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),bt("onDayCreate",Le),Le}function D(Z){Z.focus(),t.config.mode==="range"&&Ae(Z)}function I(Z){for(var X=Z>0?0:t.config.showMonths-1,ne=Z>0?t.config.showMonths:-1,fe=X;fe!=ne;fe+=Z)for(var Te=t.daysContainer.children[fe],Le=Z>0?0:Te.children.length-1,Je=Z>0?Te.children.length:-1,qe=Le;qe!=Je;qe+=Z){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&ft(Qe.dateObj))return Qe}}function L(Z,X){for(var ne=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,fe=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Le=ne-t.currentMonth;Le!=fe;Le+=Te)for(var Je=t.daysContainer.children[Le],qe=ne-t.currentMonth===Le?Z.$i+X:X<0?Je.children.length-1:0,Qe=Je.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=Te){var Ve=Je.children[Re];if(Ve.className.indexOf("hidden")===-1&&ft(Ve.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(Z,X){var ne=s(),fe=mt(ne||document.body),Te=Z!==void 0?Z:fe?ne:t.selectedDateElem!==void 0&&mt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&mt(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():fe?L(Te,X):D(Te)}function F(Z,X){for(var ne=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((X-1+12)%12,Z),Te=t.utils.getDaysInMonth(X,Z),Le=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",Qe=Je?"nextMonthDay hidden":"nextMonthDay",Re=fe+1-ne,Ve=0;Re<=fe;Re++,Ve++)Le.appendChild(O("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Le.appendChild(O("flatpickr-day",new Date(Z,X,Re),Re,Ve));for(var yt=Te+1;yt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);yt++,Ve++)Le.appendChild(O("flatpickr-day "+Qe,new Date(Z,X+1,yt%Te),yt,Ve));var Jn=dt("div","dayContainer");return Jn.appendChild(Le),Jn}function N(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ne=dt("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Po(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Z=dt("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=dt("span","cur-month"):(t.monthsDropdownContainer=dt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),bt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var fe=to("cur-year",{tabindex:"-1"}),Te=fe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=dt("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(fe),X.appendChild(Le),Z.appendChild(X),{container:Z,yearElement:Te,monthElement:ne}}function H(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){return t.monthNav=dt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(an(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(an(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Oe(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Dr(t.config);t.timeContainer=dt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=dt("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var fe=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:u(Z.hours)),t.minuteElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=to("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(dt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=dt("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function U(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=dt("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=dt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=id(t.l10n.weekdays.shorthand);Z>0&&Z{i&&(t||(t=Fe(e,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function _S(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&$c();return{c(){e=b("div"),t=b("div"),i=K("Found "),l=K(n[1]),s=M(),r=K(o),a=M(),c&&c.c(),f=M(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&oe(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&oe(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=$c(),c.c(),E(c,1),c.m(e,f)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function gS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}Ht(()=>(ci.register(Ti,_o,po,ra,hs,tS,fS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class bS extends ge{constructor(e){super(),_e(this,e,gS,_S,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function kS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function yS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Hb extends ge{constructor(e){super(),_e(this,e,yS,kS,me,{content:2,language:3,class:0})}}const vS=n=>({}),Tc=n=>({}),wS=n=>({}),Cc=n=>({});function Oc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Mc(n);const $=n[19].header,C=wt($,n,n[18],Cc);let O=n[4]&&n[2]&&Dc(n);const D=n[19].default,I=wt(D,n,n[18],null),L=n[19].footer,R=wt(L,n,n[18],Tc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),f=M(),u=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[J(t,"click",Be(n[20])),J(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Mc(n),T.c(),E(T,1),T.m(o,r)):T&&(le(),A(T,1,1,()=>{T=null}),se()),C&&C.p&&(!g||N[0]&262144)&&$t(C,$,n,n[18],g?St($,n[18],N,wS):Tt(n[18]),Cc),n[4]&&n[2]?O?O.p(n,N):(O=Dc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&$t(I,D,n,n[18],g?St(D,n[18],N,null):Tt(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&$t(R,L,n,n[18],g?St(L,n[18],N,vS):Tt(n[18]),Tc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=Rg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ma(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,$e(S)}}}function Mc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,fs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,fs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Dc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function SS(n){let e,t,i,l,s=n[0]&&Oc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Oc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,$e(l)}}}let zi,Cr=[];function zb(){return zi=zi||document.querySelector(".overlays"),zi||(zi=document.createElement("div"),zi.classList.add("overlays"),document.body.appendChild(zi)),zi}let wi=150;function Ec(){return 1e3+zb().querySelectorAll(".overlay-panel-container.active").length}function $S(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Ec(),_):t(6,_.style="",_))}function R(){j.pushUnique(Cr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Cr,h),Cr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Ec()&&(Y.preventDefault(),O())}function P(Y){o&&q(g)}function q(Y,ie){ie&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Ht(()=>(zb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const H=()=>a?O():!0;function W(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function U(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,O,_,g,T,N,P,q,u,c,d,C,D,$,l,i,H,W,G,U]}class Zt extends ge{constructor(e){super(),_e(this,e,$S,SS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function TS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[Se(i=Pe.call(null,e,n[3]?void 0:n[0])),J(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Ct(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function CS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function f(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Ht(()=>()=>{a&&clearTimeout(a)}),n.$$set=u=>{"value"in u&&t(5,i=u.value),"tooltip"in u&&t(0,l=u.tooltip),"idleClasses"in u&&t(1,s=u.idleClasses),"successClasses"in u&&t(2,o=u.successClasses),"successDuration"in u&&t(6,r=u.successDuration)},[l,s,o,a,f,i,r]}class sl extends ge{constructor(e){super(),_e(this,e,CS,TS,me,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Ic(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function OS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new eb({props:{level:n[1].level}}),I=new tb({props:{date:n[1].created}});let N=!n[4]&&Ac(n),P=ue(n[5](n[1].data)),q=[];for(let W=0;WA(q[W],1,1,()=>{q[W]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("div"),d=K(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),B(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),B(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let W=0;W',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ac(n){let e,t,i,l;function s(a,f){return a[1].message?ES:DS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function DS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ES(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&oe(i,t)},d(l){l&&v(e)}}}function IS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=K(t),s=K(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function AS(n){let e,t;return e=new Hb({props:{content:n[17],language:"html"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function LS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function NS(n){let e,t;return e=new Hb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Lc(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[PS,NS,LS,AS,IS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=K("data."),s=K(l),o=M(),r=b("td"),u.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&oe(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function FS(n){let e,t,i,l;const s=[MS,OS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(le(),A(o[u],1,1,()=>{o[u]=null}),se()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function RS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[J(e,"click",n[9]),J(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,$e(a)}}}function jS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[qS],header:[RS],default:[FS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}const Nc="log_view";function HS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Nc),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Nc})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class zS extends ge{constructor(e){super(),_e(this,e,HS,jS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function VS(n,e,t){const i=n.slice();return i[1]=e[t],i}function BS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function US(n){let e,t,i,l=ue(K1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Vb extends ge{constructor(e){super(),_e(this,e,WS,US,me,{class:0})}}function YS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[JS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[ZS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[GS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function KS(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function ZS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Vb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function GS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function XS(n){let e,t,i,l;const s=[KS,YS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function e$(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[xS],header:[QS],default:[XS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function t$(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Pc(n){let e,t;return e=new bS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Fc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new f2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Xo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[i$,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Cs({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Vb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Pc(n),N=Fc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Pc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Fc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function s$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[l$]},$$scope:{ctx:n}}});let r={};i=new zS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new n$({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const eo="logId",Rc="adminRequests",qc="adminLogRequests";function o$(n,e,t){var L;let i,l,s;We(n,zo,R=>t(19,l=R)),We(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Rc)||((L=window.localStorage)==null?void 0:L.getItem(qc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Rc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[eo]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[eo]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(eo)&&r&&r.show(o.get(eo)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(qc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class r$ extends ge{constructor(e){super(),_e(this,e,o$,s$,me,{})}}function a$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function f$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class u$ extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{tolerance:3})}}function c$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new u$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const jc="@adminSidebarWidth";function d$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(jc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(jc,a))},[s,o,a,r,l,i,f,u,c,d]}class Bb extends ge{constructor(e){super(),_e(this,e,d$,c$,me,{class:0})}}const Ua=Cn({});function un(n,e,t){Ua.set({text:n,yesCallback:e,noCallback:t})}function Ub(){Ua.set({})}function Hc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function p$(n){let e,t,i,l,s=n[0]&&Hc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Hc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function m$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,m$,p$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function zc(n,e,t){const i=n.slice();return i[27]=e[t],i}function h$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function _$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function g$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function b$(n){let e,t,i,l;const s=[g$,_$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Vc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[b$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Vc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Vc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function y$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Uc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function v$(n){let e,t,i,l,s,o,r=n[5]!=""&&Uc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Uc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function w$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[v$],header:[y$],default:[k$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-97oGZhvg.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class $$ extends ge{constructor(e){super(),_e(this,e,S$,w$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Wc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Yc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Jc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Yc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Yc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Jc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function T$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Jc=n=>n.name;function C$(n,e,t){let i;We(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class O$ extends ge{constructor(e){super(),_e(this,e,C$,T$,me,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function M$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class I$ extends ge{constructor(e){super(),_e(this,e,E$,D$,me,{class:0})}}const A$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]}),L$=n=>({interactive:n&64,hasErrors:n&32}),Qc=n=>({interactive:n[6],hasErrors:n[5]}),N$=n=>({interactive:n&64,hasErrors:n&32}),xc=n=>({interactive:n[6],hasErrors:n[5]});function ed(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function td(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&td(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=td(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function F$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function R$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function q$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function nd(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Qc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[j$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[H$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Xc);let g=!n[0].toDelete&&id(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,L$):Tt(y[19]),Qc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,A$):Tt(y[19]),Xc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=id(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function j$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function H$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function id(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function z$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function V$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&ed();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[P$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],xc),m=d||F$();function h(S,T){if(S[0].toDelete)return q$;if(S[6])return R$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&nd(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=ed(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,N$):Tt(S[19]),xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=nd(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function B$(n,e,t){let i,l,s,o;We(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of Or)N.id!=f&&N.collapse()}Ht(()=>(Or.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(Or,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,B$,V$,me,{key:1,field:0})}}function U$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function W$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[U$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[W$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[Y$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function J$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[K$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Z$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class G$ extends ge{constructor(e){super(),_e(this,e,Z$,J$,me,{field:0,key:1})}}function X$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Q$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[X$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Q$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function eT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function tT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[eT,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[tT],options:[x$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function iT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class lT extends ge{constructor(e){super(),_e(this,e,iT,nT,me,{field:0,key:1})}}function sT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class rT extends ge{constructor(e){super(),_e(this,e,oT,sT,me,{field:0,key:1})}}function aT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Fl extends ge{constructor(e){super(),_e(this,e,fT,aT,me,{value:0,separator:1,readonly:2,disabled:3})}}function uT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function cT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function dT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[uT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[cT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function pT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[dT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Wb extends ge{constructor(e){super(),_e(this,e,mT,pT,me,{field:0,key:1})}}function hT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function _T(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class gT extends ge{constructor(e){super(),_e(this,e,_T,hT,me,{field:0,key:1})}}function bT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function kT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[bT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[kT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function vT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class wT extends ge{constructor(e){super(),_e(this,e,vT,yT,me,{field:0,key:1})}}var Mr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$l={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},_s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function ld(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function fn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function dt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Yb(n,e){if(e(n))return n;if(n.parentNode)return Yb(n.parentNode,e)}function no(n,e){var t=dt("div","numInputWrapper"),i=dt("input","numInput "+n),l=dt("span","arrowUp"),s=dt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Ro=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},ST={D:Er,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Er,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Ui={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ls={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ls.w(n,e,t)]},F:function(n,e,t){return Ro(ls.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ls.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Ro(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Kb=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ls[c]&&m[d-1]!=="\\"?ls[c](r,u,t):c!=="\\"?c:""}).join("")}},aa=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||$l).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ar(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var fe=t._input.value;c(),Kt(),t._input.value!==fe&&t._debouncedChange()}function f(Z,X){return Z%12+12*In(X===t.l10n.amPM[1])}function u(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=f(Z,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Ir(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Ir(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Ir(Z,X,ne);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(Z){var X=yn(Z),ne=parseInt(X.value)+(Z.delta||0);(ne/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&Mt(ne)}function _(Z,X,ne,fe){if(X instanceof Array)return X.forEach(function(Te){return _(Z,Te,ne,fe)});if(Z instanceof Array)return Z.forEach(function(Te){return _(Te,X,ne,fe)});Z.addEventListener(X,ne,fe),t._handlers.push({remove:function(){return Z.removeEventListener(X,ne,fe)}})}function g(){kt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(fe){return _(fe,"click",t[ne])})}),t.isMobile){al();return}var Z=ld(ze,50);if(t._debouncedChange=ld(g,OT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ae(yn(ne))}),_(t._input,"keydown",De),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",De),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ut),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(Z,X){var ne=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=dt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Z,X,ne,fe){var Te=ft(X,!0),Le=dt("span",Z,X.getDate().toString());return Le.dateObj=X,Le.$i=fe,Le.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Te?(Le.tabIndex=-1,Mn(X)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(fn(Le,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),fn(Le,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),kt("onDayCreate",Le),Le}function D(Z){Z.focus(),t.config.mode==="range"&&Ae(Z)}function I(Z){for(var X=Z>0?0:t.config.showMonths-1,ne=Z>0?t.config.showMonths:-1,fe=X;fe!=ne;fe+=Z)for(var Te=t.daysContainer.children[fe],Le=Z>0?0:Te.children.length-1,Je=Z>0?Te.children.length:-1,qe=Le;qe!=Je;qe+=Z){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&ft(Qe.dateObj))return Qe}}function L(Z,X){for(var ne=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,fe=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Le=ne-t.currentMonth;Le!=fe;Le+=Te)for(var Je=t.daysContainer.children[Le],qe=ne-t.currentMonth===Le?Z.$i+X:X<0?Je.children.length-1:0,Qe=Je.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=Te){var Ve=Je.children[Re];if(Ve.className.indexOf("hidden")===-1&&ft(Ve.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(Z,X){var ne=s(),fe=ht(ne||document.body),Te=Z!==void 0?Z:fe?ne:t.selectedDateElem!==void 0&&ht(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&ht(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():fe?L(Te,X):D(Te)}function F(Z,X){for(var ne=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((X-1+12)%12,Z),Te=t.utils.getDaysInMonth(X,Z),Le=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",Qe=Je?"nextMonthDay hidden":"nextMonthDay",Re=fe+1-ne,Ve=0;Re<=fe;Re++,Ve++)Le.appendChild(O("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Le.appendChild(O("flatpickr-day",new Date(Z,X,Re),Re,Ve));for(var yt=Te+1;yt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);yt++,Ve++)Le.appendChild(O("flatpickr-day "+Qe,new Date(Z,X+1,yt%Te),yt,Ve));var Jn=dt("div","dayContainer");return Jn.appendChild(Le),Jn}function N(){if(t.daysContainer!==void 0){to(t.daysContainer),t.weekNumbers&&to(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ne=dt("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Ro(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Z=dt("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=dt("span","cur-month"):(t.monthsDropdownContainer=dt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),kt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var fe=no("cur-year",{tabindex:"-1"}),Te=fe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=dt("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(fe),X.appendChild(Le),Z.appendChild(X),{container:Z,yearElement:Te,monthElement:ne}}function H(){to(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){return t.monthNav=dt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(fn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(fn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Oe(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Ar(t.config);t.timeContainer=dt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=dt("span","flatpickr-time-separator",":"),ne=no("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var fe=no("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:u(Z.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=no("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(dt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=dt("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function U(){t.weekdayContainer?to(t.weekdayContainer):t.weekdayContainer=dt("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=dt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=sd(t.l10n.weekdays.shorthand);Z>0&&Z `+X.join("")+` - `}}function ie(){t.calendarContainer.classList.add("hasWeeks");var Z=dt("div","flatpickr-weekwrapper");Z.appendChild(dt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=dt("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function te(Z,X){X===void 0&&(X=!0);var ne=X?Z:Z-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,bt("onYearChange"),P()),N(),bt("onMonthChange"),Oe())}function pe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Dr(t.config),fe=ne.hours,Te=ne.minutes,Le=ne.seconds;m(fe,Te,Le)}t.redraw(),Z&&bt("onChange")}function Ne(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),bt("onClose")}function He(){t.config!==void 0&&bt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Xe(Z){return t.calendarContainer.contains(Z)}function xe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ne=Xe(X),fe=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),Te=!fe&&!ne&&!Xe(Z.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});Te&&Le&&(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 Mt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ne=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),bt("onYearChange"),P())}}function ft(Z,X){var ne;X===void 0&&(X=!0);var fe=t.parseDate(Z,void 0,X);if(t.config.minDate&&fe&&vn(fe,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&fe&&vn(fe,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(fe===void 0)return!1;for(var Te=!!t.config.enable,Le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Je=0,qe=void 0;Je=qe.from.getTime()&&fe.getTime()<=qe.to.getTime())return Te}return!Te}function mt(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Gt(Z){var X=Z.target===t._input,ne=t._input.value.trimEnd()!==ht();X&&ne&&!(Z.relatedTarget&&Xe(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function De(Z){var X=yn(Z),ne=t.config.wrap?n.contains(X):X===t._input,fe=t.config.allowInput,Te=t.isOpen&&(!fe||!ne),Le=t.config.inline&&ne&&!fe;if(Z.keyCode===13&&ne){if(fe)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Xe(X)||Te||Le){var Je=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Je?(Z.preventDefault(),a(),Ai()):ol(Z);break;case 27:Z.preventDefault(),Ai();break;case 8:case 46:ne&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Je&&!ne){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(fe===!1||qe&&mt(qe))){var Qe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),te(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),Mt(t.currentYear-Re),R(I(1),0)):Je||R(void 0,Re*7):X===t.currentYearElement?Mt(t.currentYear-Re):t.config.enableTime&&(!Je&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Je){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(kn){return kn}),yt=Ve.indexOf(X);if(yt!==-1){var Jn=Ve[yt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Kt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Kt();break}(ne||Xe(X))&&bt("onKeyDown",Z)}function Ae(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ne=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),fe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Le=Math.max(ne,t.selectedDates[0].getTime()),Je=!1,qe=0,Qe=0,Re=Te;ReTe&&Reqe)?qe=Re:Re>fe&&(!Qe||Re ."+X));Ve.forEach(function(yt){var Jn=yt.dateObj,kn=Jn.getTime(),Fl=qe>0&&kn0&&kn>Qe;if(Fl){yt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ul){yt.classList.remove(ul)});return}else if(Je&&!Fl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ul){yt.classList.remove(ul)}),Z!==void 0&&(Z.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),fene&&kn===fe&&yt.classList.add("endRange"),kn>=qe&&(Qe===0||kn<=Qe)&&kT(kn,fe,ne)&&yt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function gt(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ne=yn(Z);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),bt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var fe=t.isOpen;t.isOpen=!0,fe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),bt("onOpen"),zt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function de(Z){return function(X){var ne=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),fe=t.config["_"+(Z==="min"?"max":"min")+"Date"];ne!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return ft(Te)}),!t.selectedDates.length&&Z==="min"&&d(ne),Kt()),t.daysContainer&&(qn(),ne!==void 0?t.currentYearElement[Z]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!fe&&ne!==void 0&&fe.getFullYear()===ne.getFullYear())}}function ve(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=tn(tn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Kn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Kn(Ve)}});var fe=X.mode==="time";if(!X.dateFormat&&(X.enableTime||fe)){var Te=Bt.defaultConfig.dateFormat||wl.dateFormat;ne.dateFormat=X.noCalendar||fe?"H:i"+(X.enableSeconds?":S":""):Te+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||fe)&&!X.altFormat){var Le=Bt.defaultConfig.altFormat||wl.altFormat;ne.altFormat=X.noCalendar||fe?"h:i"+(X.enableSeconds?":S K":" K"):Le+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:de("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:de("max")});var Je=function(Ve){return function(yt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(yt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Je("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Je("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe-1?t.config[Re]=Cr(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=we().className+" "+t.config.altInputClass),bt("onParseConfig")}function we(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ye(){typeof t.config.locale!="object"&&typeof Bt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=tn(tn({},Bt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Bt.l10ns[t.config.locale]:void 0),Bi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Bi.l="("+t.l10n.weekdays.longhand.join("|")+")",Bi.M="("+t.l10n.months.shorthand.join("|")+")",Bi.F="("+t.l10n.months.longhand.join("|")+")",Bi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=tn(tn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Bt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Ub(t),t.parseDate=sa({config:t.config,l10n:t.l10n})}function zt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){bt("onPreCalendarPosition");var X=Z||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(r0,a0){return r0+a0.offsetHeight},0),fe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Le=Te[0],Je=Te.length>1?Te[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Le==="above"||Le!=="below"&&Qene,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(an(t.calendarContainer,"arrowTop",!Re),an(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var yt=window.pageXOffset+qe.left,Jn=!1,kn=!1;Je==="center"?(yt-=(fe-qe.width)/2,Jn=!0):Je==="right"&&(yt-=fe-qe.width,kn=!0),an(t.calendarContainer,"arrowLeft",!Jn&&!kn),an(t.calendarContainer,"arrowCenter",Jn),an(t.calendarContainer,"arrowRight",kn);var Fl=window.document.body.offsetWidth-(window.pageXOffset+qe.right),ul=yt+fe>window.document.body.offsetWidth,e0=Fl+fe>window.document.body.offsetWidth;if(an(t.calendarContainer,"rightMost",ul),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!ul)t.calendarContainer.style.left=yt+"px",t.calendarContainer.style.right="auto";else if(!e0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fl+"px";else{var er=cn();if(er===void 0)return;var t0=window.document.body.offsetWidth,n0=Math.max(0,t0/2-fe/2),i0=".flatpickr-calendar.centerMost:before",l0=".flatpickr-calendar.centerMost:after",s0=er.cssRules.length,o0="{left:"+qe.left+"px;right:auto;}";an(t.calendarContainer,"rightMost",!1),an(t.calendarContainer,"centerMost",!0),er.insertRule(i0+","+l0+o0,s0),t.calendarContainer.style.left=n0+"px",t.calendarContainer.style.right="auto"}}}}function cn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=fe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Je=Mn(Te);Je?t.selectedDates.splice(parseInt(Je),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),vn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,yt){return Ve.getTime()-yt.getTime()}));if(c(),Le){var qe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),qe&&(bt("onYearChange"),P()),bt("onMonthChange")}if(Oe(),N(),Kt(),!Le&&t.config.mode!=="range"&&t.config.showMonths===1?D(fe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Ai()}g()}}var gi={locale:[Ye,Y],showMonths:[H,r,U],minDate:[S],maxDate:[S],positionElement:[bi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ee(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ne in Z)gi[ne]!==void 0&&gi[ne].forEach(function(fe){return fe()})}else t.config[Z]=X,gi[Z]!==void 0?gi[Z].forEach(function(fe){return fe()}):Tr.indexOf(Z)>-1&&(t.config[Z]=Cr(X));t.redraw(),Kt(!0)}function Nt(Z,X){var ne=[];if(Z instanceof Array)ne=Z.map(function(fe){return t.parseDate(fe,X)});else if(Z instanceof Date||typeof Z=="number")ne=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(Z,X)];break;case"multiple":ne=Z.split(t.config.conjunction).map(function(fe){return t.parseDate(fe,X)});break;case"range":ne=Z.split(t.l10n.rangeSeparator).map(function(fe){return t.parseDate(fe,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(fe){return fe instanceof Date&&ft(fe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(fe,Te){return fe.getTime()-Te.getTime()})}function Li(Z,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Nt(Z,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Kt(X),X&&bt("onChange")}function Kn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function rl(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Nt(Z,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Pl(){if(t.input=we(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=dt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bi()}function bi(){t._positionElement=t.config.positionElement||t._input}function al(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=dt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),bt("onChange"),bt("onClose")})}function fl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function bt(Z,X){if(t.config!==void 0){var ne=t.config[Z];if(ne!==void 0&&ne.length>0)for(var fe=0;ne[fe]&&fe=0&&vn(Z,t.selectedDates[1])<=0}function Oe(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),Z.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function ht(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,fe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===fe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Kt(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=ht(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=ht(t.config.altFormat)),Z!==!1&&bt("onValueUpdate")}function ut(Z){var X=yn(Z),ne=t.prevMonthNav.contains(X),fe=t.nextMonthNav.contains(X);ne||fe?te(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ne=yn(Z),fe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(fe.getAttribute("min")),Le=parseFloat(fe.getAttribute("max")),Je=parseFloat(fe.getAttribute("step")),qe=parseInt(fe.value,10),Qe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Je*Qe;if(typeof fe.value<"u"&&fe.value.length===2){var Ve=fe===t.hourElement,yt=fe===t.minuteElement;ReLe&&(Re=fe===t.hourElement?Re-Le-In(!t.amPM):Te,yt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Je===1?Re+qe===23:Math.abs(Re-qe)>Je)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),fe.value=pn(Re)}}return l(),t}function Sl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function OT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:f="",element:u=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Ht(()=>{const $=u??h,C=y(d);return C.onReady.push((O,D,I)=>{a===void 0&&S(O,D,I),Qt().then(()=>{t(8,m=!0)})}),t(3,_=Bt($,Object.assign(C,u?{wrap:!0}:{}))),()=>{_.destroy()}});const g=lt();function y($={}){$=Object.assign({},$);for(const C of r){const O=(D,I,L)=>{g(CT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(O)):$[C]=[O]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,O){const D=ld(O,$);!sd(a,D)&&(a||D)&&t(2,a=D),t(4,f=C)}function T($){ee[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Ie(Ie({},e),Yt($)),t(1,l=Ge(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,f=$.formattedValue),"element"in $&&t(5,u=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(sd(a,ld(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,f,u,c,d,m,o,s,T]}class Va extends ge{constructor(e){super(),_e(this,e,OT,TT,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function MT(n){let e,t,i,l,s,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Va({props:c}),ee.push(()=>be(s,"value",f)),ee.push(()=>be(s,"formattedValue",u)),s.$on("close",n[8]),{c(){e=b("label"),t=K("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function DT(n){let e,t,i,l,s,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Va({props:c}),ee.push(()=>be(s,"value",f)),ee.push(()=>be(s,"formattedValue",u)),s.$on("close",n[11]),{c(){e=b("label"),t=K("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function ET(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[MT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[DT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&196613&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&196617&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function IT(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[ET]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ot(r[5])]):{};a&131087&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function AT(n,e,t){var $,C;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function f(O,D){O.detail&&O.detail.length==3&&t(0,s.options[D]=O.detail[1],s)}function u(O){r=O,t(2,r),t(0,s)}function c(O){n.$$.not_equal(s.options.min,O)&&(s.options.min=O,t(0,s))}const d=O=>f(O,"min");function m(O){a=O,t(3,a),t(0,s)}function h(O){n.$$.not_equal(s.options.max,O)&&(s.options.max=O,t(0,s))}const _=O=>f(O,"max");function g(O){s=O,t(0,s)}function y(O){Ce.call(this,n,O)}function S(O){Ce.call(this,n,O)}function T(O){Ce.call(this,n,O)}return n.$$set=O=>{e=Ie(Ie({},e),Yt(O)),t(5,l=Ge(e,i)),"field"in O&&t(0,s=O.field),"key"in O&&t(1,o=O.key)},n.$$.update=()=>{var O,D,I,L;n.$$.dirty&5&&r!=((O=s==null?void 0:s.options)==null?void 0:O.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,f,l,u,c,d,m,h,_,g,y,S,T]}class LT extends ge{constructor(e){super(),_e(this,e,AT,IT,me,{field:0,key:1})}}const NT=n=>({}),od=n=>({});function rd(n,e,t){const i=n.slice();return i[48]=e[t],i}const PT=n=>({}),ad=n=>({});function fd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function ud(n){let e,t,i;return{c(){e=b("div"),t=K(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function FT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function RT(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&2049?pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ot(r[11])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function cd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Clear")),J(e,"click",Tn(Be(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function dd(n){let e,t,i,l,s,o;const r=[RT,FT],a=[];function f(c,d){return c[10]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[8])&&cd(n);return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),u&&u.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(le(),A(a[m],1,1,()=>{a[m]=null}),se(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?u?u.p(c,d):(u=cd(c),u.c(),u.m(e,s)):u&&(u.d(1),u=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),u&&u.d()}}}function pd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[HT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function md(n){let e,t,i,l,s,o,r,a,f=n[17].length&&hd(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),f&&f.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(t,l),k(t,s),re(s,n[17]),k(t,o),f&&f.m(t,null),s.focus(),r||(a=J(s,"input",n[38]),r=!0)},p(u,c){c[0]&8&&p(s,"placeholder",u[3]),c[0]&131072&&s.value!==u[17]&&re(s,u[17]),u[17].length?f?f.p(u,c):(f=hd(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&v(e),f&&f.d(),r=!1,a()}}}function hd(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",Tn(Be(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function _d(n){let e,t=n[1]&&gd(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=gd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function gd(n){let e,t;return{c(){e=b("div"),t=K(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&v(e)}}}function qT(n){let e=n[48]+"",t;return{c(){t=K(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&oe(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function jT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&4202496?pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ot(r[13])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function bd(n){let e,t,i,l,s,o,r;const a=[jT,qT],f=[];function u(m,h){return m[12]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),f[t].m(e,null),k(e,l),s=!0,o||(r=[J(e,"click",c),J(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=u(n),t===_?f[t].p(n,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),i=f[t],i?i.p(n,h):(i=f[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),f[t].d(),o=!1,$e(r)}}}function HT(n){let e,t,i,l,s,o=n[14]&&md(n);const r=n[35].beforeOptions,a=wt(r,n,n[44],ad);let f=ue(n[22]),u=[];for(let _=0;_A(u[_],1,1,()=>{u[_]=null});let d=null;f.length||(d=_d(n));const m=n[35].afterOptions,h=wt(m,n,n[44],od);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let _=0;_A(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=ud(n));let c=!n[5]&&!n[6]&&pd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),se()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mwe(Ye,ve))||[]}function Ne(de,ve){de.preventDefault(),y&&d?W(ve):H(ve)}function He(de,ve){(de.code==="Enter"||de.code==="Space")&&(Ne(de,ve),S&&Y())}function Xe(){te(),setTimeout(()=>{const de=N==null?void 0:N.querySelector(".dropdown-item.option.selected");de&&(de.focus(),de.scrollIntoView({block:"nearest"}))},0)}function xe(de){de.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Ht(()=>{const de=document.querySelectorAll(`label[for="${r}"]`);for(const ve of de)ve.addEventListener("click",xe);return()=>{for(const ve of de)ve.removeEventListener("click",xe)}});const Mt=de=>q(de);function ft(de){ee[de?"unshift":"push"](()=>{P=de,t(20,P)})}function mt(){F=this.value,t(17,F)}const Gt=(de,ve)=>Ne(ve,de),De=(de,ve)=>He(ve,de);function Ae(de){ee[de?"unshift":"push"](()=>{R=de,t(18,R)})}function ze(de){Ce.call(this,n,de)}function gt(de){ee[de?"unshift":"push"](()=>{N=de,t(19,N)})}return n.$$set=de=>{"id"in de&&t(27,r=de.id),"noOptionsText"in de&&t(1,a=de.noOptionsText),"selectPlaceholder"in de&&t(2,f=de.selectPlaceholder),"searchPlaceholder"in de&&t(3,u=de.searchPlaceholder),"items"in de&&t(28,c=de.items),"multiple"in de&&t(4,d=de.multiple),"disabled"in de&&t(5,m=de.disabled),"readonly"in de&&t(6,h=de.readonly),"upside"in de&&t(7,_=de.upside),"selected"in de&&t(0,g=de.selected),"toggle"in de&&t(8,y=de.toggle),"closable"in de&&t(9,S=de.closable),"labelComponent"in de&&t(10,T=de.labelComponent),"labelComponentProps"in de&&t(11,$=de.labelComponentProps),"optionComponent"in de&&t(12,C=de.optionComponent),"optionComponentProps"in de&&t(13,O=de.optionComponentProps),"searchable"in de&&t(14,D=de.searchable),"searchFunc"in de&&t(29,I=de.searchFunc),"class"in de&&t(15,L=de.class),"$$scope"in de&&t(44,o=de.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ie(),te()),n.$$.dirty[0]&268566528&&t(22,i=pe(c,F)),n.$$.dirty[0]&1&&t(21,l=function(de){const ve=j.toArray(g);return j.inArray(ve,de)})},[g,a,f,u,d,m,h,_,y,S,T,$,C,O,D,L,q,F,R,N,P,l,i,te,Ne,He,Xe,r,c,I,H,W,G,U,Y,s,Mt,ft,mt,Gt,De,Ae,ze,gt,o]}class Wb extends ge{constructor(e){super(),_e(this,e,BT,zT,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function kd(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function UT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&kd(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=K(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=kd(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function WT(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class yd extends ge{constructor(e){super(),_e(this,e,WT,UT,me,{item:0})}}const YT=n=>({}),vd=n=>({});function KT(n){let e;const t=n[8].afterOptions,i=wt(t,n,n[12],vd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&$t(i,t,l,l[12],e?St(t,l[12],s,YT):Tt(l[12]),vd)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function JT(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[KT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&62?pt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ot(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function ZT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=yd}=e,{optionComponent:c=yd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const O=j.findByKey(r,d,C);O&&$.push(O)}T.length&&!$.length||t(0,f=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){f=T,t(0,f)}function y(T){Ce.call(this,n,T)}function S(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ie(Ie({},e),Yt(T)),t(5,l=Ge(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,f=T.selected),"labelComponent"in T&&t(3,u=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(f)},[f,r,a,u,c,l,m,d,s,g,y,S,o]}class hi extends ge{constructor(e){super(),_e(this,e,ZT,JT,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function GT(n){let e,t,i,l,s,o;function r(f){n[7](f)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Nl({props:a}),ee.push(()=>be(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(f,u){w(f,e,u),z(t,e,null),l=!0,s||(o=Se(Pe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(f,u){const c={};u&16384&&(c.id=f[14]),u&32768&&(c.readonly=!f[15]),!i&&u&1&&(i=!0,c.value=f[0].options.values,ke(()=>i=!1)),t.$set(c)},i(f){l||(E(t.$$.fragment,f),l=!0)},o(f){A(t.$$.fragment,f),l=!1},d(f){f&&v(e),V(t),s=!1,o()}}}function XT(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function QT(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[GT,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[XT,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function wd(n){let e,t;return e=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xT,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function eC(n){let e,t,i=!n[2]&&wd(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(le(),A(i,1,1,()=>{i=null}),se()):i?(i.p(l,s),s&4&&E(i,1)):(i=wd(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function tC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[eC],default:[QT,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&18?pt(l,[a&2&&{key:r[1]},a&16&&Ot(r[4])]):{};a&98311&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function nC(n,e,t){var S;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,f=a;function u(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,f=a)}function c(){s.options.maxSelect=it(this.value),t(0,s),t(5,f),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,f),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,f),t(2,a)}function _(T){Ce.call(this,n,T)}function g(T){Ce.call(this,n,T)}function y(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ie(Ie({},e),Yt(T)),t(4,l=Ge(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&u()},[s,o,a,r,l,f,c,d,m,h,_,g,y]}class iC extends ge{constructor(e){super(),_e(this,e,nC,tC,me,{field:0,key:1})}}function lC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max size "),i=b("small"),i.textContent="(bytes)",s=M(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(u,c){w(u,e,c),k(e,t),k(e,i),w(u,s,c),w(u,o,c),re(o,n[0].options.maxSize),a||(f=J(o,"input",n[4]),a=!0)},p(u,c){c&2048&&l!==(l=u[11])&&p(e,"for",l),c&2048&&r!==(r=u[11])&&p(o,"id",r),c&1&&it(o.value)!==u[0].options.maxSize&&re(o,u[0].options.maxSize)},d(u){u&&(v(e),v(s),v(o)),a=!1,f()}}}function sC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function oC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Sd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,H,W,G,U,Y,ie;return{c(){e=b("div"),t=b("div"),i=b("div"),l=K("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=K(` and + `}}function ie(){t.calendarContainer.classList.add("hasWeeks");var Z=dt("div","flatpickr-weekwrapper");Z.appendChild(dt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=dt("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function te(Z,X){X===void 0&&(X=!0);var ne=X?Z:Z-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,kt("onYearChange"),P()),N(),kt("onMonthChange"),Oe())}function pe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ar(t.config),fe=ne.hours,Te=ne.minutes,Le=ne.seconds;m(fe,Te,Le)}t.redraw(),Z&&kt("onChange")}function Ne(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),kt("onClose")}function He(){t.config!==void 0&&kt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Xe(Z){return t.calendarContainer.contains(Z)}function xe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ne=Xe(X),fe=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),Te=!fe&&!ne&&!Xe(Z.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});Te&&Le&&(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 Mt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ne=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),kt("onYearChange"),P())}}function ft(Z,X){var ne;X===void 0&&(X=!0);var fe=t.parseDate(Z,void 0,X);if(t.config.minDate&&fe&&vn(fe,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&fe&&vn(fe,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(fe===void 0)return!1;for(var Te=!!t.config.enable,Le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Je=0,qe=void 0;Je=qe.from.getTime()&&fe.getTime()<=qe.to.getTime())return Te}return!Te}function ht(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Gt(Z){var X=Z.target===t._input,ne=t._input.value.trimEnd()!==_t();X&&ne&&!(Z.relatedTarget&&Xe(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function De(Z){var X=yn(Z),ne=t.config.wrap?n.contains(X):X===t._input,fe=t.config.allowInput,Te=t.isOpen&&(!fe||!ne),Le=t.config.inline&&ne&&!fe;if(Z.keyCode===13&&ne){if(fe)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Xe(X)||Te||Le){var Je=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Je?(Z.preventDefault(),a(),Li()):ol(Z);break;case 27:Z.preventDefault(),Li();break;case 8:case 46:ne&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Je&&!ne){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(fe===!1||qe&&ht(qe))){var Qe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),te(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),Mt(t.currentYear-Re),R(I(1),0)):Je||R(void 0,Re*7):X===t.currentYearElement?Mt(t.currentYear-Re):t.config.enableTime&&(!Je&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Je){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(kn){return kn}),yt=Ve.indexOf(X);if(yt!==-1){var Jn=Ve[yt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Kt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Kt();break}(ne||Xe(X))&&kt("onKeyDown",Z)}function Ae(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ne=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),fe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Le=Math.max(ne,t.selectedDates[0].getTime()),Je=!1,qe=0,Qe=0,Re=Te;ReTe&&Reqe)?qe=Re:Re>fe&&(!Qe||Re ."+X));Ve.forEach(function(yt){var Jn=yt.dateObj,kn=Jn.getTime(),ql=qe>0&&kn0&&kn>Qe;if(ql){yt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ul){yt.classList.remove(ul)});return}else if(Je&&!ql)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ul){yt.classList.remove(ul)}),Z!==void 0&&(Z.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),fene&&kn===fe&&yt.classList.add("endRange"),kn>=qe&&(Qe===0||kn<=Qe)&&$T(kn,fe,ne)&&yt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function bt(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ne=yn(Z);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),kt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var fe=t.isOpen;t.isOpen=!0,fe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),kt("onOpen"),zt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function de(Z){return function(X){var ne=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),fe=t.config["_"+(Z==="min"?"max":"min")+"Date"];ne!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return ft(Te)}),!t.selectedDates.length&&Z==="min"&&d(ne),Kt()),t.daysContainer&&(qn(),ne!==void 0?t.currentYearElement[Z]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!fe&&ne!==void 0&&fe.getFullYear()===ne.getFullYear())}}function ve(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=nn(nn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Kn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Kn(Ve)}});var fe=X.mode==="time";if(!X.dateFormat&&(X.enableTime||fe)){var Te=Bt.defaultConfig.dateFormat||$l.dateFormat;ne.dateFormat=X.noCalendar||fe?"H:i"+(X.enableSeconds?":S":""):Te+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||fe)&&!X.altFormat){var Le=Bt.defaultConfig.altFormat||$l.altFormat;ne.altFormat=X.noCalendar||fe?"h:i"+(X.enableSeconds?":S K":" K"):Le+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:de("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:de("max")});var Je=function(Ve){return function(yt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(yt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Je("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Je("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe-1?t.config[Re]=Dr(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=we().className+" "+t.config.altInputClass),kt("onParseConfig")}function we(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ye(){typeof t.config.locale!="object"&&typeof Bt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=nn(nn({},Bt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Bt.l10ns[t.config.locale]:void 0),Ui.D="("+t.l10n.weekdays.shorthand.join("|")+")",Ui.l="("+t.l10n.weekdays.longhand.join("|")+")",Ui.M="("+t.l10n.months.shorthand.join("|")+")",Ui.F="("+t.l10n.months.longhand.join("|")+")",Ui.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=nn(nn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Bt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Kb(t),t.parseDate=aa({config:t.config,l10n:t.l10n})}function zt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){kt("onPreCalendarPosition");var X=Z||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(u0,c0){return u0+c0.offsetHeight},0),fe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Le=Te[0],Je=Te.length>1?Te[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Le==="above"||Le!=="below"&&Qene,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(fn(t.calendarContainer,"arrowTop",!Re),fn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var yt=window.pageXOffset+qe.left,Jn=!1,kn=!1;Je==="center"?(yt-=(fe-qe.width)/2,Jn=!0):Je==="right"&&(yt-=fe-qe.width,kn=!0),fn(t.calendarContainer,"arrowLeft",!Jn&&!kn),fn(t.calendarContainer,"arrowCenter",Jn),fn(t.calendarContainer,"arrowRight",kn);var ql=window.document.body.offsetWidth-(window.pageXOffset+qe.right),ul=yt+fe>window.document.body.offsetWidth,i0=ql+fe>window.document.body.offsetWidth;if(fn(t.calendarContainer,"rightMost",ul),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!ul)t.calendarContainer.style.left=yt+"px",t.calendarContainer.style.right="auto";else if(!i0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=ql+"px";else{var nr=dn();if(nr===void 0)return;var l0=window.document.body.offsetWidth,s0=Math.max(0,l0/2-fe/2),o0=".flatpickr-calendar.centerMost:before",r0=".flatpickr-calendar.centerMost:after",a0=nr.cssRules.length,f0="{left:"+qe.left+"px;right:auto;}";fn(t.calendarContainer,"rightMost",!1),fn(t.calendarContainer,"centerMost",!0),nr.insertRule(o0+","+r0+f0,a0),t.calendarContainer.style.left=s0+"px",t.calendarContainer.style.right="auto"}}}}function dn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=fe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Je=Mn(Te);Je?t.selectedDates.splice(parseInt(Je),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),vn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,yt){return Ve.getTime()-yt.getTime()}));if(c(),Le){var qe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),qe&&(kt("onYearChange"),P()),kt("onMonthChange")}if(Oe(),N(),Kt(),!Le&&t.config.mode!=="range"&&t.config.showMonths===1?D(fe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Li()}g()}}var gi={locale:[Ye,Y],showMonths:[H,r,U],minDate:[S],maxDate:[S],positionElement:[bi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ee(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ne in Z)gi[ne]!==void 0&&gi[ne].forEach(function(fe){return fe()})}else t.config[Z]=X,gi[Z]!==void 0?gi[Z].forEach(function(fe){return fe()}):Mr.indexOf(Z)>-1&&(t.config[Z]=Dr(X));t.redraw(),Kt(!0)}function Nt(Z,X){var ne=[];if(Z instanceof Array)ne=Z.map(function(fe){return t.parseDate(fe,X)});else if(Z instanceof Date||typeof Z=="number")ne=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(Z,X)];break;case"multiple":ne=Z.split(t.config.conjunction).map(function(fe){return t.parseDate(fe,X)});break;case"range":ne=Z.split(t.l10n.rangeSeparator).map(function(fe){return t.parseDate(fe,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(fe){return fe instanceof Date&&ft(fe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(fe,Te){return fe.getTime()-Te.getTime()})}function Ni(Z,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Nt(Z,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Kt(X),X&&kt("onChange")}function Kn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function rl(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Nt(Z,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Rl(){if(t.input=we(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=dt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bi()}function bi(){t._positionElement=t.config.positionElement||t._input}function al(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=dt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),kt("onChange"),kt("onClose")})}function fl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function kt(Z,X){if(t.config!==void 0){var ne=t.config[Z];if(ne!==void 0&&ne.length>0)for(var fe=0;ne[fe]&&fe=0&&vn(Z,t.selectedDates[1])<=0}function Oe(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Ro(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),Z.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function _t(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,fe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===fe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Kt(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=_t(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=_t(t.config.altFormat)),Z!==!1&&kt("onValueUpdate")}function ut(Z){var X=yn(Z),ne=t.prevMonthNav.contains(X),fe=t.nextMonthNav.contains(X);ne||fe?te(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ne=yn(Z),fe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(fe.getAttribute("min")),Le=parseFloat(fe.getAttribute("max")),Je=parseFloat(fe.getAttribute("step")),qe=parseInt(fe.value,10),Qe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Je*Qe;if(typeof fe.value<"u"&&fe.value.length===2){var Ve=fe===t.hourElement,yt=fe===t.minuteElement;ReLe&&(Re=fe===t.hourElement?Re-Le-In(!t.amPM):Te,yt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Je===1?Re+qe===23:Math.abs(Re-qe)>Je)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),fe.value=mn(Re)}}return l(),t}function Tl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function AT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:f="",element:u=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Ht(()=>{const $=u??h,C=y(d);return C.onReady.push((O,D,I)=>{a===void 0&&S(O,D,I),Qt().then(()=>{t(8,m=!0)})}),t(3,_=Bt($,Object.assign(C,u?{wrap:!0}:{}))),()=>{_.destroy()}});const g=lt();function y($={}){$=Object.assign({},$);for(const C of r){const O=(D,I,L)=>{g(IT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(O)):$[C]=[O]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,O){const D=od(O,$);!rd(a,D)&&(a||D)&&t(2,a=D),t(4,f=C)}function T($){ee[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Ie(Ie({},e),Yt($)),t(1,l=Ge(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,f=$.formattedValue),"element"in $&&t(5,u=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(rd(a,od(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,f,u,c,d,m,o,s,T]}class Wa extends ge{constructor(e){super(),_e(this,e,AT,ET,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function LT(n){let e,t,i,l,s,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Wa({props:c}),ee.push(()=>be(s,"value",f)),ee.push(()=>be(s,"formattedValue",u)),s.$on("close",n[8]),{c(){e=b("label"),t=K("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function NT(n){let e,t,i,l,s,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Wa({props:c}),ee.push(()=>be(s,"value",f)),ee.push(()=>be(s,"formattedValue",u)),s.$on("close",n[11]),{c(){e=b("label"),t=K("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function PT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[LT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[NT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&196613&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&196617&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function FT(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[PT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ot(r[5])]):{};a&131087&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function RT(n,e,t){var $,C;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function f(O,D){O.detail&&O.detail.length==3&&t(0,s.options[D]=O.detail[1],s)}function u(O){r=O,t(2,r),t(0,s)}function c(O){n.$$.not_equal(s.options.min,O)&&(s.options.min=O,t(0,s))}const d=O=>f(O,"min");function m(O){a=O,t(3,a),t(0,s)}function h(O){n.$$.not_equal(s.options.max,O)&&(s.options.max=O,t(0,s))}const _=O=>f(O,"max");function g(O){s=O,t(0,s)}function y(O){Ce.call(this,n,O)}function S(O){Ce.call(this,n,O)}function T(O){Ce.call(this,n,O)}return n.$$set=O=>{e=Ie(Ie({},e),Yt(O)),t(5,l=Ge(e,i)),"field"in O&&t(0,s=O.field),"key"in O&&t(1,o=O.key)},n.$$.update=()=>{var O,D,I,L;n.$$.dirty&5&&r!=((O=s==null?void 0:s.options)==null?void 0:O.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,f,l,u,c,d,m,h,_,g,y,S,T]}class qT extends ge{constructor(e){super(),_e(this,e,RT,FT,me,{field:0,key:1})}}const jT=n=>({}),ad=n=>({});function fd(n,e,t){const i=n.slice();return i[48]=e[t],i}const HT=n=>({}),ud=n=>({});function cd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function dd(n){let e,t,i;return{c(){e=b("div"),t=K(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function zT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function VT(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&2049?pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ot(r[11])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function pd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Clear")),J(e,"click",Tn(Be(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function md(n){let e,t,i,l,s,o;const r=[VT,zT],a=[];function f(c,d){return c[10]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[8])&&pd(n);return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),u&&u.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(le(),A(a[m],1,1,()=>{a[m]=null}),se(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?u?u.p(c,d):(u=pd(c),u.c(),u.m(e,s)):u&&(u.d(1),u=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),u&&u.d()}}}function hd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[WT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function _d(n){let e,t,i,l,s,o,r,a,f=n[17].length&&gd(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),f&&f.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(t,l),k(t,s),re(s,n[17]),k(t,o),f&&f.m(t,null),s.focus(),r||(a=J(s,"input",n[38]),r=!0)},p(u,c){c[0]&8&&p(s,"placeholder",u[3]),c[0]&131072&&s.value!==u[17]&&re(s,u[17]),u[17].length?f?f.p(u,c):(f=gd(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&v(e),f&&f.d(),r=!1,a()}}}function gd(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",Tn(Be(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function bd(n){let e,t=n[1]&&kd(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=kd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function kd(n){let e,t;return{c(){e=b("div"),t=K(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&v(e)}}}function BT(n){let e=n[48]+"",t;return{c(){t=K(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&oe(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function UT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&4202496?pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ot(r[13])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function yd(n){let e,t,i,l,s,o,r;const a=[UT,BT],f=[];function u(m,h){return m[12]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),f[t].m(e,null),k(e,l),s=!0,o||(r=[J(e,"click",c),J(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=u(n),t===_?f[t].p(n,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),i=f[t],i?i.p(n,h):(i=f[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),f[t].d(),o=!1,$e(r)}}}function WT(n){let e,t,i,l,s,o=n[14]&&_d(n);const r=n[35].beforeOptions,a=wt(r,n,n[44],ud);let f=ue(n[22]),u=[];for(let _=0;_A(u[_],1,1,()=>{u[_]=null});let d=null;f.length||(d=bd(n));const m=n[35].afterOptions,h=wt(m,n,n[44],ad);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let _=0;_A(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=dd(n));let c=!n[5]&&!n[6]&&hd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),se()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mwe(Ye,ve))||[]}function Ne(de,ve){de.preventDefault(),y&&d?W(ve):H(ve)}function He(de,ve){(de.code==="Enter"||de.code==="Space")&&(Ne(de,ve),S&&Y())}function Xe(){te(),setTimeout(()=>{const de=N==null?void 0:N.querySelector(".dropdown-item.option.selected");de&&(de.focus(),de.scrollIntoView({block:"nearest"}))},0)}function xe(de){de.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Ht(()=>{const de=document.querySelectorAll(`label[for="${r}"]`);for(const ve of de)ve.addEventListener("click",xe);return()=>{for(const ve of de)ve.removeEventListener("click",xe)}});const Mt=de=>q(de);function ft(de){ee[de?"unshift":"push"](()=>{P=de,t(20,P)})}function ht(){F=this.value,t(17,F)}const Gt=(de,ve)=>Ne(ve,de),De=(de,ve)=>He(ve,de);function Ae(de){ee[de?"unshift":"push"](()=>{R=de,t(18,R)})}function ze(de){Ce.call(this,n,de)}function bt(de){ee[de?"unshift":"push"](()=>{N=de,t(19,N)})}return n.$$set=de=>{"id"in de&&t(27,r=de.id),"noOptionsText"in de&&t(1,a=de.noOptionsText),"selectPlaceholder"in de&&t(2,f=de.selectPlaceholder),"searchPlaceholder"in de&&t(3,u=de.searchPlaceholder),"items"in de&&t(28,c=de.items),"multiple"in de&&t(4,d=de.multiple),"disabled"in de&&t(5,m=de.disabled),"readonly"in de&&t(6,h=de.readonly),"upside"in de&&t(7,_=de.upside),"selected"in de&&t(0,g=de.selected),"toggle"in de&&t(8,y=de.toggle),"closable"in de&&t(9,S=de.closable),"labelComponent"in de&&t(10,T=de.labelComponent),"labelComponentProps"in de&&t(11,$=de.labelComponentProps),"optionComponent"in de&&t(12,C=de.optionComponent),"optionComponentProps"in de&&t(13,O=de.optionComponentProps),"searchable"in de&&t(14,D=de.searchable),"searchFunc"in de&&t(29,I=de.searchFunc),"class"in de&&t(15,L=de.class),"$$scope"in de&&t(44,o=de.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ie(),te()),n.$$.dirty[0]&268566528&&t(22,i=pe(c,F)),n.$$.dirty[0]&1&&t(21,l=function(de){const ve=j.toArray(g);return j.inArray(ve,de)})},[g,a,f,u,d,m,h,_,y,S,T,$,C,O,D,L,q,F,R,N,P,l,i,te,Ne,He,Xe,r,c,I,H,W,G,U,Y,s,Mt,ft,ht,Gt,De,Ae,ze,bt,o]}class Jb extends ge{constructor(e){super(),_e(this,e,JT,YT,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function vd(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function ZT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&vd(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=K(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=vd(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function GT(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class wd extends ge{constructor(e){super(),_e(this,e,GT,ZT,me,{item:0})}}const XT=n=>({}),Sd=n=>({});function QT(n){let e;const t=n[8].afterOptions,i=wt(t,n,n[12],Sd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&$t(i,t,l,l[12],e?St(t,l[12],s,XT):Tt(l[12]),Sd)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function xT(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[QT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&62?pt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ot(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function eC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=wd}=e,{optionComponent:c=wd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const O=j.findByKey(r,d,C);O&&$.push(O)}T.length&&!$.length||t(0,f=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){f=T,t(0,f)}function y(T){Ce.call(this,n,T)}function S(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ie(Ie({},e),Yt(T)),t(5,l=Ge(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,f=T.selected),"labelComponent"in T&&t(3,u=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(f)},[f,r,a,u,c,l,m,d,s,g,y,S,o]}class hi extends ge{constructor(e){super(),_e(this,e,eC,xT,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function tC(n){let e,t,i,l,s,o;function r(f){n[7](f)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Fl({props:a}),ee.push(()=>be(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(f,u){w(f,e,u),z(t,e,null),l=!0,s||(o=Se(Pe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(f,u){const c={};u&16384&&(c.id=f[14]),u&32768&&(c.readonly=!f[15]),!i&&u&1&&(i=!0,c.value=f[0].options.values,ke(()=>i=!1)),t.$set(c)},i(f){l||(E(t.$$.fragment,f),l=!0)},o(f){A(t.$$.fragment,f),l=!1},d(f){f&&v(e),V(t),s=!1,o()}}}function nC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function iC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[tC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[nC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function $d(n){let e,t;return e=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[lC,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function sC(n){let e,t,i=!n[2]&&$d(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(le(),A(i,1,1,()=>{i=null}),se()):i?(i.p(l,s),s&4&&E(i,1)):(i=$d(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function oC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[sC],default:[iC,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&18?pt(l,[a&2&&{key:r[1]},a&16&&Ot(r[4])]):{};a&98311&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function rC(n,e,t){var S;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,f=a;function u(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,f=a)}function c(){s.options.maxSelect=it(this.value),t(0,s),t(5,f),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,f),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,f),t(2,a)}function _(T){Ce.call(this,n,T)}function g(T){Ce.call(this,n,T)}function y(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ie(Ie({},e),Yt(T)),t(4,l=Ge(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&u()},[s,o,a,r,l,f,c,d,m,h,_,g,y]}class aC extends ge{constructor(e){super(),_e(this,e,rC,oC,me,{field:0,key:1})}}function fC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max size "),i=b("small"),i.textContent="(bytes)",s=M(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(u,c){w(u,e,c),k(e,t),k(e,i),w(u,s,c),w(u,o,c),re(o,n[0].options.maxSize),a||(f=J(o,"input",n[4]),a=!0)},p(u,c){c&2048&&l!==(l=u[11])&&p(e,"for",l),c&2048&&r!==(r=u[11])&&p(o,"id",r),c&1&&it(o.value)!==u[0].options.maxSize&&re(o,u[0].options.maxSize)},d(u){u&&(v(e),v(s),v(o)),a=!1,f()}}}function uC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Td(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,H,W,G,U,Y,ie;return{c(){e=b("div"),t=b("div"),i=b("div"),l=K("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=K(` and `),r=b("code"),r.textContent="multipart/form-data",a=K(` requests, the following normalization rules are applied if the `),f=b("code"),f.textContent="json",u=K(` field is a `),c=b("strong"),c.textContent="plain string",d=K(`: `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",_=M(),g=b("li"),g.innerHTML=""false" is converted to the json false",y=M(),S=b("li"),S.innerHTML=""null" is converted to the json null",T=M(),$=b("li"),$.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",C=M(),O=b("li"),I=K(D),L=K(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',F=M(),N=b("li"),N.textContent="numeric strings are converted to json number",P=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",H=M(),W=b("li"),W.textContent="any other string (empty string too) is double quoted",G=K(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),U=b("code"),U.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(te,pe){w(te,e,pe),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,O),k(O,I),k(O,L),k(O,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,H),k(m,W),k(i,G),k(i,U),ie=!0},i(te){ie||(te&&Ke(()=>{ie&&(Y||(Y=Fe(e,et,{duration:150},!0)),Y.run(1))}),ie=!0)},o(te){te&&(Y||(Y=Fe(e,et,{duration:150},!1)),Y.run(0)),ie=!1},d(te){te&&v(e),te&&Y&&Y.end()}}}function rC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new ce({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[lC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?oC:sC}let m=d(n),h=m(n),_=n[2]&&Sd();return{c(){B(e.$$.fragment),t=M(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=M(),h.c(),r=M(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){z(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=J(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=Sd(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function aC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[rC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ot(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function fC(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=it(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Ce.call(this,n,_)}function m(_){Ce.call(this,n,_)}function h(_){Ce.call(this,n,_)}return n.$$set=_=>{e=Ie(Ie({},e),Yt(_)),t(3,l=Ge(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class uC extends ge{constructor(e){super(),_e(this,e,fC,aC,me,{field:0,key:1})}}function cC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=K(t),l=M(),s=b("small"),r=K(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),w(a,s,f),k(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),f&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function dC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class $d extends ge{constructor(e){super(),_e(this,e,dC,cC,me,{item:0})}}const pC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function mC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function hC(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[mC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const f={};a&16777216&&(f.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function _C(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[9]),J(i,"click",n[10]),J(s,"click",n[11]),J(r,"click",n[12])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function gC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;function $(O){n[8](O)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:$d,optionComponent:$d};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new hi({props:C}),ee.push(()=>be(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[_C]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=M(),h=b("i"),_=M(),B(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(O,D){w(O,e,D),k(e,t),k(e,i),k(e,l),w(O,o,D),z(r,O,D),w(O,f,D),w(O,u,D),k(u,c),k(c,d),k(c,m),k(c,h),k(c,_),z(g,c,null),y=!0,S||(T=Se(Pe.call(null,l,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,D){(!y||D&8388608&&s!==(s=O[23]))&&p(e,"for",s);const I={};D&8388608&&(I.id=O[23]),D&8&&(I.items=O[3]),!a&&D&1&&(a=!0,I.keyOfSelected=O[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};D&33554433&&(L.$$scope={dirty:D,ctx:O}),g.$set(L)},i(O){y||(E(r.$$.fragment,O),E(g.$$.fragment,O),y=!0)},o(O){A(r.$$.fragment,O),A(g.$$.fragment,O),y=!1},d(O){O&&(v(e),v(o),v(f),v(u)),V(r,O),V(g),S=!1,T()}}}function bC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + data inside an object, eg.`),U=b("code"),U.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(te,pe){w(te,e,pe),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,O),k(O,I),k(O,L),k(O,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,H),k(m,W),k(i,G),k(i,U),ie=!0},i(te){ie||(te&&Ke(()=>{ie&&(Y||(Y=Fe(e,et,{duration:150},!0)),Y.run(1))}),ie=!0)},o(te){te&&(Y||(Y=Fe(e,et,{duration:150},!1)),Y.run(0)),ie=!1},d(te){te&&v(e),te&&Y&&Y.end()}}}function dC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new ce({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[fC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?cC:uC}let m=d(n),h=m(n),_=n[2]&&Td();return{c(){B(e.$$.fragment),t=M(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=M(),h.c(),r=M(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){z(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=J(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=Td(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function pC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[dC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ot(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mC(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=it(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Ce.call(this,n,_)}function m(_){Ce.call(this,n,_)}function h(_){Ce.call(this,n,_)}return n.$$set=_=>{e=Ie(Ie({},e),Yt(_)),t(3,l=Ge(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class hC extends ge{constructor(e){super(),_e(this,e,mC,pC,me,{field:0,key:1})}}function _C(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=K(t),l=M(),s=b("small"),r=K(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),w(a,s,f),k(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),f&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function gC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Cd extends ge{constructor(e){super(),_e(this,e,gC,_C,me,{item:0})}}const bC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function kC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function yC(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[kC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const f={};a&16777216&&(f.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function vC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[9]),J(i,"click",n[10]),J(s,"click",n[11]),J(r,"click",n[12])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function wC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;function $(O){n[8](O)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Cd,optionComponent:Cd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new hi({props:C}),ee.push(()=>be(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[vC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=M(),h=b("i"),_=M(),B(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(O,D){w(O,e,D),k(e,t),k(e,i),k(e,l),w(O,o,D),z(r,O,D),w(O,f,D),w(O,u,D),k(u,c),k(c,d),k(c,m),k(c,h),k(c,_),z(g,c,null),y=!0,S||(T=Se(Pe.call(null,l,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,D){(!y||D&8388608&&s!==(s=O[23]))&&p(e,"for",s);const I={};D&8388608&&(I.id=O[23]),D&8&&(I.items=O[3]),!a&&D&1&&(a=!0,I.keyOfSelected=O[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};D&33554433&&(L.$$scope={dirty:D,ctx:O}),g.$set(L)},i(O){y||(E(r.$$.fragment,O),E(g.$$.fragment,O),y=!0)},o(O){A(r.$$.fragment,O),A(g.$$.fragment,O),y=!1},d(O){O&&(v(e),v(o),v(f),v(u)),V(r,O),V(g),S=!1,T()}}}function SC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C;function O(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Nl({props:D}),ee.push(()=>be(r,"value",O)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[bC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=M(),g=b("i"),y=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),z(r,I,L),w(I,f,L),w(I,u,L),k(u,c),k(u,d),k(u,m),k(m,h),k(m,_),k(m,g),k(m,y),z(S,m,null),T=!0,$||(C=Se(Pe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(f),v(u)),V(r,I),V(S),$=!1,C()}}}function yC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[14]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&&it(s.value)!==c[0].options.maxSize&&re(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Td(n){let e,t,i;return t=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[vC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function vC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=J(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function wC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[gC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[kC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[yC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Td(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),d=M(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(f,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,a),k(e,f),z(u,f,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),_[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(_,g),g&4&&E(h,1)):(h=Td(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(u.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(u.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),V(i),V(o),V(u),h&&h.d()}}}function SC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),f||(u=J(e,"change",n[7]),f=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),f=!1,u()}}}function $C(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[SC,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[$C],options:[wC],default:[hC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ot(r[5])]):{};a&50331663&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function CC(n,e,t){var F;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=pC.slice(),f=((F=s.options)==null?void 0:F.maxSelect)<=1,u=f;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,f=!0),t(6,u=f)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,u),t(2,f)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,u),t(2,f))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,u),t(2,f))}function $(){s.options.maxSize=it(this.value),t(0,s),t(6,u),t(2,f)}function C(){s.options.maxSelect=it(this.value),t(0,s),t(6,u),t(2,f)}function O(N){f=N,t(2,f)}function D(N){s=N,t(0,s),t(6,u),t(2,f)}function I(N){Ce.call(this,n,N)}function L(N){Ce.call(this,n,N)}function R(N){Ce.call(this,n,N)}return n.$$set=N=>{e=Ie(Ie({},e),Yt(N)),t(5,l=Ge(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,f,a,r,l,u,m,h,_,g,y,S,T,$,C,O,D,I,L,R]}class OC extends ge{constructor(e){super(),_e(this,e,CC,TC,me,{field:0,key:1})}}function MC(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function DC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[MC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function EC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function IC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[DC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[EC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function Cd(n){let e,t,i,l,s,o;return t=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[AC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,null),o=!0},p(r,a){const f={};a&2&&(f.name="schema."+r[1]+".options.minSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a&2&&(u.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function AC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minSelect),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&16777216&&i!==(i=f[24])&&p(e,"for",i),u&16777216&&o!==(o=f[24])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minSelect&&re(s,f[0].options.minSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function LC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.maxSelect),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&16777216&&i!==(i=u[24])&&p(e,"for",i),c&16777216&&o!==(o=u[24])&&p(s,"id",o),c&1&&r!==(r=u[0].options.minSelect||2)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.maxSelect&&re(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function NC(n){let e,t,i,l,s,o,r,a,f,u,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new hi({props:h}),ee.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),z(a,_,g),u=!0,c||(d=Se(s=Pe.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + (eg. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $C(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C;function O(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Fl({props:D}),ee.push(()=>be(r,"value",O)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[SC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=M(),g=b("i"),y=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),z(r,I,L),w(I,f,L),w(I,u,L),k(u,c),k(u,d),k(u,m),k(m,h),k(m,_),k(m,g),k(m,y),z(S,m,null),T=!0,$||(C=Se(Pe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(f),v(u)),V(r,I),V(S),$=!1,C()}}}function TC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[14]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&&it(s.value)!==c[0].options.maxSize&&re(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Od(n){let e,t,i;return t=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[CC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function CC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=J(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function OC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[wC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[$C,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[TC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Od(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),d=M(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(f,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,a),k(e,f),z(u,f,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),_[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(_,g),g&4&&E(h,1)):(h=Od(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(u.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(u.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),V(i),V(o),V(u),h&&h.d()}}}function MC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),f||(u=J(e,"change",n[7]),f=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),f=!1,u()}}}function DC(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[MC,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[DC],options:[OC],default:[yC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ot(r[5])]):{};a&50331663&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function IC(n,e,t){var F;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=bC.slice(),f=((F=s.options)==null?void 0:F.maxSelect)<=1,u=f;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,f=!0),t(6,u=f)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,u),t(2,f)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,u),t(2,f))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,u),t(2,f))}function $(){s.options.maxSize=it(this.value),t(0,s),t(6,u),t(2,f)}function C(){s.options.maxSelect=it(this.value),t(0,s),t(6,u),t(2,f)}function O(N){f=N,t(2,f)}function D(N){s=N,t(0,s),t(6,u),t(2,f)}function I(N){Ce.call(this,n,N)}function L(N){Ce.call(this,n,N)}function R(N){Ce.call(this,n,N)}return n.$$set=N=>{e=Ie(Ie({},e),Yt(N)),t(5,l=Ge(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,f,a,r,l,u,m,h,_,g,y,S,T,$,C,O,D,I,L,R]}class AC extends ge{constructor(e){super(),_e(this,e,IC,EC,me,{field:0,key:1})}}function LC(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function NC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[LC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function PC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[NC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[PC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function Md(n){let e,t,i,l,s,o;return t=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[RC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[qC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,null),o=!0},p(r,a){const f={};a&2&&(f.name="schema."+r[1]+".options.minSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a&2&&(u.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function RC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minSelect),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&16777216&&i!==(i=f[24])&&p(e,"for",i),u&16777216&&o!==(o=f[24])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minSelect&&re(s,f[0].options.minSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.maxSelect),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&16777216&&i!==(i=u[24])&&p(e,"for",i),c&16777216&&o!==(o=u[24])&&p(s,"id",o),c&1&&r!==(r=u[0].options.minSelect||2)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.maxSelect&&re(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function jC(n){let e,t,i,l,s,o,r,a,f,u,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new hi({props:h}),ee.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),z(a,_,g),u=!0,c||(d=Se(s=Pe.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"})),c=!0)},p(_,g){var S,T;s&&Ct(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=_[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!f&&g&1&&(f=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>f=!1)),a.$set(y)},i(_){u||(E(a.$$.fragment,_),u=!0)},o(_){A(a.$$.fragment,_),u=!1},d(_){_&&(v(e),v(r)),V(a,_),c=!1,d()}}}function PC(n){let e,t,i,l,s,o=!n[2]&&Cd(n);return l=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[NC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(le(),A(o,1,1,()=>{o=null}),se()):o?(o.p(r,a),a&4&&E(o,1)):(o=Cd(r),o.c(),E(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function FC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[PC],default:[IC,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;ube(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Ba({props:f}),n[21](l),l.$on("save",n[22]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(u,c){z(e,u,c),w(u,i,c),z(l,u,c),s=!0},p(u,[c]){const d=c&258?pt(o,[c&2&&{key:u[1]},c&256&&Ot(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(E(e.$$.fragment,u),E(l.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),A(l.$$.fragment,u),s=!1},d(u){u&&v(i),V(e,u),n[21](null),V(l,u)}}}function RC(n,e,t){var N;let i,l;const s=["field","key"];let o=Ge(e,s),r;Ue(n,Rn,P=>t(10,r=P));let{field:a}=e,{key:f=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function O(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Ce.call(this,n,P)}function I(P){Ce.call(this,n,P)}function L(P){Ce.call(this,n,P)}function R(P){ee[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,H;(H=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&H.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Ie(Ie({},e),Yt(P)),t(8,o=Ge(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,f=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,y,S,T,$,C,O,D,I,L,R,F]}class qC extends ge{constructor(e){super(),_e(this,e,RC,FC,me,{field:0,key:1})}}const jC=n=>({dragging:n&4,dragover:n&8}),Od=n=>({dragging:n[2],dragover:n[3]});function HC(n){let e,t,i,l,s;const o=n[10].default,r=wt(o,n,n[9],Od);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"dragover",Be(n[11])),J(e,"dragleave",Be(n[12])),J(e,"dragend",n[13]),J(e,"dragstart",n[14]),J(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&$t(r,o,a,a[9],i?St(o,a[9],f,jC):Tt(a[9]),Od),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&x(e,"dragging",a[2]),(!i||f&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function zC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:f=!1}=e,{dragHandleClass:u=""}=e,c=!1,d=!1;function m($,C){if(!(!$||f)){if(u&&!$.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||f)return;$.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const D=O.index<<0;D{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,f=$.disabled),"dragHandleClass"in $&&t(8,u=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,f,c,d,m,h,r,a,u,l,i,_,g,y,S,T]}class Ms extends ge{constructor(e){super(),_e(this,e,zC,HC,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Md(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Dd(n){let e,t,i,l,s,o,r,a;return{c(){e=K(`, +`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!f&&g&1&&(f=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>f=!1)),a.$set(y)},i(_){u||(E(a.$$.fragment,_),u=!0)},o(_){A(a.$$.fragment,_),u=!1},d(_){_&&(v(e),v(r)),V(a,_),c=!1,d()}}}function HC(n){let e,t,i,l,s,o=!n[2]&&Md(n);return l=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[jC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(le(),A(o,1,1,()=>{o=null}),se()):o?(o.p(r,a),a&4&&E(o,1)):(o=Md(r),o.c(),E(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function zC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[HC],default:[FC,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;ube(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Ya({props:f}),n[21](l),l.$on("save",n[22]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(u,c){z(e,u,c),w(u,i,c),z(l,u,c),s=!0},p(u,[c]){const d=c&258?pt(o,[c&2&&{key:u[1]},c&256&&Ot(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(E(e.$$.fragment,u),E(l.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),A(l.$$.fragment,u),s=!1},d(u){u&&v(i),V(e,u),n[21](null),V(l,u)}}}function VC(n,e,t){var N;let i,l;const s=["field","key"];let o=Ge(e,s),r;We(n,Rn,P=>t(10,r=P));let{field:a}=e,{key:f=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function O(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Ce.call(this,n,P)}function I(P){Ce.call(this,n,P)}function L(P){Ce.call(this,n,P)}function R(P){ee[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,H;(H=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&H.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Ie(Ie({},e),Yt(P)),t(8,o=Ge(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,f=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,y,S,T,$,C,O,D,I,L,R,F]}class BC extends ge{constructor(e){super(),_e(this,e,VC,zC,me,{field:0,key:1})}}const UC=n=>({dragging:n&4,dragover:n&8}),Dd=n=>({dragging:n[2],dragover:n[3]});function WC(n){let e,t,i,l,s;const o=n[10].default,r=wt(o,n,n[9],Dd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"dragover",Be(n[11])),J(e,"dragleave",Be(n[12])),J(e,"dragend",n[13]),J(e,"dragstart",n[14]),J(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&$t(r,o,a,a[9],i?St(o,a[9],f,UC):Tt(a[9]),Dd),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&x(e,"dragging",a[2]),(!i||f&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function YC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:f=!1}=e,{dragHandleClass:u=""}=e,c=!1,d=!1;function m($,C){if(!(!$||f)){if(u&&!$.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||f)return;$.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const D=O.index<<0;D{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,f=$.disabled),"dragHandleClass"in $&&t(8,u=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,f,c,d,m,h,r,a,u,l,i,_,g,y,S,T]}class Es extends ge{constructor(e){super(),_e(this,e,YC,WC,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Ed(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Id(n){let e,t,i,l,s,o,r,a;return{c(){e=K(`, `),t=b("code"),t.textContent="username",i=K(` , `),l=b("code"),l.textContent="email",s=K(` , `),o=b("code"),o.textContent="emailVisibility",r=K(` , - `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),w(f,l,u),w(f,s,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function VC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Dt(a,f(n)),ee.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&B(e.$$.fragment),i=M()},m(u,c){e&&z(e,u,c),w(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){le();const d=e;A(d.$$.fragment,1,0,()=>{V(d,1)}),se()}a?(e=Dt(a,f(n)),ee.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(u){l||(e&&E(e.$$.fragment,u),l=!0)},o(u){e&&A(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Ed(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[VC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function BC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C,O,D=n[0].type==="auth"&&Dd(),I=ue(n[0].schema);const L=N=>N[19];for(let N=0;Nbe($,"collection",R)),{c(){e=b("div"),t=b("p"),i=K(`System fields: + `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),w(f,l,u),w(f,s,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function KC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Dt(a,f(n)),ee.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&B(e.$$.fragment),i=M()},m(u,c){e&&z(e,u,c),w(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){le();const d=e;A(d.$$.fragment,1,0,()=>{V(d,1)}),se()}a?(e=Dt(a,f(n)),ee.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(u){l||(e&&E(e.$$.fragment,u),l=!0)},o(u){e&&A(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Ad(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[KC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function JC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C,O,D=n[0].type==="auth"&&Id(),I=ue(n[0].schema);const L=N=>N[19];for(let N=0;Nbe($,"collection",R)),{c(){e=b("div"),t=b("p"),i=K(`System fields: `),l=b("code"),l.textContent="id",s=K(` , `),o=b("code"),o.textContent="created",r=K(` , `),a=b("code"),a.textContent="updated",f=M(),D&&D.c(),u=K(` - .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class WC extends ge{constructor(e){super(),_e(this,e,UC,BC,me,{collection:0})}}const YC=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),KC=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),JC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]});function ZC(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[XC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Nd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Pd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function XC(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Ld),C=n[12].afterLabel,O=wt(C,n,n[15],Ad);let D=!n[9]&&Nd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Pd(n);const N=n[12].default,P=wt(N,n,n[15],Id);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,JC):Tt(q[15]),Ld),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,KC):Tt(q[15]),Ad),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Nd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Pd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,YC):Tt(q[15]),Id)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function QC(n){let e,t,i,l;const s=[GC,ZC],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Fd;function xC(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=Fd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-BPeaOUvB.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),Fd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class $l extends ge{constructor(e){super(),_e(this,e,xC,QC,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Rd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request
    filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function jd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&oe(i,t)},d(l){l&&v(e)}}}function Hd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[e5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $l({props:c}),ee.push(()=>be(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new $l({props:m}),ee.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new $l({props:_}),ee.push(()=>be(r,"rule",h)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(g,y){z(e,g,y),w(g,i,y),z(l,g,y),w(g,o,y),z(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),V(e,g),V(l,g),V(r,g)}}}function zd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function e5(n){let e,t=!n[10]&&zd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=zd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Vd(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[t5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new $l({props:s}),ee.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function t5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. + .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class GC extends ge{constructor(e){super(),_e(this,e,ZC,JC,me,{collection:0})}}const XC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),QC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]}),xC=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function e5(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[n5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function t5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Rd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Pd),C=n[12].afterLabel,O=wt(C,n,n[15],Nd);let D=!n[9]&&Fd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Rd(n);const N=n[12].default,P=wt(N,n,n[15],Ld);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,xC):Tt(q[15]),Pd),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,QC):Tt(q[15]),Nd),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Fd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Rd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,XC):Tt(q[15]),Ld)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function i5(n){let e,t,i,l;const s=[t5,e5],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let qd;function l5(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=qd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CFHe_5bb.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),qd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class Cl extends ge{constructor(e){super(),_e(this,e,l5,i5,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function zd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&oe(i,t)},d(l){l&&v(e)}}}function Vd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[s5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cl({props:c}),ee.push(()=>be(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Cl({props:m}),ee.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Cl({props:_}),ee.push(()=>be(r,"rule",h)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(g,y){z(e,g,y),w(g,i,y),z(l,g,y),w(g,o,y),z(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),V(e,g),V(l,g),V(r,g)}}}function Bd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function s5(n){let e,t=!n[10]&&Bd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Bd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Ud(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[o5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Cl({props:s}),ee.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function o5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified - state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function n5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&qd(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new $l({props:D}),ee.push(()=>be(u,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),ee.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Hd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Vd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function r5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&Hd(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new Cl({props:D}),ee.push(()=>be(u,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Cl({props:L}),ee.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Vd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Ud(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,l=M(),s=b("button"),r=K(o),a=M(),C&&C.c(),f=M(),B(u.$$.fragment),d=M(),B(m.$$.fragment),_=M(),R&&R.c(),g=M(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,H){w(q,e,H),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,f,H),z(u,q,H),w(q,d,H),z(m,q,H),w(q,_,H),R&&R.m(q,H),w(q,g,H),F&&F.m(q,H),w(q,y,H),S=!0,T||($=J(s,"click",n[3]),T=!0)},p(q,[H]){var U,Y;(!S||H&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&oe(r,o),q[1]?C?(C.p(q,H),H&2&&E(C,1)):(C=qd(q),C.c(),E(C,1),C.m(e,null)):C&&(le(),A(C,1,1,()=>{C=null}),se());const W={};H&1&&(W.collection=q[0]),!c&&H&1&&(c=!0,W.rule=q[0].listRule,ke(()=>c=!1)),u.$set(W);const G={};H&1&&(G.collection=q[0]),!h&&H&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((U=q[0])==null?void 0:U.type)!=="view"?R?(R.p(q,H),H&1&&E(R,1)):(R=Hd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(le(),A(R,1,1,()=>{R=null}),se()),((Y=q[0])==null?void 0:Y.type)==="auth"?F?(F.p(q,H),H&1&&E(F,1)):(F=Vd(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(le(),A(F,1,1,()=>{F=null}),se())},i(q){S||(E(C),E(u.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(u.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),V(u,q),V(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function i5(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class l5 extends ge{constructor(e){super(),_e(this,e,i5,n5,me,{collection:0})}}function Bd(n,e,t){const i=n.slice();return i[9]=e[t],i}function s5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function o5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ud(n){let e,t,i=ue(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. + .`,l=M(),s=b("button"),r=K(o),a=M(),C&&C.c(),f=M(),B(u.$$.fragment),d=M(),B(m.$$.fragment),_=M(),R&&R.c(),g=M(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,H){w(q,e,H),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,f,H),z(u,q,H),w(q,d,H),z(m,q,H),w(q,_,H),R&&R.m(q,H),w(q,g,H),F&&F.m(q,H),w(q,y,H),S=!0,T||($=J(s,"click",n[3]),T=!0)},p(q,[H]){var U,Y;(!S||H&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&oe(r,o),q[1]?C?(C.p(q,H),H&2&&E(C,1)):(C=Hd(q),C.c(),E(C,1),C.m(e,null)):C&&(le(),A(C,1,1,()=>{C=null}),se());const W={};H&1&&(W.collection=q[0]),!c&&H&1&&(c=!0,W.rule=q[0].listRule,ke(()=>c=!1)),u.$set(W);const G={};H&1&&(G.collection=q[0]),!h&&H&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((U=q[0])==null?void 0:U.type)!=="view"?R?(R.p(q,H),H&1&&E(R,1)):(R=Vd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(le(),A(R,1,1,()=>{R=null}),se()),((Y=q[0])==null?void 0:Y.type)==="auth"?F?(F.p(q,H),H&1&&E(F,1)):(F=Ud(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(le(),A(F,1,1,()=>{F=null}),se())},i(q){S||(E(C),E(u.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(u.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),V(u,q),V(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function a5(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class f5 extends ge{constructor(e){super(),_e(this,e,a5,r5,me,{collection:0})}}function Wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function u5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function c5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Yd(n){let e,t,i=ue(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Ud(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function a5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[r5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function f5(n,e,t){let i;Ue(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-C-zHBmhQ.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class u5 extends ge{constructor(e){super(),_e(this,e,f5,a5,me,{collection:0})}}const c5=n=>({active:n&1}),Yd=n=>({active:n[0]});function Kd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function d5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Yd);let u=n[0]&&Kd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,c5):Tt(c[14]),Yd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Kd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function p5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class ho extends ge{constructor(e){super(),_e(this,e,p5,d5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function m5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function h5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[m5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function b5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?g5:_5}let a=r(n),f=a(n),u=n[3]&&Jd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Jd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Zd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[y5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[v5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function y5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function v5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Nl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function w5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[k5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Zd(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Zd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function S5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function T5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?$5:S5}let a=r(n),f=a(n),u=n[2]&&Gd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function C5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function O5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[C5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&Xd();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=Xd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function E5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?D5:M5}let a=r(n),f=a(n),u=n[1]&&Qd();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=Qd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function A5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[11]),Se(Pe.call(null,r,{text:`The constraint is applied only for new records. -Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function L5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[12]),Se(Pe.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` -`),position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function N5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;return l=new ho({props:{single:!0,$$slots:{header:[b5],default:[h5]},$$scope:{ctx:n}}}),o=new ho({props:{single:!0,$$slots:{header:[T5],default:[w5]},$$scope:{ctx:n}}}),a=new ho({props:{single:!0,$$slots:{header:[E5],default:[O5]},$$scope:{ctx:n}}}),h=new ce({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[I5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[A5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[L5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),z(l,i,null),k(i,s),z(o,i,null),k(i,r),z(a,i,null),w($,f,C),w($,u,C),w($,c,C),w($,d,C),w($,m,C),z(h,$,C),w($,_,C),z(g,$,C),w($,y,C),z(S,$,C),T=!0},p($,[C]){const O={};C&16393&&(O.$$scope={dirty:C,ctx:$}),l.$set(O);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(f),v(u),v(c),v(d),v(m),v(_),v(y)),V(l),V(o),V(a),V(h,$),V(g,$),V(S,$)}}}function P5(n,e,t){let i,l,s,o;Ue(n,mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=it(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class F5 extends ge{constructor(e){super(),_e(this,e,P5,N5,me,{collection:0})}}function xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ip(n){let e,t,i,l,s=n[3]&&lp(n),o=!n[4]&&sp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=lp(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=sp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function lp(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=K(`Renamed collection - `),l=b("strong"),o=K(s),r=M(),a=b("i"),f=M(),u=b("strong"),d=K(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&oe(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&oe(d,c)},d(_){_&&v(e)}}}function sp(n){let e,t,i,l=ue(n[6]),s=[];for(let u=0;u
    ',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=np(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=ip(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function q5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function j5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function H5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[j5],header:[q5],default:[R5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function z5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class V5 extends ge{constructor(e){super(),_e(this,e,z5,H5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function fp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function B5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new WC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function U5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new u5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function up(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new l5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function cp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new F5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Dl)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function W5(n){let e,t,i,l,s,o,r;const a=[U5,B5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===hs&&up(n),d=n[15]&&cp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===hs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=up(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=cp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function dp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[Y5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Y5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function pp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[K5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function mp(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function K5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=pp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=hp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function _p(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function gp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function bp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&kp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Dl)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=kp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Dl)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Z5(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&dp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[J5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&_p(n),P=O&&gp(),q=n[15]&&bp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===hs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,mt,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=dp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=_p(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((mt=pe[5])==null?void 0:mt.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=gp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===hs),pe[15]?q?q.p(pe,Ne):(q=bp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function G5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function X5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[G5],header:[Z5],default:[W5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new V5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",hs="api_rules",Dl="options",Q5="base",yp="auth",vp="view";function Er(n){return JSON.stringify(n)}function x5(n,e,t){let i,l,s,o,r,a;Ue(n,mi,ve=>t(5,a=ve));const f={};f[Q5]="Base",f[vp]="View",f[yp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Er(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Er(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{wa(),lv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&fn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),sv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(hs),Xe=()=>$(Dl);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function mt(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function gt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===yp),n.$$.dirty[0]&4&&t(14,l=h.type===vp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Er(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Dl&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,mt,Gt,De,Ae,ze,gt,de]}class Ba extends ge{constructor(e){super(),_e(this,e,x5,X5,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function e6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function t6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function n6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?t6:e6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(nn.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function i6(n,e,t){let i,l;Ue(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Yb extends ge{constructor(e){super(),_e(this,e,i6,n6,me,{collection:0,pinnedIds:4})}}function wp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[22]=e[t],i}function $p(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Cp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Op(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Dp(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ep(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function l6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&$p(n),T=n[5].length&&Cp(n),$=n[3].length&&!n[2].length&&Dp(),C=!n[9]&&Ep(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=$p(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Cp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Dp(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ep(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function s6(n){let e,t,i,l;e=new Hb({props:{class:"collection-sidebar",$$slots:{default:[l6]},$$scope:{ctx:n}}});let s={};return i=new Ba({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Ip="@pinnedCollections";function o6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function r6(n,e,t){let i,l,s,o,r,a,f,u,c;Ue(n,Rn,L=>t(11,a=L)),Ue(n,Yn,L=>t(19,f=L)),Ue(n,To,L=>t(8,u=L)),Ue(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Ip);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),o6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Ip,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class a6 extends ge{constructor(e){super(),_e(this,e,r6,s6,me,{})}}function Ap(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Lp(n){n[18]=n[19].default}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Pp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Fp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Pp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Pp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function Rp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:c6,then:u6,catch:f6,value:19,blocks:[,,,]};return Xa(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&Xa(t,l)||O0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function f6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function u6(n){Lp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Lp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function c6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function qp(n,e){let t,i,l,s=e[5]===e[14]&&Rp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=Rp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function d6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function m6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[p6],default:[d6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function h6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-bZ1-xl-p.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-iCTJquUd.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-jPKcVL6M.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-DGrQC-Ly.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-EnRun5cS.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-Bdn0UuCF.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-Dpy8EoRc.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-sv1YgvnJ.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-DOQHyuHB.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-BXzC-pWX.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-CPe-dhLl.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-Csllfzv-.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-CFOUXiAS.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-BDG1xZdQ.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-DG3NuEPP.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-DOKfHUKA.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-CGAfo9a0.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-Cm7HyxiF.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class _6 extends ge{constructor(e){super(),_e(this,e,h6,m6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function g6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` + MAX(balance) as maxBalance).`,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Yd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function p5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[d5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function m5(n,e,t){let i;We(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-97oGZhvg.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class h5 extends ge{constructor(e){super(),_e(this,e,m5,p5,me,{collection:0})}}const _5=n=>({active:n&1}),Jd=n=>({active:n[0]});function Zd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function g5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Jd);let u=n[0]&&Zd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,_5):Tt(c[14]),Jd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Zd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function b5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class go extends ge{constructor(e){super(),_e(this,e,b5,g5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function y5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[k5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function v5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?w5:v5}let a=r(n),f=a(n),u=n[3]&&Gd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function $5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[T5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[C5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function T5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function C5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function O5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[$5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Xd(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Xd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function E5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?D5:M5}let a=r(n),f=a(n),u=n[2]&&Qd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Qd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function xd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function A5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[I5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&xd();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=xd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function L5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function N5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ep(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function P5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?N5:L5}let a=r(n),f=a(n),u=n[1]&&ep();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=ep(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function R5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[11]),Se(Pe.call(null,r,{text:`The constraint is applied only for new records. +Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function q5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[12]),Se(Pe.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` +`),position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function j5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;return l=new go({props:{single:!0,$$slots:{header:[S5],default:[y5]},$$scope:{ctx:n}}}),o=new go({props:{single:!0,$$slots:{header:[E5],default:[O5]},$$scope:{ctx:n}}}),a=new go({props:{single:!0,$$slots:{header:[P5],default:[A5]},$$scope:{ctx:n}}}),h=new ce({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[F5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[R5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[q5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),z(l,i,null),k(i,s),z(o,i,null),k(i,r),z(a,i,null),w($,f,C),w($,u,C),w($,c,C),w($,d,C),w($,m,C),z(h,$,C),w($,_,C),z(g,$,C),w($,y,C),z(S,$,C),T=!0},p($,[C]){const O={};C&16393&&(O.$$scope={dirty:C,ctx:$}),l.$set(O);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(f),v(u),v(c),v(d),v(m),v(_),v(y)),V(l),V(o),V(a),V(h,$),V(g,$),V(S,$)}}}function H5(n,e,t){let i,l,s,o;We(n,mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=it(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class z5 extends ge{constructor(e){super(),_e(this,e,H5,j5,me,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n,e,t){const i=n.slice();return i[18]=e[t],i}function ip(n,e,t){const i=n.slice();return i[18]=e[t],i}function lp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sp(n){let e,t,i,l,s=n[3]&&op(n),o=!n[4]&&rp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=op(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=rp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function op(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=K(`Renamed collection + `),l=b("strong"),o=K(s),r=M(),a=b("i"),f=M(),u=b("strong"),d=K(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&oe(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&oe(d,c)},d(_){_&&v(e)}}}function rp(n){let e,t,i,l=ue(n[6]),s=[];for(let u=0;u
    ',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=lp(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=sp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function B5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function W5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[U5],header:[B5],default:[V5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function Y5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class K5 extends ge{constructor(e){super(),_e(this,e,Y5,W5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function J5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new GC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Z5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new h5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function pp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new z5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Il)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function G5(n){let e,t,i,l,s,o,r;const a=[Z5,J5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===gs&&dp(n),d=n[15]&&pp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===gs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=dp(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=pp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function mp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[X5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function X5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function hp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[Q5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function _p(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function Q5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=hp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=gp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function bp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function yp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&vp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=vp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Il)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function vp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e6(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&mp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[x5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&bp(n),P=O&&kp(),q=n[15]&&yp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===gs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,ht,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=mp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=bp(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((ht=pe[5])==null?void 0:ht.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=kp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===gs),pe[15]?q?q.p(pe,Ne):(q=yp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function t6(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function n6(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[t6],header:[e6],default:[G5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new K5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",gs="api_rules",Il="options",i6="base",wp="auth",Sp="view";function Lr(n){return JSON.stringify(n)}function l6(n,e,t){let i,l,s,o,r,a;We(n,mi,ve=>t(5,a=ve));const f={};f[i6]="Base",f[Sp]="View",f[wp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Lr(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Lr(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{Ta(),fv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&un(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),uv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(gs),Xe=()=>$(Il);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function ht(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function bt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===wp),n.$$.dirty[0]&4&&t(14,l=h.type===Sp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Lr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Il&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De,Ae,ze,bt,de]}class Ya extends ge{constructor(e){super(),_e(this,e,l6,n6,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function s6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function o6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function r6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?o6:s6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(ln.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function a6(n,e,t){let i,l;We(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Zb extends ge{constructor(e){super(),_e(this,e,a6,r6,me,{collection:0,pinnedIds:4})}}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cp(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Mp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Dp(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Ip(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ap(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function f6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Cp(n),T=n[5].length&&Mp(n),$=n[3].length&&!n[2].length&&Ip(),C=!n[9]&&Ap(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=Cp(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Mp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Ip(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ap(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function u6(n){let e,t,i,l;e=new Bb({props:{class:"collection-sidebar",$$slots:{default:[f6]},$$scope:{ctx:n}}});let s={};return i=new Ya({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Lp="@pinnedCollections";function c6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function d6(n,e,t){let i,l,s,o,r,a,f,u,c;We(n,Rn,L=>t(11,a=L)),We(n,Yn,L=>t(19,f=L)),We(n,Oo,L=>t(8,u=L)),We(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Lp);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),c6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Lp,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class p6 extends ge{constructor(e){super(),_e(this,e,d6,u6,me,{})}}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Pp(n){n[18]=n[19].default}function Fp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Rp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Rp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Rp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function jp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:_6,then:h6,catch:m6,value:19,blocks:[,,,]};return ef(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&ef(t,l)||E0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function m6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function h6(n){Pp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Pp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function _6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Hp(n,e){let t,i,l,s=e[5]===e[14]&&jp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=jp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function g6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function k6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[b6],default:[g6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function y6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-CtNZ5G9D.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-Bt5koN3Z.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-cTL4BTwH.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-B4w33bkJ.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-C521Da9d.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-DlyauiFo.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-CaL3O2uX.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-C9IystLV.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-CdUir8-r.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-B3KxCvqw.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-BKx9x0MU.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-CCrC-X-J.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-DCQFPDN7.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-DmKjgrzy.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-T4e4Bmxi.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-DifPdWR1.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-DCCFJUK6.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-4JM4cUB_.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class v6 extends ge{constructor(e){super(),_e(this,e,y6,k6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function w6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&Ct(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const jp="yyyy-MM-dd HH:mm:ss.SSS";function b6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,jp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,jp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Kb extends ge{constructor(e){super(),_e(this,e,b6,g6,me,{model:1})}}function k6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function y6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[k6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function v6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Jb extends ge{constructor(e){super(),_e(this,e,v6,y6,me,{class:0,length:5})}}function w6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function S6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Hp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[$6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function zp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[T6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[C6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function T6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Jb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function C6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function O6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function M6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[w6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[S6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Hp(n),_=(n[2]||n[3])&&zp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Hp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=zp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function D6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||fn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class E6 extends ge{constructor(e){super(),_e(this,e,D6,M6,me,{record:0,collection:1,isNew:2})}}function I6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class L6 extends ge{constructor(e){super(),_e(this,e,A6,I6,me,{value:0,maxHeight:4})}}function N6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new L6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function P6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function F6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class R6 extends ge{constructor(e){super(),_e(this,e,F6,P6,me,{field:1,value:0})}}function q6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function j6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[q6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function H6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class z6 extends ge{constructor(e){super(),_e(this,e,H6,j6,me,{field:1,value:0})}}function V6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function B6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[V6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class W6 extends ge{constructor(e){super(),_e(this,e,U6,B6,me,{field:1,value:0})}}function Y6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function K6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function J6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Z6 extends ge{constructor(e){super(),_e(this,e,J6,K6,me,{field:1,value:0})}}function G6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function X6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[G6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Q6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class x6 extends ge{constructor(e){super(),_e(this,e,Q6,X6,me,{field:1,value:0})}}function Vp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function eO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Vp(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Va({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Vp($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function tO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[eO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class iO extends ge{constructor(e){super(),_e(this,e,nO,tO,me,{field:1,value:0})}}function Bp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function lO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Wb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Bp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Bp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function sO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[lO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function oO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class rO extends ge{constructor(e){super(),_e(this,e,oO,sO,me,{field:1,value:0})}}function aO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function uO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function cO(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function dO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?fO:aO}let $=T(n),C=$(n);const O=[cO,uO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function pO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Up(n){return typeof n=="string"&&Zb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Zb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function mO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Up(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-C-zHBmhQ.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Up(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Zb(r))},[s,l,r,o,i,a]}class hO extends ge{constructor(e){super(),_e(this,e,mO,pO,me,{field:1,value:0})}}function _O(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function gO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function bO(n){let e;function t(s,o){return s[2]?gO:_O}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function kO(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{file:0,size:1})}}function Wp(n){let e;function t(s,o){return s[4]==="image"?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function vO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Wp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Wp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function $O(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function TO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function CO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[TO],header:[$O],default:[SO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function OO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class MO extends ge{constructor(e){super(),_e(this,e,OO,CO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function DO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?LO:f[3]==="video"||f[3]==="audio"?AO:IO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function EO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function IO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Yp(n){let e,t,i={};return e=new MO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function NO(n){let e,t,i;function l(a,f){return a[2]?EO:DO}let s=l(n),o=s(n),r=n[7]&&Yp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Yp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function PO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ua extends ge{constructor(e){super(),_e(this,e,PO,NO,me,{record:9,filename:0,size:1})}}function Kp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function FO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function RO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function qO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ua({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?RO:FO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Zp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[qO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function jO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new yO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Gp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[jO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function HO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Gb extends ge{constructor(e){super(),_e(this,e,S6,w6,me,{model:1})}}function $6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function T6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[$6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function C6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Xb extends ge{constructor(e){super(),_e(this,e,C6,T6,me,{class:0,length:5})}}function O6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function M6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Vp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[D6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[E6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[I6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function E6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function I6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function A6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function L6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[M6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Vp(n),_=(n[2]||n[3])&&Bp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[A6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Vp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Bp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function N6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||un("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class P6 extends ge{constructor(e){super(),_e(this,e,N6,L6,me,{record:0,collection:1,isNew:2})}}function F6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class q6 extends ge{constructor(e){super(),_e(this,e,R6,F6,me,{value:0,maxHeight:4})}}function j6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new q6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function H6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class V6 extends ge{constructor(e){super(),_e(this,e,z6,H6,me,{field:1,value:0})}}function B6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function U6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Y6 extends ge{constructor(e){super(),_e(this,e,W6,U6,me,{field:1,value:0})}}function K6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function J6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class G6 extends ge{constructor(e){super(),_e(this,e,Z6,J6,me,{field:1,value:0})}}function X6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function Q6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class eO extends ge{constructor(e){super(),_e(this,e,x6,Q6,me,{field:1,value:0})}}function tO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function nO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function iO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class lO extends ge{constructor(e){super(),_e(this,e,iO,nO,me,{field:1,value:0})}}function Up(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function sO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Up(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Wa({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Up($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function oO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class aO extends ge{constructor(e){super(),_e(this,e,rO,oO,me,{field:1,value:0})}}function Wp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function fO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Jb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Wp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Wp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function uO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class dO extends ge{constructor(e){super(),_e(this,e,cO,uO,me,{field:1,value:0})}}function pO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function _O(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function gO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?mO:pO}let $=T(n),C=$(n);const O=[_O,hO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function bO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yp(n){return typeof n=="string"&&Qb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Qb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function kO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Yp(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-97oGZhvg.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Yp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Qb(r))},[s,l,r,o,i,a]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{field:1,value:0})}}function vO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){let e;function t(s,o){return s[2]?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function $O(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class TO extends ge{constructor(e){super(),_e(this,e,$O,SO,me,{file:0,size:1})}}function Kp(n){let e;function t(s,o){return s[4]==="image"?OO:CO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function CO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function OO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function MO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Kp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Kp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function DO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function EO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function IO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[EO],header:[DO],default:[MO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function AO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class LO extends ge{constructor(e){super(),_e(this,e,AO,IO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function NO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?qO:f[3]==="video"||f[3]==="audio"?RO:FO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function PO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function FO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function RO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Jp(n){let e,t,i={};return e=new LO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function jO(n){let e,t,i;function l(a,f){return a[2]?PO:NO}let s=l(n),o=s(n),r=n[7]&&Jp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Jp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function HO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ka extends ge{constructor(e){super(),_e(this,e,HO,jO,me,{record:9,filename:0,size:1})}}function Zp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Gp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function zO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function VO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function BO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ka({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?VO:zO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Xp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[BO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function UO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new TO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Qp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[UO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function WO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,l||(s=[J(e,"dragover",Be(n[25])),J(e,"dragleave",n[26]),J(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[WO,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,l||(s=[J(e,"dragover",Be(n[25])),J(e,"dragleave",n[26]),J(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&v(e),V(t),l=!1,$e(s)}}}function VO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,h="";function _(H){j.removeByValue(u,H),t(2,u)}function g(H){j.pushUnique(u,H),t(2,u)}function y(H){j.isEmpty(f[H])||f.splice(H,1),t(1,f)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function T(H){var G,U;H.preventDefault(),t(9,m=!1);const W=((G=H.dataTransfer)==null?void 0:G.files)||[];if(!(s||!W.length)){for(const Y of W){const ie=l.length+f.length-u.length;if(((U=r.options)==null?void 0:U.maxSelect)<=ie)break;f.push(Y)}t(1,f)}}Ht(async()=>{t(10,h=await ae.getAdminFileToken(o.collectionId))});const $=H=>_(H),C=H=>g(H);function O(H){a=H,t(0,a),t(6,i),t(4,r)}const D=H=>y(H);function I(H){f=H,t(1,f)}function L(H){ee[H?"unshift":"push"](()=>{c=H,t(7,c)})}const R=()=>{for(let H of c.files)f.push(H);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(H){ee[H?"unshift":"push"](()=>{d=H,t(8,d)})}const P=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=H=>{"record"in H&&t(3,o=H.record),"field"in H&&t(4,r=H.field),"value"in H&&t(0,a=H.value),"uploadedFiles"in H&&t(1,f=H.uploadedFiles),"deletedFileNames"in H&&t(2,u=H.deletedFileNames)},n.$$.update=()=>{var H,W;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=j.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=j.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((H=r.options)==null?void 0:H.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((W=r.options)==null?void 0:W.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,y,T,$,C,O,D,I,L,R,F,N,P,q]}class BO extends ge{constructor(e){super(),_e(this,e,VO,zO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Xp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function UO(n,e){e=Xp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Xp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Qp(n,e,t){const i=n.slice();i[6]=e[t];const l=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=l,i}function xp(n,e,t){const i=n.slice();return i[10]=e[t],i}function em(n){let e,t;return e=new Ua({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[10]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function tm(n){let e=!j.isEmpty(n[10]),t,i,l=e&&em(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&3&&(e=!j.isEmpty(s[10])),e?l?(l.p(s,o),o&3&&E(l,1)):(l=em(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(le(),A(l,1,1,()=>{l=null}),se())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function nm(n){let e,t,i=ue(n[7]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oA(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let _=0;_t(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.schema)||[];if(t(1,o=f.filter(u=>u.presentable&&u.type=="file").map(u=>u.name)),t(2,r=f.filter(u=>u.presentable&&u.type!="file").map(u=>u.name)),!o.length&&!r.length){const u=f.find(c=>{var d,m,h;return c.type=="file"&&((d=c.options)==null?void 0:d.maxSelect)==1&&((h=(m=c.options)==null?void 0:m.mimeTypes)==null?void 0:h.find(_=>_.startsWith("image/")))});u&&o.push(u.name)}}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l]}class xo extends ge{constructor(e){super(),_e(this,e,YO,WO,me,{record:0})}}function im(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function lm(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function sm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function om(n){let e,t=!n[13]&&rm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=rm(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function rm(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&am(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=am(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function am(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function KO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function JO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[Se(Pe.call(null,t,"Edit")),J(t,"keydown",Tn(n[27])),J(t,"click",Tn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,$e(l)}}}function um(n,e){let t,i,l,s,o,r,a,f;function u(g,y){return g[6]?JO:KO}let c=u(e),d=c(e);s=new xo({props:{record:e[49]}});let m=!e[11]&&fm(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),z(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(f=[J(t,"click",h),J(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=u(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=fm(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),V(s),m&&m.d(),a=!1,$e(f)}}}function cm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function dm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=K("("),i=K(t),l=K(" of MAX "),s=K(n[4]),o=K(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function ZO(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function GO(n){let e,t,i=ue(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(u,c){w(u,e,c),z(t,e,null),k(e,i),k(e,l),w(u,s,c),o=!0,r||(a=J(l,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(u){o||(E(t.$$.fragment,u),o=!0)},o(u){A(t.$$.fragment,u),o=!1},d(u){u&&(v(e),v(s)),V(t),r=!1,a()}}}function pm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[XO,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Ms({props:s}),ee.push(()=>be(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function QO(n){let e,t,i,l,s,o=[],r=new Map,a,f,u,c,d,m,h,_,g,y,S,T;t=new $s({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&sm(n),C=ue(n[8]);const O=P=>P[49].id;for(let P=0;P1&&dm(n);const R=[GO,ZO],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),$&&$.c(),l=M(),s=b("div");for(let P=0;P1?L?L.p(P,q):(L=dm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let W=h;h=N(P),h===W?F[h].p(P,q):(le(),A(F[W],1,1,()=>{F[W]=null}),se(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;qCancel',t=M(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[28]),J(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function tM(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[eM],header:[xO],default:[QO]},$$scope:{ctx:n}};for(let a=0;at(26,m=we));const h=lt(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],O=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,O=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const we=j.toArray(g);if(!l||!we.length)return;t(24,R=!0);let Ye=[];const zt=we.slice(),cn=[];for(;zt.length>0;){const rn=[];for(const qn of zt.splice(0,no))rn.push(`id="${qn}"`);cn.push(ae.collection(l).getFullList({batch:no,filter:rn.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(cn).then(rn=>{Ye=Ye.concat(...rn)}),t(6,O=[]);for(const rn of we){const qn=j.findByKey(Ye,"id",rn);qn&&O.push(qn)}$.trim()||t(8,C=j.filterDuplicatesByKey(O.concat(C))),t(24,R=!1)}catch(rn){rn.isAbort||(ae.error(rn),t(24,R=!1))}}async function q(we=!1){if(l){t(3,L=!0),we&&($.trim()?t(8,C=[]):t(8,C=j.toArray(O).slice()));try{const Ye=we?1:D+1,zt=j.getAllCollectionIdentifiers(s),cn=await ae.collection(l).getList(Ye,no,{filter:j.normalizeSearchFilter($,zt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(cn.items))),D=cn.page,t(23,I=cn.items.length),t(3,L=!1)}catch(Ye){Ye.isAbort||(ae.error(Ye),t(3,L=!1))}}}function H(we){i==1?t(6,O=[we]):f&&(j.pushOrReplaceByKey(O,we),t(6,O))}function W(we){j.removeByKey(O,"id",we.id),t(6,O)}function G(we){u(we)?W(we):H(we)}function U(){var we;i!=1?t(20,g=O.map(Ye=>Ye.id)):t(20,g=((we=O==null?void 0:O[0])==null?void 0:we.id)||""),h("save",O),N()}function Y(we){Ce.call(this,n,we)}const ie=()=>N(),te=()=>U(),pe=we=>t(2,$=we.detail),Ne=()=>T==null?void 0:T.show(),He=we=>T==null?void 0:T.show(we.id),Xe=we=>G(we),xe=(we,Ye)=>{(Ye.code==="Enter"||Ye.code==="Space")&&(Ye.preventDefault(),Ye.stopPropagation(),G(we))},Mt=()=>t(2,$=""),ft=()=>{a&&!L&&q()},mt=we=>W(we);function Gt(we){O=we,t(6,O)}function De(we){ee[we?"unshift":"push"](()=>{S=we,t(1,S)})}function Ae(we){Ce.call(this,n,we)}function ze(we){Ce.call(this,n,we)}function gt(we){ee[we?"unshift":"push"](()=>{T=we,t(7,T)})}const de=we=>{j.removeByKey(C,"id",we.detail.record.id),C.unshift(we.detail.record),t(8,C),H(we.detail.record)},ve=we=>{j.removeByKey(C,"id",we.detail.id),t(8,C),W(we.detail)};return n.$$set=we=>{e=Ie(Ie({},e),Yt(we)),t(19,d=Ge(e,c)),"value"in we&&t(20,g=we.value),"field"in we&&t(21,y=we.field)},n.$$.update=()=>{var we,Ye;n.$$.dirty[0]&2097152&&t(4,i=((we=y==null?void 0:y.options)==null?void 0:we.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(Ye=y==null?void 0:y.options)==null?void 0:Ye.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(zt=>zt.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==no),n.$$.dirty[0]&80&&t(10,f=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,u=function(zt){return j.findByKey(O,"id",zt.id)})},[N,S,$,L,i,s,O,T,C,u,f,o,a,r,q,H,W,G,U,d,g,y,F,I,R,l,m,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,mt,Gt,De,Ae,ze,gt,de,ve]}class iM extends ge{constructor(e){super(),_e(this,e,nM,tM,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function mm(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function hm(n,e,t){const i=n.slice();return i[26]=e[t],i}function _m(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Ct(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function gm(n){let e,t=n[5]&&bm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=bm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function bm(n){let e,t=ue(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function lM(n){let e,t,i,l,s,o,r,a,f,u;i=new xo({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,f||(u=[Se(Pe.call(null,o,"Remove")),J(o,"click",c)],f=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),f=!1,$e(u)}}}function ym(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[lM,({dragging:a,dragover:f})=>({24:a,25:f}),({dragging:a,dragover:f})=>(a?16777216:0)|(f?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Ms({props:r}),ee.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[23]),f&128&&(u.disabled=!e[7]),f&587202576&&(u.$$scope={dirty:f,ctx:e}),!l&&f&16&&(l=!0,u.list=e[4],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function sM(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&_m(n),O=ue(n[4]);const D=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Un(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",f=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,u,R),w(L,c,R),k(c,d);for(let F=0;F({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new ce({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new iM({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,[a]){const f={};a&4&&(f.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(f.name=r[2].name),a&537919735&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a&1&&(u.value=r[0]),a&4&&(u.field=r[2]),i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const vm=100;function rM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],f=!1,u,c=[];function d(){if(f)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,f=!1);return}t(5,f=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,vm))N.push(`id="${P}"`);L.push(ae.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(vm,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){ae.error(N)}t(5,f=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}ks(()=>{clearTimeout(u)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){ee[D?"unshift":"push"](()=>{o=D,t(1,o)})}const O=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,f=!0),clearTimeout(u),t(10,u=setTimeout(m,0)))},[s,o,l,r,a,f,c,i,h,_,u,g,y,S,T,$,C,O]}class aM extends ge{constructor(e){super(),_e(this,e,rM,oM,me,{field:2,value:0,picker:1})}}function fM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),b0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function uM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function cM(n){let e;function t(s,o){return s[1]?uM:fM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function dM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let pM=dM();function Ir(){return window&&window.tinymce?window.tinymce:null}function mM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:f=""}=e,{text:u=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=f,S=s;const T=lt();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(f),L.on(a,()=>{t(12,y=L.getContent()),y!==f&&(t(5,f=y),t(6,u=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Ir().init(I)}Ht(()=>(Ir()!==null?$():pM.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,L;try{g&&((I=g.dom)==null||I.unbind(document),(L=Ir())==null||L.remove(g))}catch{}}));function C(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function O(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){ee[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,f=I.value),"text"in I&&t(6,u=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==f&&(g.setContent(f),t(6,u=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,f,u,s,o,r,a,g,y,S,C,O,D]}class Wa extends ge{constructor(e){super(),_e(this,e,mM,cM,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function wm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Sm(n,e,t){const i=n.slice();return i[48]=e[t],i}function $m(n,e,t){const i=n.slice();return i[51]=e[t],i}function hM(n){let e,t,i=[],l=new Map,s,o,r,a,f,u,c,d,m,h,_,g=ue(n[7]);const y=S=>S[51].id;for(let S=0;SNew record',c=M(),B(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(u,"type","button"),p(u,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$file field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Tm(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var f;t=b("button"),l=K(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((f=e[8])==null?void 0:f.id)==e[51].id),this.first=t},m(f,u){w(f,t,u),k(t,l),k(t,s),o||(r=J(t,"click",Be(a)),o=!0)},p(f,u){var c;e=f,u[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),u[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(f){f&&v(t),o=!1,r()}}}function gM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Cm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Cm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function bM(n){let e=[],t=new Map,i,l=ue(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function kM(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=ae.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=ae.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Om(n){let e,t,i,l,s,o;function r(u,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(u[48])),t?yM:kM}let a=r(n,[-1,-1]),f=a(n);return{c(){e=b("button"),f.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(u,c){w(u,e,c),f.m(e,null),k(e,i),s||(o=[Se(l=Pe.call(null,e,n[48]+` + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&v(e),V(t),l=!1,$e(s)}}}function KO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,h="";function _(H){j.removeByValue(u,H),t(2,u)}function g(H){j.pushUnique(u,H),t(2,u)}function y(H){j.isEmpty(f[H])||f.splice(H,1),t(1,f)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function T(H){var G,U;H.preventDefault(),t(9,m=!1);const W=((G=H.dataTransfer)==null?void 0:G.files)||[];if(!(s||!W.length)){for(const Y of W){const ie=l.length+f.length-u.length;if(((U=r.options)==null?void 0:U.maxSelect)<=ie)break;f.push(Y)}t(1,f)}}Ht(async()=>{t(10,h=await ae.getAdminFileToken(o.collectionId))});const $=H=>_(H),C=H=>g(H);function O(H){a=H,t(0,a),t(6,i),t(4,r)}const D=H=>y(H);function I(H){f=H,t(1,f)}function L(H){ee[H?"unshift":"push"](()=>{c=H,t(7,c)})}const R=()=>{for(let H of c.files)f.push(H);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(H){ee[H?"unshift":"push"](()=>{d=H,t(8,d)})}const P=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=H=>{"record"in H&&t(3,o=H.record),"field"in H&&t(4,r=H.field),"value"in H&&t(0,a=H.value),"uploadedFiles"in H&&t(1,f=H.uploadedFiles),"deletedFileNames"in H&&t(2,u=H.deletedFileNames)},n.$$.update=()=>{var H,W;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=j.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=j.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((H=r.options)==null?void 0:H.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((W=r.options)==null?void 0:W.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,y,T,$,C,O,D,I,L,R,F,N,P,q]}class JO extends ge{constructor(e){super(),_e(this,e,KO,YO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function xp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function ZO(n,e){e=xp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=xp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function em(n,e,t){const i=n.slice();i[6]=e[t];const l=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=l,i}function tm(n,e,t){const i=n.slice();return i[10]=e[t],i}function nm(n){let e,t;return e=new Ka({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[10]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function im(n){let e=!j.isEmpty(n[10]),t,i,l=e&&nm(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&3&&(e=!j.isEmpty(s[10])),e?l?(l.p(s,o),o&3&&E(l,1)):(l=nm(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(le(),A(l,1,1,()=>{l=null}),se())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function lm(n){let e,t,i=ue(n[7]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oA(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let _=0;_t(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.schema)||[];if(t(1,o=f.filter(u=>u.presentable&&u.type=="file").map(u=>u.name)),t(2,r=f.filter(u=>u.presentable&&u.type!="file").map(u=>u.name)),!o.length&&!r.length){const u=f.find(c=>{var d,m,h;return c.type=="file"&&((d=c.options)==null?void 0:d.maxSelect)==1&&((h=(m=c.options)==null?void 0:m.mimeTypes)==null?void 0:h.find(_=>_.startsWith("image/")))});u&&o.push(u.name)}}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l]}class tr extends ge{constructor(e){super(),_e(this,e,XO,GO,me,{record:0})}}function sm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function om(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function rm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function am(n){let e,t=!n[13]&&fm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=fm(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function fm(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&um(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=um(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function QO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[Se(Pe.call(null,t,"Edit")),J(t,"keydown",Tn(n[27])),J(t,"click",Tn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,$e(l)}}}function dm(n,e){let t,i,l,s,o,r,a,f;function u(g,y){return g[6]?xO:QO}let c=u(e),d=c(e);s=new tr({props:{record:e[49]}});let m=!e[11]&&cm(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),z(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(f=[J(t,"click",h),J(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=u(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=cm(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),V(s),m&&m.d(),a=!1,$e(f)}}}function pm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=K("("),i=K(t),l=K(" of MAX "),s=K(n[4]),o=K(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function eM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function tM(n){let e,t,i=ue(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(u,c){w(u,e,c),z(t,e,null),k(e,i),k(e,l),w(u,s,c),o=!0,r||(a=J(l,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(u){o||(E(t.$$.fragment,u),o=!0)},o(u){A(t.$$.fragment,u),o=!1},d(u){u&&(v(e),v(s)),V(t),r=!1,a()}}}function hm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[nM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Es({props:s}),ee.push(()=>be(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function iM(n){let e,t,i,l,s,o=[],r=new Map,a,f,u,c,d,m,h,_,g,y,S,T;t=new Cs({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&rm(n),C=ue(n[8]);const O=P=>P[49].id;for(let P=0;P1&&mm(n);const R=[tM,eM],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),$&&$.c(),l=M(),s=b("div");for(let P=0;P1?L?L.p(P,q):(L=mm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let W=h;h=N(P),h===W?F[h].p(P,q):(le(),A(F[W],1,1,()=>{F[W]=null}),se(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;qCancel',t=M(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[28]),J(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function oM(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[sM],header:[lM],default:[iM]},$$scope:{ctx:n}};for(let a=0;at(26,m=we));const h=lt(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],O=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,O=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const we=j.toArray(g);if(!l||!we.length)return;t(24,R=!0);let Ye=[];const zt=we.slice(),dn=[];for(;zt.length>0;){const an=[];for(const qn of zt.splice(0,io))an.push(`id="${qn}"`);dn.push(ae.collection(l).getFullList({batch:io,filter:an.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(an=>{Ye=Ye.concat(...an)}),t(6,O=[]);for(const an of we){const qn=j.findByKey(Ye,"id",an);qn&&O.push(qn)}$.trim()||t(8,C=j.filterDuplicatesByKey(O.concat(C))),t(24,R=!1)}catch(an){an.isAbort||(ae.error(an),t(24,R=!1))}}async function q(we=!1){if(l){t(3,L=!0),we&&($.trim()?t(8,C=[]):t(8,C=j.toArray(O).slice()));try{const Ye=we?1:D+1,zt=j.getAllCollectionIdentifiers(s),dn=await ae.collection(l).getList(Ye,io,{filter:j.normalizeSearchFilter($,zt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(dn.items))),D=dn.page,t(23,I=dn.items.length),t(3,L=!1)}catch(Ye){Ye.isAbort||(ae.error(Ye),t(3,L=!1))}}}function H(we){i==1?t(6,O=[we]):f&&(j.pushOrReplaceByKey(O,we),t(6,O))}function W(we){j.removeByKey(O,"id",we.id),t(6,O)}function G(we){u(we)?W(we):H(we)}function U(){var we;i!=1?t(20,g=O.map(Ye=>Ye.id)):t(20,g=((we=O==null?void 0:O[0])==null?void 0:we.id)||""),h("save",O),N()}function Y(we){Ce.call(this,n,we)}const ie=()=>N(),te=()=>U(),pe=we=>t(2,$=we.detail),Ne=()=>T==null?void 0:T.show(),He=we=>T==null?void 0:T.show(we.id),Xe=we=>G(we),xe=(we,Ye)=>{(Ye.code==="Enter"||Ye.code==="Space")&&(Ye.preventDefault(),Ye.stopPropagation(),G(we))},Mt=()=>t(2,$=""),ft=()=>{a&&!L&&q()},ht=we=>W(we);function Gt(we){O=we,t(6,O)}function De(we){ee[we?"unshift":"push"](()=>{S=we,t(1,S)})}function Ae(we){Ce.call(this,n,we)}function ze(we){Ce.call(this,n,we)}function bt(we){ee[we?"unshift":"push"](()=>{T=we,t(7,T)})}const de=we=>{j.removeByKey(C,"id",we.detail.record.id),C.unshift(we.detail.record),t(8,C),H(we.detail.record)},ve=we=>{j.removeByKey(C,"id",we.detail.id),t(8,C),W(we.detail)};return n.$$set=we=>{e=Ie(Ie({},e),Yt(we)),t(19,d=Ge(e,c)),"value"in we&&t(20,g=we.value),"field"in we&&t(21,y=we.field)},n.$$.update=()=>{var we,Ye;n.$$.dirty[0]&2097152&&t(4,i=((we=y==null?void 0:y.options)==null?void 0:we.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(Ye=y==null?void 0:y.options)==null?void 0:Ye.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(zt=>zt.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==io),n.$$.dirty[0]&80&&t(10,f=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,u=function(zt){return j.findByKey(O,"id",zt.id)})},[N,S,$,L,i,s,O,T,C,u,f,o,a,r,q,H,W,G,U,d,g,y,F,I,R,l,m,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De,Ae,ze,bt,de,ve]}class aM extends ge{constructor(e){super(),_e(this,e,rM,oM,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function _m(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function gm(n,e,t){const i=n.slice();return i[26]=e[t],i}function bm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Ct(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function km(n){let e,t=n[5]&&ym(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=ym(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function ym(n){let e,t=ue(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fM(n){let e,t,i,l,s,o,r,a,f,u;i=new tr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,f||(u=[Se(Pe.call(null,o,"Remove")),J(o,"click",c)],f=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),f=!1,$e(u)}}}function wm(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[fM,({dragging:a,dragover:f})=>({24:a,25:f}),({dragging:a,dragover:f})=>(a?16777216:0)|(f?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[23]),f&128&&(u.disabled=!e[7]),f&587202576&&(u.$$scope={dirty:f,ctx:e}),!l&&f&16&&(l=!0,u.list=e[4],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function uM(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&bm(n),O=ue(n[4]);const D=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Un(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",f=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,u,R),w(L,c,R),k(c,d);for(let F=0;F({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new ce({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new aM({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,[a]){const f={};a&4&&(f.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(f.name=r[2].name),a&537919735&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a&1&&(u.value=r[0]),a&4&&(u.field=r[2]),i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const Sm=100;function dM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],f=!1,u,c=[];function d(){if(f)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,f=!1);return}t(5,f=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,Sm))N.push(`id="${P}"`);L.push(ae.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(Sm,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){ae.error(N)}t(5,f=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}vs(()=>{clearTimeout(u)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){ee[D?"unshift":"push"](()=>{o=D,t(1,o)})}const O=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,f=!0),clearTimeout(u),t(10,u=setTimeout(m,0)))},[s,o,l,r,a,f,c,i,h,_,u,g,y,S,T,$,C,O]}class pM extends ge{constructor(e){super(),_e(this,e,dM,cM,me,{field:2,value:0,picker:1})}}function mM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),v0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function hM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function _M(n){let e;function t(s,o){return s[1]?hM:mM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function gM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let bM=gM();function Nr(){return window&&window.tinymce?window.tinymce:null}function kM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:f=""}=e,{text:u=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=f,S=s;const T=lt();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(f),L.on(a,()=>{t(12,y=L.getContent()),y!==f&&(t(5,f=y),t(6,u=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Nr().init(I)}Ht(()=>(Nr()!==null?$():bM.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,L;try{g&&((I=g.dom)==null||I.unbind(document),(L=Nr())==null||L.remove(g))}catch{}}));function C(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function O(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){ee[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,f=I.value),"text"in I&&t(6,u=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==f&&(g.setContent(f),t(6,u=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,f,u,s,o,r,a,g,y,S,C,O,D]}class Ja extends ge{constructor(e){super(),_e(this,e,kM,_M,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function $m(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Tm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Cm(n,e,t){const i=n.slice();return i[51]=e[t],i}function yM(n){let e,t,i=[],l=new Map,s,o,r,a,f,u,c,d,m,h,_,g=ue(n[7]);const y=S=>S[51].id;for(let S=0;SNew record',c=M(),B(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(u,"type","button"),p(u,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$file field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Om(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var f;t=b("button"),l=K(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((f=e[8])==null?void 0:f.id)==e[51].id),this.first=t},m(f,u){w(f,t,u),k(t,l),k(t,s),o||(r=J(t,"click",Be(a)),o=!0)},p(f,u){var c;e=f,u[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),u[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(f){f&&v(t),o=!1,r()}}}function wM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Mm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Mm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function SM(n){let e=[],t=new Map,i,l=ue(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function $M(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=ae.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=ae.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Dm(n){let e,t,i,l,s,o;function r(u,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(u[48])),t?TM:$M}let a=r(n,[-1,-1]),f=a(n);return{c(){e=b("button"),f.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(u,c){w(u,e,c),f.m(e,null),k(e,i),s||(o=[Se(l=Pe.call(null,e,n[48]+` (record: `+n[44].id+")")),J(e,"click",Be(function(){Ct(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(u,c){n=u,a===(a=r(n,c))&&f?f.p(n,c):(f.d(1),f=a(n),f&&(f.c(),f.m(e,i))),l&&Ct(l.update)&&c[0]&32&&l.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(u){u&&v(e),f.d(),s=!1,$e(o)}}}function Mm(n,e){let t,i,l=ue(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function vM(n){let e,t;function i(r,a){if(r[15])return bM;if(!r[6])return gM}let l=i(n),s=l&&l(n),o=n[6]&&Dm();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Dm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function wM(n){let e,t,i,l;const s=[_M,hM],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function SM(n){let e,t;return{c(){e=b("h4"),t=K(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&v(e)}}}function Em(n){let e,t;return e=new ce({props:{class:"form-field file-picker-size-select",$$slots:{default:[$M,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $M(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function TM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Em(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=K(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=f=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),u=!0,c||(d=[J(e,"click",n[2]),J(o,"click",n[21])],c=!0)},p(_,g){var y;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Em(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(le(),A(m,1,1,()=>{m=null}),se()),(!u||g[0]&2)&&oe(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(E(m),u=!0)},o(_){A(m),u=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,$e(d)}}}function CM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[TM],header:[SM],default:[wM]},$$scope:{ctx:n}};for(let a=0;at(27,f=Ae));const u=lt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,O=[],D=[],I=[],L={},R={},F="";function N(){return W(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function H(){t(4,y="")}async function W(Ae=!1){if(L!=null&&L.id){t(6,C=!0),Ae&&q();try{const ze=Ae?1:T+1,gt=j.getAllCollectionIdentifiers(L);let de=j.normalizeSearchFilter(y,gt)||"";de&&(de+=" && "),de+="("+D.map(we=>`${we.name}:length>0`).join("||")+")";const ve=await ae.collection(L.id).getList(ze,Im,{filter:de,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(ve.items))),T=ve.page,t(26,$=ve.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ae.error(ze),t(6,C=!1))}}}function G(){var ze,gt;let Ae=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const de of D)if(j.toArray(R.record[de.name]).includes(R.name)){Ae=Ae.concat(j.toArray((gt=de.options)==null?void 0:gt.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const de of Ae)I.push({label:`${de} thumb`,value:de});F&&!Ae.includes(F)&&t(12,F="")}function U(Ae){let ze=[];for(const gt of D){const de=j.toArray(Ae[gt.name]);for(const ve of de)h.includes(j.getFileType(ve))&&ze.push(ve)}return ze}function Y(Ae,ze){t(9,R={record:Ae,name:ze})}function ie(){o&&(u("submit",Object.assign({size:F},R)),P())}function te(Ae){F=Ae,t(12,F)}const pe=Ae=>{t(8,L=Ae)},Ne=Ae=>t(4,y=Ae.detail),He=()=>g==null?void 0:g.show(),Xe=()=>{s&&W()};function xe(Ae){ee[Ae?"unshift":"push"](()=>{_=Ae,t(3,_)})}function Mt(Ae){Ce.call(this,n,Ae)}function ft(Ae){Ce.call(this,n,Ae)}function mt(Ae){ee[Ae?"unshift":"push"](()=>{g=Ae,t(10,g)})}const Gt=Ae=>{j.removeByKey(S,"id",Ae.detail.record.id),S.unshift(Ae.detail.record),t(5,S);const ze=U(Ae.detail.record);ze.length>0&&Y(Ae.detail.record,ze[0])},De=Ae=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Ae.detail.id&&t(9,R={}),j.removeByKey(S,"id",Ae.detail.id),t(5,S)};return n.$$set=Ae=>{e=Ie(Ie({},e),Yt(Ae)),t(22,a=Ge(e,r)),"title"in Ae&&t(0,d=Ae.title),"submitText"in Ae&&t(1,m=Ae.submitText),"fileTypes"in Ae&&t(24,h=Ae.fileTypes)},n.$$.update=()=>{var Ae;n.$$.dirty[0]&134217728&&t(7,O=f.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(gt=>{var de,ve,we,Ye,zt;return gt.type==="file"&&!((de=gt.options)!=null&&de.protected)&&(!((we=(ve=gt.options)==null?void 0:ve.mimeTypes)!=null&&we.length)||!!((zt=(Ye=gt.options)==null?void 0:Ye.mimeTypes)!=null&&zt.find(cn=>cn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(D=(Ae=L==null?void 0:L.schema)==null?void 0:Ae.filter(ze=>{var gt;return ze.type==="file"&&!((gt=ze.options)!=null&>.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(H(),G()),n.$$.dirty[0]&512&&R!=null&&R.name&&G(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&W(!0),n.$$.dirty[0]&512&&t(16,i=(ze,gt)=>{var de;return(R==null?void 0:R.name)==gt&&((de=R==null?void 0:R.record)==null?void 0:de.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>U(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Im),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,O,L,R,g,I,F,o,s,l,i,H,W,U,Y,ie,a,c,h,N,$,f,te,pe,Ne,He,Xe,xe,Mt,ft,mt,Gt,De]}class MM extends ge{constructor(e){super(),_e(this,e,OM,CM,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function DM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function EM(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Wa({props:s}),ee.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function IM(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m;const h=[EM,DM],_=[];function g(y,S){return y[4]?0:1}return u=g(n),c=_[u]=h[u](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),_[u].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&oe(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=u;u=g(y),u===T?_[u].p(y,S):(le(),A(_[T],1,1,()=>{_[T]=null}),se(),c=_[u],c?c.p(y,S):(c=_[u]=h[u](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(f),v(d)),_[u].d(y)}}}function AM(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[IM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new MM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function LM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,f=null;Ht(async()=>(typeof s>"u"&&t(0,s=""),f=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(f)}));function u(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ee[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,ae.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,u,c,d,m]}class NM extends ge{constructor(e){super(),_e(this,e,LM,AM,me,{field:1,value:0})}}function PM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function FM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qM(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[PM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[FM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[RM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=K(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(u,c){w(u,e,c),k(e,t),w(u,i,c),z(l,u,c),w(u,s,c),z(o,u,c),w(u,r,c),z(a,u,c),f=!0},p(u,[c]){(!f||c&4)&&oe(t,u[2]);const d={};c&8&&(d.class="form-field "+(u[3]?"required":"")),c&2&&(d.name=u[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&8&&(m.class="form-field "+(u[3]?"required":"")),c&2&&(m.name=u[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:u}),o.$set(m);const h={};c&8&&(h.class="form-field "+(u[3]?"required":"")),c&2&&(h.name=u[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:u}),a.$set(h)},i(u){f||(E(l.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),f=!0)},o(u){A(l.$$.fragment,u),A(o.$$.fragment,u),A(a.$$.fragment,u),f=!1},d(u){u&&(v(e),v(i),v(s),v(r)),V(l,u),V(o,u),V(a,u)}}}function jM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function f(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,f,u]}class Ar extends ge{constructor(e){super(),_e(this,e,jM,qM,me,{key:1,config:0,required:4,title:2})}}function HM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Display name"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","text"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].displayName),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].displayName&&re(s,f[0].displayName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function UM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[7]),Se(Pe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],f=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&256&&a!==(a=c[8])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function WM(n){let e,t,i,l,s,o,r,a,f,u,c,d;return e=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".displayName",$$slots:{default:[HM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".authUrl",$$slots:{default:[zM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[VM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[BM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ce({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[UM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),i=b("div"),i.textContent="Endpoints",l=M(),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),B(c.$$.fragment),p(i,"class","section-title")},m(m,h){z(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),z(s,m,h),w(m,o,h),z(r,m,h),w(m,a,h),z(f,m,h),w(m,u,h),z(c,m,h),d=!0},p(m,[h]){const _={};h&4&&(_.class="form-field "+(m[2]?"required":"")),h&2&&(_.name=m[1]+".displayName"),h&773&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&4&&(g.class="form-field "+(m[2]?"required":"")),h&2&&(g.name=m[1]+".authUrl"),h&773&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&4&&(y.class="form-field "+(m[2]?"required":"")),h&2&&(y.name=m[1]+".tokenUrl"),h&773&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&4&&(S.class="form-field "+(m[2]?"required":"")),h&2&&(S.name=m[1]+".userApiUrl"),h&773&&(S.$$scope={dirty:h,ctx:m}),f.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&769&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(f.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(f.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(u)),V(e,m),V(s,m),V(r,m),V(f,m),V(c,m)}}}function YM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e;j.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC");function o(){s.displayName=this.value,t(0,s)}function r(){s.authUrl=this.value,t(0,s)}function a(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}function u(){s.pkce=this.checked,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=!!s.enabled)},[s,l,i,o,r,a,f,u]}class Lr extends ge{constructor(e){super(),_e(this,e,YM,WM,me,{key:1,config:0})}}function KM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[2]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&re(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function JM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[3]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&re(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function ZM(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[KM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[JM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,[a]){const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".authUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".tokenUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function GM(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class XM extends ge{constructor(e){super(),_e(this,e,GM,ZM,me,{key:1,config:0})}}function QM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function xM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[3]),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&8&&s.value!==f[3]&&re(s,f[3])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function e8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[4]),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&16&&s.value!==f[4]&&re(s,f[4])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function t8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",_o),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[6]),f||(u=[Se(Pe.call(null,l,{text:`Max ${_o} seconds (~${_o/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function n8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Private key"),l=M(),s=b("textarea"),r=M(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- +(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(u){u&&v(e),f.d(),s=!1,$e(o)}}}function Em(n,e){let t,i,l=ue(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function CM(n){let e,t;function i(r,a){if(r[15])return SM;if(!r[6])return wM}let l=i(n),s=l&&l(n),o=n[6]&&Im();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Im(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function OM(n){let e,t,i,l;const s=[vM,yM],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function MM(n){let e,t;return{c(){e=b("h4"),t=K(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&v(e)}}}function Am(n){let e,t;return e=new ce({props:{class:"form-field file-picker-size-select",$$slots:{default:[DM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function EM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Am(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=K(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=f=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),u=!0,c||(d=[J(e,"click",n[2]),J(o,"click",n[21])],c=!0)},p(_,g){var y;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Am(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(le(),A(m,1,1,()=>{m=null}),se()),(!u||g[0]&2)&&oe(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(E(m),u=!0)},o(_){A(m),u=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,$e(d)}}}function IM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[EM],header:[MM],default:[OM]},$$scope:{ctx:n}};for(let a=0;at(27,f=Ae));const u=lt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,O=[],D=[],I=[],L={},R={},F="";function N(){return W(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function H(){t(4,y="")}async function W(Ae=!1){if(L!=null&&L.id){t(6,C=!0),Ae&&q();try{const ze=Ae?1:T+1,bt=j.getAllCollectionIdentifiers(L);let de=j.normalizeSearchFilter(y,bt)||"";de&&(de+=" && "),de+="("+D.map(we=>`${we.name}:length>0`).join("||")+")";const ve=await ae.collection(L.id).getList(ze,Lm,{filter:de,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(ve.items))),T=ve.page,t(26,$=ve.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ae.error(ze),t(6,C=!1))}}}function G(){var ze,bt;let Ae=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const de of D)if(j.toArray(R.record[de.name]).includes(R.name)){Ae=Ae.concat(j.toArray((bt=de.options)==null?void 0:bt.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const de of Ae)I.push({label:`${de} thumb`,value:de});F&&!Ae.includes(F)&&t(12,F="")}function U(Ae){let ze=[];for(const bt of D){const de=j.toArray(Ae[bt.name]);for(const ve of de)h.includes(j.getFileType(ve))&&ze.push(ve)}return ze}function Y(Ae,ze){t(9,R={record:Ae,name:ze})}function ie(){o&&(u("submit",Object.assign({size:F},R)),P())}function te(Ae){F=Ae,t(12,F)}const pe=Ae=>{t(8,L=Ae)},Ne=Ae=>t(4,y=Ae.detail),He=()=>g==null?void 0:g.show(),Xe=()=>{s&&W()};function xe(Ae){ee[Ae?"unshift":"push"](()=>{_=Ae,t(3,_)})}function Mt(Ae){Ce.call(this,n,Ae)}function ft(Ae){Ce.call(this,n,Ae)}function ht(Ae){ee[Ae?"unshift":"push"](()=>{g=Ae,t(10,g)})}const Gt=Ae=>{j.removeByKey(S,"id",Ae.detail.record.id),S.unshift(Ae.detail.record),t(5,S);const ze=U(Ae.detail.record);ze.length>0&&Y(Ae.detail.record,ze[0])},De=Ae=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Ae.detail.id&&t(9,R={}),j.removeByKey(S,"id",Ae.detail.id),t(5,S)};return n.$$set=Ae=>{e=Ie(Ie({},e),Yt(Ae)),t(22,a=Ge(e,r)),"title"in Ae&&t(0,d=Ae.title),"submitText"in Ae&&t(1,m=Ae.submitText),"fileTypes"in Ae&&t(24,h=Ae.fileTypes)},n.$$.update=()=>{var Ae;n.$$.dirty[0]&134217728&&t(7,O=f.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(bt=>{var de,ve,we,Ye,zt;return bt.type==="file"&&!((de=bt.options)!=null&&de.protected)&&(!((we=(ve=bt.options)==null?void 0:ve.mimeTypes)!=null&&we.length)||!!((zt=(Ye=bt.options)==null?void 0:Ye.mimeTypes)!=null&&zt.find(dn=>dn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(D=(Ae=L==null?void 0:L.schema)==null?void 0:Ae.filter(ze=>{var bt;return ze.type==="file"&&!((bt=ze.options)!=null&&bt.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(H(),G()),n.$$.dirty[0]&512&&R!=null&&R.name&&G(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&W(!0),n.$$.dirty[0]&512&&t(16,i=(ze,bt)=>{var de;return(R==null?void 0:R.name)==bt&&((de=R==null?void 0:R.record)==null?void 0:de.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>U(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Lm),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,O,L,R,g,I,F,o,s,l,i,H,W,U,Y,ie,a,c,h,N,$,f,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De]}class LM extends ge{constructor(e){super(),_e(this,e,AM,IM,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function NM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function PM(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Ja({props:s}),ee.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FM(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m;const h=[PM,NM],_=[];function g(y,S){return y[4]?0:1}return u=g(n),c=_[u]=h[u](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),_[u].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&oe(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=u;u=g(y),u===T?_[u].p(y,S):(le(),A(_[T],1,1,()=>{_[T]=null}),se(),c=_[u],c?c.p(y,S):(c=_[u]=h[u](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(f),v(d)),_[u].d(y)}}}function RM(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[FM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new LM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function qM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,f=null;Ht(async()=>(typeof s>"u"&&t(0,s=""),f=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(f)}));function u(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ee[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,ae.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,u,c,d,m]}class jM extends ge{constructor(e){super(),_e(this,e,qM,RM,me,{field:1,value:0})}}function HM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BM(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[HM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[zM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[VM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=K(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(u,c){w(u,e,c),k(e,t),w(u,i,c),z(l,u,c),w(u,s,c),z(o,u,c),w(u,r,c),z(a,u,c),f=!0},p(u,[c]){(!f||c&4)&&oe(t,u[2]);const d={};c&8&&(d.class="form-field "+(u[3]?"required":"")),c&2&&(d.name=u[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&8&&(m.class="form-field "+(u[3]?"required":"")),c&2&&(m.name=u[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:u}),o.$set(m);const h={};c&8&&(h.class="form-field "+(u[3]?"required":"")),c&2&&(h.name=u[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:u}),a.$set(h)},i(u){f||(E(l.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),f=!0)},o(u){A(l.$$.fragment,u),A(o.$$.fragment,u),A(a.$$.fragment,u),f=!1},d(u){u&&(v(e),v(i),v(s),v(r)),V(l,u),V(o,u),V(a,u)}}}function UM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function f(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,f,u]}class Pr extends ge{constructor(e){super(),_e(this,e,UM,BM,me,{key:1,config:0,required:4,title:2})}}function WM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Display name"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","text"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].displayName),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].displayName&&re(s,f[0].displayName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function YM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function KM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function JM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function ZM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[7]),Se(Pe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],f=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&256&&a!==(a=c[8])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function GM(n){let e,t,i,l,s,o,r,a,f,u,c,d;return e=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".displayName",$$slots:{default:[WM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".authUrl",$$slots:{default:[YM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[KM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[JM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ce({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[ZM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),i=b("div"),i.textContent="Endpoints",l=M(),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),B(c.$$.fragment),p(i,"class","section-title")},m(m,h){z(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),z(s,m,h),w(m,o,h),z(r,m,h),w(m,a,h),z(f,m,h),w(m,u,h),z(c,m,h),d=!0},p(m,[h]){const _={};h&4&&(_.class="form-field "+(m[2]?"required":"")),h&2&&(_.name=m[1]+".displayName"),h&773&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&4&&(g.class="form-field "+(m[2]?"required":"")),h&2&&(g.name=m[1]+".authUrl"),h&773&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&4&&(y.class="form-field "+(m[2]?"required":"")),h&2&&(y.name=m[1]+".tokenUrl"),h&773&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&4&&(S.class="form-field "+(m[2]?"required":"")),h&2&&(S.name=m[1]+".userApiUrl"),h&773&&(S.$$scope={dirty:h,ctx:m}),f.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&769&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(f.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(f.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(u)),V(e,m),V(s,m),V(r,m),V(f,m),V(c,m)}}}function XM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e;j.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC");function o(){s.displayName=this.value,t(0,s)}function r(){s.authUrl=this.value,t(0,s)}function a(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}function u(){s.pkce=this.checked,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=!!s.enabled)},[s,l,i,o,r,a,f,u]}class Fr extends ge{constructor(e){super(),_e(this,e,XM,GM,me,{key:1,config:0})}}function QM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[2]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&re(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function xM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[3]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&re(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function e8(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[QM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[xM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,[a]){const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".authUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".tokenUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function t8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class n8 extends ge{constructor(e){super(),_e(this,e,t8,e8,me,{key:1,config:0})}}function i8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function l8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[3]),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&8&&s.value!==f[3]&&re(s,f[3])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function s8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[4]),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&16&&s.value!==f[4]&&re(s,f[4])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function o8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",bo),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[6]),f||(u=[Se(Pe.call(null,l,{text:`Max ${bo} seconds (~${bo/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function r8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Private key"),l=M(),s=b("textarea"),r=M(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[5]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[16]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&re(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function i8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return l=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[QM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[xM,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[e8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[t8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[n8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),B(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(t,h),z(_,t,null),g=!0,y||(S=J(e,"submit",Be(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const O={};$&25165832&&(O.$$scope={dirty:$,ctx:T}),r.$set(O);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),u.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(l),V(r),V(u),V(m),V(_),y=!1,S()}}}function l8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function s8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function o8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[s8],header:[l8],default:[i8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const _o=15777e3;function r8(n,e,t){let i;const l=lt(),s="apple_secret_"+j.randomString(5);let o,r,a,f,u,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,f=R.keyId||""),t(5,u=R.privateKey||""),t(6,c=R.duration||_o),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await ae.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Lt("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ae.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){f=this.value,t(4,f)}function T(){c=this.value,t(6,c)}function $(){u=this.value,t(5,u)}const C=()=>_(),O=()=>!d;function D(R){ee[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Ce.call(this,n,R)}function L(R){Ce.call(this,n,R)}return t(8,i=!0),[h,o,r,a,f,u,c,d,i,s,_,m,g,y,S,T,$,C,O,D,I,L]}class a8 extends ge{constructor(e){super(),_e(this,e,r8,o8,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function f8(n){let e,t,i,l,s,o,r,a,f,u,c={};return r=new a8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),z(r,d,m),a=!0,f||(u=J(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),V(r,d),f=!1,u()}}}function u8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{var u;t(0,l.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",l)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class c8 extends ge{constructor(e){super(),_e(this,e,u8,f8,me,{key:1,config:0})}}const go=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:c8},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:XM},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Ar,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Ar,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Ar,optionsComponentProps:{required:!0}},{key:"planningcenterAuth",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Lr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Lr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Lr}];function Am(n,e,t){const i=n.slice();return i[9]=e[t],i}function d8(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function p8(n){let e,t=ue(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Lm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=K(r),f=M(),u=b("div"),c=K("ID: "),m=K(d),h=M(),_=b("button"),_.innerHTML='',g=M(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,f),k(e,u),k(u,c),k(u,m),k(e,h),k(e,_),k(e,g),y||(S=J(_,"click",T),y=!0)},p($,C){var O;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),C&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d($){$&&v(e),y=!1,S()}}}function h8(n){let e;function t(s,o){var r;return s[2]?m8:(r=s[0])!=null&&r.id&&s[1].length?p8:d8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function _8(n,e,t){const i=lt();let{record:l}=e,s=[],o=!1;function r(d){return go.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function f(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ae.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ae.error(d)}t(2,o=!1)}function u(d){!(l!=null&&l.id)||!d||fn(`Do you really want to unlink the ${a(d)} provider?`,()=>ae.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Lt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{ae.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,u,c]}class g8 extends ge{constructor(e){super(),_e(this,e,_8,h8,me,{record:0})}}function Nm(n,e,t){const i=n.slice();return i[71]=e[t],i[72]=e,i[73]=t,i}function Pm(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=M(),f=b("button"),f.innerHTML='',u=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(f,"type","button"),p(f,"class","close"),p(f,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,f),k(e,u),k(e,c),m=!0,h||(_=[J(r,"click",n[39]),Se(Pe.call(null,f,"Discard draft")),J(f,"click",Be(n[40]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=ca(e,et,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,$e(_)}}}function Fm(n){let e,t,i;return t=new Kb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function b8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y=!n[6]&&Fm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),y&&y.c(),f=M(),u=b("input"),p(t,"class",Un(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[74]),p(u,"type","text"),p(u,"id",c=n[74]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,f,T),w(S,u,T),re(u,n[3].id),h=!0,_||(g=J(u,"input",n[41]),_=!0)},p(S,T){(!h||T[2]&4096&&r!==(r=S[74]))&&p(e,"for",r),S[6]?y&&(le(),A(y,1,1,()=>{y=null}),se()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=Fm(S),y.c(),E(y,1),y.m(f.parentNode,f)),(!h||T[2]&4096&&c!==(c=S[74]))&&p(u,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(u.readOnly=m),T[0]&8&&u.value!==S[3].id&&re(u,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(f),v(u)),y&&y.d(S),_=!1,g()}}}function Rm(n){var f,u;let e,t,i,l,s;function o(c){n[42](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new E6({props:r}),ee.push(()=>be(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&qm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ye()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=qm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function qm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function k8(n){let e,t,i;function l(o){n[55](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new aM({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function y8(n){let e,t,i,l,s;function o(u){n[52](u,n[71])}function r(u){n[53](u,n[71])}function a(u){n[54](u,n[71])}let f={field:n[71],record:n[3]};return n[3][n[71].name]!==void 0&&(f.value=n[3][n[71].name]),n[4][n[71].name]!==void 0&&(f.uploadedFiles=n[4][n[71].name]),n[5][n[71].name]!==void 0&&(f.deletedFileNames=n[5][n[71].name]),e=new BO({props:f}),ee.push(()=>be(e,"value",o)),ee.push(()=>be(e,"uploadedFiles",r)),ee.push(()=>be(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(u,c){z(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[71]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[71].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[71].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[71].name],ke(()=>l=!1)),e.$set(d)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function v8(n){let e,t,i;function l(o){n[51](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new hO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function w8(n){let e,t,i;function l(o){n[50](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new rO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function S8(n){let e,t,i;function l(o){n[49](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new iO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $8(n){let e,t,i;function l(o){n[48](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new NM({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function T8(n){let e,t,i;function l(o){n[47](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new x6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function C8(n){let e,t,i;function l(o){n[46](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new Z6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O8(n){let e,t,i;function l(o){n[45](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new W6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M8(n){let e,t,i;function l(o){n[44](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new z6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D8(n){let e,t,i;function l(o){n[43](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new R6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function jm(n,e){let t,i,l,s,o;const r=[D8,M8,O8,C8,T8,$8,S8,w8,v8,y8,k8],a=[];function f(u,c){return u[71].type==="text"?0:u[71].type==="number"?1:u[71].type==="bool"?2:u[71].type==="email"?3:u[71].type==="url"?4:u[71].type==="editor"?5:u[71].type==="date"?6:u[71].type==="select"?7:u[71].type==="json"?8:u[71].type==="file"?9:u[71].type==="relation"?10:-1}return~(i=f(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,s,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(l&&(le(),A(a[d],1,1,()=>{a[d]=null}),se()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(u){o||(E(l),o=!0)},o(u){A(l),o=!1},d(u){u&&(v(t),v(s)),~i&&a[i].d(u)}}}function Hm(n){let e,t,i;return t=new g8({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===_s)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===_s)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function E8(n){var S;let e,t,i,l,s,o,r=[],a=new Map,f,u,c,d,m=!n[8]&&n[10]&&!n[7]&&Pm(n);l=new ce({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[b8,({uniqueId:T})=>({74:T}),({uniqueId:T})=>[0,0,T?4096:0]]},$$scope:{ctx:n}}});let h=n[14]&&Rm(n),_=ue(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[71].name;for(let T=0;T<_.length;T+=1){let $=Nm(n,_,T),C=g($);a.set(C,r[T]=jm(C,$))}let y=n[14]&&!n[6]&&Hm(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=M(),B(l.$$.fragment),s=M(),h&&h.c(),o=M();for(let T=0;T{m=null}),se());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&12288&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=Rm(T),h.c(),E(h,1),h.m(t,o)):h&&(le(),A(h,1,1,()=>{h=null}),se()),$[0]&57&&(_=ue(((O=T[0])==null?void 0:O.schema)||[]),le(),r=at(r,$,g,1,T,_,a,t,Et,jm,null,Nm),se()),(!u||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!u||$[0]&8192)&&x(t,"active",T[13]===Gi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=Hm(T),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se())},i(T){if(!u){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),u=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;${d=null}),se()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=zm(h),d.c(),E(d,1),d.m(u.parentNode,u))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(f),v(u)),d&&d.d(h)}}}function A8(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function zm(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[L8]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[0]&16388|f[2]&8192&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Vm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Bm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[34]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function L8(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Vm(n),f=n[14]&&n[2].email&&Bm(n);return{c(){a&&a.c(),e=M(),f&&f.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable"),p(s,"role","menuitem")},m(u,c){a&&a.m(u,c),w(u,e,c),f&&f.m(u,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),o||(r=[J(i,"click",n[35]),J(s,"click",Tn(Be(n[36])))],o=!0)},p(u,c){u[14]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=Vm(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[14]&&u[2].email?f?f.p(u,c):(f=Bm(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){u&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(u),f&&f.d(u),o=!1,$e(r)}}}function Um(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Gi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===_s),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[J(t,"click",n[37]),J(l,"click",n[38])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Gi),a[0]&8192&&x(l,"active",r[13]===_s)},d(r){r&&v(e),s=!1,$e(o)}}}function N8(n){let e,t,i,l,s;const o=[A8,I8],r=[];function a(u,c){return u[7]?0:1}e=a(n),t=r[e]=o[e](n);let f=n[14]&&!n[6]&&Um(n);return{c(){t.c(),i=M(),f&&f.c(),l=ye()},m(u,c){r[e].m(u,c),w(u,i,c),f&&f.m(u,c),w(u,l,c),s=!0},p(u,c){let d=e;e=a(u),e===d?r[e].p(u,c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),t=r[e],t?t.p(u,c):(t=r[e]=o[e](u),t.c()),E(t,1),t.m(i.parentNode,i)),u[14]&&!u[6]?f?f.p(u,c):(f=Um(u),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(u){s||(E(t),s=!0)},o(u){A(t),s=!1},d(u){u&&(v(i),v(l)),r[e].d(u),f&&f.d(u)}}}function P8(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,f,u,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),u||(c=J(e,"click",n[32]),u=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&oe(a,r),m[0]&34816&&f!==(f=!d[15]||d[11])&&(s.disabled=f),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),u=!1,c()}}}function F8(n){let e,t,i={class:` +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[5]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[16]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&re(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function a8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return l=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[i8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[l8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[s8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[o8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[r8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),B(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(t,h),z(_,t,null),g=!0,y||(S=J(e,"submit",Be(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const O={};$&25165832&&(O.$$scope={dirty:$,ctx:T}),r.$set(O);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),u.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(l),V(r),V(u),V(m),V(_),y=!1,S()}}}function f8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function u8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function c8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[u8],header:[f8],default:[a8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const bo=15777e3;function d8(n,e,t){let i;const l=lt(),s="apple_secret_"+j.randomString(5);let o,r,a,f,u,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,f=R.keyId||""),t(5,u=R.privateKey||""),t(6,c=R.duration||bo),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await ae.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Lt("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ae.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){f=this.value,t(4,f)}function T(){c=this.value,t(6,c)}function $(){u=this.value,t(5,u)}const C=()=>_(),O=()=>!d;function D(R){ee[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Ce.call(this,n,R)}function L(R){Ce.call(this,n,R)}return t(8,i=!0),[h,o,r,a,f,u,c,d,i,s,_,m,g,y,S,T,$,C,O,D,I,L]}class p8 extends ge{constructor(e){super(),_e(this,e,d8,c8,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function m8(n){let e,t,i,l,s,o,r,a,f,u,c={};return r=new p8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),z(r,d,m),a=!0,f||(u=J(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),V(r,d),f=!1,u()}}}function h8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{var u;t(0,l.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",l)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class _8 extends ge{constructor(e){super(),_e(this,e,h8,m8,me,{key:1,config:0})}}const ko=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:_8},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:n8},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Pr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Pr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Pr,optionsComponentProps:{required:!0}},{key:"planningcenterAuth",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr}];function Nm(n,e,t){const i=n.slice();return i[9]=e[t],i}function g8(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function b8(n){let e,t=ue(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Pm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=K(r),f=M(),u=b("div"),c=K("ID: "),m=K(d),h=M(),_=b("button"),_.innerHTML='',g=M(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,f),k(e,u),k(u,c),k(u,m),k(e,h),k(e,_),k(e,g),y||(S=J(_,"click",T),y=!0)},p($,C){var O;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),C&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d($){$&&v(e),y=!1,S()}}}function y8(n){let e;function t(s,o){var r;return s[2]?k8:(r=s[0])!=null&&r.id&&s[1].length?b8:g8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function v8(n,e,t){const i=lt();let{record:l}=e,s=[],o=!1;function r(d){return ko.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function f(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ae.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ae.error(d)}t(2,o=!1)}function u(d){!(l!=null&&l.id)||!d||un(`Do you really want to unlink the ${a(d)} provider?`,()=>ae.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Lt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{ae.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,u,c]}class w8 extends ge{constructor(e){super(),_e(this,e,v8,y8,me,{record:0})}}function Fm(n,e,t){const i=n.slice();return i[71]=e[t],i[72]=e,i[73]=t,i}function Rm(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=M(),f=b("button"),f.innerHTML='',u=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(f,"type","button"),p(f,"class","close"),p(f,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,f),k(e,u),k(e,c),m=!0,h||(_=[J(r,"click",n[39]),Se(Pe.call(null,f,"Discard draft")),J(f,"click",Be(n[40]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=ma(e,et,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,$e(_)}}}function qm(n){let e,t,i;return t=new Gb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function S8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y=!n[6]&&qm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),y&&y.c(),f=M(),u=b("input"),p(t,"class",Un(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[74]),p(u,"type","text"),p(u,"id",c=n[74]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,f,T),w(S,u,T),re(u,n[3].id),h=!0,_||(g=J(u,"input",n[41]),_=!0)},p(S,T){(!h||T[2]&4096&&r!==(r=S[74]))&&p(e,"for",r),S[6]?y&&(le(),A(y,1,1,()=>{y=null}),se()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=qm(S),y.c(),E(y,1),y.m(f.parentNode,f)),(!h||T[2]&4096&&c!==(c=S[74]))&&p(u,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(u.readOnly=m),T[0]&8&&u.value!==S[3].id&&re(u,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(f),v(u)),y&&y.d(S),_=!1,g()}}}function jm(n){var f,u;let e,t,i,l,s;function o(c){n[42](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new P6({props:r}),ee.push(()=>be(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&Hm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ye()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Hm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Hm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $8(n){let e,t,i;function l(o){n[55](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new pM({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function T8(n){let e,t,i,l,s;function o(u){n[52](u,n[71])}function r(u){n[53](u,n[71])}function a(u){n[54](u,n[71])}let f={field:n[71],record:n[3]};return n[3][n[71].name]!==void 0&&(f.value=n[3][n[71].name]),n[4][n[71].name]!==void 0&&(f.uploadedFiles=n[4][n[71].name]),n[5][n[71].name]!==void 0&&(f.deletedFileNames=n[5][n[71].name]),e=new JO({props:f}),ee.push(()=>be(e,"value",o)),ee.push(()=>be(e,"uploadedFiles",r)),ee.push(()=>be(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(u,c){z(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[71]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[71].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[71].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[71].name],ke(()=>l=!1)),e.$set(d)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function C8(n){let e,t,i;function l(o){n[51](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new yO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O8(n){let e,t,i;function l(o){n[50](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new dO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M8(n){let e,t,i;function l(o){n[49](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new aO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D8(n){let e,t,i;function l(o){n[48](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new jM({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function E8(n){let e,t,i;function l(o){n[47](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new lO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function I8(n){let e,t,i;function l(o){n[46](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new eO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function A8(n){let e,t,i;function l(o){n[45](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new G6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function L8(n){let e,t,i;function l(o){n[44](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new Y6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function N8(n){let e,t,i;function l(o){n[43](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new V6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zm(n,e){let t,i,l,s,o;const r=[N8,L8,A8,I8,E8,D8,M8,O8,C8,T8,$8],a=[];function f(u,c){return u[71].type==="text"?0:u[71].type==="number"?1:u[71].type==="bool"?2:u[71].type==="email"?3:u[71].type==="url"?4:u[71].type==="editor"?5:u[71].type==="date"?6:u[71].type==="select"?7:u[71].type==="json"?8:u[71].type==="file"?9:u[71].type==="relation"?10:-1}return~(i=f(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,s,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(l&&(le(),A(a[d],1,1,()=>{a[d]=null}),se()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(u){o||(E(l),o=!0)},o(u){A(l),o=!1},d(u){u&&(v(t),v(s)),~i&&a[i].d(u)}}}function Vm(n){let e,t,i;return t=new w8({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===bs)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===bs)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function P8(n){var S;let e,t,i,l,s,o,r=[],a=new Map,f,u,c,d,m=!n[8]&&n[10]&&!n[7]&&Rm(n);l=new ce({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[S8,({uniqueId:T})=>({74:T}),({uniqueId:T})=>[0,0,T?4096:0]]},$$scope:{ctx:n}}});let h=n[14]&&jm(n),_=ue(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[71].name;for(let T=0;T<_.length;T+=1){let $=Fm(n,_,T),C=g($);a.set(C,r[T]=zm(C,$))}let y=n[14]&&!n[6]&&Vm(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=M(),B(l.$$.fragment),s=M(),h&&h.c(),o=M();for(let T=0;T{m=null}),se());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&12288&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=jm(T),h.c(),E(h,1),h.m(t,o)):h&&(le(),A(h,1,1,()=>{h=null}),se()),$[0]&57&&(_=ue(((O=T[0])==null?void 0:O.schema)||[]),le(),r=at(r,$,g,1,T,_,a,t,Et,zm,null,Fm),se()),(!u||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!u||$[0]&8192)&&x(t,"active",T[13]===Gi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=Vm(T),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se())},i(T){if(!u){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),u=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;${d=null}),se()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Bm(h),d.c(),E(d,1),d.m(u.parentNode,u))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(f),v(u)),d&&d.d(h)}}}function R8(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function Bm(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[q8]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[0]&16388|f[2]&8192&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Wm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[34]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function q8(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Um(n),f=n[14]&&n[2].email&&Wm(n);return{c(){a&&a.c(),e=M(),f&&f.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable"),p(s,"role","menuitem")},m(u,c){a&&a.m(u,c),w(u,e,c),f&&f.m(u,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),o||(r=[J(i,"click",n[35]),J(s,"click",Tn(Be(n[36])))],o=!0)},p(u,c){u[14]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=Um(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[14]&&u[2].email?f?f.p(u,c):(f=Wm(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){u&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(u),f&&f.d(u),o=!1,$e(r)}}}function Ym(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Gi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===bs),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[J(t,"click",n[37]),J(l,"click",n[38])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Gi),a[0]&8192&&x(l,"active",r[13]===bs)},d(r){r&&v(e),s=!1,$e(o)}}}function j8(n){let e,t,i,l,s;const o=[R8,F8],r=[];function a(u,c){return u[7]?0:1}e=a(n),t=r[e]=o[e](n);let f=n[14]&&!n[6]&&Ym(n);return{c(){t.c(),i=M(),f&&f.c(),l=ye()},m(u,c){r[e].m(u,c),w(u,i,c),f&&f.m(u,c),w(u,l,c),s=!0},p(u,c){let d=e;e=a(u),e===d?r[e].p(u,c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),t=r[e],t?t.p(u,c):(t=r[e]=o[e](u),t.c()),E(t,1),t.m(i.parentNode,i)),u[14]&&!u[6]?f?f.p(u,c):(f=Ym(u),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(u){s||(E(t),s=!0)},o(u){A(t),s=!1},d(u){u&&(v(i),v(l)),r[e].d(u),f&&f.d(u)}}}function H8(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,f,u,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),u||(c=J(e,"click",n[32]),u=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&oe(a,r),m[0]&34816&&f!==(f=!d[15]||d[11])&&(s.disabled=f),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),u=!1,c()}}}function z8(n){let e,t,i={class:` record-panel `+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[14]&&!n[6]?"colored-header":"")+` - `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[56],$$slots:{footer:[P8],header:[N8],default:[E8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[57](e),e.$on("hide",n[58]),e.$on("show",n[59]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[56],$$slots:{footer:[H8],header:[j8],default:[P8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[57](e),e.$on("hide",n[58]),e.$on("show",n[59]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` record-panel `+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(l[14]&&!l[6]?"colored-header":"")+` - `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[56]),s[0]&60925|s[2]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[57](null),V(e,l)}}}const Gi="form",_s="providers";function R8(n,e,t){let i,l,s,o,r;const a=lt(),f="record_"+j.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Gi,O=!0,D=!0,I=u;function L(he){return q(he),t(12,g=!0),t(13,C=Gi),c==null?void 0:c.show()}function R(){return c==null?void 0:c.hide()}function F(){t(12,g=!1),R()}function N(){t(30,I=u),c!=null&&c.isActive()&&(U(JSON.stringify(m)),F())}async function P(he){if(he&&typeof he=="string"){try{return await ae.collection(u.id).getOne(he)}catch(Oe){Oe.isAbort||(F(),console.warn("resolveModel:",Oe),ii(`Unable to load record with id "${he}"`))}return null}return he}async function q(he){t(7,D=!0),Jt({}),t(4,y={}),t(5,S={}),t(2,d=typeof he=="string"?{id:he,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:he||{}),t(3,m=structuredClone(d)),t(2,d=await P(he)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,h=G()),!h||ie(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function H(he){var ht,Kt;Jt({}),t(2,d=he||{}),t(4,y={}),t(5,S={});const Oe=((Kt=(ht=u==null?void 0:u.schema)==null?void 0:ht.filter(ut=>ut.type!="file"))==null?void 0:Kt.map(ut=>ut.name))||[];for(let ut in he)Oe.includes(ut)||t(3,m[ut]=he[ut],m);await Qt(),t(28,T=JSON.stringify(m)),te()}function W(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function G(he){try{const Oe=window.localStorage.getItem(W());if(Oe)return JSON.parse(Oe)}catch{}return he}function U(he){try{window.localStorage.setItem(W(),he)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem(W())}}function Y(){h&&(t(3,m=h),t(10,h=null))}function ie(he,Oe){var Z;const ht=structuredClone(he||{}),Kt=structuredClone(Oe||{}),ut=(Z=u==null?void 0:u.schema)==null?void 0:Z.filter(X=>X.type==="file");for(let X of ut)delete ht[X.name],delete Kt[X.name];const oi=["expand","password","passwordConfirm"];for(let X of oi)delete ht[X],delete Kt[X];return JSON.stringify(ht)==JSON.stringify(Kt)}function te(){t(10,h=null),window.localStorage.removeItem(W())}async function pe(he=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Oe=He();let ht;O?ht=await ae.collection(u.id).create(Oe):ht=await ae.collection(u.id).update(m.id,Oe),Lt(O?"Successfully created record.":"Successfully updated record."),te(),he?F():H(ht),a("save",{isNew:O,record:ht})}catch(Oe){ae.error(Oe)}t(11,_=!1)}}function Ne(){d!=null&&d.id&&fn("Do you really want to delete the selected record?",()=>ae.collection(d.collectionId).delete(d.id).then(()=>{R(),Lt("Successfully deleted record."),a("delete",d)}).catch(he=>{ae.error(he)}))}function He(){const he=structuredClone(m||{}),Oe=new FormData,ht={id:he.id},Kt={};for(const ut of(u==null?void 0:u.schema)||[])ht[ut.name]=!0,ut.type=="json"&&(Kt[ut.name]=!0);i&&(ht.username=!0,ht.email=!0,ht.emailVisibility=!0,ht.password=!0,ht.passwordConfirm=!0,ht.verified=!0);for(const ut in he)if(ht[ut]){if(typeof he[ut]>"u"&&(he[ut]=null),Kt[ut]&&he[ut]!=="")try{JSON.parse(he[ut])}catch(oi){const Z={};throw Z[ut]={code:"invalid_json",message:oi.toString()},new gn({status:400,response:{data:Z}})}j.addValueToFormData(Oe,ut,he[ut])}for(const ut in y){const oi=j.toArray(y[ut]);for(const Z of oi)Oe.append(ut,Z)}for(const ut in S){const oi=j.toArray(S[ut]);for(const Z of oi)Oe.append(ut+"."+Z,"")}return Oe}function Xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||fn(`Do you really want to sent verification email to ${d.email}?`,()=>ae.collection(u.id).requestVerification(d.email).then(()=>{Lt(`Successfully sent verification email to ${d.email}.`)}).catch(he=>{ae.error(he)}))}function xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||fn(`Do you really want to sent password reset email to ${d.email}?`,()=>ae.collection(u.id).requestPasswordReset(d.email).then(()=>{Lt(`Successfully sent password reset email to ${d.email}.`)}).catch(he=>{ae.error(he)}))}function Mt(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{ft()}):ft()}async function ft(){let he=d?structuredClone(d):null;if(he){he.id="",he.created="",he.updated="";const Oe=(u==null?void 0:u.schema)||[];for(const ht of Oe)ht.type==="file"&&delete he[ht.name]}te(),L(he),await Qt(),t(28,T="")}function mt(he){(he.ctrlKey||he.metaKey)&&he.code=="KeyS"&&(he.preventDefault(),he.stopPropagation(),pe(!1))}const Gt=()=>R(),De=()=>Xe(),Ae=()=>xe(),ze=()=>Mt(),gt=()=>Ne(),de=()=>t(13,C=Gi),ve=()=>t(13,C=_s),we=()=>Y(),Ye=()=>te();function zt(){m.id=this.value,t(3,m)}function cn(he){m=he,t(3,m)}function rn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function qn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Ai(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function ol(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function gi(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Ee(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Nt(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Li(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Kn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function rl(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Pl(he,Oe){n.$$.not_equal(y[Oe.name],he)&&(y[Oe.name]=he,t(4,y))}function bi(he,Oe){n.$$.not_equal(S[Oe.name],he)&&(S[Oe.name]=he,t(5,S))}function al(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}const fl=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{F()}),!1):(Jt({}),te(),!0);function bt(he){ee[he?"unshift":"push"](()=>{c=he,t(9,c)})}function rt(he){Ce.call(this,n,he)}function Mn(he){Ce.call(this,n,he)}return n.$$set=he=>{"collection"in he&&t(0,u=he.collection)},n.$$.update=()=>{var he;n.$$.dirty[0]&1&&t(14,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((he=u==null?void 0:u.schema)!=null&&he.find(Oe=>Oe.type==="editor"))),n.$$.dirty[0]&48&&t(31,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&805306368|n.$$.dirty[1]&1&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(O||o)),n.$$.dirty[0]&536871040&&(D||U($)),n.$$.dirty[0]&1073741825&&u&&(I==null?void 0:I.id)!=(u==null?void 0:u.id)&&N()},[u,R,d,m,y,S,O,D,o,c,h,_,g,C,i,r,l,f,F,Y,te,pe,Ne,Xe,xe,Mt,mt,L,T,$,I,s,Gt,De,Ae,ze,gt,de,ve,we,Ye,zt,cn,rn,qn,Ai,ol,gi,Ee,Nt,Li,Kn,rl,Pl,bi,al,fl,bt,rt,Mn]}class Ya extends ge{constructor(e){super(),_e(this,e,R8,F8,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function q8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function j8(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("div"),t=b("div"),i=K(n[2]),l=M(),s=b("div"),o=K(n[1]),r=K(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(f=Se(Pe.call(null,e,n[3])),a=!0)},p(u,c){c&4&&oe(i,u[2]),c&2&&oe(o,u[1])},d(u){u&&v(e),a=!1,f()}}}function H8(n){let e;function t(s,o){return s[0]?j8:q8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function z8(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class el extends ge{constructor(e){super(),_e(this,e,z8,H8,me,{date:0})}}function Wm(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Ym(n,e,t){const i=n.slice();return i[13]=e[t],i}function Km(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Jm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function V8(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function B8(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function U8(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function W8(n){let e,t;return{c(){e=b("div"),t=K(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&oe(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function Y8(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function K8(n){let e,t=[],i=new Map,l,s,o=ue(n[16].slice(0,n[17]));const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Gm();return{c(){var f;e=b("div");for(let u=0;uf[17]?a||(a=Gm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||u&2)&&x(e,"multiple",((c=f[1].options)==null?void 0:c.maxSelect)!=1)},i(f){if(!s){for(let u=0;un[11]&&xm();return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),k(e,l),f&&f.m(e,null),s=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),E(i,1),i.m(e,l)),u[9].length>u[11]?f||(f=xm(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(e),r[t].d(),f&&f.d()}}}function Z8(n){let e,t=[],i=new Map,l=ue(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Q8(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=K(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[Se(Pe.call(null,e,"Open in new tab")),J(e,"click",Tn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function x8(n){let e,t;return{c(){e=b("span"),t=K(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&oe(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function eD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function tD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function nD(n){let e,t,i,l;const s=[aD,rD],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Zm(n,e){let t,i,l;return i=new Ua({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function Gm(n){let e;return{c(){e=K("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function iD(n){let e,t=ue(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&th(n);return{c(){e=b("span"),i=K(t),l=M(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&oe(i,t),a[5].length>500?r?(r.p(a,f),f&8&&E(r,1)):(r=th(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function aD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function th(n){let e,t;return e=new sl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function fD(n){let e,t,i,l,s;const o=[nD,tD,eD,x8,Q8,X8,G8,Z8,J8,K8,Y8,W8],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(u[3])),e?1:u[1].type==="bool"?2:u[1].type==="number"?3:u[1].type==="url"?4:u[1].type==="editor"?5:u[1].type==="date"?6:u[1].type==="select"?7:u[1].type==="relation"?8:u[1].type==="file"?9:u[2]?10:11)}function f(u,c){return c===0?U8(u):c===8?B8(u):c===9?V8(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),l=ye()},m(u,c){r[t].m(u,c),w(u,l,c),s=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(l),r[t].d(u)}}}function uD(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ce.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class Gb extends ge{constructor(e){super(),_e(this,e,uD,fD,me,{record:0,field:1,short:2})}}function nh(n,e,t){const i=n.slice();return i[13]=e[t],i}function ih(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new Gb({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=K(i),s=M(),o=b("td"),B(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(e,s),k(e,o),z(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[13].name+"")&&oe(l,i);const c={};u&1&&(c.field=f[13]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(E(r.$$.fragment,f),a=!0)},o(f){A(r.$$.fragment,f),a=!1},d(f){f&&v(e),V(r)}}}function lh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function sh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function cD(n){var O;let e,t,i,l,s,o,r,a,f,u,c=(n[3].id||"...")+"",d,m,h,_,g;a=new sl({props:{value:n[3].id}});let y=ue((O=n[0])==null?void 0:O.schema),S=[];for(let D=0;DA(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&lh(n),C=n[3].updated&&sh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("span"),d=K(c),m=M();for(let D=0;D{$=null}),se()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=sh(D),C.c(),E(C,1),C.m(t,null)):C&&(le(),A(C,1,1,()=>{C=null}),se()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function mD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[pD],header:[dD],default:[cD]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function hD(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return u(g),s==null?void 0:s.show()}function f(){return t(4,r=!1),s==null?void 0:s.hide()}async function u(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await ae.collection(l.id).getOne(g)}catch(y){y.isAbort||(f(),console.warn("resolveModel:",y),ii(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>f();function m(g){ee[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ce.call(this,n,g)}function _(g){Ce.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,f,s,o,r,i,a,d,m,h,_]}class _D extends ge{constructor(e){super(),_e(this,e,hD,mD,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function oh(n,e,t){const i=n.slice();return i[63]=e[t],i}function rh(n,e,t){const i=n.slice();return i[66]=e[t],i}function ah(n,e,t){const i=n.slice();return i[66]=e[t],i}function fh(n,e,t){const i=n.slice();return i[59]=e[t],i}function uh(n){let e;function t(s,o){return s[13]?bD:gD}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function gD(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[32]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function bD(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ch(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[kD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function kD(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function dh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&ph(n),r=i&&mh(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){f[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,f),f[0]&32&&E(o,1)):(o=ph(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(le(),A(o,1,1,()=>{o=null}),se()),f[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=mh(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function ph(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[yD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function yD(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mh(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[vD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function vD(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wD(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=K(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,f){f[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[66].name+"")&&oe(r,o)},d(a){a&&v(e)}}}function hh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[wD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Sn({props:r}),ee.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[66].type+" col-field-"+e[66].name),f[0]&524288&&(u.name=e[66].name),f[0]&524288|f[2]&512&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.sort=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function _h(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[SD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function SD(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function gh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[$D]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $D(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function kh(n){let e;function t(s,o){return s[13]?CD:TD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function TD(n){let e,t,i,l;function s(a,f){var u;if((u=a[1])!=null&&u.length)return MD;if(!a[10])return OD}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function CD(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function MD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function yh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[J(i,"change",c),J(t,"click",Tn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,$e(u)}}}function vh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&wh(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=K(r),f=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),z(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&oe(a,r),d[9]?c?c.p(d,m):(c=wh(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function wh(n){let e;function t(s,o){return s[63].verified?ED:DD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function DD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function ED(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Sh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&$h(n),o=i&&Th(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=$h(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Th(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function $h(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?AD:ID}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function ID(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&oe(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function AD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Th(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?ND:LD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function LD(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&oe(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function ND(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ch(n,e){let t,i,l,s;return i=new Gb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function Oh(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Mh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Dh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&yh(e),T=l&&vh(e),$=e[9]&&Sh(e),C=ue(e[19]);const O=F=>F[66].name;for(let F=0;F',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P{T=null}),se()),e[9]?$?$.p(e,N):($=Sh(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=ue(e[19]),le(),r=at(r,N,O,1,e,C,a,t,Et,Ch,f,rh),se()),N[0]&288&&(u=e[8]&&!e[5].includes("@created")),u?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Oh(e),D.c(),E(D,1),D.m(t,c)):D&&(le(),A(D,1,1,()=>{D=null}),se()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Mh(e),I.c(),E(I,1),I.m(t,m)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(F){if(!_){E(T);for(let N=0;NU[66].name;for(let U=0;UU[10]?U[63]:U[63].id;for(let U=0;U{D=null}),se()),U[9]?I?(I.p(U,Y),Y[0]&512&&E(I,1)):(I=dh(U),I.c(),E(I,1),I.m(i,r)):I&&(le(),A(I,1,1,()=>{I=null}),se()),Y[0]&524289&&(L=ue(U[19]),le(),a=at(a,Y,R,1,U,L,f,i,Et,hh,u,ah),se()),Y[0]&288&&(c=U[8]&&!U[5].includes("@created")),c?F?(F.p(U,Y),Y[0]&288&&E(F,1)):(F=_h(U),F.c(),E(F,1),F.m(i,d)):F&&(le(),A(F,1,1,()=>{F=null}),se()),Y[0]&160&&(m=U[7]&&!U[5].includes("@updated")),m?N?(N.p(U,Y),Y[0]&160&&E(N,1)):(N=gh(U),N.c(),E(N,1),N.m(i,h)):N&&(le(),A(N,1,1,()=>{N=null}),se()),U[16].length?P?P.p(U,Y):(P=bh(U),P.c(),P.m(_,null)):P&&(P.d(1),P=null),Y[0]&9971642&&(q=ue(U[3]),le(),S=at(S,Y,H,1,U,q,T,y,Et,Dh,$,oh),se(),!q.length&&W?W.p(U,Y):q.length?W&&(W.d(1),W=null):(W=kh(U),W.c(),W.m(y,$))),U[3].length&&U[18]?G?G.p(U,Y):(G=Eh(U),G.c(),G.m(y,null)):G&&(G.d(1),G=null),(!C||Y[0]&8192)&&x(e,"table-loading",U[13])},i(U){if(!C){E(D),E(I);for(let Y=0;Y({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function RD(n){let e,t,i=[],l=new Map,s,o,r=ue(n[16]);const a=f=>f[59].id+f[59].name;for(let f=0;f{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Lh(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[6]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[47]),J(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&oe(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&oe(a,r),(!g||$[0]&16384)&&x(u,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function jD(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[qD],default:[PD]},$$scope:{ctx:n}};e=new Go({props:s}),n[46](e);let o=n[6]&&Lh(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ye()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const f={};a[0]&1030075|a[2]&512&&(f.$$scope={dirty:a,ctx:r}),e.$set(f),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=Lh(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(le(),A(o,1,1,()=>{o=null}),se())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const HD=/^([\+\-])?(\w+)$/,Nh=40;function zD(n,e,t){let i,l,s,o,r,a,f,u,c,d,m,h;Ue(n,Rn,Ee=>t(53,h=Ee));const _=lt();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,O=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function H(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function W(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Ee=localStorage.getItem(q);Ee&&t(5,N=JSON.parse(Ee)||[])}catch{}}function G(Ee){return!!$.find(Nt=>Nt.id)}async function U(){const Ee=C;for(let Nt=1;Nt<=Ee;Nt++)(Nt===1||f)&&await Y(Nt,!1)}async function Y(Ee=1,Nt=!0){var al,fl,bt;if(!(g!=null&&g.id))return;t(13,I=!0);let Li=y;const Kn=Li.match(HD),rl=Kn?r.find(rt=>rt.name===Kn[2]):null;if(Kn&&rl){const rt=((bt=(fl=(al=h==null?void 0:h.find(he=>{var Oe;return he.id==((Oe=rl.options)==null?void 0:Oe.collectionId)}))==null?void 0:al.schema)==null?void 0:fl.filter(he=>he.presentable))==null?void 0:bt.map(he=>he.name))||[],Mn=[];for(const he of rt)Mn.push((Kn[1]||"")+Kn[2]+"."+he);Mn.length>0&&(Li=Mn.join(","))}const Pl=j.getAllCollectionIdentifiers(g),bi=o.map(rt=>rt.name+":excerpt(200)").concat(r.map(rt=>"expand."+rt.name+".*:excerpt(200)"));return bi.length&&bi.unshift("*"),ae.collection(g.id).getList(Ee,Nh,{sort:Li,skipTotal:1,filter:j.normalizeSearchFilter(S,Pl),expand:r.map(rt=>rt.name).join(","),fields:bi.join(","),requestKey:"records_list"}).then(async rt=>{var Mn;if(Ee<=1&&ie(),t(13,I=!1),t(12,C=rt.page),t(28,O=rt.items.length),_("load",$.concat(rt.items)),o.length)for(let he of rt.items)he._partial=!0;if(Nt){const he=++R;for(;(Mn=rt.items)!=null&&Mn.length&&R==he;){const Oe=rt.items.splice(0,20);for(let ht of Oe)j.pushOrReplaceByKey($,ht);t(3,$),await j.yieldToMain()}}else{for(let he of rt.items)j.pushOrReplaceByKey($,he);t(3,$)}}).catch(rt=>{rt!=null&&rt.isAbort||(t(13,I=!1),console.warn(rt),ie(),ae.error(rt,!S||(rt==null?void 0:rt.status)!=400))})}function ie(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,O=0),t(4,D={})}function te(){c?pe():Ne()}function pe(){t(4,D={})}function Ne(){for(const Ee of $)t(4,D[Ee.id]=Ee,D);t(4,D)}function He(Ee){D[Ee.id]?delete D[Ee.id]:t(4,D[Ee.id]=Ee,D),t(4,D)}function Xe(){fn(`Do you really want to delete the selected ${u===1?"record":"records"}?`,xe)}async function xe(){if(L||!u||!(g!=null&&g.id))return;let Ee=[];for(const Nt of Object.keys(D))Ee.push(ae.collection(g.id).delete(Nt));return t(14,L=!0),Promise.all(Ee).then(()=>{Lt(`Successfully deleted the selected ${u===1?"record":"records"}.`),_("delete",D),pe()}).catch(Nt=>{ae.error(Nt)}).finally(()=>(t(14,L=!1),U()))}function Mt(Ee){Ce.call(this,n,Ee)}const ft=(Ee,Nt)=>{Nt.target.checked?j.removeByValue(N,Ee.id):j.pushUnique(N,Ee.id),t(5,N)},mt=()=>te();function Gt(Ee){y=Ee,t(0,y)}function De(Ee){y=Ee,t(0,y)}function Ae(Ee){y=Ee,t(0,y)}function ze(Ee){y=Ee,t(0,y)}function gt(Ee){y=Ee,t(0,y)}function de(Ee){y=Ee,t(0,y)}function ve(Ee){ee[Ee?"unshift":"push"](()=>{F=Ee,t(15,F)})}const we=Ee=>He(Ee),Ye=Ee=>_("select",Ee),zt=(Ee,Nt)=>{Nt.code==="Enter"&&(Nt.preventDefault(),_("select",Ee))},cn=()=>t(1,S=""),rn=()=>_("new"),qn=()=>Y(C+1);function Ai(Ee){ee[Ee?"unshift":"push"](()=>{T=Ee,t(11,T)})}const ol=()=>pe(),gi=()=>Xe();return n.$$set=Ee=>{"collection"in Ee&&t(25,g=Ee.collection),"sort"in Ee&&t(0,y=Ee.sort),"filter"in Ee&&t(1,S=Ee.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",W(),ie()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ee=>Ee.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ee=>Ee.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ee=>!N.includes(Ee.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&Y(1),n.$$.dirty[0]&268435456&&t(18,f=O>=Nh),n.$$.dirty[0]&16&&t(6,u=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&u===$.length),n.$$.dirty[0]&32&&N!==-1&&H(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ee=>({id:Ee.id,name:Ee.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,Y,$,D,N,u,m,d,l,i,T,C,I,L,F,P,c,f,a,_,te,pe,He,Xe,g,G,U,O,s,Mt,ft,mt,Gt,De,Ae,ze,gt,de,ve,we,Ye,zt,cn,rn,qn,Ai,ol,gi]}class VD extends ge{constructor(e){super(),_e(this,e,zD,jD,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function BD(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=K(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[f]){f&5&&s!==(s=(a[2]?"...":a[0])+"")&&oe(o,s),f&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function UD(n,e,t){const i=lt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function f(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const u=j.getAllCollectionIdentifiers(l),c=await ae.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,u),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(u){u!=null&&u.isAbort||(t(2,a=!1),console.warn(u))}}}return n.$$set=u=>{"collection"in u&&t(3,l=u.collection),"filter"in u&&t(4,s=u.filter),"totalCount"in u&&t(0,o=u.totalCount),"class"in u&&t(1,r=u.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&f()},[o,r,a,l,s,f]}class WD extends ge{constructor(e){super(),_e(this,e,UD,BD,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function YD(n){let e,t,i,l;return e=new a6({}),i=new bn({props:{class:"flex-content",$$slots:{footer:[GD],default:[ZD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function KD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[xD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function JD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[eE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ph(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function Fh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ZD(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F=!n[12]&&Ph(n);c=new Zo({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&Fh(n);y=new $s({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(W){n[26](W)}function q(W){n[27](W)}let H={collection:n[2]};return n[0]!==void 0&&(H.filter=n[0]),n[1]!==void 0&&(H.sort=n[1]),C=new VD({props:H}),n[25](C),ee.push(()=>be(C,"filter",P)),ee.push(()=>be(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=K(o),a=M(),f=b("div"),F&&F.c(),u=M(),B(c.$$.fragment),d=M(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=M(),N&&N.c(),g=M(),B(y.$$.fragment),S=M(),T=b("div"),$=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(W,G){w(W,e,G),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,f),F&&F.m(f,null),k(f,u),z(c,f,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(W,g,G),z(y,W,G),w(W,S,G),w(W,T,G),w(W,$,G),z(C,W,G),I=!0,L||(R=J(h,"click",n[22]),L=!0)},p(W,G){(!I||G[0]&4)&&o!==(o=W[2].name+"")&&oe(r,o),W[12]?F&&(F.d(1),F=null):F?F.p(W,G):(F=Ph(W),F.c(),F.m(f,u)),W[2].type!=="view"?N?N.p(W,G):(N=Fh(W),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const U={};G[0]&1&&(U.value=W[0]),G[0]&4&&(U.autocompleteCollection=W[2]),y.$set(U);const Y={};G[0]&4&&(Y.collection=W[2]),!O&&G[0]&1&&(O=!0,Y.filter=W[0],ke(()=>O=!1)),!D&&G[0]&2&&(D=!0,Y.sort=W[1],ke(()=>D=!1)),C.$set(Y)},i(W){I||(E(c.$$.fragment,W),E(y.$$.fragment,W),E(C.$$.fragment,W),I=!0)},o(W){A(c.$$.fragment,W),A(y.$$.fragment,W),A(C.$$.fragment,W),I=!1},d(W){W&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),V(c),N&&N.d(),V(y,W),n[25](null),V(C,W),L=!1,R()}}}function GD(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new WD({props:s}),n[18](e),ee.push(()=>be(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function XD(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function QD(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xD(n){let e,t,i;function l(r,a){return r[12]?QD:XD}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function eE(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tE(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[JD,KD,YD],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ba({props:_}),n[31](l);let g={};o=new _6({props:g}),n[32](o);let y={collection:n[2]};a=new Ya({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new _D({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),z(l,T,$),w(T,s,$),z(o,T,$),w(T,r,$),z(a,T,$),w(T,f,$),z(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(le(),A(m[C],1,1,()=>{m[C]=null}),se(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const O={};l.$set(O);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),V(l,T),n[32](null),V(o,T),n[33](null),V(a,T),n[37](null),V(u,T)}}}function nE(n,e,t){let i,l,s,o,r,a,f;Ue(n,Yn,De=>t(2,l=De)),Ue(n,It,De=>t(39,s=De)),Ue(n,To,De=>t(3,o=De)),Ue(n,jo,De=>t(16,r=De)),Ue(n,Rn,De=>t(11,a=De)),Ue(n,Xi,De=>t(12,f=De));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;J1(T);async function C(De){await Qt(),(l==null?void 0:l.type)==="view"?h.show(De):m==null||m.show(De)}function O(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D(),c==null||c.forceHide(),d==null||d.hide()}async function D(){if(!S)return;const De=j.getAllCollectionIdentifiers(l),Ae=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Ae.filter(ze=>De.includes(ze)).length!=Ae.length&&(De.includes("created")?t(1,S="-created"):t(1,S=""))}function I(De={}){const Ae=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},De);j.replaceHashQueryParams(Ae)}const L=()=>c==null?void 0:c.show();function R(De){ee[De?"unshift":"push"](()=>{g=De,t(9,g)})}function F(De){$=De,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),H=()=>m==null?void 0:m.show(),W=De=>t(0,y=De.detail);function G(De){ee[De?"unshift":"push"](()=>{_=De,t(8,_)})}function U(De){y=De,t(0,y)}function Y(De){S=De,t(1,S)}const ie=De=>{I({recordId:De.detail.id});let Ae=De.detail._partial?De.detail.id:De.detail;l.type==="view"?h==null||h.show(Ae):m==null||m.show(Ae)},te=()=>{g==null||g.reload()},pe=()=>m==null?void 0:m.show();function Ne(De){ee[De?"unshift":"push"](()=>{c=De,t(4,c)})}function He(De){ee[De?"unshift":"push"](()=>{d=De,t(5,d)})}function Xe(De){ee[De?"unshift":"push"](()=>{m=De,t(6,m)})}const xe=()=>{I({recordId:null})},Mt=De=>{y?g==null||g.reload():De.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},ft=De=>{(!y||_!=null&&_.hasRecord(De.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function mt(De){ee[De?"unshift":"push"](()=>{h=De,t(7,h)})}const Gt=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&iv(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&O(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(It,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,q,H,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,mt,Gt]}class iE extends ge{constructor(e){super(),_e(this,e,nE,tE,me,{},null,[-1,-1])}}function Rh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=M(),i=b("a"),i.innerHTML=' Export collections',l=M(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(Ln.call(null,i,{path:"/settings/export-collections/?.*"})),Se(nn.call(null,i)),Se(Ln.call(null,s,{path:"/settings/import-collections/?.*"})),Se(nn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function lE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O=!n[0]&&Rh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',f=M(),u=b("a"),u.innerHTML=' Backups',c=M(),O&&O.c(),d=M(),m=b("div"),m.textContent="Authentication",h=M(),_=b("a"),_.innerHTML=' Auth providers',g=M(),y=b("a"),y.innerHTML=' Token options',S=M(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),O&&O.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[Se(Ln.call(null,l,{path:"/settings"})),Se(nn.call(null,l)),Se(Ln.call(null,o,{path:"/settings/mail/?.*"})),Se(nn.call(null,o)),Se(Ln.call(null,a,{path:"/settings/storage/?.*"})),Se(nn.call(null,a)),Se(Ln.call(null,u,{path:"/settings/backups/?.*"})),Se(nn.call(null,u)),Se(Ln.call(null,_,{path:"/settings/auth-providers/?.*"})),Se(nn.call(null,_)),Se(Ln.call(null,y,{path:"/settings/tokens/?.*"})),Se(nn.call(null,y)),Se(Ln.call(null,T,{path:"/settings/admins/?.*"})),Se(nn.call(null,T))],$=!0)},p(D,I){D[0]?O&&(O.d(1),O=null):O||(O=Rh(),O.c(),O.m(e,d))},d(D){D&&v(e),O&&O.d(),$=!1,$e(C)}}}function sE(n){let e,t;return e=new Hb({props:{class:"settings-sidebar",$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function oE(n,e,t){let i;return Ue(n,Xi,l=>t(0,i=l)),[i]}class _i extends ge{constructor(e){super(),_e(this,e,oE,sE,me,{})}}function qh(n,e,t){const i=n.slice();return i[31]=e[t],i}function jh(n){let e,t;return e=new ce({props:{class:"form-field readonly",name:"id",$$slots:{default:[rE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Kb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),f=M(),u=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),z(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),V(a)}}}function Hh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function aE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[3]),f||(u=J(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function zh(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[fE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function fE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Vh(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[uE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[cE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(t,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(t,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function uE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Jb({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),re(r,n[9]),w(_,f,g),w(_,u,g),z(c,u,null),d=!0,m||(h=J(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&re(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function cE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[10]),f||(u=J(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&re(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function dE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&jh(n),_=ue([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=Hh(qh(n,_,T));a=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[aE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&zh(n),S=(n[5]||n[4])&&Vh(n);return{c(){e=b("form"),h&&h.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=M(),B(a.$$.fragment),f=M(),y&&y.c(),u=M(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),z(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=J(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=jh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=ue([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const D=qh(T,_,O);g[O]?g[O].p(D,$):(g[O]=Hh(D),g[O].c(),g[O].m(o,null))}for(;O<10;O+=1)g[O].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(le(),A(y,1,1,()=>{y=null}),se()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=zh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Vh(T),S.c(),E(S,1),S.m(e,null)):S&&(le(),A(S,1,1,()=>{S=null}),se())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),ot(g,T),V(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function pE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&oe(i,t)},d(l){l&&v(e)}}}function Bh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[mE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(t,"aria-hidden","true"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"aria-label","More admin options"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),z(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),V(o)}}}function mE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function hE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Bh(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=J(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(le(),A(m,1,1,()=>{m=null}),se()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Bh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&oe(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function _E(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[hE],header:[pE],default:[dE]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function gE(n,e,t){let i,l;const s=lt(),o="admin_"+j.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Jt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let U;i?U=ae.admins.create(G):U=ae.admins.update(a.id,G),U.then(async Y=>{var ie;t(8,u=!1),y(),Lt(i?"Successfully created admin.":"Successfully updated admin."),((ie=ae.authStore.model)==null?void 0:ie.id)===Y.id&&ae.authStore.save(ae.authStore.token,Y),s("save",Y)}).catch(Y=>{ae.error(Y)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&fn("Do you really want to delete the selected admin?",()=>ae.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Lt("Successfully deleted admin."),s("delete",a)}).catch(G=>{ae.error(G)}))}const O=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(G){ee[G?"unshift":"push"](()=>{r=G,t(6,r)})}function H(G){Ce.call(this,n,G)}function W(G){Ce.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,O,D,I,L,R,F,N,P,q,H,W]}class bE extends ge{constructor(e){super(),_e(this,e,gE,_E,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Uh(n,e,t){const i=n.slice();return i[24]=e[t],i}function kE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function vE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Wh(n){let e;function t(s,o){return s[5]?$E:SE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function SE(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Yh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Yh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function $E(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Yh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Kh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,O,D,I,L,R,F,N,P,q,H,W,G;u=new sl({props:{value:e[24].id}});let U=e[24].id===e[7].id&&Kh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Y(){return e[15](e[24])}function ie(...te){return e[16](e[24],...te)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),f=b("div"),B(u.$$.fragment),c=M(),d=b("span"),h=K(m),_=M(),U&&U.c(),g=M(),y=b("td"),S=b("span"),$=K(T),O=M(),D=b("td"),B(I.$$.fragment),L=M(),R=b("td"),B(F.$$.fragment),N=M(),P=b("td"),P.innerHTML='',q=M(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,pe){w(te,t,pe),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),z(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),U&&U.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,O),k(t,D),z(I,D,null),k(t,L),k(t,R),z(F,R,null),k(t,N),k(t,P),k(t,q),H=!0,W||(G=[J(t,"click",Y),J(t,"keydown",ie)],W=!0)},p(te,pe){e=te,(!H||pe&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Ne={};pe&16&&(Ne.value=e[24].id),u.$set(Ne),(!H||pe&16)&&m!==(m=e[24].id+"")&&oe(h,m),e[24].id===e[7].id?U||(U=Kh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!H||pe&16)&&T!==(T=e[24].email+"")&&oe($,T),(!H||pe&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};pe&16&&(He.date=e[24].created),I.$set(He);const Xe={};pe&16&&(Xe.date=e[24].updated),F.$set(Xe)},i(te){H||(E(u.$$.fragment,te),E(I.$$.fragment,te),E(F.$$.fragment,te),H=!0)},o(te){A(u.$$.fragment,te),A(I.$$.fragment,te),A(F.$$.fragment,te),H=!1},d(te){te&&v(t),V(u),U&&U.d(),V(I),V(F),W=!1,$e(G)}}}function TE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],O=new Map,D;function I(Y){n[11](Y)}let L={class:"col-type-text",name:"id",$$slots:{default:[kE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(Y){n[12](Y)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[yE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(Y){n[13](Y)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[vE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));function q(Y){n[14](Y)}let H={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[wE]},$$scope:{ctx:n}};n[2]!==void 0&&(H.sort=n[2]),_=new Sn({props:H}),ee.push(()=>be(_,"sort",q));let W=ue(n[4]);const G=Y=>Y[24].id;for(let Y=0;Yr=!1)),o.$set(te);const pe={};ie&134217728&&(pe.$$scope={dirty:ie,ctx:Y}),!u&&ie&4&&(u=!0,pe.sort=Y[2],ke(()=>u=!1)),f.$set(pe);const Ne={};ie&134217728&&(Ne.$$scope={dirty:ie,ctx:Y}),!m&&ie&4&&(m=!0,Ne.sort=Y[2],ke(()=>m=!1)),d.$set(Ne);const He={};ie&134217728&&(He.$$scope={dirty:ie,ctx:Y}),!g&&ie&4&&(g=!0,He.sort=Y[2],ke(()=>g=!1)),_.$set(He),ie&186&&(W=ue(Y[4]),le(),C=at(C,ie,G,1,Y,W,O,$,Et,Jh,null,Uh),se(),!W.length&&U?U.p(Y,ie):W.length?U&&(U.d(1),U=null):(U=Wh(Y),U.c(),U.m($,null))),(!D||ie&32)&&x(e,"table-loading",Y[5])},i(Y){if(!D){E(o.$$.fragment,Y),E(f.$$.fragment,Y),E(d.$$.fragment,Y),E(_.$$.fragment,Y);for(let ie=0;ie New admin',h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=M(),B(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),z(a,e,null),k(e,f),k(e,u),k(e,c),k(e,d),k(d,m),w(D,h,I),z(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),z(T,D,I),$=!0,C||(O=J(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&oe(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),V(a),V(_,D),V(T,D),C=!1,O()}}}function OE(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=K("Total found: "),l=K(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&oe(l,i)},d(s){s&&v(e)}}}function ME(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{footer:[OE],default:[CE]},$$scope:{ctx:n}}});let r={};return s=new bE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function DE(n,e,t){let i,l,s;Ue(n,jo,F=>t(21,i=F)),Ue(n,It,F=>t(6,l=F)),Ue(n,$a,F=>t(7,s=F)),xt(It,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],f=!1,u=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,f=!0),t(4,a=[]);const F=j.normalizeSearchFilter(u,["id","email","created","updated"]);return ae.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,f=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,f=!1),console.warn(N),m(),ae.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,u=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),O=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,u="");function I(F){ee[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();tl("/settings/admins?"+F),d()}},[d,u,c,r,a,f,l,s,h,_,g,y,S,T,$,C,O,D,I,L,R]}class EE extends ge{constructor(e){super(),_e(this,e,DE,ME,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function IE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function AE(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),f=b("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[1]),w(d,r,m),w(d,a,m),k(a,f),u||(c=[J(s,"input",n[5]),Se(nn.call(null,f))],u=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&re(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),u=!1,$e(c)}}}function LE(n){let e,t,i,l,s,o,r,a,f,u,c;return l=new ce({props:{class:"form-field required",name:"identity",$$slots:{default:[IE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[AE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),k(e,a),f=!0,u||(c=J(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),V(o),u=!1,c()}}}function NE(n){let e,t;return e=new Z1({props:{$$slots:{default:[LE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PE(n,e,t){let i;Ue(n,jo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ae.admins.authWithPassword(s,o).then(()=>{wa(),tl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class FE extends ge{constructor(e){super(),_e(this,e,PE,NE,me,{})}}function RE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new ce({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[jE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[HE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[zE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Zh(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("div"),c=b("div"),d=M(),$&&$.c(),m=M(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,O){w(C,e,O),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),z(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=J(h,"click",n[12]),S=!0)},p(C,O){const D={};O&786433&&(D.$$scope={dirty:O,ctx:C}),i.$set(D);const I={};O&786433&&(I.$$scope={dirty:O,ctx:C}),o.$set(I);const L={};O&786433&&(L.$$scope={dirty:O,ctx:C}),a.$set(L),C[3]?$?$.p(C,O):($=Zh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||O&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||O&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),V(i),V(o),V(a),$&&$.d(),S=!1,T()}}}function qE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function jE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appName),r||(a=J(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&re(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function HE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appUrl),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&re(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[10]),Se(Pe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function Zh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function VE(n){let e,t,i,l,s,o,r,a,f;const u=[qE,RE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=J(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function BE(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[VE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function UE(n,e,t){let i,l,s,o;Ue(n,Xi,C=>t(13,l=C)),Ue(n,Oo,C=>t(14,s=C)),Ue(n,It,C=>t(15,o=C)),xt(It,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await ae.settings.getAll()||{};h(C)}catch(C){ae.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await ae.settings.update(j.filterRedactedProps(a));h(C),Lt("Successfully saved application settings.")}catch(C){ae.error(C)}t(2,u=!1)}}function h(C={}){var O,D;xt(Oo,s=(O=C==null?void 0:C.meta)==null?void 0:O.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class WE extends ge{constructor(e){super(),_e(this,e,UE,BE,me,{})}}function YE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),l.autofocus&&l.focus(),s||(o=[Se(Pe.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],s=!0)},p(f,u){ni(l,a=pt(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&(v(e),v(i),v(l)),s=!1,$e(o)}}}function JE(n){let e;function t(s,o){return s[3]?KE:YE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function ZE(n,e,t){const i=["value","mask"];let l=Ge(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const u=()=>f();function c(m){ee[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(5,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,f,l,u,c,d]}class Ka extends ge{constructor(e){super(),_e(this,e,ZE,JE,me,{value:0,mask:1})}}function GE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("label"),t=K("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: + `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[56]),s[0]&60925|s[2]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[57](null),V(e,l)}}}const Gi="form",bs="providers";function V8(n,e,t){let i,l,s,o,r;const a=lt(),f="record_"+j.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Gi,O=!0,D=!0,I=u;function L(he){return q(he),t(12,g=!0),t(13,C=Gi),c==null?void 0:c.show()}function R(){return c==null?void 0:c.hide()}function F(){t(12,g=!1),R()}function N(){t(30,I=u),c!=null&&c.isActive()&&(U(JSON.stringify(m)),F())}async function P(he){if(he&&typeof he=="string"){try{return await ae.collection(u.id).getOne(he)}catch(Oe){Oe.isAbort||(F(),console.warn("resolveModel:",Oe),ii(`Unable to load record with id "${he}"`))}return null}return he}async function q(he){t(7,D=!0),Jt({}),t(4,y={}),t(5,S={}),t(2,d=typeof he=="string"?{id:he,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:he||{}),t(3,m=structuredClone(d)),t(2,d=await P(he)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,h=G()),!h||ie(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function H(he){var _t,Kt;Jt({}),t(2,d=he||{}),t(4,y={}),t(5,S={});const Oe=((Kt=(_t=u==null?void 0:u.schema)==null?void 0:_t.filter(ut=>ut.type!="file"))==null?void 0:Kt.map(ut=>ut.name))||[];for(let ut in he)Oe.includes(ut)||t(3,m[ut]=he[ut],m);await Qt(),t(28,T=JSON.stringify(m)),te()}function W(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function G(he){try{const Oe=window.localStorage.getItem(W());if(Oe)return JSON.parse(Oe)}catch{}return he}function U(he){try{window.localStorage.setItem(W(),he)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem(W())}}function Y(){h&&(t(3,m=h),t(10,h=null))}function ie(he,Oe){var Z;const _t=structuredClone(he||{}),Kt=structuredClone(Oe||{}),ut=(Z=u==null?void 0:u.schema)==null?void 0:Z.filter(X=>X.type==="file");for(let X of ut)delete _t[X.name],delete Kt[X.name];const oi=["expand","password","passwordConfirm"];for(let X of oi)delete _t[X],delete Kt[X];return JSON.stringify(_t)==JSON.stringify(Kt)}function te(){t(10,h=null),window.localStorage.removeItem(W())}async function pe(he=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Oe=He();let _t;O?_t=await ae.collection(u.id).create(Oe):_t=await ae.collection(u.id).update(m.id,Oe),Lt(O?"Successfully created record.":"Successfully updated record."),te(),he?F():H(_t),a("save",{isNew:O,record:_t})}catch(Oe){ae.error(Oe)}t(11,_=!1)}}function Ne(){d!=null&&d.id&&un("Do you really want to delete the selected record?",()=>ae.collection(d.collectionId).delete(d.id).then(()=>{R(),Lt("Successfully deleted record."),a("delete",d)}).catch(he=>{ae.error(he)}))}function He(){const he=structuredClone(m||{}),Oe=new FormData,_t={id:he.id},Kt={};for(const ut of(u==null?void 0:u.schema)||[])_t[ut.name]=!0,ut.type=="json"&&(Kt[ut.name]=!0);i&&(_t.username=!0,_t.email=!0,_t.emailVisibility=!0,_t.password=!0,_t.passwordConfirm=!0,_t.verified=!0);for(const ut in he)if(_t[ut]){if(typeof he[ut]>"u"&&(he[ut]=null),Kt[ut]&&he[ut]!=="")try{JSON.parse(he[ut])}catch(oi){const Z={};throw Z[ut]={code:"invalid_json",message:oi.toString()},new gn({status:400,response:{data:Z}})}j.addValueToFormData(Oe,ut,he[ut])}for(const ut in y){const oi=j.toArray(y[ut]);for(const Z of oi)Oe.append(ut,Z)}for(const ut in S){const oi=j.toArray(S[ut]);for(const Z of oi)Oe.append(ut+"."+Z,"")}return Oe}function Xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent verification email to ${d.email}?`,()=>ae.collection(u.id).requestVerification(d.email).then(()=>{Lt(`Successfully sent verification email to ${d.email}.`)}).catch(he=>{ae.error(he)}))}function xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent password reset email to ${d.email}?`,()=>ae.collection(u.id).requestPasswordReset(d.email).then(()=>{Lt(`Successfully sent password reset email to ${d.email}.`)}).catch(he=>{ae.error(he)}))}function Mt(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{ft()}):ft()}async function ft(){let he=d?structuredClone(d):null;if(he){he.id="",he.created="",he.updated="";const Oe=(u==null?void 0:u.schema)||[];for(const _t of Oe)_t.type==="file"&&delete he[_t.name]}te(),L(he),await Qt(),t(28,T="")}function ht(he){(he.ctrlKey||he.metaKey)&&he.code=="KeyS"&&(he.preventDefault(),he.stopPropagation(),pe(!1))}const Gt=()=>R(),De=()=>Xe(),Ae=()=>xe(),ze=()=>Mt(),bt=()=>Ne(),de=()=>t(13,C=Gi),ve=()=>t(13,C=bs),we=()=>Y(),Ye=()=>te();function zt(){m.id=this.value,t(3,m)}function dn(he){m=he,t(3,m)}function an(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function qn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Li(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function ol(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function gi(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Ee(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Nt(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Ni(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Kn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function rl(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Rl(he,Oe){n.$$.not_equal(y[Oe.name],he)&&(y[Oe.name]=he,t(4,y))}function bi(he,Oe){n.$$.not_equal(S[Oe.name],he)&&(S[Oe.name]=he,t(5,S))}function al(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}const fl=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{F()}),!1):(Jt({}),te(),!0);function kt(he){ee[he?"unshift":"push"](()=>{c=he,t(9,c)})}function rt(he){Ce.call(this,n,he)}function Mn(he){Ce.call(this,n,he)}return n.$$set=he=>{"collection"in he&&t(0,u=he.collection)},n.$$.update=()=>{var he;n.$$.dirty[0]&1&&t(14,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((he=u==null?void 0:u.schema)!=null&&he.find(Oe=>Oe.type==="editor"))),n.$$.dirty[0]&48&&t(31,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&805306368|n.$$.dirty[1]&1&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(O||o)),n.$$.dirty[0]&536871040&&(D||U($)),n.$$.dirty[0]&1073741825&&u&&(I==null?void 0:I.id)!=(u==null?void 0:u.id)&&N()},[u,R,d,m,y,S,O,D,o,c,h,_,g,C,i,r,l,f,F,Y,te,pe,Ne,Xe,xe,Mt,ht,L,T,$,I,s,Gt,De,Ae,ze,bt,de,ve,we,Ye,zt,dn,an,qn,Li,ol,gi,Ee,Nt,Ni,Kn,rl,Rl,bi,al,fl,kt,rt,Mn]}class Za extends ge{constructor(e){super(),_e(this,e,V8,z8,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function B8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U8(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("div"),t=b("div"),i=K(n[2]),l=M(),s=b("div"),o=K(n[1]),r=K(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(f=Se(Pe.call(null,e,n[3])),a=!0)},p(u,c){c&4&&oe(i,u[2]),c&2&&oe(o,u[1])},d(u){u&&v(e),a=!1,f()}}}function W8(n){let e;function t(s,o){return s[0]?U8:B8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function Y8(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class el extends ge{constructor(e){super(),_e(this,e,Y8,W8,me,{date:0})}}function Km(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Jm(n,e,t){const i=n.slice();return i[13]=e[t],i}function Zm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Gm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function K8(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function J8(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function Z8(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function G8(n){let e,t;return{c(){e=b("div"),t=K(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&oe(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function X8(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function Q8(n){let e,t=[],i=new Map,l,s,o=ue(n[16].slice(0,n[17]));const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Qm();return{c(){var f;e=b("div");for(let u=0;uf[17]?a||(a=Qm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||u&2)&&x(e,"multiple",((c=f[1].options)==null?void 0:c.maxSelect)!=1)},i(f){if(!s){for(let u=0;un[11]&&th();return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),k(e,l),f&&f.m(e,null),s=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),E(i,1),i.m(e,l)),u[9].length>u[11]?f||(f=th(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(e),r[t].d(),f&&f.d()}}}function eD(n){let e,t=[],i=new Map,l=ue(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function iD(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=K(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[Se(Pe.call(null,e,"Open in new tab")),J(e,"click",Tn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function lD(n){let e,t;return{c(){e=b("span"),t=K(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&oe(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function sD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function oD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function rD(n){let e,t,i,l;const s=[pD,dD],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Xm(n,e){let t,i,l;return i=new Ka({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function Qm(n){let e;return{c(){e=K("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function aD(n){let e,t=ue(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&ih(n);return{c(){e=b("span"),i=K(t),l=M(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&oe(i,t),a[5].length>500?r?(r.p(a,f),f&8&&E(r,1)):(r=ih(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function pD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ih(n){let e,t;return e=new sl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mD(n){let e,t,i,l,s;const o=[rD,oD,sD,lD,iD,nD,tD,eD,x8,Q8,X8,G8],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(u[3])),e?1:u[1].type==="bool"?2:u[1].type==="number"?3:u[1].type==="url"?4:u[1].type==="editor"?5:u[1].type==="date"?6:u[1].type==="select"?7:u[1].type==="relation"?8:u[1].type==="file"?9:u[2]?10:11)}function f(u,c){return c===0?Z8(u):c===8?J8(u):c===9?K8(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),l=ye()},m(u,c){r[t].m(u,c),w(u,l,c),s=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(l),r[t].d(u)}}}function hD(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ce.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class xb extends ge{constructor(e){super(),_e(this,e,hD,mD,me,{record:0,field:1,short:2})}}function lh(n,e,t){const i=n.slice();return i[13]=e[t],i}function sh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new xb({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=K(i),s=M(),o=b("td"),B(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(e,s),k(e,o),z(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[13].name+"")&&oe(l,i);const c={};u&1&&(c.field=f[13]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(E(r.$$.fragment,f),a=!0)},o(f){A(r.$$.fragment,f),a=!1},d(f){f&&v(e),V(r)}}}function oh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function rh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function _D(n){var O;let e,t,i,l,s,o,r,a,f,u,c=(n[3].id||"...")+"",d,m,h,_,g;a=new sl({props:{value:n[3].id}});let y=ue((O=n[0])==null?void 0:O.schema),S=[];for(let D=0;DA(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&oh(n),C=n[3].updated&&rh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("span"),d=K(c),m=M();for(let D=0;D{$=null}),se()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=rh(D),C.c(),E(C,1),C.m(t,null)):C&&(le(),A(C,1,1,()=>{C=null}),se()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function kD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[bD],header:[gD],default:[_D]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function yD(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return u(g),s==null?void 0:s.show()}function f(){return t(4,r=!1),s==null?void 0:s.hide()}async function u(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await ae.collection(l.id).getOne(g)}catch(y){y.isAbort||(f(),console.warn("resolveModel:",y),ii(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>f();function m(g){ee[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ce.call(this,n,g)}function _(g){Ce.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,f,s,o,r,i,a,d,m,h,_]}class vD extends ge{constructor(e){super(),_e(this,e,yD,kD,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function ah(n,e,t){const i=n.slice();return i[63]=e[t],i}function fh(n,e,t){const i=n.slice();return i[66]=e[t],i}function uh(n,e,t){const i=n.slice();return i[66]=e[t],i}function ch(n,e,t){const i=n.slice();return i[59]=e[t],i}function dh(n){let e;function t(s,o){return s[13]?SD:wD}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function wD(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[32]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function SD(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ph(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[$D]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $D(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&hh(n),r=i&&_h(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){f[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,f),f[0]&32&&E(o,1)):(o=hh(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(le(),A(o,1,1,()=>{o=null}),se()),f[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=_h(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function hh(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[TD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function TD(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _h(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[CD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CD(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OD(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=K(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,f){f[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[66].name+"")&&oe(r,o)},d(a){a&&v(e)}}}function gh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[OD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Sn({props:r}),ee.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[66].type+" col-field-"+e[66].name),f[0]&524288&&(u.name=e[66].name),f[0]&524288|f[2]&512&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.sort=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function bh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[MD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function MD(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[DD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function DD(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function vh(n){let e;function t(s,o){return s[13]?ID:ED}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ED(n){let e,t,i,l;function s(a,f){var u;if((u=a[1])!=null&&u.length)return LD;if(!a[10])return AD}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function ID(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function wh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[J(i,"change",c),J(t,"click",Tn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,$e(u)}}}function Sh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&$h(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=K(r),f=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),z(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&oe(a,r),d[9]?c?c.p(d,m):(c=$h(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function $h(n){let e;function t(s,o){return s[63].verified?PD:ND}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ND(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function PD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Th(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Ch(n),o=i&&Oh(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Ch(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Oh(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Ch(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?RD:FD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function FD(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&oe(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function RD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Oh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?jD:qD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function qD(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&oe(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function jD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Mh(n,e){let t,i,l,s;return i=new xb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function Dh(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Eh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Ih(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&wh(e),T=l&&Sh(e),$=e[9]&&Th(e),C=ue(e[19]);const O=F=>F[66].name;for(let F=0;F',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P{T=null}),se()),e[9]?$?$.p(e,N):($=Th(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=ue(e[19]),le(),r=at(r,N,O,1,e,C,a,t,Et,Mh,f,fh),se()),N[0]&288&&(u=e[8]&&!e[5].includes("@created")),u?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Dh(e),D.c(),E(D,1),D.m(t,c)):D&&(le(),A(D,1,1,()=>{D=null}),se()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Eh(e),I.c(),E(I,1),I.m(t,m)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(F){if(!_){E(T);for(let N=0;NU[66].name;for(let U=0;UU[10]?U[63]:U[63].id;for(let U=0;U{D=null}),se()),U[9]?I?(I.p(U,Y),Y[0]&512&&E(I,1)):(I=mh(U),I.c(),E(I,1),I.m(i,r)):I&&(le(),A(I,1,1,()=>{I=null}),se()),Y[0]&524289&&(L=ue(U[19]),le(),a=at(a,Y,R,1,U,L,f,i,Et,gh,u,uh),se()),Y[0]&288&&(c=U[8]&&!U[5].includes("@created")),c?F?(F.p(U,Y),Y[0]&288&&E(F,1)):(F=bh(U),F.c(),E(F,1),F.m(i,d)):F&&(le(),A(F,1,1,()=>{F=null}),se()),Y[0]&160&&(m=U[7]&&!U[5].includes("@updated")),m?N?(N.p(U,Y),Y[0]&160&&E(N,1)):(N=kh(U),N.c(),E(N,1),N.m(i,h)):N&&(le(),A(N,1,1,()=>{N=null}),se()),U[16].length?P?P.p(U,Y):(P=yh(U),P.c(),P.m(_,null)):P&&(P.d(1),P=null),Y[0]&9971642&&(q=ue(U[3]),le(),S=at(S,Y,H,1,U,q,T,y,Et,Ih,$,ah),se(),!q.length&&W?W.p(U,Y):q.length?W&&(W.d(1),W=null):(W=vh(U),W.c(),W.m(y,$))),U[3].length&&U[18]?G?G.p(U,Y):(G=Ah(U),G.c(),G.m(y,null)):G&&(G.d(1),G=null),(!C||Y[0]&8192)&&x(e,"table-loading",U[13])},i(U){if(!C){E(D),E(I);for(let Y=0;Y({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function VD(n){let e,t,i=[],l=new Map,s,o,r=ue(n[16]);const a=f=>f[59].id+f[59].name;for(let f=0;f{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ph(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[6]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[47]),J(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&oe(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&oe(a,r),(!g||$[0]&16384)&&x(u,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function UD(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[BD],default:[HD]},$$scope:{ctx:n}};e=new Qo({props:s}),n[46](e);let o=n[6]&&Ph(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ye()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const f={};a[0]&1030075|a[2]&512&&(f.$$scope={dirty:a,ctx:r}),e.$set(f),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=Ph(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(le(),A(o,1,1,()=>{o=null}),se())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const WD=/^([\+\-])?(\w+)$/,Fh=40;function YD(n,e,t){let i,l,s,o,r,a,f,u,c,d,m,h;We(n,Rn,Ee=>t(53,h=Ee));const _=lt();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,O=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function H(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function W(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Ee=localStorage.getItem(q);Ee&&t(5,N=JSON.parse(Ee)||[])}catch{}}function G(Ee){return!!$.find(Nt=>Nt.id)}async function U(){const Ee=C;for(let Nt=1;Nt<=Ee;Nt++)(Nt===1||f)&&await Y(Nt,!1)}async function Y(Ee=1,Nt=!0){var al,fl,kt;if(!(g!=null&&g.id))return;t(13,I=!0);let Ni=y;const Kn=Ni.match(WD),rl=Kn?r.find(rt=>rt.name===Kn[2]):null;if(Kn&&rl){const rt=((kt=(fl=(al=h==null?void 0:h.find(he=>{var Oe;return he.id==((Oe=rl.options)==null?void 0:Oe.collectionId)}))==null?void 0:al.schema)==null?void 0:fl.filter(he=>he.presentable))==null?void 0:kt.map(he=>he.name))||[],Mn=[];for(const he of rt)Mn.push((Kn[1]||"")+Kn[2]+"."+he);Mn.length>0&&(Ni=Mn.join(","))}const Rl=j.getAllCollectionIdentifiers(g),bi=o.map(rt=>rt.name+":excerpt(200)").concat(r.map(rt=>"expand."+rt.name+".*:excerpt(200)"));return bi.length&&bi.unshift("*"),ae.collection(g.id).getList(Ee,Fh,{sort:Ni,skipTotal:1,filter:j.normalizeSearchFilter(S,Rl),expand:r.map(rt=>rt.name).join(","),fields:bi.join(","),requestKey:"records_list"}).then(async rt=>{var Mn;if(Ee<=1&&ie(),t(13,I=!1),t(12,C=rt.page),t(28,O=rt.items.length),_("load",$.concat(rt.items)),o.length)for(let he of rt.items)he._partial=!0;if(Nt){const he=++R;for(;(Mn=rt.items)!=null&&Mn.length&&R==he;){const Oe=rt.items.splice(0,20);for(let _t of Oe)j.pushOrReplaceByKey($,_t);t(3,$),await j.yieldToMain()}}else{for(let he of rt.items)j.pushOrReplaceByKey($,he);t(3,$)}}).catch(rt=>{rt!=null&&rt.isAbort||(t(13,I=!1),console.warn(rt),ie(),ae.error(rt,!S||(rt==null?void 0:rt.status)!=400))})}function ie(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,O=0),t(4,D={})}function te(){c?pe():Ne()}function pe(){t(4,D={})}function Ne(){for(const Ee of $)t(4,D[Ee.id]=Ee,D);t(4,D)}function He(Ee){D[Ee.id]?delete D[Ee.id]:t(4,D[Ee.id]=Ee,D),t(4,D)}function Xe(){un(`Do you really want to delete the selected ${u===1?"record":"records"}?`,xe)}async function xe(){if(L||!u||!(g!=null&&g.id))return;let Ee=[];for(const Nt of Object.keys(D))Ee.push(ae.collection(g.id).delete(Nt));return t(14,L=!0),Promise.all(Ee).then(()=>{Lt(`Successfully deleted the selected ${u===1?"record":"records"}.`),_("delete",D),pe()}).catch(Nt=>{ae.error(Nt)}).finally(()=>(t(14,L=!1),U()))}function Mt(Ee){Ce.call(this,n,Ee)}const ft=(Ee,Nt)=>{Nt.target.checked?j.removeByValue(N,Ee.id):j.pushUnique(N,Ee.id),t(5,N)},ht=()=>te();function Gt(Ee){y=Ee,t(0,y)}function De(Ee){y=Ee,t(0,y)}function Ae(Ee){y=Ee,t(0,y)}function ze(Ee){y=Ee,t(0,y)}function bt(Ee){y=Ee,t(0,y)}function de(Ee){y=Ee,t(0,y)}function ve(Ee){ee[Ee?"unshift":"push"](()=>{F=Ee,t(15,F)})}const we=Ee=>He(Ee),Ye=Ee=>_("select",Ee),zt=(Ee,Nt)=>{Nt.code==="Enter"&&(Nt.preventDefault(),_("select",Ee))},dn=()=>t(1,S=""),an=()=>_("new"),qn=()=>Y(C+1);function Li(Ee){ee[Ee?"unshift":"push"](()=>{T=Ee,t(11,T)})}const ol=()=>pe(),gi=()=>Xe();return n.$$set=Ee=>{"collection"in Ee&&t(25,g=Ee.collection),"sort"in Ee&&t(0,y=Ee.sort),"filter"in Ee&&t(1,S=Ee.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",W(),ie()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ee=>Ee.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ee=>Ee.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ee=>!N.includes(Ee.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&Y(1),n.$$.dirty[0]&268435456&&t(18,f=O>=Fh),n.$$.dirty[0]&16&&t(6,u=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&u===$.length),n.$$.dirty[0]&32&&N!==-1&&H(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ee=>({id:Ee.id,name:Ee.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,Y,$,D,N,u,m,d,l,i,T,C,I,L,F,P,c,f,a,_,te,pe,He,Xe,g,G,U,O,s,Mt,ft,ht,Gt,De,Ae,ze,bt,de,ve,we,Ye,zt,dn,an,qn,Li,ol,gi]}class KD extends ge{constructor(e){super(),_e(this,e,YD,UD,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function JD(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=K(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[f]){f&5&&s!==(s=(a[2]?"...":a[0])+"")&&oe(o,s),f&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function ZD(n,e,t){const i=lt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function f(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const u=j.getAllCollectionIdentifiers(l),c=await ae.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,u),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(u){u!=null&&u.isAbort||(t(2,a=!1),console.warn(u))}}}return n.$$set=u=>{"collection"in u&&t(3,l=u.collection),"filter"in u&&t(4,s=u.filter),"totalCount"in u&&t(0,o=u.totalCount),"class"in u&&t(1,r=u.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&f()},[o,r,a,l,s,f]}class GD extends ge{constructor(e){super(),_e(this,e,ZD,JD,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function XD(n){let e,t,i,l;return e=new p6({}),i=new bn({props:{class:"flex-content",$$slots:{footer:[tE],default:[eE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function QD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[sE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Rh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function qh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eE(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F=!n[12]&&Rh(n);c=new Xo({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&qh(n);y=new Cs({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(W){n[26](W)}function q(W){n[27](W)}let H={collection:n[2]};return n[0]!==void 0&&(H.filter=n[0]),n[1]!==void 0&&(H.sort=n[1]),C=new KD({props:H}),n[25](C),ee.push(()=>be(C,"filter",P)),ee.push(()=>be(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=K(o),a=M(),f=b("div"),F&&F.c(),u=M(),B(c.$$.fragment),d=M(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=M(),N&&N.c(),g=M(),B(y.$$.fragment),S=M(),T=b("div"),$=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(W,G){w(W,e,G),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,f),F&&F.m(f,null),k(f,u),z(c,f,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(W,g,G),z(y,W,G),w(W,S,G),w(W,T,G),w(W,$,G),z(C,W,G),I=!0,L||(R=J(h,"click",n[22]),L=!0)},p(W,G){(!I||G[0]&4)&&o!==(o=W[2].name+"")&&oe(r,o),W[12]?F&&(F.d(1),F=null):F?F.p(W,G):(F=Rh(W),F.c(),F.m(f,u)),W[2].type!=="view"?N?N.p(W,G):(N=qh(W),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const U={};G[0]&1&&(U.value=W[0]),G[0]&4&&(U.autocompleteCollection=W[2]),y.$set(U);const Y={};G[0]&4&&(Y.collection=W[2]),!O&&G[0]&1&&(O=!0,Y.filter=W[0],ke(()=>O=!1)),!D&&G[0]&2&&(D=!0,Y.sort=W[1],ke(()=>D=!1)),C.$set(Y)},i(W){I||(E(c.$$.fragment,W),E(y.$$.fragment,W),E(C.$$.fragment,W),I=!0)},o(W){A(c.$$.fragment,W),A(y.$$.fragment,W),A(C.$$.fragment,W),I=!1},d(W){W&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),V(c),N&&N.d(),V(y,W),n[25](null),V(C,W),L=!1,R()}}}function tE(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new GD({props:s}),n[18](e),ee.push(()=>be(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function nE(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function iE(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function lE(n){let e,t,i;function l(r,a){return r[12]?iE:nE}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function sE(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oE(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[xD,QD,XD],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ya({props:_}),n[31](l);let g={};o=new v6({props:g}),n[32](o);let y={collection:n[2]};a=new Za({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new vD({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),z(l,T,$),w(T,s,$),z(o,T,$),w(T,r,$),z(a,T,$),w(T,f,$),z(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(le(),A(m[C],1,1,()=>{m[C]=null}),se(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const O={};l.$set(O);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),V(l,T),n[32](null),V(o,T),n[33](null),V(a,T),n[37](null),V(u,T)}}}function rE(n,e,t){let i,l,s,o,r,a,f;We(n,Yn,De=>t(2,l=De)),We(n,It,De=>t(39,s=De)),We(n,Oo,De=>t(3,o=De)),We(n,zo,De=>t(16,r=De)),We(n,Rn,De=>t(11,a=De)),We(n,Xi,De=>t(12,f=De));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;X1(T);async function C(De){await Qt(),(l==null?void 0:l.type)==="view"?h.show(De):m==null||m.show(De)}function O(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D(),c==null||c.forceHide(),d==null||d.hide()}async function D(){if(!S)return;const De=j.getAllCollectionIdentifiers(l),Ae=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Ae.filter(ze=>De.includes(ze)).length!=Ae.length&&(De.includes("created")?t(1,S="-created"):t(1,S=""))}function I(De={}){const Ae=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},De);j.replaceHashQueryParams(Ae)}const L=()=>c==null?void 0:c.show();function R(De){ee[De?"unshift":"push"](()=>{g=De,t(9,g)})}function F(De){$=De,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),H=()=>m==null?void 0:m.show(),W=De=>t(0,y=De.detail);function G(De){ee[De?"unshift":"push"](()=>{_=De,t(8,_)})}function U(De){y=De,t(0,y)}function Y(De){S=De,t(1,S)}const ie=De=>{I({recordId:De.detail.id});let Ae=De.detail._partial?De.detail.id:De.detail;l.type==="view"?h==null||h.show(Ae):m==null||m.show(Ae)},te=()=>{g==null||g.reload()},pe=()=>m==null?void 0:m.show();function Ne(De){ee[De?"unshift":"push"](()=>{c=De,t(4,c)})}function He(De){ee[De?"unshift":"push"](()=>{d=De,t(5,d)})}function Xe(De){ee[De?"unshift":"push"](()=>{m=De,t(6,m)})}const xe=()=>{I({recordId:null})},Mt=De=>{y?g==null||g.reload():De.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},ft=De=>{(!y||_!=null&&_.hasRecord(De.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function ht(De){ee[De?"unshift":"push"](()=>{h=De,t(7,h)})}const Gt=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&av(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&O(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(It,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,q,H,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt]}class aE extends ge{constructor(e){super(),_e(this,e,rE,oE,me,{},null,[-1,-1])}}function jh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=M(),i=b("a"),i.innerHTML=' Export collections',l=M(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(Ln.call(null,i,{path:"/settings/export-collections/?.*"})),Se(ln.call(null,i)),Se(Ln.call(null,s,{path:"/settings/import-collections/?.*"})),Se(ln.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function fE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O=!n[0]&&jh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',f=M(),u=b("a"),u.innerHTML=' Backups',c=M(),O&&O.c(),d=M(),m=b("div"),m.textContent="Authentication",h=M(),_=b("a"),_.innerHTML=' Auth providers',g=M(),y=b("a"),y.innerHTML=' Token options',S=M(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),O&&O.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[Se(Ln.call(null,l,{path:"/settings"})),Se(ln.call(null,l)),Se(Ln.call(null,o,{path:"/settings/mail/?.*"})),Se(ln.call(null,o)),Se(Ln.call(null,a,{path:"/settings/storage/?.*"})),Se(ln.call(null,a)),Se(Ln.call(null,u,{path:"/settings/backups/?.*"})),Se(ln.call(null,u)),Se(Ln.call(null,_,{path:"/settings/auth-providers/?.*"})),Se(ln.call(null,_)),Se(Ln.call(null,y,{path:"/settings/tokens/?.*"})),Se(ln.call(null,y)),Se(Ln.call(null,T,{path:"/settings/admins/?.*"})),Se(ln.call(null,T))],$=!0)},p(D,I){D[0]?O&&(O.d(1),O=null):O||(O=jh(),O.c(),O.m(e,d))},d(D){D&&v(e),O&&O.d(),$=!1,$e(C)}}}function uE(n){let e,t;return e=new Bb({props:{class:"settings-sidebar",$$slots:{default:[fE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cE(n,e,t){let i;return We(n,Xi,l=>t(0,i=l)),[i]}class _i extends ge{constructor(e){super(),_e(this,e,cE,uE,me,{})}}function Hh(n,e,t){const i=n.slice();return i[31]=e[t],i}function zh(n){let e,t;return e=new ce({props:{class:"form-field readonly",name:"id",$$slots:{default:[dE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Gb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),f=M(),u=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),z(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),V(a)}}}function Vh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function pE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[3]),f||(u=J(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function Bh(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[mE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Uh(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[hE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[_E,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(t,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(t,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function hE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),re(r,n[9]),w(_,f,g),w(_,u,g),z(c,u,null),d=!0,m||(h=J(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&re(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function _E(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[10]),f||(u=J(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&re(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function gE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&zh(n),_=ue([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=Vh(Hh(n,_,T));a=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[pE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Bh(n),S=(n[5]||n[4])&&Uh(n);return{c(){e=b("form"),h&&h.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=M(),B(a.$$.fragment),f=M(),y&&y.c(),u=M(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),z(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=J(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=zh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=ue([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const D=Hh(T,_,O);g[O]?g[O].p(D,$):(g[O]=Vh(D),g[O].c(),g[O].m(o,null))}for(;O<10;O+=1)g[O].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(le(),A(y,1,1,()=>{y=null}),se()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Bh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Uh(T),S.c(),E(S,1),S.m(e,null)):S&&(le(),A(S,1,1,()=>{S=null}),se())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),ot(g,T),V(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function bE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&oe(i,t)},d(l){l&&v(e)}}}function Wh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[kE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(t,"aria-hidden","true"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"aria-label","More admin options"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),z(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),V(o)}}}function kE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function yE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Wh(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=J(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(le(),A(m,1,1,()=>{m=null}),se()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Wh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&oe(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function vE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[yE],header:[bE],default:[gE]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function wE(n,e,t){let i,l;const s=lt(),o="admin_"+j.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Jt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let U;i?U=ae.admins.create(G):U=ae.admins.update(a.id,G),U.then(async Y=>{var ie;t(8,u=!1),y(),Lt(i?"Successfully created admin.":"Successfully updated admin."),((ie=ae.authStore.model)==null?void 0:ie.id)===Y.id&&ae.authStore.save(ae.authStore.token,Y),s("save",Y)}).catch(Y=>{ae.error(Y)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&un("Do you really want to delete the selected admin?",()=>ae.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Lt("Successfully deleted admin."),s("delete",a)}).catch(G=>{ae.error(G)}))}const O=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(G){ee[G?"unshift":"push"](()=>{r=G,t(6,r)})}function H(G){Ce.call(this,n,G)}function W(G){Ce.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,O,D,I,L,R,F,N,P,q,H,W]}class SE extends ge{constructor(e){super(),_e(this,e,wE,vE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Yh(n,e,t){const i=n.slice();return i[24]=e[t],i}function $E(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kh(n){let e;function t(s,o){return s[5]?DE:ME}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ME(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Jh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Jh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function DE(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Zh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,O,D,I,L,R,F,N,P,q,H,W,G;u=new sl({props:{value:e[24].id}});let U=e[24].id===e[7].id&&Zh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Y(){return e[15](e[24])}function ie(...te){return e[16](e[24],...te)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),f=b("div"),B(u.$$.fragment),c=M(),d=b("span"),h=K(m),_=M(),U&&U.c(),g=M(),y=b("td"),S=b("span"),$=K(T),O=M(),D=b("td"),B(I.$$.fragment),L=M(),R=b("td"),B(F.$$.fragment),N=M(),P=b("td"),P.innerHTML='',q=M(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,pe){w(te,t,pe),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),z(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),U&&U.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,O),k(t,D),z(I,D,null),k(t,L),k(t,R),z(F,R,null),k(t,N),k(t,P),k(t,q),H=!0,W||(G=[J(t,"click",Y),J(t,"keydown",ie)],W=!0)},p(te,pe){e=te,(!H||pe&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Ne={};pe&16&&(Ne.value=e[24].id),u.$set(Ne),(!H||pe&16)&&m!==(m=e[24].id+"")&&oe(h,m),e[24].id===e[7].id?U||(U=Zh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!H||pe&16)&&T!==(T=e[24].email+"")&&oe($,T),(!H||pe&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};pe&16&&(He.date=e[24].created),I.$set(He);const Xe={};pe&16&&(Xe.date=e[24].updated),F.$set(Xe)},i(te){H||(E(u.$$.fragment,te),E(I.$$.fragment,te),E(F.$$.fragment,te),H=!0)},o(te){A(u.$$.fragment,te),A(I.$$.fragment,te),A(F.$$.fragment,te),H=!1},d(te){te&&v(t),V(u),U&&U.d(),V(I),V(F),W=!1,$e(G)}}}function EE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],O=new Map,D;function I(Y){n[11](Y)}let L={class:"col-type-text",name:"id",$$slots:{default:[$E]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(Y){n[12](Y)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[TE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(Y){n[13](Y)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[CE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));function q(Y){n[14](Y)}let H={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[OE]},$$scope:{ctx:n}};n[2]!==void 0&&(H.sort=n[2]),_=new Sn({props:H}),ee.push(()=>be(_,"sort",q));let W=ue(n[4]);const G=Y=>Y[24].id;for(let Y=0;Yr=!1)),o.$set(te);const pe={};ie&134217728&&(pe.$$scope={dirty:ie,ctx:Y}),!u&&ie&4&&(u=!0,pe.sort=Y[2],ke(()=>u=!1)),f.$set(pe);const Ne={};ie&134217728&&(Ne.$$scope={dirty:ie,ctx:Y}),!m&&ie&4&&(m=!0,Ne.sort=Y[2],ke(()=>m=!1)),d.$set(Ne);const He={};ie&134217728&&(He.$$scope={dirty:ie,ctx:Y}),!g&&ie&4&&(g=!0,He.sort=Y[2],ke(()=>g=!1)),_.$set(He),ie&186&&(W=ue(Y[4]),le(),C=at(C,ie,G,1,Y,W,O,$,Et,Gh,null,Yh),se(),!W.length&&U?U.p(Y,ie):W.length?U&&(U.d(1),U=null):(U=Kh(Y),U.c(),U.m($,null))),(!D||ie&32)&&x(e,"table-loading",Y[5])},i(Y){if(!D){E(o.$$.fragment,Y),E(f.$$.fragment,Y),E(d.$$.fragment,Y),E(_.$$.fragment,Y);for(let ie=0;ie New admin',h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=M(),B(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),z(a,e,null),k(e,f),k(e,u),k(e,c),k(e,d),k(d,m),w(D,h,I),z(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),z(T,D,I),$=!0,C||(O=J(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&oe(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),V(a),V(_,D),V(T,D),C=!1,O()}}}function AE(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=K("Total found: "),l=K(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&oe(l,i)},d(s){s&&v(e)}}}function LE(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{footer:[AE],default:[IE]},$$scope:{ctx:n}}});let r={};return s=new SE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function NE(n,e,t){let i,l,s;We(n,zo,F=>t(21,i=F)),We(n,It,F=>t(6,l=F)),We(n,Oa,F=>t(7,s=F)),xt(It,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],f=!1,u=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,f=!0),t(4,a=[]);const F=j.normalizeSearchFilter(u,["id","email","created","updated"]);return ae.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,f=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,f=!1),console.warn(N),m(),ae.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,u=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),O=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,u="");function I(F){ee[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();tl("/settings/admins?"+F),d()}},[d,u,c,r,a,f,l,s,h,_,g,y,S,T,$,C,O,D,I,L,R]}class PE extends ge{constructor(e){super(),_e(this,e,NE,LE,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function FE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RE(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),f=b("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[1]),w(d,r,m),w(d,a,m),k(a,f),u||(c=[J(s,"input",n[5]),Se(ln.call(null,f))],u=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&re(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),u=!1,$e(c)}}}function qE(n){let e,t,i,l,s,o,r,a,f,u,c;return l=new ce({props:{class:"form-field required",name:"identity",$$slots:{default:[FE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[RE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),k(e,a),f=!0,u||(c=J(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),V(o),u=!1,c()}}}function jE(n){let e,t;return e=new Q1({props:{$$slots:{default:[qE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function HE(n,e,t){let i;We(n,zo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ae.admins.authWithPassword(s,o).then(()=>{Ta(),tl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class zE extends ge{constructor(e){super(),_e(this,e,HE,jE,me,{})}}function VE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new ce({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[UE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[WE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[YE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Xh(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("div"),c=b("div"),d=M(),$&&$.c(),m=M(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,O){w(C,e,O),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),z(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=J(h,"click",n[12]),S=!0)},p(C,O){const D={};O&786433&&(D.$$scope={dirty:O,ctx:C}),i.$set(D);const I={};O&786433&&(I.$$scope={dirty:O,ctx:C}),o.$set(I);const L={};O&786433&&(L.$$scope={dirty:O,ctx:C}),a.$set(L),C[3]?$?$.p(C,O):($=Xh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||O&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||O&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),V(i),V(o),V(a),$&&$.d(),S=!1,T()}}}function BE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function UE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appName),r||(a=J(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&re(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function WE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appUrl),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&re(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function YE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[10]),Se(Pe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function Xh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function KE(n){let e,t,i,l,s,o,r,a,f;const u=[BE,VE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=J(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function JE(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[KE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function ZE(n,e,t){let i,l,s,o;We(n,Xi,C=>t(13,l=C)),We(n,Do,C=>t(14,s=C)),We(n,It,C=>t(15,o=C)),xt(It,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await ae.settings.getAll()||{};h(C)}catch(C){ae.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await ae.settings.update(j.filterRedactedProps(a));h(C),Lt("Successfully saved application settings.")}catch(C){ae.error(C)}t(2,u=!1)}}function h(C={}){var O,D;xt(Do,s=(O=C==null?void 0:C.meta)==null?void 0:O.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class GE extends ge{constructor(e){super(),_e(this,e,ZE,JE,me,{})}}function XE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),l.autofocus&&l.focus(),s||(o=[Se(Pe.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],s=!0)},p(f,u){ni(l,a=pt(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&(v(e),v(i),v(l)),s=!1,$e(o)}}}function xE(n){let e;function t(s,o){return s[3]?QE:XE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function eI(n,e,t){const i=["value","mask"];let l=Ge(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const u=()=>f();function c(m){ee[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(5,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,f,l,u,c,d]}class Ga extends ge{constructor(e){super(),_e(this,e,eI,xE,me,{value:0,mask:1})}}function tI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("label"),t=K("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=K(`, - `),d=b("button"),d.textContent="{APP_URL} ",m=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),re(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),h||(_=[J(s,"input",n[13]),J(u,"click",n[14]),J(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&re(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,$e(_)}}}function XE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y;return{c(){e=b("label"),t=K("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: + `),d=b("button"),d.textContent="{APP_URL} ",m=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),re(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),h||(_=[J(s,"input",n[13]),J(u,"click",n[14]),J(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&re(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,$e(_)}}}function nI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y;return{c(){e=b("label"),t=K("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=K(`, `),d=b("button"),d.textContent="{APP_URL} ",m=K(`, - `),h=b("button"),h.textContent="{TOKEN} ",_=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),re(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[J(s,"input",n[16]),J(u,"click",n[17]),J(d,"click",n[18]),J(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&re(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,$e(y)}}}function QE(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),re(e,n[0].body),i||(l=J(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&re(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function xE(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function eI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;const C=[xE,QE],O=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=O[s]=C[s](n),{c(){e=b("label"),t=K("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),f=K(`Available placeholder parameters: + `),h=b("button"),h.textContent="{TOKEN} ",_=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),re(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[J(s,"input",n[16]),J(u,"click",n[17]),J(d,"click",n[18]),J(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&re(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,$e(y)}}}function iI(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),re(e,n[0].body),i||(l=J(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&re(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function lI(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function sI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;const C=[lI,iI],O=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=O[s]=C[s](n),{c(){e=b("label"),t=K("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),f=K(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=K(`, `),d=b("button"),d.textContent="{APP_URL} ",m=K(`, `),h=b("button"),h.textContent="{TOKEN} ",_=K(`, - `),g=b("button"),g.textContent="{ACTION_URL} ",y=K("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[J(u,"click",n[22]),J(d,"click",n[23]),J(h,"click",n[24]),J(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(le(),A(O[R],1,1,()=>{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function tI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[GE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[XE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[eI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Gh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function nI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Gh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Gh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function iI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[nI],default:[tI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=Xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-C-zHBmhQ.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),Xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),$o(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Ja extends ge{constructor(e){super(),_e(this,e,lI,iI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Qh(n,e,t){const i=n.slice();return i[21]=e[t],i}function xh(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=_0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function sI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[oI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function aI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function uI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[fI],header:[aI],default:[rI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Nr="last_email_test",e_="email_test_request";function cI(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Nr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Nr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(e_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:e_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class dI extends ge{constructor(e){super(),_e(this,e,cI,uI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function pI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[hI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[_I,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&t_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&n_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&i_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[gI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&l_(n);function L(N,P){return N[5]?MI:OI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=t_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=n_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=i_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=l_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function mI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function hI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function _I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function t_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function n_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function i_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Ja({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function l_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[bI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[kI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[yI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[vI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?SI:wI}let O=C(n),D=O(n),I=n[4]&&s_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=s_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function bI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function kI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function wI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function SI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function s_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[$I,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[TI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[CI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function $I(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function TI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function CI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function OI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function MI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function DI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[mI,pI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function EI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[DI]},$$scope:{ctx:n}}});let r={};return s=new dI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function II(n,e,t){let i,l,s;Ue(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class AI extends ge{constructor(e){super(),_e(this,e,II,EI,me,{},null,[-1,-1])}}const LI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),o_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function NI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[PI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[FI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[RI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[qI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[jI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function PI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function FI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function jI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function HI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function zI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[NI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],o_);let a=n[0].enabled&&r_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,LI):Tt(f[15]),o_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=r_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const Pr="s3_test_request";function VI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(Pr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(Pr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:Pr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class Xb extends ge{constructor(e){super(),_e(this,e,VI,zI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function BI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[WI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new Xb({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&f_(n),O=n[6]&&u_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=f_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=u_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function UI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function a_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually + `),g=b("button"),g.textContent="{ACTION_URL} ",y=K("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[J(u,"click",n[22]),J(d,"click",n[23]),J(h,"click",n[24]),J(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(le(),A(O[R],1,1,()=>{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function oI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[tI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[nI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[sI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function rI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Qh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function aI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[rI],default:[oI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-97oGZhvg.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),Co(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Xa extends ge{constructor(e){super(),_e(this,e,fI,aI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function e_(n,e,t){const i=n.slice();return i[21]=e[t],i}function t_(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=k0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function uI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[cI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function pI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function hI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mI],header:[pI],default:[dI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Rr="last_email_test",n_="email_test_request";function _I(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Rr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(n_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:n_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class gI extends ge{constructor(e){super(),_e(this,e,_I,hI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function bI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&i_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&l_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&s_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[wI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&o_(n);function L(N,P){return N[5]?LI:AI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=i_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=l_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=s_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=o_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function kI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function i_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function s_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[SI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$I,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[TI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[CI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?MI:OI}let O=C(n),D=O(n),I=n[4]&&r_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=r_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function SI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function TI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function OI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function MI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[EI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[II,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function DI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function EI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function II(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function AI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function NI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[kI,bI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function PI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}});let r={};return s=new gI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function FI(n,e,t){let i,l,s;We(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class RI extends ge{constructor(e){super(),_e(this,e,FI,PI,me,{},null,[-1,-1])}}const qI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),a_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function jI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function f_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[VI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[BI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[UI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[WI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function HI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function UI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function WI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function YI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[jI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],a_);let a=n[0].enabled&&f_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,qI):Tt(f[15]),a_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=f_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const qr="s3_test_request";function KI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(qr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:qr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class e0 extends ge{constructor(e){super(),_e(this,e,KI,YI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function JI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[GI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new e0({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&c_(n),O=n[6]&&d_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=c_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=d_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function ZI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function u_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),f=K(a),u=K(` to the @@ -127,20 +127,20 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),y=b("a"),y.textContent=`rclone `,S=K(`, `),T=b("a"),T.textContent=`s5cmd - `,$=K(", etc."),C=M(),O=b("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(O,"class","clearfix m-t-base")},m(R,F){w(R,e,F),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(r,f),k(s,u),k(s,c),k(c,m),k(s,h),k(s,_),k(s,g),k(s,y),k(s,S),k(s,T),k(s,$),k(e,C),k(e,O),I=!0},p(R,F){var N;(!I||F&1)&&a!==(a=(N=R[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&oe(f,a),(!I||F&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(R){I||(R&&Ke(()=>{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function WI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&a_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=a_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(le(),A(t,1,1,()=>{t=null}),se())},d(l){l&&v(e),t&&t.d(l)}}}function f_(n){let e;function t(s,o){return s[4]?JI:s[5]?KI:YI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function YI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function KI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function JI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function u_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function ZI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[UI,BI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

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

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

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[16])),_=!0)},p($,C){(!h||C&128)&&oe(o,$[7]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function GI(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[ZI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const XI="s3_test_request";function QI(n,e,t){let i,l,s;Ue(n,It,O=>t(7,s=O)),xt(It,s="Files storage",s);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await ae.settings.getAll()||{};h(O)}catch(O){ae.error(O)}t(2,a=!1)}async function m(){if(!(f||!l)){t(3,f=!0);try{ae.cancelRequest(XI);const O=await ae.settings.update(j.filterRedactedProps(r));Jt({}),await h(O),wa(),c?nv("Successfully saved but failed to establish S3 connection."):Lt("Successfully saved files storage settings.")}catch(O){ae.error(O)}t(3,f=!1)}}async function h(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){u=O,t(4,u)}function S(O){c=O,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,f,u,c,l,s,m,_,i,g,y,S,T,$,C]}class xI extends ge{constructor(e){super(),_e(this,e,QI,GI,me,{})}}function eA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&2&&(e.checked=f[1].enabled),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function tA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[1].clientId),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&1048576&&i!==(i=u[20])&&p(e,"for",i),c&1048576&&o!==(o=u[20])&&p(s,"id",o),c&2&&r!==(r=u[1].enabled)&&(s.required=r),c&2&&s.value!==u[1].clientId&&re(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function nA(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(f.value=n[1].clientSecret),s=new Ka({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),c&2&&(d.required=u[1].enabled),!o&&c&2&&(o=!0,d.value=u[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function c_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(f){n[14](f)}var r=n[3].optionsComponent;function a(f,u){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(f,u){w(f,e,u),t&&z(t,e,null),l=!0},p(f,u){if(u&8&&r!==(r=f[3].optionsComponent)){if(t){le();const c=t;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}r?(t=Dt(r,a(f,u)),ee.push(()=>be(t,"config",o)),B(t.$$.fragment),E(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=u&8?pt(s,[{key:f[3].key},Ot(f[3].optionsComponentProps||{})]):{};!i&&u&2&&(i=!0,c.config=f[1],ke(()=>i=!1)),t.$set(c)}},i(f){l||(t&&E(t.$$.fragment,f),l=!0)},o(f){t&&A(t.$$.fragment,f),l=!1},d(f){f&&v(e),t&&V(t)}}}function iA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[eA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[tA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[nA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&c_(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(t,l),k(t,s),k(e,o),z(r,e,null),k(e,a),z(f,e,null),k(e,u),h&&h.m(e,null),c=!0,d||(m=[J(s,"click",n[8]),J(e,"submit",Be(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=c_(_),h.c(),E(h,1),h.m(e,null)):h&&(le(),A(h,1,1,()=>{h=null}),se())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(f.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(f.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),V(i),V(r),V(f),h&&h.d(),d=!1,$e(m)}}}function lA(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=K(t),l=K(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&oe(i,t)},d(s){s&&v(e)}}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function oA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[sA],header:[lA],default:[iA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function rA(n,e,t){let i;const l=lt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},f=!1,u="";function c(D,I){Jt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,u=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,f=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await ae.settings.update(D);Jt({}),Lt("Successfully updated provider settings."),l("submit",I),d()}catch(D){ae.error(D)}t(4,f=!1)}function h(){var D;for(let I in a)t(1,a[I]=j.zeroValue(a[I]),a);(D=r.key)!=null&&D.startsWith("oidc")?t(1,a.pkce=!1,a):t(1,a.pkce=null,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){ee[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,s,m,h,c,u,_,g,y,S,T,$,C,O]}class aA extends ge{constructor(e){super(),_e(this,e,rA,oA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function d_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function p_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fA(n){let e,t,i,l,s=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&d_(n),O=n[0].enabled&&p_(),D={};return y=new aA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=K(s),r=M(),a=b("em"),f=K("("),c=K(u),d=K(")"),m=M(),O&&O.c(),h=M(),_=b("button"),_.innerHTML='',g=M(),B(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,f),k(a,c),k(a,d),k(e,m),O&&O.m(e,null),k(e,h),k(e,_),w(I,g,L),z(y,I,L),S=!0,T||($=J(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=d_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&oe(o,s),(!S||L&2)&&u!==(u=I[1].key.slice(0,-4)+"")&&oe(c,u),I[0].enabled?O||(O=p_(),O.c(),O.m(e,h)):O&&(O.d(1),O=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),O&&O.d(),n[4](null),V(y,I),T=!1,$()}}}function uA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0,pkce:l.clientId?l.pkce:null}))};function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{f.detail[i.key]&&t(0,l=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class Qb extends ge{constructor(e){super(),_e(this,e,uA,fA,me,{provider:1,config:0})}}function m_(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function h_(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function cA(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,f,u=ue(n[3]);const c=_=>_[9].key;for(let _=0;_0&&n[2].length>0&&g_(),m=ue(n[2]);const h=_=>_[9].key;for(let _=0;_0&&_[2].length>0?d||(d=g_(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=ue(_[2]),le(),r=at(r,g,h,1,_,m,a,o,Et,b_,null,m_),se())},i(_){if(!f){for(let g=0;gbe(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!l&&u&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function g_(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function b_(n,e){let t,i,l,s,o;function r(f){e[6](f,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new Qb({props:a}),ee.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!l&&u&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function pA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;const _=[dA,cA],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("div"),u=b("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","m-b-base"),p(f,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,f),k(f,u),k(f,c),g[d].m(f,null),h=!0},p(S,T){(!h||T&16)&&oe(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(le(),A(g[$],1,1,()=>{g[$]=null}),se(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(f,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function mA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[pA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function hA(n,e,t){let i,l,s;Ue(n,It,d=>t(4,s=d)),xt(It,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ae.settings.getAll()||{};f(d)}catch(d){ae.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of go)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function u(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=go.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=go.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,u,c]}class _A extends ge{constructor(e){super(),_e(this,e,hA,mA,me,{})}}function gA(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=K(n[3]),i=K(" duration (in seconds)"),s=M(),o=b("input"),a=M(),f=b("div"),u=b("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),x(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),re(o,n[0]),w(m,a,h),w(m,f,h),k(f,u),c||(d=[J(o,"input",n[4]),J(u,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&it(o.value)!==m[0]&&re(o,m[0]),h&2&&x(u,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(f)),c=!1,$e(d)}}}function bA(n){let e,t;return e=new ce({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[gA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function kA(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=it(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,l=f.label),"duration"in f&&t(0,s=f.duration),"secret"in f&&t(1,o=f.secret)},[s,o,i,l,r,a]}class xb extends ge{constructor(e){super(),_e(this,e,kA,bA,me,{key:2,label:3,duration:0,secret:1})}}function k_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function y_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function yA(n){let e,t,i=[],l=new Map,s,o,r,a,f,u=[],c=new Map,d,m,h,_,g,y,S,T,$,C,O,D=ue(n[5]);const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nbe(i,"duration",r)),ee.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function w_(n,e){let t,i,l,s,o;function r(u){e[13](u,e[19])}function a(u){e[14](u,e[19])}let f={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(f.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(f.secret=e[0][e[19].key].secret),i=new xb({props:f}),ee.push(()=>be(i,"duration",r)),ee.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function S_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function wA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[vA,yA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content m-b-sm txt-xl"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[7])),_=!0)},p($,C){(!h||C&16)&&oe(o,$[4]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function SA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[wA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function $A(n,e,t){let i,l,s;Ue(n,It,O=>t(4,s=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(It,s="Token options",s);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const O=await ae.settings.getAll()||{};h(O)}catch(O){ae.error(O)}t(1,u=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const O=await ae.settings.update(j.filterRedactedProps(f));h(O),Lt("Successfully saved tokens options.")}catch(O){ae.error(O)}t(2,c=!1)}}function h(O){var I;O=O||{},t(0,f={});const D=o.concat(r);for(const L of D)t(0,f[L.key]={duration:((I=O[L.key])==null?void 0:I.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function g(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function y(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}function S(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function T(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(f))},[f,u,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class TA extends ge{constructor(e){super(),_e(this,e,$A,SA,me,{})}}function $_(n,e,t){const i=n.slice();return i[22]=e[t],i}function CA(n){let e,t,i,l,s,o,r,a=[],f=new Map,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F,N;o=new ce({props:{class:"form-field",$$slots:{default:[MA,({uniqueId:H})=>({12:H}),({uniqueId:H})=>H?4096:0]},$$scope:{ctx:n}}});let P=ue(n[0]);const q=H=>H[22].id;for(let H=0;HBelow you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=M(),i=b("div"),l=b("div"),s=b("div"),B(o.$$.fragment),r=M();for(let H=0;H({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),l=M(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),z(i,t,null),k(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function EA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[OA,CA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y&128)&&oe(o,g[7]);let S=u;u=_(g),u===S?h[u].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function IA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[EA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function AA(n,e,t){let i,l,s,o;Ue(n,It,L=>t(7,o=L)),xt(It,o="Export collections",o);const r="export_"+j.randomString(5);let a,f=[],u={},c=!1;d();async function d(){t(4,c=!0);try{t(0,f=await ae.collections.getFullList({batch:100,$cancelKey:r})),t(0,f=j.sortCollections(f));for(let L of f)delete L.created,delete L.updated;y()}catch(L){ae.error(L)}t(4,c=!1)}function m(){j.downloadJson(Object.values(u),"pb_schema")}function h(){j.copyToClipboard(i),$o("The configuration was copied to your clipboard!",3e3)}function _(){s?g():y()}function g(){t(1,u={})}function y(){t(1,u={});for(const L of f)t(1,u[L.id]=L,u)}function S(L){u[L.id]?delete u[L.id]:t(1,u[L.id]=L,u),t(1,u)}const T=()=>_(),$=L=>S(L),C=()=>h();function O(L){ee[L?"unshift":"push"](()=>{a=L,t(3,a)})}const D=L=>{if(L.ctrlKey&&L.code==="KeyA"){L.preventDefault();const R=window.getSelection(),F=document.createRange();F.selectNodeContents(a),R.removeAllRanges(),R.addRange(F)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(u),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(u).length),n.$$.dirty&5&&t(5,s=f.length&&l===f.length)},[f,u,l,a,c,s,i,o,m,h,_,S,r,T,$,C,O,D,I]}class LA extends ge{constructor(e){super(),_e(this,e,AA,IA,me,{})}}function C_(n,e,t){const i=n.slice();return i[14]=e[t],i}function O_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function M_(n,e,t){const i=n.slice();return i[14]=e[t],i}function D_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function E_(n,e,t){const i=n.slice();return i[14]=e[t],i}function I_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function A_(n,e,t){const i=n.slice();return i[30]=e[t],i}function NA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&L_(),a=n[0].name!==n[1].name&&N_(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=K(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(f,u){f[9]?r||(r=L_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].name!==f[1].name?a?a.p(f,u):(a=N_(f),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[0]&2&&s!==(s=f[1].name+"")&&oe(o,s)},d(f){f&&v(e),r&&r.d(),a&&a.d()}}}function PA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&1&&l!==(l=((f=r[0])==null?void 0:f.name)+"")&&oe(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function FA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&2&&l!==(l=((f=r[1])==null?void 0:f.name)+"")&&oe(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function L_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function N_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=K(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&oe(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function P_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,f,u,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=K(r),f=M(),u=b("td"),c=b("pre"),m=K(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&hn((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(u,"class","svelte-lmkr38"),x(u,"changed-new-col",!n[5]&&hn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(u,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",hn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,u),k(u,c),k(c,m)},p(g,y){var S,T,$,C,O,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&oe(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&hn((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&oe(m,d),y[0]&2083&&x(u,"changed-new-col",!g[5]&&hn((O=g[0])==null?void 0:O[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(u,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",hn((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function F_(n){let e,t=ue(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let $=0;$!["schema","created","updated"].includes(y));function _(){t(4,u=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,u=u.concat(f.filter(y=>!u.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=f.filter(y=>!u.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=u.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=u.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,s,l,h,g]}class jA extends ge{constructor(e){super(),_e(this,e,qA,RA,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function U_(n,e,t){const i=n.slice();return i[17]=e[t],i}function W_(n){let e,t;return e=new jA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function HA(n){let e,t,i=ue(n[2]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function GI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&u_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=u_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(le(),A(t,1,1,()=>{t=null}),se())},d(l){l&&v(e),t&&t.d(l)}}}function c_(n){let e;function t(s,o){return s[4]?xI:s[5]?QI:XI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function XI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function QI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function xI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function d_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function eA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[ZI,JI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

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

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

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[16])),_=!0)},p($,C){(!h||C&128)&&oe(o,$[7]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function tA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[eA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const nA="s3_test_request";function iA(n,e,t){let i,l,s;We(n,It,O=>t(7,s=O)),xt(It,s="Files storage",s);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await ae.settings.getAll()||{};h(O)}catch(O){ae.error(O)}t(2,a=!1)}async function m(){if(!(f||!l)){t(3,f=!0);try{ae.cancelRequest(nA);const O=await ae.settings.update(j.filterRedactedProps(r));Jt({}),await h(O),Ta(),c?rv("Successfully saved but failed to establish S3 connection."):Lt("Successfully saved files storage settings.")}catch(O){ae.error(O)}t(3,f=!1)}}async function h(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){u=O,t(4,u)}function S(O){c=O,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,f,u,c,l,s,m,_,i,g,y,S,T,$,C]}class lA extends ge{constructor(e){super(),_e(this,e,iA,tA,me,{})}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&2&&(e.checked=f[1].enabled),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function oA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[1].clientId),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&1048576&&i!==(i=u[20])&&p(e,"for",i),c&1048576&&o!==(o=u[20])&&p(s,"id",o),c&2&&r!==(r=u[1].enabled)&&(s.required=r),c&2&&s.value!==u[1].clientId&&re(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function rA(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(f.value=n[1].clientSecret),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),c&2&&(d.required=u[1].enabled),!o&&c&2&&(o=!0,d.value=u[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function p_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(f){n[14](f)}var r=n[3].optionsComponent;function a(f,u){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(f,u){w(f,e,u),t&&z(t,e,null),l=!0},p(f,u){if(u&8&&r!==(r=f[3].optionsComponent)){if(t){le();const c=t;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}r?(t=Dt(r,a(f,u)),ee.push(()=>be(t,"config",o)),B(t.$$.fragment),E(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=u&8?pt(s,[{key:f[3].key},Ot(f[3].optionsComponentProps||{})]):{};!i&&u&2&&(i=!0,c.config=f[1],ke(()=>i=!1)),t.$set(c)}},i(f){l||(t&&E(t.$$.fragment,f),l=!0)},o(f){t&&A(t.$$.fragment,f),l=!1},d(f){f&&v(e),t&&V(t)}}}function aA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[sA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[oA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[rA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&p_(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(t,l),k(t,s),k(e,o),z(r,e,null),k(e,a),z(f,e,null),k(e,u),h&&h.m(e,null),c=!0,d||(m=[J(s,"click",n[8]),J(e,"submit",Be(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=p_(_),h.c(),E(h,1),h.m(e,null)):h&&(le(),A(h,1,1,()=>{h=null}),se())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(f.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(f.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),V(i),V(r),V(f),h&&h.d(),d=!1,$e(m)}}}function fA(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=K(t),l=K(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&oe(i,t)},d(s){s&&v(e)}}}function uA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function cA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[uA],header:[fA],default:[aA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function dA(n,e,t){let i;const l=lt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},f=!1,u="";function c(D,I){Jt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,u=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,f=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await ae.settings.update(D);Jt({}),Lt("Successfully updated provider settings."),l("submit",I),d()}catch(D){ae.error(D)}t(4,f=!1)}function h(){var D;for(let I in a)t(1,a[I]=j.zeroValue(a[I]),a);(D=r.key)!=null&&D.startsWith("oidc")?t(1,a.pkce=!1,a):t(1,a.pkce=null,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){ee[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,s,m,h,c,u,_,g,y,S,T,$,C,O]}class pA extends ge{constructor(e){super(),_e(this,e,dA,cA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function m_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function h_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mA(n){let e,t,i,l,s=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&m_(n),O=n[0].enabled&&h_(),D={};return y=new pA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=K(s),r=M(),a=b("em"),f=K("("),c=K(u),d=K(")"),m=M(),O&&O.c(),h=M(),_=b("button"),_.innerHTML='',g=M(),B(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,f),k(a,c),k(a,d),k(e,m),O&&O.m(e,null),k(e,h),k(e,_),w(I,g,L),z(y,I,L),S=!0,T||($=J(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=m_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&oe(o,s),(!S||L&2)&&u!==(u=I[1].key.slice(0,-4)+"")&&oe(c,u),I[0].enabled?O||(O=h_(),O.c(),O.m(e,h)):O&&(O.d(1),O=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),O&&O.d(),n[4](null),V(y,I),T=!1,$()}}}function hA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0,pkce:l.clientId?l.pkce:null}))};function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{f.detail[i.key]&&t(0,l=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class t0 extends ge{constructor(e){super(),_e(this,e,hA,mA,me,{provider:1,config:0})}}function __(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function g_(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function _A(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,f,u=ue(n[3]);const c=_=>_[9].key;for(let _=0;_0&&n[2].length>0&&k_(),m=ue(n[2]);const h=_=>_[9].key;for(let _=0;_0&&_[2].length>0?d||(d=k_(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=ue(_[2]),le(),r=at(r,g,h,1,_,m,a,o,Et,y_,null,__),se())},i(_){if(!f){for(let g=0;gbe(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!l&&u&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function k_(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function y_(n,e){let t,i,l,s,o;function r(f){e[6](f,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new t0({props:a}),ee.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!l&&u&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function bA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;const _=[gA,_A],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("div"),u=b("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","m-b-base"),p(f,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,f),k(f,u),k(f,c),g[d].m(f,null),h=!0},p(S,T){(!h||T&16)&&oe(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(le(),A(g[$],1,1,()=>{g[$]=null}),se(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(f,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function kA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[bA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function yA(n,e,t){let i,l,s;We(n,It,d=>t(4,s=d)),xt(It,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ae.settings.getAll()||{};f(d)}catch(d){ae.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of ko)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function u(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=ko.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=ko.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,u,c]}class vA extends ge{constructor(e){super(),_e(this,e,yA,kA,me,{})}}function wA(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=K(n[3]),i=K(" duration (in seconds)"),s=M(),o=b("input"),a=M(),f=b("div"),u=b("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),x(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),re(o,n[0]),w(m,a,h),w(m,f,h),k(f,u),c||(d=[J(o,"input",n[4]),J(u,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&it(o.value)!==m[0]&&re(o,m[0]),h&2&&x(u,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(f)),c=!1,$e(d)}}}function SA(n){let e,t;return e=new ce({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[wA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $A(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=it(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,l=f.label),"duration"in f&&t(0,s=f.duration),"secret"in f&&t(1,o=f.secret)},[s,o,i,l,r,a]}class n0 extends ge{constructor(e){super(),_e(this,e,$A,SA,me,{key:2,label:3,duration:0,secret:1})}}function v_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function w_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function TA(n){let e,t,i=[],l=new Map,s,o,r,a,f,u=[],c=new Map,d,m,h,_,g,y,S,T,$,C,O,D=ue(n[5]);const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nbe(i,"duration",r)),ee.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function $_(n,e){let t,i,l,s,o;function r(u){e[13](u,e[19])}function a(u){e[14](u,e[19])}let f={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(f.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(f.secret=e[0][e[19].key].secret),i=new n0({props:f}),ee.push(()=>be(i,"duration",r)),ee.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function T_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function OA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[CA,TA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content m-b-sm txt-xl"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[7])),_=!0)},p($,C){(!h||C&16)&&oe(o,$[4]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function MA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[OA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function DA(n,e,t){let i,l,s;We(n,It,O=>t(4,s=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(It,s="Token options",s);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const O=await ae.settings.getAll()||{};h(O)}catch(O){ae.error(O)}t(1,u=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const O=await ae.settings.update(j.filterRedactedProps(f));h(O),Lt("Successfully saved tokens options.")}catch(O){ae.error(O)}t(2,c=!1)}}function h(O){var I;O=O||{},t(0,f={});const D=o.concat(r);for(const L of D)t(0,f[L.key]={duration:((I=O[L.key])==null?void 0:I.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function g(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function y(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}function S(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function T(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(f))},[f,u,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class EA extends ge{constructor(e){super(),_e(this,e,DA,MA,me,{})}}function C_(n,e,t){const i=n.slice();return i[22]=e[t],i}function IA(n){let e,t,i,l,s,o,r,a=[],f=new Map,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F,N;o=new ce({props:{class:"form-field",$$slots:{default:[LA,({uniqueId:H})=>({12:H}),({uniqueId:H})=>H?4096:0]},$$scope:{ctx:n}}});let P=ue(n[0]);const q=H=>H[22].id;for(let H=0;HBelow you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=M(),i=b("div"),l=b("div"),s=b("div"),B(o.$$.fragment),r=M();for(let H=0;H({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),l=M(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),z(i,t,null),k(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function PA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[AA,IA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y&128)&&oe(o,g[7]);let S=u;u=_(g),u===S?h[u].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function FA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function RA(n,e,t){let i,l,s,o;We(n,It,L=>t(7,o=L)),xt(It,o="Export collections",o);const r="export_"+j.randomString(5);let a,f=[],u={},c=!1;d();async function d(){t(4,c=!0);try{t(0,f=await ae.collections.getFullList({batch:100,$cancelKey:r})),t(0,f=j.sortCollections(f));for(let L of f)delete L.created,delete L.updated;y()}catch(L){ae.error(L)}t(4,c=!1)}function m(){j.downloadJson(Object.values(u),"pb_schema")}function h(){j.copyToClipboard(i),Co("The configuration was copied to your clipboard!",3e3)}function _(){s?g():y()}function g(){t(1,u={})}function y(){t(1,u={});for(const L of f)t(1,u[L.id]=L,u)}function S(L){u[L.id]?delete u[L.id]:t(1,u[L.id]=L,u),t(1,u)}const T=()=>_(),$=L=>S(L),C=()=>h();function O(L){ee[L?"unshift":"push"](()=>{a=L,t(3,a)})}const D=L=>{if(L.ctrlKey&&L.code==="KeyA"){L.preventDefault();const R=window.getSelection(),F=document.createRange();F.selectNodeContents(a),R.removeAllRanges(),R.addRange(F)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(u),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(u).length),n.$$.dirty&5&&t(5,s=f.length&&l===f.length)},[f,u,l,a,c,s,i,o,m,h,_,S,r,T,$,C,O,D,I]}class qA extends ge{constructor(e){super(),_e(this,e,RA,FA,me,{})}}function M_(n,e,t){const i=n.slice();return i[14]=e[t],i}function D_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function E_(n,e,t){const i=n.slice();return i[14]=e[t],i}function I_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function A_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function N_(n,e,t){const i=n.slice();return i[30]=e[t],i}function jA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&P_(),a=n[0].name!==n[1].name&&F_(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=K(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(f,u){f[9]?r||(r=P_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].name!==f[1].name?a?a.p(f,u):(a=F_(f),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[0]&2&&s!==(s=f[1].name+"")&&oe(o,s)},d(f){f&&v(e),r&&r.d(),a&&a.d()}}}function HA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&1&&l!==(l=((f=r[0])==null?void 0:f.name)+"")&&oe(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function zA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&2&&l!==(l=((f=r[1])==null?void 0:f.name)+"")&&oe(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function P_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function F_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=K(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&oe(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function R_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,f,u,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=K(r),f=M(),u=b("td"),c=b("pre"),m=K(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&hn((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(u,"class","svelte-lmkr38"),x(u,"changed-new-col",!n[5]&&hn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(u,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",hn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,u),k(u,c),k(c,m)},p(g,y){var S,T,$,C,O,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&oe(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&hn((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&oe(m,d),y[0]&2083&&x(u,"changed-new-col",!g[5]&&hn((O=g[0])==null?void 0:O[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(u,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",hn((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function q_(n){let e,t=ue(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let $=0;$!["schema","created","updated"].includes(y));function _(){t(4,u=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,u=u.concat(f.filter(y=>!u.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=f.filter(y=>!u.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=u.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=u.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,s,l,h,g]}class UA extends ge{constructor(e){super(),_e(this,e,BA,VA,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Y_(n,e,t){const i=n.slice();return i[17]=e[t],i}function K_(n){let e,t;return e=new UA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function WA(n){let e,t,i=ue(n[2]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await ae.collections.import(o,a),Lt("Successfully imported collections configuration."),i("submit")}catch($){ae.error($)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function y($){ee[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,y,S,T]}class WA extends ge{constructor(e){super(),_e(this,e,UA,BA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Y_(n,e,t){const i=n.slice();return i[33]=e[t],i}function K_(n,e,t){const i=n.slice();return i[36]=e[t],i}function J_(n,e,t){const i=n.slice();return i[33]=e[t],i}function YA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[JA,({uniqueId:H})=>({41:H}),({uniqueId:H})=>[0,H?1024:0]]},$$scope:{ctx:n}}});let L=n[1].length&&G_(n),R=!1,F=n[6]&&n[1].length&&!n[7]&&X_(),N=n[6]&&n[1].length&&n[7]&&Q_(n),P=n[13].length&&fg(n),q=!!n[0]&&ug(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=K(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),f=M(),L&&L.c(),u=M(),c=M(),F&&F.c(),d=M(),N&&N.c(),m=M(),P&&P.c(),h=M(),_=b("div"),q&&q.c(),g=M(),y=b("div"),S=M(),T=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p($,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-expanded btn-warning m-l-auto"),T.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(H,W){w(H,e,W),n[21](e),w(H,t,W),w(H,i,W),k(i,l),k(l,s),k(l,o),w(H,r,W),z(a,H,W),w(H,f,W),L&&L.m(H,W),w(H,u,W),w(H,c,W),F&&F.m(H,W),w(H,d,W),N&&N.m(H,W),w(H,m,W),P&&P.m(H,W),w(H,h,W),w(H,_,W),q&&q.m(_,null),k(_,g),k(_,y),k(_,S),k(_,T),k(T,$),O=!0,D||(I=[J(e,"change",n[22]),J(o,"click",n[23]),J(T,"click",n[19])],D=!0)},p(H,W){(!O||W[0]&4096)&&x(o,"btn-loading",H[12]);const G={};W[0]&64&&(G.class="form-field "+(H[6]?"":"field-error")),W[0]&65|W[1]&3072&&(G.$$scope={dirty:W,ctx:H}),a.$set(G),H[1].length?L?(L.p(H,W),W[0]&2&&E(L,1)):(L=G_(H),L.c(),E(L,1),L.m(u.parentNode,u)):L&&(le(),A(L,1,1,()=>{L=null}),se()),H[6]&&H[1].length&&!H[7]?F||(F=X_(),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),H[6]&&H[1].length&&H[7]?N?N.p(H,W):(N=Q_(H),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),H[13].length?P?P.p(H,W):(P=fg(H),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),H[0]?q?q.p(H,W):(q=ug(H),q.c(),q.m(_,g)):q&&(q.d(1),q=null),(!O||W[0]&16384&&C!==(C=!H[14]))&&(T.disabled=C)},i(H){O||(E(a.$$.fragment,H),E(L),E(R),O=!0)},o(H){A(a.$$.fragment,H),A(L),A(R),O=!1},d(H){H&&(v(e),v(t),v(i),v(r),v(f),v(u),v(c),v(d),v(m),v(h),v(_)),n[21](null),V(a,H),L&&L.d(H),F&&F.d(H),N&&N.d(H),P&&P.d(H),q&&q.d(),D=!1,$e(I)}}}function KA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Z_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function JA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&Z_();return{c(){e=b("label"),t=K("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ye(),p(e,"for",i=n[41]),p(e,"class","p-b-10"),p(s,"id",o=n[41]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=J(s,"input",n[24]),f=!0)},p(d,m){m[1]&1024&&i!==(i=d[41])&&p(e,"for",i),m[1]&1024&&o!==(o=d[41])&&p(s,"id",o),m[0]&1&&re(s,d[0]),d[0]&&!d[6]?c||(c=Z_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),f=!1,u()}}}function G_(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[ZA,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&3072&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ZA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[41]),e.disabled=i=!n[6],p(s,"for",r=n[41])},m(u,c){w(u,e,c),e.checked=n[5],w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[25]),a=!0)},p(u,c){c[1]&1024&&t!==(t=u[41])&&p(e,"id",t),c[0]&64&&i!==(i=!u[6])&&(e.disabled=i),c[0]&32&&(e.checked=u[5]),c[1]&1024&&r!==(r=u[41])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function X_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Q_(n){let e,t,i,l,s,o=n[9].length&&x_(n),r=n[3].length&&ng(n),a=n[8].length&&og(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),o&&o.m(i,null),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=x_(f),o.c(),o.m(i,l)):o&&(o.d(1),o=null),f[3].length?r?r.p(f,u):(r=ng(f),r.c(),r.m(i,s)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=og(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function x_(n){let e=[],t=new Map,i,l=ue(n[9]);const s=o=>o[33].id;for(let o=0;oo[36].old.id+o[36].new.id;for(let o=0;oo[33].id;for(let o=0;o',i=M(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await ae.collections.import(o,a),Lt("Successfully imported collections configuration."),i("submit")}catch($){ae.error($)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function y($){ee[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,y,S,T]}class GA extends ge{constructor(e){super(),_e(this,e,ZA,JA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function J_(n,e,t){const i=n.slice();return i[33]=e[t],i}function Z_(n,e,t){const i=n.slice();return i[36]=e[t],i}function G_(n,e,t){const i=n.slice();return i[33]=e[t],i}function XA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[xA,({uniqueId:H})=>({41:H}),({uniqueId:H})=>[0,H?1024:0]]},$$scope:{ctx:n}}});let L=n[1].length&&Q_(n),R=!1,F=n[6]&&n[1].length&&!n[7]&&x_(),N=n[6]&&n[1].length&&n[7]&&eg(n),P=n[13].length&&cg(n),q=!!n[0]&&dg(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=K(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),f=M(),L&&L.c(),u=M(),c=M(),F&&F.c(),d=M(),N&&N.c(),m=M(),P&&P.c(),h=M(),_=b("div"),q&&q.c(),g=M(),y=b("div"),S=M(),T=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p($,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-expanded btn-warning m-l-auto"),T.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(H,W){w(H,e,W),n[21](e),w(H,t,W),w(H,i,W),k(i,l),k(l,s),k(l,o),w(H,r,W),z(a,H,W),w(H,f,W),L&&L.m(H,W),w(H,u,W),w(H,c,W),F&&F.m(H,W),w(H,d,W),N&&N.m(H,W),w(H,m,W),P&&P.m(H,W),w(H,h,W),w(H,_,W),q&&q.m(_,null),k(_,g),k(_,y),k(_,S),k(_,T),k(T,$),O=!0,D||(I=[J(e,"change",n[22]),J(o,"click",n[23]),J(T,"click",n[19])],D=!0)},p(H,W){(!O||W[0]&4096)&&x(o,"btn-loading",H[12]);const G={};W[0]&64&&(G.class="form-field "+(H[6]?"":"field-error")),W[0]&65|W[1]&3072&&(G.$$scope={dirty:W,ctx:H}),a.$set(G),H[1].length?L?(L.p(H,W),W[0]&2&&E(L,1)):(L=Q_(H),L.c(),E(L,1),L.m(u.parentNode,u)):L&&(le(),A(L,1,1,()=>{L=null}),se()),H[6]&&H[1].length&&!H[7]?F||(F=x_(),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),H[6]&&H[1].length&&H[7]?N?N.p(H,W):(N=eg(H),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),H[13].length?P?P.p(H,W):(P=cg(H),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),H[0]?q?q.p(H,W):(q=dg(H),q.c(),q.m(_,g)):q&&(q.d(1),q=null),(!O||W[0]&16384&&C!==(C=!H[14]))&&(T.disabled=C)},i(H){O||(E(a.$$.fragment,H),E(L),E(R),O=!0)},o(H){A(a.$$.fragment,H),A(L),A(R),O=!1},d(H){H&&(v(e),v(t),v(i),v(r),v(f),v(u),v(c),v(d),v(m),v(h),v(_)),n[21](null),V(a,H),L&&L.d(H),F&&F.d(H),N&&N.d(H),P&&P.d(H),q&&q.d(),D=!1,$e(I)}}}function QA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function X_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&X_();return{c(){e=b("label"),t=K("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ye(),p(e,"for",i=n[41]),p(e,"class","p-b-10"),p(s,"id",o=n[41]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=J(s,"input",n[24]),f=!0)},p(d,m){m[1]&1024&&i!==(i=d[41])&&p(e,"for",i),m[1]&1024&&o!==(o=d[41])&&p(s,"id",o),m[0]&1&&re(s,d[0]),d[0]&&!d[6]?c||(c=X_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),f=!1,u()}}}function Q_(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[e7,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&3072&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function e7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[41]),e.disabled=i=!n[6],p(s,"for",r=n[41])},m(u,c){w(u,e,c),e.checked=n[5],w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[25]),a=!0)},p(u,c){c[1]&1024&&t!==(t=u[41])&&p(e,"id",t),c[0]&64&&i!==(i=!u[6])&&(e.disabled=i),c[0]&32&&(e.checked=u[5]),c[1]&1024&&r!==(r=u[41])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function eg(n){let e,t,i,l,s,o=n[9].length&&tg(n),r=n[3].length&&lg(n),a=n[8].length&&ag(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),o&&o.m(i,null),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=tg(f),o.c(),o.m(i,l)):o&&(o.d(1),o=null),f[3].length?r?r.p(f,u):(r=lg(f),r.c(),r.m(i,s)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=ag(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function tg(n){let e=[],t=new Map,i,l=ue(n[9]);const s=o=>o[33].id;for(let o=0;oo[36].old.id+o[36].new.id;for(let o=0;oo[33].id;for(let o=0;o',i=M(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=J(o,"click",n[27]),r=!0)},p:Q,d(f){f&&v(e),r=!1,a()}}}function ug(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[28]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function GA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[KA,YA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[15]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y[0]&32768)&&oe(o,g[15]);let S=u;u=_(g),u===S?h[u].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function XA(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[GA]},$$scope:{ctx:n}}});let r={};return s=new WA({props:r}),n[29](s),s.$on("submit",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&63487|f[1]&2048&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[29](null),V(s,a)}}}function QA(n,e,t){let i,l,s,o,r,a,f;Ue(n,It,ie=>t(15,f=ie)),xt(It,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1,T=!1;$();async function $(){t(4,S=!0);try{t(20,_=await ae.collections.getFullList(200));for(let ie of _)delete ie.created,delete ie.updated}catch(ie){ae.error(ie)}t(4,S=!1)}function C(){if(t(3,y=[]),!!i)for(let ie of h){const te=j.findByKey(_,"id",ie.id);!(te!=null&&te.id)||!j.hasCollectionChanges(te,ie,g)||y.push({new:ie,old:te})}}function O(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let ie of h)delete ie.created,delete ie.updated,ie.schema=j.filterDuplicatesByKey(ie.schema)}function D(){var ie,te;for(let pe of h){const Ne=j.findByKey(_,"name",pe.name)||j.findByKey(_,"id",pe.id);if(!Ne)continue;const He=pe.id,Xe=Ne.id;pe.id=Xe;const xe=Array.isArray(Ne.schema)?Ne.schema:[],Mt=Array.isArray(pe.schema)?pe.schema:[];for(const ft of Mt){const mt=j.findByKey(xe,"name",ft.name);mt&&mt.id&&(ft.id=mt.id)}for(let ft of h)if(Array.isArray(ft.schema))for(let mt of ft.schema)(ie=mt.options)!=null&&ie.collectionId&&((te=mt.options)==null?void 0:te.collectionId)===He&&(mt.options.collectionId=Xe)}t(0,d=JSON.stringify(h,null,4))}function I(ie){t(12,m=!0);const te=new FileReader;te.onload=async pe=>{t(12,m=!1),t(10,u.value="",u),t(0,d=pe.target.result),await Qt(),h.length||(ii("Invalid collections configuration."),L())},te.onerror=pe=>{console.warn(pe),ii("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},te.readAsText(ie)}function L(){t(0,d=""),t(10,u.value="",u),Jt({})}function R(){const ie=T?j.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,ie,g)}function F(ie){ee[ie?"unshift":"push"](()=>{u=ie,t(10,u)})}const N=()=>{u.files.length&&I(u.files[0])},P=()=>{u.click()};function q(){d=this.value,t(0,d)}function H(){T=this.checked,t(5,T)}function W(){g=this.checked,t(2,g)}const G=()=>D(),U=()=>L();function Y(ie){ee[ie?"unshift":"push"](()=>{c=ie,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==null&&O(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ie=>!!ie.id&&!!ie.name).length),n.$$.dirty[0]&1048678&&t(9,l=_.filter(ie=>i&&!T&&g&&!j.findByKey(h,"id",ie.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(ie=>i&&!j.findByKey(_,"id",ie.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&C(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(ie=>{let te=j.findByKey(_,"name",ie.name)||j.findByKey(_,"id",ie.id);if(!te)return!1;if(te.id!=ie.id)return!0;const pe=Array.isArray(te.schema)?te.schema:[],Ne=Array.isArray(ie.schema)?ie.schema:[];for(const He of Ne){if(j.findByKey(pe,"id",He.id))continue;const xe=j.findByKey(pe,"name",He.name);if(xe&&He.id!=xe.id)return!0}return!1}))},[d,h,g,y,S,T,i,o,s,l,u,c,m,a,r,f,D,I,L,R,_,F,N,P,q,H,W,G,U,Y]}class xA extends ge{constructor(e){super(),_e(this,e,QA,XA,me,{},null,[-1,-1])}}function e7(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[2]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[7]),f=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&re(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function t7(n){let e,t,i,l,s,o,r;return l=new ce({props:{class:"form-field m-0",name:"name",$$slots:{default:[e7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + to.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=J(o,"click",n[27]),r=!0)},p:Q,d(f){f&&v(e),r=!1,a()}}}function dg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[28]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function t7(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[QA,XA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[15]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y[0]&32768)&&oe(o,g[15]);let S=u;u=_(g),u===S?h[u].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function n7(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[t7]},$$scope:{ctx:n}}});let r={};return s=new GA({props:r}),n[29](s),s.$on("submit",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&63487|f[1]&2048&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[29](null),V(s,a)}}}function i7(n,e,t){let i,l,s,o,r,a,f;We(n,It,ie=>t(15,f=ie)),xt(It,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1,T=!1;$();async function $(){t(4,S=!0);try{t(20,_=await ae.collections.getFullList(200));for(let ie of _)delete ie.created,delete ie.updated}catch(ie){ae.error(ie)}t(4,S=!1)}function C(){if(t(3,y=[]),!!i)for(let ie of h){const te=j.findByKey(_,"id",ie.id);!(te!=null&&te.id)||!j.hasCollectionChanges(te,ie,g)||y.push({new:ie,old:te})}}function O(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let ie of h)delete ie.created,delete ie.updated,ie.schema=j.filterDuplicatesByKey(ie.schema)}function D(){var ie,te;for(let pe of h){const Ne=j.findByKey(_,"name",pe.name)||j.findByKey(_,"id",pe.id);if(!Ne)continue;const He=pe.id,Xe=Ne.id;pe.id=Xe;const xe=Array.isArray(Ne.schema)?Ne.schema:[],Mt=Array.isArray(pe.schema)?pe.schema:[];for(const ft of Mt){const ht=j.findByKey(xe,"name",ft.name);ht&&ht.id&&(ft.id=ht.id)}for(let ft of h)if(Array.isArray(ft.schema))for(let ht of ft.schema)(ie=ht.options)!=null&&ie.collectionId&&((te=ht.options)==null?void 0:te.collectionId)===He&&(ht.options.collectionId=Xe)}t(0,d=JSON.stringify(h,null,4))}function I(ie){t(12,m=!0);const te=new FileReader;te.onload=async pe=>{t(12,m=!1),t(10,u.value="",u),t(0,d=pe.target.result),await Qt(),h.length||(ii("Invalid collections configuration."),L())},te.onerror=pe=>{console.warn(pe),ii("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},te.readAsText(ie)}function L(){t(0,d=""),t(10,u.value="",u),Jt({})}function R(){const ie=T?j.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,ie,g)}function F(ie){ee[ie?"unshift":"push"](()=>{u=ie,t(10,u)})}const N=()=>{u.files.length&&I(u.files[0])},P=()=>{u.click()};function q(){d=this.value,t(0,d)}function H(){T=this.checked,t(5,T)}function W(){g=this.checked,t(2,g)}const G=()=>D(),U=()=>L();function Y(ie){ee[ie?"unshift":"push"](()=>{c=ie,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==null&&O(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ie=>!!ie.id&&!!ie.name).length),n.$$.dirty[0]&1048678&&t(9,l=_.filter(ie=>i&&!T&&g&&!j.findByKey(h,"id",ie.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(ie=>i&&!j.findByKey(_,"id",ie.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&C(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(ie=>{let te=j.findByKey(_,"name",ie.name)||j.findByKey(_,"id",ie.id);if(!te)return!1;if(te.id!=ie.id)return!0;const pe=Array.isArray(te.schema)?te.schema:[],Ne=Array.isArray(ie.schema)?ie.schema:[];for(const He of Ne){if(j.findByKey(pe,"id",He.id))continue;const xe=j.findByKey(pe,"name",He.name);if(xe&&He.id!=xe.id)return!0}return!1}))},[d,h,g,y,S,T,i,o,s,l,u,c,m,a,r,f,D,I,L,R,_,F,N,P,q,H,W,G,U,Y]}class l7 extends ge{constructor(e){super(),_e(this,e,i7,n7,me,{},null,[-1,-1])}}function s7(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[2]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[7]),f=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&re(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function o7(n){let e,t,i,l,s,o,r;return l=new ce({props:{class:"form-field m-0",name:"name",$$slots:{default:[s7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

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

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

    Please proceed with caution and use it only with trusted backups!

    Backup restore is experimental and works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from + separately since they are not locally stored and will not be included in the final backup!

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

    Please proceed with caution and use it only with trusted backups!

    Backup restore is experimental and works only on UNIX based systems.

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

    This means that on success all of your data (including app settings, users, admins, etc.) will be replaced with the ones from the backup.

    Nothing will happen if the backup is invalid or incompatible (ex. missing data.db file).

    `,t=M(),i=b("div"),l=K(`Type the backup name `),s=b("div"),o=b("span"),r=K(n[1]),a=M(),B(f.$$.fragment),u=K(` - to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),z(f,s,null),k(i,u),w(y,c,S),w(y,d,S),z(m,d,null),h=!0,_||(g=J(d,"submit",Be(n[7])),_=!0)},p(y,S){(!h||S&2)&&oe(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(f.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(f.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),V(f),V(m),_=!1,g()}}}function f7(n){let e,t,i,l;return{c(){e=b("h4"),t=K("Restore "),i=b("strong"),l=K(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&v(e)}}}function u7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function c7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[u7],header:[f7],default:[a7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function d7(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,f=null;function u(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await ae.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(f),T!=null&&T.isAbort||(t(4,a=!1),ii(((S=T.response)==null?void 0:S.message)||T.message))}}}ks(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ee[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ce.call(this,n,S)}function y(S){Ce.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,y]}class p7 extends ge{constructor(e){super(),_e(this,e,d7,c7,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function cg(n,e,t){const i=n.slice();return i[22]=e[t],i}function dg(n,e,t){const i=n.slice();return i[19]=e[t],i}function m7(n){let e=[],t=new Map,i,l,s=ue(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mg(n,e){let t,i,l,s,o,r=e[22].key+"",a,f,u,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G;function U(){return e[10](e[22])}function Y(){return e[11](e[22])}function ie(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=K(r),u=M(),c=b("span"),d=K("("),h=K(m),_=K(")"),g=M(),y=b("div"),S=b("button"),T=b("i"),C=M(),O=b("button"),D=b("i"),L=M(),R=b("button"),F=b("i"),P=M(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",f=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=I=e[6][e[22].key],p(O,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(te,pe){w(te,t,pe),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,O),k(O,D),k(y,L),k(y,R),k(R,F),k(t,P),H=!0,W||(G=[Se(Pe.call(null,S,"Download")),J(S,"click",Be(U)),Se(Pe.call(null,O,"Restore")),J(O,"click",Be(Y)),Se(Pe.call(null,R,"Delete")),J(R,"click",Be(ie))],W=!0)},p(te,pe){e=te,(!H||pe&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!H||pe&8&&f!==(f=e[22].key))&&p(o,"title",f),(!H||pe&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&oe(h,m),(!H||pe&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!H||pe&40)&&x(S,"btn-loading",e[5][e[22].key]),(!H||pe&72&&I!==(I=e[6][e[22].key]))&&(O.disabled=I),(!H||pe&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!H||pe&72)&&x(R,"btn-loading",e[6][e[22].key])},i(te){H||(te&&Ke(()=>{H&&(q||(q=Fe(t,et,{duration:150},!0)),q.run(1))}),H=!0)},o(te){te&&(q||(q=Fe(t,et,{duration:150},!1)),q.run(0)),H=!1},d(te){te&&v(t),te&&q&&q.end(),W=!1,$e(G)}}}function hg(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _7(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function g7(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function b7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;const g=[h7,m7],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?g7:_7}let $=T(n),C=$(n),O={};u=new o7({props:O}),n[14](u),u.$on("submit",n[15]);let D={};return d=new p7({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),f=M(),B(u.$$.fragment),c=M(),B(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,f,L),z(u,I,L),w(I,c,L),z(d,I,L),m=!0,h||(_=J(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(le(),A(y[R],1,1,()=>{y[R]=null}),se(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};u.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(u.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(u.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(f),v(c)),y[i].d(),C.d(),n[14](null),V(u,I),n[16](null),V(d,I),h=!1,_()}}}function k7(n,e,t){let i,l,s=[],o=!1,r={},a={},f=!0;u(),h();async function u(){t(4,o=!0);try{t(3,s=await ae.backups.getFullList()),s.sort((O,D)=>O.modifiedD.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(ae.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const D=await ae.getAdminFileToken(),I=ae.backups.getDownloadUrl(D,O);j.download(I)}catch(D){D.isAbort||ae.error(D)}delete r[O],t(5,r)}}function d(O){fn(`Do you really want to delete ${O}?`,()=>m(O))}async function m(O){if(!a[O]){t(6,a[O]=!0,a);try{await ae.backups.delete(O),j.removeByKey(s,"name",O),u(),Lt(`Successfully deleted ${O}.`)}catch(D){D.isAbort||ae.error(D)}delete a[O],t(6,a)}}async function h(){var O;try{const D=await ae.health.check({$autoCancel:!1}),I=f;t(7,f=((O=D==null?void 0:D.data)==null?void 0:O.canBackup)||!1),I!=f&&f&&u()}catch{}}Ht(()=>{let O=setInterval(()=>{h()},3e3);return()=>{clearInterval(O)}});const _=O=>c(O.key),g=O=>l.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function T(O){ee[O?"unshift":"push"](()=>{i=O,t(1,i)})}const $=()=>{u()};function C(O){ee[O?"unshift":"push"](()=>{l=O,t(2,l)})}return[u,i,l,s,o,r,a,f,c,d,_,g,y,S,T,$,C]}class y7 extends ge{constructor(e){super(),_e(this,e,k7,b7,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function v7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,f){w(a,e,f),k(e,t),w(a,l,f),w(a,s,f),n[5](s),o||(r=[Se(Pe.call(null,e,"Upload backup")),J(e,"click",n[4]),J(s,"change",n[3])],o=!0)},p(a,[f]){f&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),f&5&&x(e,"btn-loading",a[2]),f&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,$e(r)}}}const _g="upload_backup";function w7(n,e,t){const i=lt();let{class:l=""}=e,s,o=!1;async function r(u){var d,m,h,_,g;if(o||!((m=(d=u==null?void 0:u.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",u.target.files[0]);try{await ae.backups.upload(c,{requestKey:_g}),t(2,o=!1),i("success"),Lt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ii(y.response.data.file.message):ae.error(y))}}ks(()=>{ae.cancelRequest(_g)});const a=()=>s==null?void 0:s.click();function f(u){ee[u?"unshift":"push"](()=>{s=u,t(1,s)})}return n.$$set=u=>{"class"in u&&t(0,l=u.class)},[l,s,o,r,a,f]}class S7 extends ge{constructor(e){super(),_e(this,e,w7,v7,me,{class:0})}}function $7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function T7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function gg(n){var H,W,G;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D;t=new ce({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[C7,({uniqueId:U})=>({31:U}),({uniqueId:U})=>[0,U?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&bg(n);function L(U){n[24](U)}function R(U){n[25](U)}function F(U){n[26](U)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(H=n[0].backups)==null?void 0:H.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new Xb({props:N}),ee.push(()=>be(r,"config",L)),ee.push(()=>be(r,"isTesting",R)),ee.push(()=>be(r,"testError",F));let P=((G=(W=n[1].backups)==null?void 0:W.s3)==null?void 0:G.enabled)&&!n[9]&&!n[5]&&kg(n),q=n[9]&&yg(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),I&&I.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),h=M(),P&&P.c(),_=M(),q&&q.c(),g=M(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(U,Y){w(U,e,Y),z(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),z(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,O||(D=[J(y,"click",n[28]),J(e,"submit",Be(n[11]))],O=!0)},p(U,Y){var pe,Ne,He;const ie={};Y[0]&4|Y[1]&3&&(ie.$$scope={dirty:Y,ctx:U}),t.$set(ie),U[2]?I?(I.p(U,Y),Y[0]&4&&E(I,1)):(I=bg(U),I.c(),E(I,1),I.m(e,l)):I&&(le(),A(I,1,1,()=>{I=null}),se());const te={};Y[0]&1&&(te.originalConfig=(pe=U[0].backups)==null?void 0:pe.s3),!a&&Y[0]&2&&(a=!0,te.config=U[1].backups.s3,ke(()=>a=!1)),!f&&Y[0]&128&&(f=!0,te.isTesting=U[7],ke(()=>f=!1)),!u&&Y[0]&256&&(u=!0,te.testError=U[8],ke(()=>u=!1)),r.$set(te),(He=(Ne=U[1].backups)==null?void 0:Ne.s3)!=null&&He.enabled&&!U[9]&&!U[5]?P?P.p(U,Y):(P=kg(U),P.c(),P.m(d,_)):P&&(P.d(1),P=null),U[9]?q?q.p(U,Y):(q=yg(U),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||Y[0]&544&&T!==(T=!U[9]||U[5]))&&(y.disabled=T),(!C||Y[0]&32)&&x(y,"btn-loading",U[5])},i(U){C||(E(t.$$.fragment,U),E(I),E(r.$$.fragment,U),U&&Ke(()=>{C&&($||($=Fe(e,et,{duration:150},!0)),$.run(1))}),C=!0)},o(U){A(t.$$.fragment,U),A(I),A(r.$$.fragment,U),U&&($||($=Fe(e,et,{duration:150},!1)),$.run(0)),C=!1},d(U){U&&v(e),V(t),I&&I.d(),V(r),P&&P.d(),q&&q.d(),U&&$&&$.end(),O=!1,$e(D)}}}function C7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[17]),r=!0)},p(f,u){u[1]&1&&t!==(t=f[31])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&1&&o!==(o=f[31])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function bg(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[M7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[D7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function O7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[19]),J(i,"click",n[20]),J(s,"click",n[21]),J(r,"click",n[22])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function M7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[O7]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=K("Cron expression"),l=M(),s=b("input"),a=M(),f=b("div"),u=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=b("p"),T=K(`Supports numeric list, steps, ranges or + to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),z(f,s,null),k(i,u),w(y,c,S),w(y,d,S),z(m,d,null),h=!0,_||(g=J(d,"submit",Be(n[7])),_=!0)},p(y,S){(!h||S&2)&&oe(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(f.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(f.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),V(f),V(m),_=!1,g()}}}function m7(n){let e,t,i,l;return{c(){e=b("h4"),t=K("Restore "),i=b("strong"),l=K(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&v(e)}}}function h7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function _7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[h7],header:[m7],default:[p7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function g7(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,f=null;function u(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await ae.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(f),T!=null&&T.isAbort||(t(4,a=!1),ii(((S=T.response)==null?void 0:S.message)||T.message))}}}vs(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ee[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ce.call(this,n,S)}function y(S){Ce.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,y]}class b7 extends ge{constructor(e){super(),_e(this,e,g7,_7,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function pg(n,e,t){const i=n.slice();return i[22]=e[t],i}function mg(n,e,t){const i=n.slice();return i[19]=e[t],i}function k7(n){let e=[],t=new Map,i,l,s=ue(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _g(n,e){let t,i,l,s,o,r=e[22].key+"",a,f,u,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G;function U(){return e[10](e[22])}function Y(){return e[11](e[22])}function ie(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=K(r),u=M(),c=b("span"),d=K("("),h=K(m),_=K(")"),g=M(),y=b("div"),S=b("button"),T=b("i"),C=M(),O=b("button"),D=b("i"),L=M(),R=b("button"),F=b("i"),P=M(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",f=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=I=e[6][e[22].key],p(O,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(te,pe){w(te,t,pe),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,O),k(O,D),k(y,L),k(y,R),k(R,F),k(t,P),H=!0,W||(G=[Se(Pe.call(null,S,"Download")),J(S,"click",Be(U)),Se(Pe.call(null,O,"Restore")),J(O,"click",Be(Y)),Se(Pe.call(null,R,"Delete")),J(R,"click",Be(ie))],W=!0)},p(te,pe){e=te,(!H||pe&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!H||pe&8&&f!==(f=e[22].key))&&p(o,"title",f),(!H||pe&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&oe(h,m),(!H||pe&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!H||pe&40)&&x(S,"btn-loading",e[5][e[22].key]),(!H||pe&72&&I!==(I=e[6][e[22].key]))&&(O.disabled=I),(!H||pe&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!H||pe&72)&&x(R,"btn-loading",e[6][e[22].key])},i(te){H||(te&&Ke(()=>{H&&(q||(q=Fe(t,et,{duration:150},!0)),q.run(1))}),H=!0)},o(te){te&&(q||(q=Fe(t,et,{duration:150},!1)),q.run(0)),H=!1},d(te){te&&v(t),te&&q&&q.end(),W=!1,$e(G)}}}function gg(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function v7(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function w7(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function S7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;const g=[y7,k7],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?w7:v7}let $=T(n),C=$(n),O={};u=new c7({props:O}),n[14](u),u.$on("submit",n[15]);let D={};return d=new b7({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),f=M(),B(u.$$.fragment),c=M(),B(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,f,L),z(u,I,L),w(I,c,L),z(d,I,L),m=!0,h||(_=J(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(le(),A(y[R],1,1,()=>{y[R]=null}),se(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};u.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(u.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(u.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(f),v(c)),y[i].d(),C.d(),n[14](null),V(u,I),n[16](null),V(d,I),h=!1,_()}}}function $7(n,e,t){let i,l,s=[],o=!1,r={},a={},f=!0;u(),h();async function u(){t(4,o=!0);try{t(3,s=await ae.backups.getFullList()),s.sort((O,D)=>O.modifiedD.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(ae.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const D=await ae.getAdminFileToken(),I=ae.backups.getDownloadUrl(D,O);j.download(I)}catch(D){D.isAbort||ae.error(D)}delete r[O],t(5,r)}}function d(O){un(`Do you really want to delete ${O}?`,()=>m(O))}async function m(O){if(!a[O]){t(6,a[O]=!0,a);try{await ae.backups.delete(O),j.removeByKey(s,"name",O),u(),Lt(`Successfully deleted ${O}.`)}catch(D){D.isAbort||ae.error(D)}delete a[O],t(6,a)}}async function h(){var O;try{const D=await ae.health.check({$autoCancel:!1}),I=f;t(7,f=((O=D==null?void 0:D.data)==null?void 0:O.canBackup)||!1),I!=f&&f&&u()}catch{}}Ht(()=>{let O=setInterval(()=>{h()},3e3);return()=>{clearInterval(O)}});const _=O=>c(O.key),g=O=>l.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function T(O){ee[O?"unshift":"push"](()=>{i=O,t(1,i)})}const $=()=>{u()};function C(O){ee[O?"unshift":"push"](()=>{l=O,t(2,l)})}return[u,i,l,s,o,r,a,f,c,d,_,g,y,S,T,$,C]}class T7 extends ge{constructor(e){super(),_e(this,e,$7,S7,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function C7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,f){w(a,e,f),k(e,t),w(a,l,f),w(a,s,f),n[5](s),o||(r=[Se(Pe.call(null,e,"Upload backup")),J(e,"click",n[4]),J(s,"change",n[3])],o=!0)},p(a,[f]){f&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),f&5&&x(e,"btn-loading",a[2]),f&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,$e(r)}}}const bg="upload_backup";function O7(n,e,t){const i=lt();let{class:l=""}=e,s,o=!1;async function r(u){var d,m,h,_,g;if(o||!((m=(d=u==null?void 0:u.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",u.target.files[0]);try{await ae.backups.upload(c,{requestKey:bg}),t(2,o=!1),i("success"),Lt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ii(y.response.data.file.message):ae.error(y))}}vs(()=>{ae.cancelRequest(bg)});const a=()=>s==null?void 0:s.click();function f(u){ee[u?"unshift":"push"](()=>{s=u,t(1,s)})}return n.$$set=u=>{"class"in u&&t(0,l=u.class)},[l,s,o,r,a,f]}class M7 extends ge{constructor(e){super(),_e(this,e,O7,C7,me,{class:0})}}function D7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function E7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function kg(n){var H,W,G;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D;t=new ce({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[I7,({uniqueId:U})=>({31:U}),({uniqueId:U})=>[0,U?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&yg(n);function L(U){n[24](U)}function R(U){n[25](U)}function F(U){n[26](U)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(H=n[0].backups)==null?void 0:H.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new e0({props:N}),ee.push(()=>be(r,"config",L)),ee.push(()=>be(r,"isTesting",R)),ee.push(()=>be(r,"testError",F));let P=((G=(W=n[1].backups)==null?void 0:W.s3)==null?void 0:G.enabled)&&!n[9]&&!n[5]&&vg(n),q=n[9]&&wg(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),I&&I.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),h=M(),P&&P.c(),_=M(),q&&q.c(),g=M(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(U,Y){w(U,e,Y),z(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),z(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,O||(D=[J(y,"click",n[28]),J(e,"submit",Be(n[11]))],O=!0)},p(U,Y){var pe,Ne,He;const ie={};Y[0]&4|Y[1]&3&&(ie.$$scope={dirty:Y,ctx:U}),t.$set(ie),U[2]?I?(I.p(U,Y),Y[0]&4&&E(I,1)):(I=yg(U),I.c(),E(I,1),I.m(e,l)):I&&(le(),A(I,1,1,()=>{I=null}),se());const te={};Y[0]&1&&(te.originalConfig=(pe=U[0].backups)==null?void 0:pe.s3),!a&&Y[0]&2&&(a=!0,te.config=U[1].backups.s3,ke(()=>a=!1)),!f&&Y[0]&128&&(f=!0,te.isTesting=U[7],ke(()=>f=!1)),!u&&Y[0]&256&&(u=!0,te.testError=U[8],ke(()=>u=!1)),r.$set(te),(He=(Ne=U[1].backups)==null?void 0:Ne.s3)!=null&&He.enabled&&!U[9]&&!U[5]?P?P.p(U,Y):(P=vg(U),P.c(),P.m(d,_)):P&&(P.d(1),P=null),U[9]?q?q.p(U,Y):(q=wg(U),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||Y[0]&544&&T!==(T=!U[9]||U[5]))&&(y.disabled=T),(!C||Y[0]&32)&&x(y,"btn-loading",U[5])},i(U){C||(E(t.$$.fragment,U),E(I),E(r.$$.fragment,U),U&&Ke(()=>{C&&($||($=Fe(e,et,{duration:150},!0)),$.run(1))}),C=!0)},o(U){A(t.$$.fragment,U),A(I),A(r.$$.fragment,U),U&&($||($=Fe(e,et,{duration:150},!1)),$.run(0)),C=!1},d(U){U&&v(e),V(t),I&&I.d(),V(r),P&&P.d(),q&&q.d(),U&&$&&$.end(),O=!1,$e(D)}}}function I7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[17]),r=!0)},p(f,u){u[1]&1&&t!==(t=f[31])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&1&&o!==(o=f[31])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function yg(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[L7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[N7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function A7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[19]),J(i,"click",n[20]),J(s,"click",n[21]),J(r,"click",n[22])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function L7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[A7]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=K("Cron expression"),l=M(),s=b("input"),a=M(),f=b("div"),u=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=b("p"),T=K(`Supports numeric list, steps, ranges or `),$=b("span"),$.textContent="macros",C=K(`. `),O=b("br"),D=K(` The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((N=(F=n[0])==null?void 0:F.backups)!=null&&N.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(u,"type","button"),p(u,"class","btn btn-sm btn-outline p-r-0"),p(f,"class","form-field-addon"),p($,"class","link-primary"),p(y,"class","help-block")},m(F,N){var P,q;w(F,e,N),k(e,t),w(F,l,N),w(F,s,N),re(s,n[1].backups.cron),w(F,a,N),w(F,f,N),k(f,u),k(u,c),k(u,d),k(u,m),k(u,h),z(_,u,null),w(F,g,N),w(F,y,N),k(y,S),k(S,T),k(S,$),k(S,C),k(S,O),k(S,D),I=!0,(q=(P=n[0])==null?void 0:P.backups)!=null&&q.cron||s.focus(),L||(R=[J(s,"input",n[18]),Se(Pe.call(null,$,`@yearly @@ -149,4 +149,4 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t @weekly @daily @midnight -@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function D7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function kg(n){let e;function t(s,o){return s[7]?A7:s[8]?I7:E7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function E7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function I7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function A7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function L7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Zo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new S7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new y7({props:N}),n[15](y);function P(G,U){return G[6]?T7:$7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&gg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=gg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function N7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[L7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function P7(n,e,t){let i,l;Ue(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class F7 extends ge{constructor(e){super(),_e(this,e,P7,N7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],R7={"/login":At({component:FE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-vLynAsfN.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-vRRTYNd2.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:iE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:n$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:WE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:EE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:AI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:xI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:_A,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:TA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:LA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:xA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:F7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-Bjhn5ho5.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-Bjhn5ho5.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-D66thJgG.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-D66thJgG.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B7npCYXU.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B7npCYXU.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-BusSuTAQ.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-B-zxwuJd.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Mv,userData:{showAppSidebar:!1}})};function q7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Jo}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function vg(n,e,t){const i=n.slice();return i[2]=e[t],i}function j7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function H7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function z7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function V7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wg(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?V7:O[2].type==="success"?z7:O[2].type==="warning"?H7:j7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){S0(t),h(),Ag(t,m)},a(){h(),h=w0(t,m,q7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Pg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ca(t,rs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function B7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>W1(s)]}class W7 extends ge{constructor(e){super(),_e(this,e,U7,B7,me,{})}}function Y7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function K7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function J7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[K7],header:[Y7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function Z7(n,e,t){let i;Ue(n,za,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),zb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function Sg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[X7]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(nn.call(null,t)),Se(nn.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(nn.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(nn.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function X7(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(nn.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function $g(n){let e,t,i;return t=new Wa({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Q7(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Sg(n);o=new R0({props:{routes:R7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new W7({}),u=new G7({});let _=n[1]&&!n[2]&&$g(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Sg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=$g(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function x7(n,e,t){let i,l,s,o;Ue(n,Xi,_=>t(10,i=_)),Ue(n,Oo,_=>t(3,l=_)),Ue(n,$a,_=>t(0,s=_)),Ue(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),zb())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Oo,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class eL extends ge{constructor(e){super(),_e(this,e,x7,Q7,me,{})}}new eL({target:document.getElementById("app")});export{ae as A,Lt as B,j as C,tl as D,ye as E,Z1 as F,Ho as G,so as H,Ht as I,Ue as J,Rn as K,lt as L,ee as M,Rb as N,ue as O,at as P,Ii as Q,Et as R,ge as S,ot as T,b0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,nn as l,z as m,se as n,v as o,ce as p,x as q,J as r,me as s,E as t,Be as u,K as v,oe as w,Q as x,re as y,$e as z}; +@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function N7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vg(n){let e;function t(s,o){return s[7]?R7:s[8]?F7:P7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function P7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function F7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function R7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function q7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new M7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new T7({props:N}),n[15](y);function P(G,U){return G[6]?E7:D7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&kg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=kg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function j7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function H7(n,e,t){let i,l;We(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class z7 extends ge{constructor(e){super(),_e(this,e,H7,j7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],V7={"/login":At({component:zE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-DnoMIZGu.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-C5ZKwumu.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:aE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:r$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:GE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:PE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:RI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:lA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:vA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:EA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:qA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:l7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:z7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-CP5c1DP1.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-CP5c1DP1.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CfCN5jko.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CfCN5jko.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-D9_-dnhk.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-D9_-dnhk.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-BBB69FeN.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-Da-UeZbe.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Lv,userData:{showAppSidebar:!1}})};function B7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Go}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function Sg(n,e,t){const i=n.slice();return i[2]=e[t],i}function U7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Y7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function K7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $g(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?K7:O[2].type==="success"?Y7:O[2].type==="warning"?W7:U7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){C0(t),h(),Ng(t,m)},a(){h(),h=T0(t,m,B7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Rg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ma(t,fs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function J7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J1(s)]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function X7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function Q7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function x7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[Q7],header:[X7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function eL(n,e,t){let i;We(n,Ua,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Ub()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class tL extends ge{constructor(e){super(),_e(this,e,eL,x7,me,{})}}function Tg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(ln.call(null,t)),Se(ln.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(ln.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(ln.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function nL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(ln.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function Cg(n){let e,t,i;return t=new Ja({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function iL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Tg(n);o=new H0({props:{routes:V7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new G7({}),u=new tL({});let _=n[1]&&!n[2]&&Cg(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Tg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=Cg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function lL(n,e,t){let i,l,s,o;We(n,Xi,_=>t(10,i=_)),We(n,Do,_=>t(3,l=_)),We(n,Oa,_=>t(0,s=_)),We(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),Ub())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Do,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class sL extends ge{constructor(e){super(),_e(this,e,lL,iL,me,{})}}new sL({target:document.getElementById("app")});export{$e as A,Lt as B,j as C,tl as D,ye as E,Q1 as F,Vo as G,oo as H,Ht as I,We as J,Rn as K,lt as L,ee as M,Hb as N,ue as O,at as P,Ai as Q,Et as R,ge as S,ot as T,v0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,ln as l,z as m,se as n,v as o,ae as p,ce as q,x as r,me as s,E as t,J as u,Be as v,K as w,oe as x,Q as y,re as z}; diff --git a/ui/dist/assets/index-BJXhcZ8-.js b/ui/dist/assets/index-BJXhcZ8-.js new file mode 100644 index 0000000000..ea47b9938f --- /dev/null +++ b/ui/dist/assets/index-BJXhcZ8-.js @@ -0,0 +1,14 @@ +class F{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ge(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Gt.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ge(this,t,e);let i=[];return this.decompose(t,e,i,0),Gt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new yi(this),r=new yi(t);for(let o=e,l=e;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new yi(this,t)}iterRange(t,e=this.length){return new Rl(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Ll(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?F.empty:t.length<=32?new _(t):Gt.from(_.split(t,[]))}}class _ extends F{constructor(t,e=Cc(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((e?i:l)>=t)return new Ac(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new _(Gr(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=hn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new _(l,o.length+r.length));else{let a=l.length>>1;i.push(new _(l.slice(0,a)),new _(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof _))return super.replace(t,e,i);[t,e]=Ge(this,t,e);let n=hn(this.text,hn(i.text,Gr(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new _(n,r):Gt.from(_.split(n,[]),r)}sliceString(t,e=this.length,i=` +`){[t,e]=Ge(this,t,e);let n="";for(let r=0,o=0;r<=e&&ot&&o&&(n+=i),tr&&(n+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let r of t)i.push(r),n+=r.length+1,i.length==32&&(e.push(new _(i,n)),i=[],n=-1);return n>-1&&e.push(new _(i,n)),e}}class Gt extends F{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,n);n=l+1,i=a+1}}decompose(t,e,i,n){for(let r=0,o=0;o<=e&&r=o){let c=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!c?i.push(l):l.decompose(t-o,e-o,i,c)}o=a+1}}replace(t,e,i){if([t,e]=Ge(this,t,e),i.lines=r&&e<=l){let a=o.replace(t-r,e-r,i),c=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[n]=a,new Gt(h,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=` +`){[t,e]=Ge(this,t,e);let n="";for(let r=0,o=0;rt&&r&&(n+=i),to&&(n+=l.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Gt))return 0;let i=0,[n,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,r+=e){if(n==o||r==l)return i;let a=this.children[n],c=t.children[r];if(a!=c)return i+a.scanIdentical(c,e);i+=a.length+1}}static from(t,e=t.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new _(d,e)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,c=-1,h=[];function f(d){let p;if(d.lines>r&&d instanceof Gt)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,c+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Gt.from(h,c)),c=-1,a=h.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new Gt(l,e)}}F.empty=new _([""],0);function Cc(s){let t=-1;for(let e of s)t+=e.length+1;return t}function hn(s,t,e=0,i=1e9){for(let n=0,r=0,o=!0;r=e&&(a>i&&(l=l.slice(0,i-n)),n0?1:(t instanceof _?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof _?n.text.length:n.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(n instanceof _){let a=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=n.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Rl{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new yi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ll{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},yi.prototype[Symbol.iterator]=Rl.prototype[Symbol.iterator]=Ll.prototype[Symbol.iterator]=function(){return this});class Ac{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Ge(s,t,e){return t=Math.max(0,Math.min(s.length,t)),[t,Math.max(t,Math.min(s.length,e))]}let ze="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(s=>s?parseInt(s,36):1);for(let s=1;ss)return ze[t-1]<=s;return!1}function Jr(s){return s>=127462&&s<=127487}const Yr=8205;function ot(s,t,e=!0,i=!0){return(e?El:Dc)(s,t,i)}function El(s,t,e){if(t==s.length)return t;t&&Il(s.charCodeAt(t))&&Nl(s.charCodeAt(t-1))&&t--;let i=st(s,t);for(t+=Bt(i);t=0&&Jr(st(s,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Dc(s,t,e){for(;t>0;){let i=El(s,t-2,e);if(i=56320&&s<57344}function Nl(s){return s>=55296&&s<56320}function st(s,t){let e=s.charCodeAt(t);if(!Nl(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return Il(i)?(e-55296<<10)+(i-56320)+65536:e}function fr(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Bt(s){return s<65536?1:2}const ms=/\r\n?|\n/;var ht=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(ht||(ht={}));class Qt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return r+(t-n);r+=l}else{if(i!=ht.Simple&&c>=t&&(i==ht.TrackDel&&nt||i==ht.TrackBefore&&nt))return null;if(c>t||c==t&&e<0&&!l)return t==n||e<0?r:r+a;r+=a}n=c}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return r}touchesRange(t,e=t){for(let i=0,n=0;i=0&&n<=e&&l>=t)return ne?"cover":!0;n=l}return!1}toString(){let t="";for(let e=0;e=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(t)}static create(t){return new Qt(t)}}class tt extends Qt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return ys(this,(e,i,n,r,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return bs(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n=0){e[n]=l,e[n+1]=o;let a=n>>1;for(;i.length0&&ce(i,e,r.text),r.forward(h),l+=h}let c=t[o++];for(;l>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!n.length)return;ou||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?F.of(d.split(i||ms)):d:F.empty,g=p.length;if(f==u&&g==0)return;fo&&at(n,f-o,-1),at(n,u-f,g),ce(r,n,p),o=u}}return c(t),a(!l),l}static empty(t){return new tt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;nl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length=0&&e<=0&&e==s[n+1]?s[n]+=t:t==0&&s[n]==0?s[n+1]+=e:i?(s[n]+=t,s[n+1]+=e):s.push(t,e)}function ce(s,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i>1])),!(e||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];t(n,c,r,h,f),n=c,r=h}}}function bs(s,t,e,i=!1){let n=[],r=i?[]:null,o=new Si(s),l=new Si(t);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);at(n,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class Si{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?F.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?F.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ve{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new ve(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return b.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return b.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(t.anchor,t.head)}static create(t,e,i){return new ve(t,e,i)}}class b{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:b.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(t.ranges.map(e=>ve.fromJSON(e)),t.main)}static single(t,e=t){return new b([b.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;nt?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((n,r)=>n.from-r.from),e=t.indexOf(i);for(let n=1;nr.head?b.range(a,l):b.range(l,a))}}return new b(t,e)}}function Vl(s,t){for(let e of s.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let ur=0;class T{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=ur++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:dr),!!t.static,t.enables)}of(t){return new cn([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new cn(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new cn(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function dr(s,t){return s==t||s.length==t.length&&s.every((e,i)=>e===t[i])}class cn{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=ur++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||h.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||xs(f,h)){let d=i(f);if(l?!Xr(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=bn(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===f.facet(m):m instanceof bt?u.field(m,!1)==f.field(m,!1):!0)||(l?Xr(d=i(f),g,n):n(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Xr(s,t,e){if(s.length!=t.length)return!1;for(let i=0;is[a.id]),n=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[t.id]>>1;function l(a){let c=[];for(let h=0;hi===n),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(_r).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,n)=>{let r=i.values[e],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,n)=>n.config.address[this.id]!=null?(i.values[e]=n.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,_r.of({field:this,create:t})]}get extension(){return this}}const ke={lowest:4,low:3,default:2,high:1,highest:0};function oi(s){return t=>new Hl(t,s)}const be={highest:oi(ke.highest),high:oi(ke.high),default:oi(ke.default),low:oi(ke.low),lowest:oi(ke.lowest)};class Hl{constructor(t,e){this.inner=t,this.prec=e}}class Hn{of(t){return new ws(this,t)}reconfigure(t){return Hn.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ws{constructor(t,e){this.compartment=t,this.inner=e}}class yn{constructor(t,e,i,n,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let n=[],r=Object.create(null),o=new Map;for(let u of Tc(t,e,o))u instanceof bt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of n)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=h&&h[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,dr(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(y=>m.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(m=>Oc(m,p,d))}}let f=c.map(u=>u(l));return new yn(t,o,f,l,a,r)}}function Tc(s,t,e){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof ws&&e.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof ws){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(o.compartment)||o.inner;e.set(o.compartment,c),r(c,l)}else if(o instanceof Hl)r(o.inner,o.prec);else if(o instanceof bt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof cn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,ke.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(s,ke.default),i.reduce((o,l)=>o.concat(l))}function bi(s,t){if(t&1)return 2;let e=t>>1,i=s.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[e]=4;let n=s.computeSlot(s,s.config.dynamicSlots[e]);return s.status[e]=2|n}function bn(s,t){return t&1?s.config.staticValues[t>>1]:s.values[t>>1]}const Wl=T.define(),Ss=T.define({combine:s=>s.some(t=>t),static:!0}),zl=T.define({combine:s=>s.length?s[0]:void 0,static:!0}),ql=T.define(),Kl=T.define(),$l=T.define(),jl=T.define({combine:s=>s.length?s[0]:!1});class re{constructor(t,e){this.type=t,this.value=e}static define(){return new Pc}}class Pc{of(t){return new re(this,t)}}class Bc{constructor(t){this.map=t}of(t){return new N(this,t)}}class N{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new N(this.type,e)}is(t){return this.type==t}static define(t={}){return new Bc(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let r=n.map(e);r&&i.push(r)}return i}}N.reconfigure=N.define();N.appendConfig=N.define();class Z{constructor(t,e,i,n,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Vl(i,e.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(t,e,i,n,r,o){return new Z(t,e,i,n,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Z.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}Z.time=re.define();Z.userEvent=re.define();Z.addToHistory=re.define();Z.remote=re.define();function Rc(s,t){let e=[];for(let i=0,n=0;;){let r,o;if(i=s[i]))r=s[i++],o=s[i++];else if(n=0;n--){let r=i[n](s);r instanceof Z?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?s=r[0]:s=Gl(t,qe(r),!1)}return s}function Ec(s){let t=s.startState,e=t.facet($l),i=s;for(let n=e.length-1;n>=0;n--){let r=e[n](s);r&&Object.keys(r).length&&(i=Ul(i,ks(t,r,s.changes.newLength),!0))}return i==s?s:Z.create(t,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const Ic=[];function qe(s){return s==null?Ic:Array.isArray(s)?s:[s]}var J=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(J||(J={}));const Nc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let vs;try{vs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Fc(s){if(vs)return vs.test(s);for(let t=0;t"€"&&(e.toUpperCase()!=e.toLowerCase()||Nc.test(e)))return!0}return!1}function Vc(s){return t=>{if(!/\S/.test(t))return J.Space;if(Fc(t))return J.Word;for(let e=0;e-1)return J.Word;return J.Other}}class H{constructor(t,e,i,n,r,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ln.set(c,a)),e=null),n.set(l.value.compartment,l.value.extension)):l.is(N.reconfigure)?(e=null,i=l.value):l.is(N.appendConfig)&&(e=null,i=qe(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=yn.resolve(i,n,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=t.startState.facet(Ss)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:b.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],o=qe(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:b.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=yn.resolve(t.extensions||[],new Map),i=t.doc instanceof F?t.doc:F.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||ms)),n=t.selection?t.selection instanceof b?t.selection:b.single(t.selection.anchor,t.selection.head):b.single(0);return Vl(n,i.length),e.staticFacet(Ss)||(n=n.asSingle()),new H(e,i,n,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||` +`}get readOnly(){return this.facet(jl)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let r=+(n||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let n=[];for(let r of this.facet(Wl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&n.push(o[t]);return n}charCategorizer(t){return Vc(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=ot(e,o,!1);if(r(e.slice(a,o))!=J.Word)break;o=a}for(;ls.length?s[0]:4});H.lineSeparator=zl;H.readOnly=jl;H.phrases=T.define({compare(s,t){let e=Object.keys(s),i=Object.keys(t);return e.length==i.length&&e.every(n=>s[n]==t[n])}});H.languageData=Wl;H.changeFilter=ql;H.transactionFilter=Kl;H.transactionExtender=$l;Hn.reconfigure=N.define();function Ee(s,t,e={}){let i={};for(let n of s)for(let r of Object.keys(n)){let o=n[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let n in t)i[n]===void 0&&(i[n]=t[n]);return i}class De{eq(t){return this==t}range(t,e=t){return Cs.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=ht.TrackDel;let Cs=class Jl{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Jl(t,e,i)}};function As(s,t){return s.from-t.from||s.value.startSide-t.value.startSide}class pr{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let r=i?this.to:this.from;for(let o=n,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(t,e,i,n){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),i.push(c),n.push(u-o),r.push(d-o))}return{mapped:i.length?new pr(n,r,i,l):null,pos:o}}}class K{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new K(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(As)),this.isEmpty)return e.length?K.of(e):this;let l=new Yl(this,null,-1).goto(0),a=0,c=[],h=new Oe;for(;l.value||a=0){let f=e[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return ki.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return ki.from(t).goto(e)}static compare(t,e,i,n,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Qr(o,l,i),c=new li(o,a,r),h=new li(l,a,r);i.iterGaps((f,u,d)=>Zr(c,f,h,u,d,n)),i.empty&&i.length==0&&Zr(c,0,h,0,0,n)}static eq(t,e,i=0,n){n==null&&(n=999999999);let r=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0),o=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Qr(r,o),a=new li(r,l,0).goto(i),c=new li(o,l,0).goto(i);for(;;){if(a.to!=c.to||!Ms(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>n)return!0;a.next(),c.next()}}static spans(t,e,i,n,r=-1){let o=new li(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFroml&&(n.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new Oe;for(let n of t instanceof Cs?[t]:e?Hc(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return K.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=K.empty;n=n.nextLayer)e=new K(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}K.empty=new K([],[],null,-1);function Hc(s){if(s.length>1)for(let t=s[0],e=1;e0)return s.slice().sort(As);t=i}return s}K.empty.nextLayer=K.empty;class Oe{finishChunk(t){this.chunks.push(new pr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Oe)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(K.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Qr(s,t,e){let i=new Map;for(let r of s)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Yl(o,e,i,r));return n.length==1?n[0]:new ki(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)Xn(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)Xn(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Xn(this.heap,0)}}}function Xn(s,t){for(let e=s[t];;){let i=(t<<1)+1;if(i>=s.length)break;let n=s[i];if(i+1=0&&(n=s[i+1],i++),e.compare(n)<0)break;s[i]=e,s[t]=n,t=i}}class li{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ki.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){qi(this.active,t),qi(this.activeTo,t),qi(this.activeRank,t),this.minActive=to(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:r}=this.cursor;for(;e0;)e++;Ki(this.active,e,i),Ki(this.activeTo,e,n),Ki(this.activeRank,e,r),t&&Ki(t,e,this.cursor.from),this.minActive=to(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&qi(i,n)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[n]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function Zr(s,t,e,i,n,r){s.goto(t),e.goto(i);let o=i+n,l=i,a=i-t;for(;;){let c=s.to+a-e.to||s.endSide-e.endSide,h=c<0?s.to+a:e.to,f=Math.min(h,o);if(s.point||e.point?s.point&&e.point&&(s.point==e.point||s.point.eq(e.point))&&Ms(s.activeForPoint(s.to),e.activeForPoint(e.to))||r.comparePoint(l,f,s.point,e.point):f>l&&!Ms(s.active,e.active)&&r.compareRange(l,f,s.active,e.active),h>o)break;l=h,c<=0&&s.next(),c>=0&&e.next()}}function Ms(s,t){if(s.length!=t.length)return!1;for(let e=0;e=t;i--)s[i+1]=s[i];s[t]=e}function to(s,t){let e=-1,i=1e9;for(let n=0;n=t)return n;if(n==s.length)break;r+=s.charCodeAt(n)==9?e-r%e:1,n=ot(s,n)}return i===!0?-1:s.length}const Os="ͼ",eo=typeof Symbol>"u"?"__"+Os:Symbol.for(Os),Ts=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),io=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class pe{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(n(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in t)r(n(o),t[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=io[eo]||1;return io[eo]=t+1,Os+t.toString(36)}static mount(t,e,i){let n=t[Ts],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Wc(t,r),n.mount(Array.isArray(e)?e:[e],t)}}let no=new Map;class Wc{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let r=no.get(i);if(r)return t[Ts]=r;this.sheet=new n.CSSStyleSheet,no.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ts]=this}mount(t,e){let i=this.sheet,n=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},zc=typeof navigator<"u"&&/Mac/.test(navigator.platform),qc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)ge[48+rt]=ge[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)ge[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)ge[rt]=String.fromCharCode(rt+32),vi[rt]=String.fromCharCode(rt);for(var _n in ge)vi.hasOwnProperty(_n)||(vi[_n]=ge[_n]);function Kc(s){var t=zc&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||qc&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",e=!t&&s.key||(s.shiftKey?vi:ge)[s.keyCode]||s.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function Ci(s){let t;return s.nodeType==11?t=s.getSelection?s:s.ownerDocument:t=s,t.getSelection()}function Ps(s,t){return t?s==t||s.contains(t.nodeType!=1?t.parentNode:t):!1}function fn(s,t){if(!t.anchorNode)return!1;try{return Ps(s,t.anchorNode)}catch{return!1}}function Je(s){return s.nodeType==3?Pe(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function xi(s,t,e,i){return e?so(s,t,e,i,-1)||so(s,t,e,i,1):!1}function Te(s){for(var t=0;;t++)if(s=s.previousSibling,!s)return t}function xn(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function so(s,t,e,i,n){for(;;){if(s==e&&t==i)return!0;if(t==(n<0?0:Zt(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;t=Te(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[t+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;t=n<0?Zt(s):0}else return!1}}function Zt(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Ei(s,t){let e=t?s.left:s.right;return{left:e,right:e,top:s.top,bottom:s.bottom}}function $c(s){let t=s.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function Xl(s,t){let e=t.width/s.offsetWidth,i=t.height/s.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-s.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-s.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function jc(s,t,e,i,n,r,o,l){let a=s.ownerDocument,c=a.defaultView||window;for(let h=s,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=$c(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=Xl(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(n=="nearest")t.top0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+y+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.leftn.clientHeight&&(i=n),!e&&n.scrollWidth>n.clientWidth&&(e=n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;return{x:e,y:i}}class Gc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Zt(e):0),i,Math.min(t.focusOffset,i?Zt(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let Fe=null;function _l(s){if(s.setActive)return s.setActive();if(Fe)return s.focus(Fe);let t=[];for(let e=s;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(s.focus(Fe==null?{get preventScroll(){return Fe={preventScroll:!0},!0}}:void 0),!Fe){Fe=!1;for(let e=0;eMath.max(1,s.scrollHeight-s.clientHeight-4)}function ta(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=Zt(e)}else if(e.parentNode&&!xn(e))i=Te(e),e=e.parentNode;else return null}}function ea(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&ie)return f.domBoundsAround(t,e,c);if(u>=t&&n==-1&&(n=a,r=c),c>e&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=gr){this.markDirty();for(let n=t;nthis.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function na(s,t,e,i,n,r,o,l,a){let{children:c}=s,h=c.length?c[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&h&&!o&&!u&&r.length<2&&h.merge(e,n,r.length?f:null,e==0,l,a))){if(i0&&(!o&&r.length&&h.merge(e,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(e2);var D={mac:ho||/Mac/.test(xt.platform),windows:/Win/.test(xt.platform),linux:/Linux|X11/.test(xt.platform),ie:Wn,ie_version:ra?Bs.documentMode||6:Ls?+Ls[1]:Rs?+Rs[1]:0,gecko:lo,gecko_version:lo?+(/Firefox\/(\d+)/.exec(xt.userAgent)||[0,0])[1]:0,chrome:!!Qn,chrome_version:Qn?+Qn[1]:0,ios:ho,android:/Android\b/.test(xt.userAgent),webkit:ao,safari:oa,webkit_version:ao?+(/\bAppleWebKit\/(\d+)/.exec(xt.userAgent)||[0,0])[1]:0,tabSize:Bs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Xc=256;class Vt extends ${constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof Vt)||this.length-(e-t)+i.length>Xc||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Vt(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ct(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return _c(this.dom,t,e)}}class se extends ${constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let n of e)n.setParent(this)}setAttrs(t){if(Ql(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,r,o){return i&&(!(i instanceof se&&i.mark.eq(this.mark))||t&&r<=0||et&&e.push(i=t&&(n=r),i=a,r++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new se(this.mark,e,o)}domAtPos(t){return la(this,t)}coordsAt(t,e){return ha(this,t,e)}}function _c(s,t,e){let i=s.nodeValue.length;t>i&&(t=i);let n=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?D.chrome||D.gecko||(t?(n--,o=1):r=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Ei(a,o<0):a||null}class Ce extends ${static create(t,e,i){return new Ce(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=Ce.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,r,o){return i&&(!(i instanceof Ce)||!this.widget.compare(i.widget)||t>0&&r<=0||e0)?ct.before(this.dom):ct.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?n.length-1:0;r=n[l],!(t>0?l==0:l==n.length-1||r.top0?ct.before(this.dom):ct.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return F.empty}get isHidden(){return!0}}Vt.prototype.children=Ce.prototype.children=Ye.prototype.children=gr;function la(s,t){let e=s.dom,{children:i}=s,n=0;for(let r=0;nr&&t0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=n;r0&&t instanceof se&&n.length&&(i=n[n.length-1])instanceof se&&i.mark.eq(t.mark)?aa(i,t.children[0],e-1):(n.push(t),t.setParent(s)),s.length+=t.length}function ha(s,t,e){let i=null,n=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&e>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u-1?1:0)!=n.length-(e&&n.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(n.indexOf(r)==-1||s[r]!==t[r]))return!1;return!0}function Is(s,t,e){let i=!1;if(t)for(let n in t)e&&n in e||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(e)for(let n in e)t&&t[n]==e[n]||(i=!0,n=="style"?s.style.cssText=e[n]:s.setAttribute(n,e[n]));return i}function Zc(s){let t=Object.create(null);for(let e=0;e0?3e8:-4e8:e>0?1e8:-1e8,new me(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,n;if(t.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=ca(t,e);i=(r?e?-3e8:-1:5e8)-1,n=(o?e?2e8:1:-6e8)+1}return new me(t,i,n,e,t.widget||null,!0)}static line(t){return new Ni(t)}static set(t,e=!1){return K.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=K.empty;class Ii extends B{constructor(t){let{start:e,end:i}=ca(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Ii&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&wn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Ii.prototype.point=!1;class Ni extends B{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Ni&&this.spec.class==t.spec.class&&wn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Ni.prototype.mapMode=ht.TrackBefore;Ni.prototype.point=!0;class me extends B{constructor(t,e,i,n,r,o){super(e,i,r,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?ht.TrackBefore:ht.TrackAfter:ht.TrackDel}get type(){return this.startSide!=this.endSide?Dt.WidgetRange:this.startSide<=0?Dt.WidgetBefore:Dt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof me&&tf(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}me.prototype.point=!0;function ca(s,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=s;return e==null&&(e=s.inclusive),i==null&&(i=s.inclusive),{start:e??t,end:i??t}}function tf(s,t){return s==t||!!(s&&t&&s.compare(t))}function Ns(s,t,e,i=0){let n=e.length-1;n>=0&&e[n]+i>=s?e[n]=Math.max(e[n],t):e.push(s,t)}class Q extends ${constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,o){if(i){if(!(i instanceof Q))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),sa(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Q;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){wn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){aa(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Es(e,this.attrs||{})),i&&(this.attrs=Es({class:i},this.attrs||{}))}domAtPos(t){return la(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(Ql(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Is(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&$.get(n)instanceof se;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=$.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof Vt))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Vt)||/[^ -~]/.test(i.text))return null;let n=Je(i.dom);if(n.length!=1)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=ha(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-n.lineHeight)<2&&n.textHeight=e){if(r instanceof Q)return r;if(o>e)break}n=o+r.breakAfter}return null}}class ie extends ${constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,r,o){return i&&(!(i instanceof ie)||!this.widget.compare(i.widget)||t>0&&r<=0||e0}}class Fs extends Ie{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class wi{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof ie&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Q),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($i(new Ye(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof ie)&&this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=r,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append($i(new Vt(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof me){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof me)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ie(i.widget||Xe.block,l,i));else{let a=Ce.create(i.widget||Xe.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=n.length&&(t0),h=!a.isEditable&&(tn.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),c&&(f.append($i(new Ye(1),n),r),r=n.length+Math.max(0,r-n.length)),f.append($i(a,n),r),this.atCursorPos=h,this.pendingBuffer=h?tn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,n,r){let o=new wi(t,e,i,r);return o.openEnd=K.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function $i(s,t){for(let e of t)s=new se(e,[s],s.length);return s}class Xe extends Ie{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Xe.inline=new Xe("span");Xe.block=new Xe("div");var X=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(X||(X={}));const Be=X.LTR,mr=X.RTL;function fa(s){let t=[];for(let e=0;e=e){if(l.level==i)return o;(r<0||(n!=0?n<0?l.frome:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function da(s,t){if(s.length!=t.length)return!1;for(let e=0;e=0;g-=3)if(Kt[g+1]==-d){let m=Kt[g+2],y=m&2?n:m&4?m&1?r:n:0;y&&(q[f]=q[Kt[g]]=y),l=g;break}}else{if(Kt.length==189)break;Kt[l++]=f,Kt[l++]=u,Kt[l++]=a}else if((p=q[f])==2||p==1){let g=p==n;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=Kt[m+2];if(y&2)break;if(g)Kt[m+2]|=2;else{if(y&4)break;Kt[m+2]|=4}}}}}function lf(s,t,e,i){for(let n=0,r=i;n<=e.length;n++){let o=n?e[n-1].to:s,l=na;)p==m&&(p=e[--g].from,m=g?e[g-1].to:s),q[--p]=d;a=h}else r=c,a++}}}function Hs(s,t,e,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=t,c=0;aa&&o.push(new fe(a,g.from,d));let m=g.direction==Be!=!(d%2);Ws(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(h?q[p]!=l:q[p]==l))break;p++}u?Hs(s,a,p,i+1,n,u,o):at;){let h=!0,f=!1;if(!c||a>r[c-1].to){let g=q[a-1];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c&&p==r[c-1].to){if(f)break t;let g=r[--c];if(!h)for(let m=g.from,y=c;;){if(m==t)break t;if(y&&r[y-1].to==m)m=r[--y].from;else{if(q[m-1]==l)break t;break}}if(u)u.push(g);else{g.toq.length;)q[q.length]=256;let i=[],n=t==Be?0:1;return Ws(s,n,n,e,0,s.length,i),i}function pa(s){return[new fe(0,s,0)]}let ga="";function hf(s,t,e,i,n){var r;let o=i.head-s.from,l=fe.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],c=a.side(n,e);if(o==c){let u=l+=n?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!n,e),c=a.side(n,e)}let h=ot(s.text,o,a.forward(n,e));(ha.to)&&(h=c),ga=s.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(n?t.length-1:0)?null:t[l+(n?1:-1)];return f&&h==c&&f.level+(n?0:1)s.some(t=>t)}),va=T.define({combine:s=>s.some(t=>t)}),Ca=T.define();class $e{constructor(t,e="nearest",i="nearest",n=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new $e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new $e(b.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ji=N.define({map:(s,t)=>s.map(t)}),Aa=N.define();function Mt(s,t,e){let i=s.facet(xa);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const ae=T.define({combine:s=>s.length?s[0]:!0});let ff=0;const ui=T.define();class ut{constructor(t,e,i,n,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=e||{};return new ut(ff++,t,i,n,l=>{let a=[ui.of(l)];return o&&a.push(Ai.of(c=>{let h=c.plugin(l);return h?o(h):B.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return ut.define(i=>new t(i),e)}}class Zn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(Mt(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Mt(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){Mt(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ma=T.define(),xr=T.define(),Ai=T.define(),Da=T.define(),wr=T.define(),Oa=T.define();function fo(s,t){let e=s.state.facet(Oa);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(s):r),n=[];return K.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let c=r-t.from,h=o-t.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=cf(t.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let g={from:c,to:h,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const Ta=T.define();function Pa(s){let t=0,e=0,i=0,n=0;for(let r of s.state.facet(Ta)){let o=r(s);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:t,right:e,top:i,bottom:n}}const di=T.define();class It{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new It(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toAh)break;r+=2}if(!a)return i;new It(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Sn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=tt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges((r,o,l,a)=>n.push(new It(r,o,l,a))),this.changedRanges=n}static create(t,e,i){return new Sn(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class uo extends ${get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=B.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Q],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new It(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?n=this.domChanged.newSel.head:!bf(t.changes,this.hasComposition)&&!t.selectionSet&&(n=t.state.selection.main.head));let r=n>-1?df(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new It(c,h,t.changes.mapPos(c,-1),t.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=mf(o,l,t.changes);return i=It.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||n.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?n[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,g;if(i&&i.range.fromBh){let k=wi.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=wi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,p=k.openStart,g=w.openEnd;let v=this.compositionView(i);w.breakAtStart?v.breakAfter=1:w.content.length&&v.merge(v.length,v.length,w.content[0],!1,w.openStart,0)&&(v.breakAfter=w.content[0].breakAfter,w.content.shift()),k.content.length&&v.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(v).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=wi.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(c,1),{i:x,off:S}=r.findPos(a,-1);na(this,x,S,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(Aa)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new Vt(t.text.nodeValue);e.flags|=8;for(let{deco:n}of t.marks)e=new se(n,[e],e.length);let i=new Q;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=$.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let r=t.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],e(r>=0?t.marks[r].node:t.text,n)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&fn(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&uf(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new ct(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!xi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!xi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&yf(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Ci(this.view.root);if(f)if(l.empty){if(D.gecko){let u=pf(a.node,a.offset);if(u&&u!=3){let d=(u==1?ta:ea)(a.node,a.offset);d&&(a=new ct(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ct(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ct(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&xi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=Ci(t.root),{anchorNode:n,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Q.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),c=this.coordsAt(e.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(n,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let n=t.offset;!i&&n=0;n--){let r=$.get(e.childNodes[n]);r instanceof Q&&(i=r.domAtPos(r.length))}return i?new ct(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=$.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(at||l.covers(1))&&(!i||l instanceof Q&&!(i instanceof Q&&e>=0)))i=l,n=c;else if(i&&c==t&&a==t&&l instanceof ie&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Q))return null;for(;n.children.length;){let{i:l,off:a}=n.childPos(i,1);for(;;l++){if(l==n.children.length)return null;if((n=n.children[l]).length)break}i=a}if(!(n instanceof Vt))return null;let r=ot(n.text,i);if(r==i)return null;let o=Pe(n.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let c=0,h=0;hn)break;if(c>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Je(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Q){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,n;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Je(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,n=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new ia(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let r=n==e.viewports.length?null:e.viewports[n],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(B.replace({widget:new Fs(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Ai).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,n=this.view.state.facet(Da).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(K.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];te.anchor?-1:1),n;if(!i)return;!e.empty&&(n=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let r=Pa(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;jc(this.view.scrollDOM,o,e.head{it.from&&(e=!0)}),e}function xf(s,t,e=1){let i=s.charCategorizer(t),n=s.doc.lineAt(t),r=t-n.from;if(n.length==0)return b.cursor(t);r==0?e=1:r==n.length&&(e=-1);let o=r,l=r;e<0?o=ot(n.text,r,!1):l=ot(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let c=ot(n.text,o,!1);if(i(n.text.slice(c,o))!=a)break;o=c}for(;ls?t.left-s:Math.max(0,s-t.right)}function Sf(s,t){return t.top>s?t.top-s:Math.max(0,s-t.bottom)}function ts(s,t){return s.topt.top+1}function po(s,t){return ts.bottom?{top:s.top,left:s.left,right:s.right,bottom:t}:s}function qs(s,t,e){let i,n,r,o,l=!1,a,c,h,f;for(let p=s.firstChild;p;p=p.nextSibling){let g=Je(p);for(let m=0;mS||o==S&&r>x){i=p,n=y,r=x,o=S;let k=S?e0?m0)}x==0?e>y.bottom&&(!h||h.bottomy.top)&&(c=p,f=y):h&&ts(h,y)?h=go(h,y.bottom):f&&ts(f,y)&&(f=po(f,y.top))}}if(h&&h.bottom>=e?(i=a,n=h):f&&f.top<=e&&(i=c,n=f),!i)return{node:s,offset:0};let u=Math.max(n.left,Math.min(n.right,t));if(i.nodeType==3)return mo(i,u,e);if(l&&i.contentEditable!="false")return qs(i,u,e);let d=Array.prototype.indexOf.call(s.childNodes,i)+(t>=(n.left+n.right)/2?1:0);return{node:s,offset:d}}function mo(s,t,e){let i=s.nodeValue.length,n=-1,r=1e9,o=0;for(let l=0;le?h.top-e:e-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&f=(h.left+h.right)/2,d=u;if((D.chrome||D.gecko)&&Pe(s,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:s,offset:l+(d?1:0)};n=l+(d?1:0),r=f}}}return{node:s,offset:n>-1?n:o>0?s.nodeValue.length:0}}function Ra(s,t,e,i=-1){var n,r;let o=s.contentDOM.getBoundingClientRect(),l=o.top+s.viewState.paddingTop,a,{docHeight:c}=s.viewState,{x:h,y:f}=t,u=f-l;if(u<0)return 0;if(u>c)return s.state.doc.length;for(let k=s.viewState.heightOracle.textHeight/2,w=!1;a=s.elementAtHeight(u),a.type!=Dt.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(ds.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:e?null:yo(s,o,a,h,f);let p=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:p,m=g.elementFromPoint(h,f);m&&!s.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=g.elementFromPoint(h,f),m&&!s.contentDOM.contains(m)&&(m=null));let y,x=-1;if(m&&((n=s.docView.nearest(m))===null||n===void 0?void 0:n.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,f);k&&({offsetNode:y,offset:x}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,f);k&&({startContainer:y,startOffset:x}=k,(!s.contentDOM.contains(y)||D.safari&&kf(y,x,h)||D.chrome&&vf(y,x,h))&&(y=void 0))}y&&(x=Math.min(Zt(y),x))}if(!y||!s.docView.dom.contains(y)){let k=Q.find(s.docView,d);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=qs(k.dom,h,f))}let S=s.docView.nearest(y);if(!S)return null;if(S.isWidget&&((r=S.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=S.dom.getBoundingClientRect();return t.ys.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-e.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(e.from,e.to);return e.from+Ds(o,r,s.state.tabSize)}function kf(s,t,e){let i;if(s.nodeType!=3||t!=(i=s.nodeValue.length))return!1;for(let n=s.nextSibling;n;n=n.nextSibling)if(n.nodeType!=1||n.nodeName!="BR")return!1;return Pe(s,i-1,i).getBoundingClientRect().left>e}function vf(s,t,e){if(t!=0)return!1;for(let n=s;;){let r=n.parentNode;if(!r||r.nodeType!=1||r.firstChild!=n)return!1;if(r.classList.contains("cm-line"))break;n=r}let i=s.nodeType==1?s.getBoundingClientRect():Pe(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function Ks(s,t){let e=s.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Dt.Text))return i}return e}function Cf(s,t,e,i){let n=Ks(s,t.head),r=!i||n.type!=Dt.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(t.assoc<0&&t.head>n.from?t.head-1:t.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:e==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,e?-1:1)}return b.cursor(e?n.to:n.from,e?-1:1)}function bo(s,t,e,i){let n=s.state.doc.lineAt(t.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=t,a=null;;){let c=hf(n,r,o,l,e),h=ga;if(!c){if(n.number==(e?s.state.doc.lines:1))return l;h=` +`,n=s.state.doc.line(n.number+(e?1:-1)),r=s.bidiSpans(n),c=s.visualLineSide(n,!e)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function Af(s,t,e){let i=s.state.charCategorizer(t),n=i(e);return r=>{let o=i(r);return n==J.Space&&(n=o),n==o}}function Mf(s,t,e,i){let n=t.head,r=e?1:-1;if(n==(e?s.state.doc.length:0))return b.cursor(n,t.assoc);let o=t.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),c=s.coordsAtPos(n,t.assoc||-1),h=s.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=i??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Ra(s,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gn)){let m=s.docView.coordsForChar(g),y=!m||p{if(t>r&&tn(s)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,ir)&&this.lineBreak(),n=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Of(t,i.node,i.offset)?e:0))}}function Of(s,t,e){for(;;){if(!t||e-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:Rf(t),a=new Df(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Lf(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ps(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ps(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?s.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=n.from,c=null;(r===8||D.android&&t.text.length=n.from&&e.to<=n.to&&(e.from!=n.from||e.to!=n.to)&&n.to-n.from-(e.to-e.from)<=4?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,e.from).append(e.insert).append(s.state.doc.slice(e.to,n.to))}:(D.mac||D.android)&&e&&e.from==e.to&&e.from==n.head-1&&/^\. ?$/.test(e.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:F.of([" "])}):D.chrome&&e&&e.from==e.to&&e.from==n.head&&e.insert.toString()==` + `&&s.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:F.of([" "])}),e)return Sr(s,e,i,r);if(i&&!i.main.eq(n)){let o=!1,l="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(o=!0),l=s.inputState.lastSelectionOrigin),s.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Sr(s,t,e,i=-1){if(D.ios&&s.inputState.flushIOSKey(t))return!0;let n=s.state.selection.main;if(D.android&&(t.to==n.to&&(t.from==n.from||t.from==n.from-1&&s.state.sliceDoc(t.from,n.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Ke(s.contentDOM,"Enter",13)||(t.from==n.from-1&&t.to==n.to&&t.insert.length==0||i==8&&t.insert.lengthn.head)&&Ke(s.contentDOM,"Backspace",8)||t.from==n.from&&t.to==n.to+1&&t.insert.length==0&&Ke(s.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,l=()=>o||(o=Pf(s,t,e));return s.state.facet(wa).some(a=>a(s,t.from,t.to,r,l))||s.dispatch(l()),!0}function Pf(s,t,e){let i,n=s.state,r=n.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&s.inputState.composing<0){let l=r.fromt.to?n.sliceDoc(t.to,r.to):"";i=n.replaceSelection(s.state.toText(l+t.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let l=n.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(n.selection.ranges.length>1&&s.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let c=s.state.sliceDoc(t.from,t.to),h,f=e&&Ba(s,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);h={from:f.from,to:f.to-p}}else h=s.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-c.length;if(p.to-p.from!=d||s.state.sliceDoc(m,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=n.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&n.selection.replaceRange(a)}}let o="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,o+=".compose",s.inputState.compositionFirstChange&&(o+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function Bf(s,t,e,i){let n=Math.min(s.length,t.length),r=0;for(;r0&&l>0&&s.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Rf(s){let t=[];if(s.root.activeElement!=s.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return e&&(t.push(new xo(e,i)),(n!=e||r!=i)&&t.push(new xo(n,r))),t}function Lf(s,t){if(s.length==0)return null;let e=s[0].pos,i=s.length==2?s[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}class Ef{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,D.safari&&t.contentDOM.addEventListener("input",()=>null),D.gecko&&Xf(t.contentDOM.ownerDocument)}handleEvent(t){!qf(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let n of i.observers)n(this.view,e);for(let n of i.handlers){if(e.defaultPrevented)break;if(n(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=If(t),i=this.handlers,n=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&n.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Ia.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return D.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Ea.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||Nf.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function wo(s,t){return(e,i)=>{try{return t.call(s,i,e)}catch(n){Mt(e.state,n)}}}function If(s){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec;if(n&&n.domEventHandlers)for(let r in n.domEventHandlers){let o=n.domEventHandlers[r];o&&e(r).handlers.push(wo(i.value,o))}if(n&&n.domEventObservers)for(let r in n.domEventObservers){let o=n.domEventObservers[r];o&&e(r).observers.push(wo(i.value,o))}}for(let i in Ht)e(i).handlers.push(Ht[i]);for(let i in Nt)e(i).observers.push(Nt[i]);return t}const Ea=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Nf="dthko",Ia=[16,17,18,20,91,92,224,225],Ui=6;function Gi(s){return Math.max(0,s)*.7+8}function Ff(s,t){return Math.max(Math.abs(s.clientX-t.clientX),Math.abs(s.clientY-t.clientY))}class Vf{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=Uc(t.contentDOM),this.atoms=t.state.facet(wr).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(H.allowMultipleSelections)&&Hf(t,e),this.dragging=zf(t,e)&&Va(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Ff(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,n=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Pa(this.view);t.clientX-a.left<=n+Ui?e=-Gi(n-t.clientX):t.clientX+a.right>=o-Ui&&(e=Gi(t.clientX-o)),t.clientY-a.top<=r+Ui?i=-Gi(r-t.clientY):t.clientY+a.bottom>=l-Ui&&(i=Gi(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;ie.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Hf(s,t){let e=s.state.facet(ma);return e.length?e[0](t):D.mac?t.metaKey:t.ctrlKey}function Wf(s,t){let e=s.state.facet(ya);return e.length?e[0](t):D.mac?!t.altKey:!t.ctrlKey}function zf(s,t){let{main:e}=s.state.selection;if(e.empty)return!1;let i=Ci(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function qf(s,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=s.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=$.get(e))&&i.ignoreEvent(t))return!1;return!0}const Ht=Object.create(null),Nt=Object.create(null),Na=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Kf(s){let t=s.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{s.focus(),e.remove(),Fa(s,e.value)},50)}function zn(s,t,e){for(let i of s.facet(t))e=i(e,s);return e}function Fa(s,t){t=zn(s.state,yr,t);let{state:e}=s,i,n=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if($s!=null&&e.selection.ranges.every(a=>a.empty)&&$s==r.toString()){let a=-1;i=e.changeByRange(c=>{let h=e.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=e.toText((o?r.line(n++).text:t)+e.lineBreak);return{changes:{from:h.from,insert:f},range:b.cursor(c.from+f.length)}})}else o?i=e.changeByRange(a=>{let c=r.line(n++);return{changes:{from:a.from,to:a.to,insert:c.text},range:b.cursor(a.from+c.length)}}):i=e.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Nt.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Ht.keydown=(s,t)=>(s.inputState.setSelectionOrigin("select"),t.keyCode==27&&s.inputState.tabFocusMode!=0&&(s.inputState.tabFocusMode=Date.now()+2e3),!1);Nt.touchstart=(s,t)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};Nt.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};Ht.mousedown=(s,t)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of s.state.facet(ba))if(e=i(s,t),e)break;if(!e&&t.button==0&&(e=Uf(s,t)),e){let i=!s.hasFocus;s.inputState.startMouseSelection(new Vf(s,t,e,i)),i&&s.observer.ignore(()=>{_l(s.contentDOM);let r=s.root.activeElement;r&&!r.contains(s.contentDOM)&&r.blur()});let n=s.inputState.mouseSelection;if(n)return n.start(t),n.dragging===!1}return!1};function So(s,t,e,i){if(i==1)return b.cursor(t,e);if(i==2)return xf(s.state,t,e);{let n=Q.find(s.docView,t),r=s.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return lt>=e.top&&t<=e.bottom&&s>=e.left&&s<=e.right;function $f(s,t,e,i){let n=Q.find(s.docView,t);if(!n)return 1;let r=t-n.posAtStart;if(r==0)return 1;if(r==n.length)return-1;let o=n.coordsAt(r,-1);if(o&&ko(e,i,o))return-1;let l=n.coordsAt(r,1);return l&&ko(e,i,l)?1:o&&o.bottom>=i?-1:1}function vo(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:$f(s,e,t.clientX,t.clientY)}}const jf=D.ie&&D.ie_version<=11;let Co=null,Ao=0,Mo=0;function Va(s){if(!jf)return s.detail;let t=Co,e=Mo;return Co=s,Mo=Date.now(),Ao=!t||e>Date.now()-400&&Math.abs(t.clientX-s.clientX)<2&&Math.abs(t.clientY-s.clientY)<2?(Ao+1)%3:1}function Uf(s,t){let e=vo(s,t),i=Va(t),n=s.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),n=n.map(r.changes))},get(r,o,l){let a=vo(s,r),c,h=So(s,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=So(s,e.pos,e.bias,i),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u1&&(c=Gf(n,a.pos))?c:l?n.addRange(h):b.create([h])}}}function Gf(s,t){for(let e=0;e=t)return b.create(s.ranges.slice(0,e).concat(s.ranges.slice(e+1)),s.mainIndex==e?0:s.mainIndex-(s.mainIndex>e?1:0))}return null}Ht.dragstart=(s,t)=>{let{selection:{main:e}}=s.state;if(t.target.draggable){let n=s.docView.nearest(t.target);if(n&&n.isWidget){let r=n.posAtStart,o=r+n.length;(r>=e.to||o<=e.from)&&(e=b.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",zn(s.state,br,s.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Ht.dragend=s=>(s.inputState.draggedContent=null,!1);function Do(s,t,e,i){if(e=zn(s.state,yr,e),!e)return;let n=s.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&Wf(s,t)?{from:r.from,to:r.to}:null,l={from:n,insert:e},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}Ht.drop=(s,t)=>{if(!t.dataTransfer)return!1;if(s.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),n=0,r=()=>{++n==e.length&&Do(s,t,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Do(s,t,i,!0),!0}return!1};Ht.paste=(s,t)=>{if(s.state.readOnly)return!0;s.observer.flush();let e=Na?null:t.clipboardData;return e?(Fa(s,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Kf(s),!1)};function Jf(s,t){let e=s.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),s.focus()},50)}function Yf(s){let t=[],e=[],i=!1;for(let n of s.selection.ranges)n.empty||(t.push(s.sliceDoc(n.from,n.to)),e.push(n));if(!t.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(t.push(o.text),e.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:zn(s,br,t.join(s.lineBreak)),ranges:e,linewise:i}}let $s=null;Ht.copy=Ht.cut=(s,t)=>{let{text:e,ranges:i,linewise:n}=Yf(s.state);if(!e&&!n)return!1;$s=n?e:null,t.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Na?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(Jf(s,e),!1)};const Ha=re.define();function Wa(s,t){let e=[];for(let i of s.facet(Sa)){let n=i(s,t);n&&e.push(n)}return e?s.update({effects:e,annotations:Ha.of(!0)}):null}function za(s){setTimeout(()=>{let t=s.hasFocus;if(t!=s.inputState.notifiedFocused){let e=Wa(s.state,t);e?s.dispatch(e):s.update([])}},10)}Nt.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),za(s)};Nt.blur=s=>{s.observer.clearSelectionRange(),za(s)};Nt.compositionstart=Nt.compositionupdate=s=>{s.observer.editContext||(s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))};Nt.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,D.chrome&&D.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))};Nt.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};Ht.beforeinput=(s,t)=>{var e,i;if(t.inputType=="insertReplacementText"&&s.observer.editContext){let r=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let l=o[0],a=s.posAtDOM(l.startContainer,l.startOffset),c=s.posAtDOM(l.endContainer,l.endOffset);return Sr(s,{from:a,to:c,insert:s.state.toText(r)},null),!0}}let n;if(D.chrome&&D.android&&(n=Ea.find(r=>r.inputType==t.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return D.ios&&t.inputType=="deleteContentForward"&&s.observer.flushSoon(),D.safari&&t.inputType=="insertText"&&s.inputState.composing>=0&&setTimeout(()=>Nt.compositionend(s,t),20),!1};const Oo=new Set;function Xf(s){Oo.has(s)||(Oo.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const To=["pre-wrap","normal","pre-line","break-spaces"];let _e=!1;function Po(){_e=!1}class _f{constructor(t){this.lineWrapping=t,this.doc=F.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return To.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let c=0;c0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>dn&&(_e=!0),this.height=t)}replace(t,e,i){return gt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=n[l],u=r.lineAt(a,G.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=c?u:r.lineAt(c,G.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,h=n[l-1].fromB,l--,ar*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n=r&&o(this.blockAt(0,i,n,r))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends qa{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Jt(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return i.length==1&&(n instanceof Ct||n instanceof nt&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof nt?n=new Ct(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):gt.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends gt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(t,e,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let c=n+(t0){let r=i[i.length-1];r instanceof nt?i[i.length-1]=new nt(r.length+n):i.push(null,new nt(n-1))}if(t>0){let r=i[0];r instanceof nt?i[0]=new nt(t+r.length):i.unshift(new nt(t-1),null)}return gt.of(i)}decomposeLeft(t,e){e.push(new nt(t-1),null)}decomposeRight(t,e){e.push(null,new nt(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let r=e+this.length;if(n&&n.from<=e+this.length&&n.more){let o=[],l=Math.max(e,n.from),a=-1;for(n.from>e&&o.push(new nt(n.from-e-1).updateHeight(t,e));l<=r&&n.more;){let h=t.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++];a==-1?a=f:Math.abs(f-a)>=dn&&(a=-2);let u=new Ct(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new nt(r-l).updateHeight(t,l));let c=gt.of(o);return(a<0||Math.abs(c.height-this.height)>=dn||Math.abs(a-this.heightMetrics(t,e).perLine)>=dn)&&(_e=!0),kn(this,c)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Zf extends gt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,n){let r=i+this.left.height;return tl))return c;let h=e==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,n,r).join(c)}forEachLine(t,e,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,l,a,o);else{let c=this.lineAt(a,G.ByPos,i,n,r);t=t&&c.from<=e&&o(c),e>c.to&&this.right.forEachLine(c.to+1,e,i,l,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&Bo(r,o-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?gt.of(this.break?[t,null,e]:[t,e]):(this.left=kn(this.left,t),this.right=kn(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(t,l,i,n):o.updateHeight(t,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Bo(s,t){let e,i;s[t]==null&&(e=s[t-1])instanceof nt&&(i=s[t+1])instanceof nt&&s.splice(t-1,3,new nt(e.length+1+i.length))}const tu=5;class kr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Ct?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ct(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=tu)&&this.addLineDeco(n,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Ct(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new nt(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ct)return t;let e=new Ct(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(c==s.parentNode?n.innerHeight:a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function su(s,t){let e=s.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class is{constructor(t,e,i,n){this.from=t,this.to=e,this.size=i,this.displaySize=n}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new _f(e),this.stateDeco=t.facet(Ai).filter(i=>typeof i!="function"),this.heightMap=gt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle.setDoc(t.doc),[new It(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);t.push(new Ji(r,o))}}return this.viewports=t.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Lo:new vr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(gi(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ai).filter(h=>typeof h!="function");let n=t.changedRanges,r=It.extendWithRanges(n,eu(i,this.stateDeco,t?t.changes:tt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Po(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||_e)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(va)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:w}=Xl(e,l);(k>.005&&Math.abs(this.scaleX-k)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=k,this.scaleY=w,c|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Zl(t.scrollDOM);let p=(this.printing?su:nu)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),a){let k=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(k)&&(o=!0),o||n.lineWrapping&&Math.abs(x-this.contentDOMWidth)>n.charWidth){let{lineHeight:w,charWidth:v,textHeight:A}=t.docView.measureTextSize();o=w>0&&n.refresh(r,w,v,A,x/v,k),o&&(t.docView.minWidth=0,c|=8)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),Po();for(let w of this.viewports){let v=w.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?gt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle,[new It(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Qf(w.from,v))}_e&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Ji(n.lineAt(o-i*1e3,G.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,G.ByHeight,r,0,0).to);if(e){let{head:c}=e.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(c,G.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-h/2:e.y=="start"||e.y=="nearest"&&c=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r>1,o=n<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,f,u,d)=>{if(f-hh&&yy.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)y.fromx));if(!m){if(fS.from<=f&&S.to>=f)){let S=e.moveToLineBoundary(b.cursor(f),!1,!0).head;S>h&&(f=S)}let y=this.gapSize(u,h,f,d),x=i||y<2e6?y:2e6;m=new is(h,f,y,x)}l.push(m)},c=h=>{if(h.length2e6)for(let v of t)v.from>=h.from&&v.fromh.from&&a(h.from,d,h,f),pe.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];K.spans(t,this.viewport.from,this.viewport.to,{span(n,r){e.push({from:n,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((n,r)=>n.from!=e[r].from||n.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||gi(this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||gi(this.heightMap.lineAt(this.scaler.fromDOM(t),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return gi(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ji{constructor(t,e){this.from=t,this.to=e}}function ou(s,t,e){let i=[],n=s,r=0;return K.spans(e,s,t,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n=1)return t[t.length-1].to;let i=Math.floor(s*e);for(let n=0;;n++){let{from:r,to:o}=t[n],l=o-r;if(i<=l)return r+i;i-=l}}function Xi(s,t){let e=0;for(let{from:i,to:n}of s.ranges){if(t<=n){e+=t-i;break}e+=n-i}return e/s.total}function lu(s,t){for(let e of s)if(t(e))return e}const Lo={toDOM(s){return s},fromDOM(s){return s},scale:1,eq(s){return s==this}};class vr{constructor(t,e,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=e.lineAt(l,G.ByPos,t,0,0).top,h=e.lineAt(a,G.ByPos,t,0,0).bottom;return n+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let r=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function gi(s,t){if(t.scale==1)return s;let e=t.toDOM(s.top),i=t.toDOM(s.bottom);return new Jt(s.from,s.length,e,i-e,Array.isArray(s._content)?s._content.map(n=>gi(n,t)):s._content)}const _i=T.define({combine:s=>s.join(" ")}),js=T.define({combine:s=>s.indexOf(!0)>-1}),Us=pe.newName(),Ka=pe.newName(),$a=pe.newName(),ja={"&light":"."+Ka,"&dark":"."+$a};function Gs(s,t,e){return new pe(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!e||!e[n])throw new RangeError(`Unsupported selector: ${n}`);return e[n]}):s+" "+i}})}const au=Gs("."+Us,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ja),hu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ns=D.ie&&D.ie_version<=11;class cu{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Gc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new uu(t),t.state.facet(ae)&&(t.contentDOM.editContext=this.editContext.editContext)),ns&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(ae)?i.root.activeElement!=this.dom:!fn(this.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&n.focusNode&&xi(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=Ci(t.root);if(!e)return!1;let i=D.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&fu(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=fn(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ke(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&fn(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Tf(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=La(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Eo(e,t.previousSibling||t.target.previousSibling,-1),n=Eo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ae)!=t.state.facet(ae)&&(t.view.contentDOM.editContext=t.state.facet(ae)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Eo(s,t,e){for(;t;){let i=$.get(t);if(i&&i.parent==s)return i;let n=t.parentNode;t=n!=s.dom?n:e>0?t.nextSibling:t.previousSibling}return null}function Io(s,t){let e=t.startContainer,i=t.startOffset,n=t.endContainer,r=t.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return xi(o.node,o.offset,n,r)&&([e,i,n,r]=[n,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}}function fu(s,t){if(t.getComposedRanges){let n=t.getComposedRanges(s.root)[0];if(n)return Io(s,n)}let e=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),e=n.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",i,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",i,!0),e?Io(s,e):null}class uu{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:n}=t.state.selection.main,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:F.of(i.text.split(` +`))};r.from==this.from&&nthis.to&&(r.to=n),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,t.state.readOnly||Sr(t,r,b.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)))},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;n.push(B.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}t.dispatch({effects:Aa.of(B.set(n))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{t.inputState.composing=-1,t.inputState.compositionFirstChange=null};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=Ci(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(c)){n=this.pendingContextChange=null,e+=h,this.to+=h;return}else n=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}e+=h}),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.resetRange(t.state),this.editContext.updateText(0,this.editContext.text.length,t.state.doc.sliceString(this.from,this.to)),this.setSelection(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to1e4*3)}toEditorPos(t){return t+this.from}toContextPos(t){return t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Jc(t.parent)||document,this.viewState=new Ro(t.state||H.create(t)),t.scrollTo&&t.scrollTo.is(ji)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ui).map(n=>new Zn(n));for(let n of this.plugins)n.update(this);this.observer=new cu(this),this.inputState=new Ef(this),this.inputState.ensureHandlers(this.plugins),this.docView=new uo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=t.length==1&&t[0]instanceof Z?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,n,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Ha))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Wa(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);n=Sn.create(this,r,t),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new $e(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(ji)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=vn.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),e=this.docView.update(n),this.state.facet(di)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(_i)!=n.state.facet(_i)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(zs))try{u(n)}catch(d){Mt(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!La(this,h)&&c.force&&Ke(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Ro(t),this.plugins=t.facet(ui).map(i=>new Zn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new uo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ui),i=t.state.facet(ui);if(e!=i){let n=[];for(let r of i){let o=e.indexOf(r);if(o<0)n.push(new Zn(r));else{let l=this.plugins[o];l.mustUpdate=t,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=t;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Zl(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(d=>{try{return d.read(this)}catch(p){return Mt(this.state,p),No}}),f=Sn.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){n=n+p,i.scrollTop=n/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(zs))l(e)}get themeClasses(){return Us+" "+(this.state.facet(js)?$a:Ka)+" "+this.state.facet(_i)}updateAttrs(){let t=Fo(this,Ma,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ae)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Fo(this,xr,e);let i=this.observer.ignore(()=>{let n=Is(this.contentDOM,this.contentAttrs,e),r=Is(this.dom,this.editorAttrs,t);return n||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let n of i.effects)if(n.is(O.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(di);let t=this.state.facet(O.cspNonce);pe.mount(this.root,this.styleModules.concat(au).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;ei.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return es(this,t,bo(this,t,e,i))}moveByGroup(t,e){return es(this,t,bo(this,t,e,i=>Af(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return b.cursor(r.side(e,n)+t.from,r.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return Cf(this,t,e,i)}moveVertically(t,e,i){return es(this,t,Mf(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Ra(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),r=this.bidiSpans(n),o=r[fe.find(r,t-n.from,-1,e)];return Ei(i,o.dir==X.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(ka)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>du)return pa(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||da(r.isolates,i=fo(this,t))))return r.order;i||(i=fo(this,t));let n=af(t.text,e,i);return this.bidiCache.push(new vn(t.from,t.to,e,i,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||D.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_l(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return ji.of(new $e(typeof t=="number"?b.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return ji.of(new $e(b.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ut.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ut.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=pe.newName(),n=[_i.of(i),di.of(Gs(`.${i}`,t))];return e&&e.dark&&n.push(js.of(!0)),n}static baseTheme(t){return be.lowest(di.of(Gs("."+Us,t,ja)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&$.get(i)||$.get(t);return((e=n==null?void 0:n.rootView)===null||e===void 0?void 0:e.view)||null}}O.styleModule=di;O.inputHandler=wa;O.clipboardInputFilter=yr;O.clipboardOutputFilter=br;O.scrollHandler=Ca;O.focusChangeEffect=Sa;O.perLineTextDirection=ka;O.exceptionSink=xa;O.updateListener=zs;O.editable=ae;O.mouseSelectionStyle=ba;O.dragMovesSelection=ya;O.clickAddsSelectionRange=ma;O.decorations=Ai;O.outerDecorations=Da;O.atomicRanges=wr;O.bidiIsolatedRanges=Oa;O.scrollMargins=Ta;O.darkTheme=js;O.cspNonce=T.define({combine:s=>s.length?s[0]:""});O.contentAttributes=xr;O.editorAttributes=Ma;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=N.define();const du=4096,No={};class vn{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:X.LTR;for(let r=Math.max(0,t.length-10);r=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&Es(o,e)}return e}const pu=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function gu(s,t){const e=s.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;ai.concat(n),[]))),e}function yu(s,t,e){return Ga(Ua(s.state),t,s,e)}let he=null;const bu=4e3;function xu(s,t=pu){let e=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>gu(y,t));for(let y=1;y{let k=he={view:S,prefix:x,scope:o};return setTimeout(()=>{he==k&&(he=null)},bu),!0}]})}let g=p.join(" ");n(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=e[c]||(e[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,Js))}let a=o[t]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Js=null;function Ga(s,t,e,i){Js=t;let n=Kc(t),r=st(n,0),o=Bt(r)==n.length&&n!=" ",l="",a=!1,c=!1,h=!1;he&&he.view==e&&he.scope==i&&(l=he.prefix+" ",Ia.indexOf(t.keyCode)<0&&(c=!0,he=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(e)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),c=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Qi(n,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(D.windows&&t.ctrlKey&&t.altKey)&&(p=ge[t.keyCode])&&p!=n?(u(d[l+Qi(p,t,!0)])||t.shiftKey&&(g=vi[t.keyCode])!=n&&g!=p&&u(d[l+Qi(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+Qi(n,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&t.stopPropagation(),Js=null,a}class Fi{constructor(t,e,i,n,r){this.className=t,this.left=e,this.top=i,this.width=n,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=Ja(t);return[new Fi(e,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}else return wu(t,e,i)}}function Ja(s){let t=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==X.LTR?t.left:t.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:t.top-s.scrollDOM.scrollTop*s.scaleY}}function Ho(s,t,e,i){let n=s.coordsAtPos(t,e*2);if(!n)return i;let r=s.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,l=s.posAtCoords({x:r.left+1,y:o}),a=s.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function wu(s,t,e){if(e.to<=s.viewport.from||e.from>=s.viewport.to)return[];let i=Math.max(e.from,s.viewport.from),n=Math.min(e.to,s.viewport.to),r=s.textDirection==X.LTR,o=s.contentDOM,l=o.getBoundingClientRect(),a=Ja(s),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=Ks(s,i),p=Ks(s,n),g=d.type==Dt.Text?d:null,m=p.type==Dt.Text?p:null;if(g&&(s.lineWrapping||d.widgetLineBreaks)&&(g=Ho(s,i,1,g)),m&&(s.lineWrapping||p.widgetLineBreaks)&&(m=Ho(s,n,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return x(S(e.from,e.to,g));{let w=g?S(e.from,null,g):k(d,!1),v=m?S(null,e.to,m):k(p,!0),A=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+s.defaultLineHeight/2P&&V.from=pt)break;Ot>j&&E(Math.max(it,j),w==null&&it<=P,Math.min(Ot,pt),v==null&&Ot>=W,zt.dir)}if(j=kt.to+1,j>=pt)break}return z.length==0&&E(P,w==null,W,v==null,s.textDirection),{top:R,bottom:I,horizontal:z}}function k(w,v){let A=l.top+(v?w.top:w.bottom);return{top:A,bottom:A,horizontal:[]}}}function Su(s,t){return s.constructor==t.constructor&&s.eq(t)}class ku{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(pn)!=t.state.facet(pn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(pn);for(;e!Su(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let n=e.nextSibling;e.remove(),e=n}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const pn=T.define();function Ya(s){return[ut.define(t=>new ku(t,s)),pn.of(s)]}const Xa=!D.ios,Mi=T.define({combine(s){return Ee(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function xm(s={}){return[Mi.of(s),vu,Cu,Au,va.of(!0)]}function _a(s){return s.startState.facet(Mi)!=s.state.facet(Mi)}const vu=Ya({above:!0,markers(s){let{state:t}=s,e=t.facet(Mi),i=[];for(let n of t.selection.ranges){let r=n==t.selection.main;if(n.empty?!r||Xa:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=n.empty?n:b.cursor(n.head,n.head>n.anchor?-1:1);for(let a of Fi.forRange(s,o,l))i.push(a)}}return i},update(s,t){s.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=_a(s);return e&&Wo(s.state,t),s.docChanged||s.selectionSet||e},mount(s,t){Wo(t.state,s)},class:"cm-cursorLayer"});function Wo(s,t){t.style.animationDuration=s.facet(Mi).cursorBlinkRate+"ms"}const Cu=Ya({above:!1,markers(s){return s.state.selection.ranges.map(t=>t.empty?[]:Fi.forRange(s,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(s,t){return s.docChanged||s.selectionSet||s.viewportChanged||_a(s)},class:"cm-selectionLayer"}),Ys={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Xa&&(Ys[".cm-line"].caretColor=Ys[".cm-content"].caretColor="transparent !important");const Au=be.highest(O.theme(Ys)),Qa=N.define({map(s,t){return s==null?null:t.mapPos(s)}}),mi=bt.define({create(){return null},update(s,t){return s!=null&&(s=t.changes.mapPos(s)),t.effects.reduce((e,i)=>i.is(Qa)?i.value:e,s)}}),Mu=ut.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var t;let e=s.state.field(mi);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(mi)!=e||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,t=s.state.field(mi),e=t!=null&&s.coordsAtPos(t);if(!e)return null;let i=s.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+s.scrollDOM.scrollLeft*s.scaleX,top:e.top-i.top+s.scrollDOM.scrollTop*s.scaleY,height:e.bottom-e.top}}drawCursor(s){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;s?(this.cursor.style.left=s.left/t+"px",this.cursor.style.top=s.top/e+"px",this.cursor.style.height=s.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(mi)!=s&&this.view.dispatch({effects:Qa.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function wm(){return[mi,Mu]}function zo(s,t,e,i,n){t.lastIndex=0;for(let r=s.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)n(o+l.index,l)}function Du(s,t){let e=s.visibleRanges;if(e.length==1&&e[0].from==s.viewport.from&&e[0].to==s.viewport.to)return e;let i=[];for(let{from:n,to:r}of e)n=Math.max(s.state.doc.lineAt(n).from,n-t),r=Math.min(s.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=n?i[i.length-1].to=r:i.push({from:n,to:r});return i}class Ou{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(l,a,c,h)=>n(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let f=i(l,a,c);f&&h(c,c+l[0].length,f)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new Oe,i=e.add.bind(e);for(let{from:n,to:r}of Du(t,this.maxLength))zo(t.state.doc,this.regexp,n,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>t.view.viewport.from&&l1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,n);if(l>o){let a=t.state.doc.lineAt(o),c=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lu.push(y.range(g,m));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,t,g,p));e=e.update({filterFrom:h,filterTo:f,filter:(g,m)=>gf,add:u})}}return e}}const Xs=/x/.unicode!=null?"gu":"g",Tu=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Xs),Pu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ss=null;function Bu(){var s;if(ss==null&&typeof document<"u"&&document.body){let t=document.body.style;ss=((s=t.tabSize)!==null&&s!==void 0?s:t.MozTabSize)!=null}return ss||!1}const gn=T.define({combine(s){let t=Ee(s,{render:null,specialChars:Tu,addSpecialChars:null});return(t.replaceTabs=!Bu())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Xs)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Xs)),t}});function Sm(s={}){return[gn.of(s),Ru()]}let qo=null;function Ru(){return qo||(qo=ut.fromClass(class{constructor(s){this.view=s,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(gn)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new Ou({regexp:s.specialChars,decoration:(t,e,i)=>{let{doc:n}=e.state,r=st(t[0],0);if(r==9){let o=n.lineAt(i),l=e.state.tabSize,a=ii(o.text,l,i-o.from);return B.replace({widget:new Nu((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new Iu(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let t=s.state.facet(gn);s.startState.facet(gn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const Lu="•";function Eu(s){return s>=32?Lu:s==10?"␤":String.fromCharCode(9216+s)}class Iu extends Ie{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=Eu(this.code),i=t.state.phrase("Control character")+" "+(Pu[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Nu extends Ie{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class Fu extends Ie{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?Je(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=Ei(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return n.bottom-n.top>r*1.5?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}function km(s){return ut.fromClass(class{constructor(t){this.view=t,this.placeholder=s?B.set([B.widget({widget:new Fu(s),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:t=>t.decorations})}const _s=2e3;function Vu(s,t,e){let i=Math.min(t.line,e.line),n=Math.max(t.line,e.line),r=[];if(t.off>_s||e.off>_s||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=n;a++){let c=s.doc.line(a);c.length<=l&&r.push(b.range(c.from+o,c.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=n;a++){let c=s.doc.line(a),h=Ds(c.text,o,s.tabSize,!0);if(h<0)r.push(b.cursor(c.to));else{let f=Ds(c.text,l,s.tabSize);r.push(b.range(c.from+h,c.from+f))}}}return r}function Hu(s,t){let e=s.coordsAtPos(s.viewport.from);return e?Math.round(Math.abs((e.left-t)/s.defaultCharacterWidth)):-1}function Ko(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1),i=s.state.doc.lineAt(e),n=e-i.from,r=n>_s?-1:n==i.length?Hu(s,t.clientX):ii(i.text,s.state.tabSize,e-i.from);return{line:i.number,col:r,off:n}}function Wu(s,t){let e=Ko(s,t),i=s.state.selection;return e?{update(n){if(n.docChanged){let r=n.changes.mapPos(n.startState.doc.line(e.line).from),o=n.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(n.changes)}},get(n,r,o){let l=Ko(s,n);if(!l)return i;let a=Vu(s.state,e,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function vm(s){let t=e=>e.altKey&&e.button==0;return O.mouseSelectionStyle.of((e,i)=>t(i)?Wu(e,i):null)}const ai="-10000px";class zu{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let n=t.state.facet(this.facet),r=n.filter(a=>a);if(n===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;ae[c]=a),e.length=l.length),this.input=n,this.tooltips=r,this.tooltipViews=o,!0}}function qu(s){let{win:t}=s;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const rs=T.define({combine:s=>{var t,e,i;return{position:D.ios?"absolute":((t=s.find(n=>n.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=s.find(n=>n.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=s.find(n=>n.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||qu}}}),$o=new WeakMap,Za=ut.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=s.state.facet(rs);this.position=t.position,this.parent=t.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new zu(s,th,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(s,this.above);t&&this.observeIntersection();let e=t||s.geometryChanged,i=s.state.facet(rs);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let n of this.manager.tooltipViews)n.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let n of this.manager.tooltipViews)this.container.appendChild(n.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(s,t){let e=s.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let n=document.createElement("div");n.className="cm-tooltip-arrow",e.dom.appendChild(n)}return e.dom.style.position=this.position,e.dom.style.top=ai,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var s,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(s=i.destroy)===null||s===void 0||s.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect(),t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:n}=this.manager.tooltipViews[0];if(D.gecko)i=n.offsetParent!=this.container.ownerDocument.body;else if(n.style.top==ai&&n.style.left=="0px"){let r=n.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(t=n.width/this.parent.offsetWidth,e=n.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((n,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(n.pos):this.view.coordsAtPos(n.pos)}),size:this.manager.tooltipViews.map(({dom:n})=>n.getBoundingClientRect()),space:this.view.state.facet(rs).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(s){var t;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:e,space:i,scaleX:n,scaleY:r}=s,o=[];for(let l=0;l=Math.min(e.bottom,i.bottom)||f.rightMath.min(e.right,i.right)+.1){h.style.top=ai;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=$o.get(c))!==null&&t!==void 0?t:u.bottom-u.top,y=c.offset||$u,x=this.view.textDirection==X.LTR,S=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-y.x),i.right-g),k=this.above[l];!a.strictSide&&(k?f.top-(u.bottom-u.top)-y.yi.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let w=(k?f.top-i.top:i.bottom-f.bottom)-p;if(wS&&R.topv&&(v=k?R.top-m-2-p:R.bottom+p+2);if(this.position=="absolute"?(h.style.top=(v-s.parent.top)/r+"px",h.style.left=(S-s.parent.left)/n+"px"):(h.style.top=v/r+"px",h.style.left=S/n+"px"),d){let R=f.left+(x?y.x:-y.x)-(S+14-7);d.style.left=R/n+"px"}c.overlap!==!0&&o.push({left:S,top:v,right:A,bottom:v+m}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=ai}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Ku=O.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),$u={x:0,y:0},th=T.define({enables:[Za,Ku]});function eh(s,t){let e=s.plugin(Za);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const jo=T.define({combine(s){let t,e;for(let i of s)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function Cn(s,t){let e=s.plugin(ih),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const ih=ut.fromClass(class{constructor(s){this.input=s.state.facet(An),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(s));let t=s.state.facet(jo);this.top=new Zi(s,!0,t.topContainer),this.bottom=new Zi(s,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(s){let t=s.state.facet(jo);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Zi(s.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Zi(s.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=s.state.facet(An);if(e!=this.input){let i=e.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(s.view),l.push(h)):(h=this.panels[c],h.update&&h.update(s)),n.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>O.scrollMargins.of(t=>{let e=t.plugin(s);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Zi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Uo(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Uo(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Uo(s){let t=s.nextSibling;return s.remove(),t}const An=T.define({enables:ih});class Re extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Re.prototype.elementClass="";Re.prototype.toDOM=void 0;Re.prototype.mapMode=ht.TrackBefore;Re.prototype.startSide=Re.prototype.endSide=-1;Re.prototype.point=!0;const ju=T.define(),Uu=new class extends Re{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Gu=ju.compute(["selection"],s=>{let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.head).from;n>e&&(e=n,t.push(Uu.range(n)))}return K.of(t)});function Cm(){return Gu}const Ju=1024;let Yu=0;class Rt{constructor(t,e){this.from=t,this.to=e}}class L{constructor(t={}){this.id=Yu++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=mt.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:s=>s.split(" ")});L.openedBy=new L({deserialize:s=>s.split(" ")});L.group=new L({deserialize:s=>s.split(" ")});L.isolate=new L({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Di{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[L.mounted.id]}}const Xu=Object.create(null);class mt{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Xu,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new mt(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(L.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(L.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}}mt.none=new mt("",Object.create(null),0,8);class Ar{constructor(t){this.types=t;for(let e=0;e0;for(let a=this.cursor(o|Y.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Or(mt.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new U(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new U(mt.none,e,i,n)))}static build(t){return td(t)}}U.empty=new U(mt.none,[],[],0);class Mr{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Mr(this.buffer,this.index)}}class ye{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return mt.none}toString(){let t=[];for(let e=0;e0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l=t&&et;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Oi(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to0?l.length:-1;t!=c;t+=e){let h=l[t],f=a[t]+o.from;if(nh(n,i,f,f+h.length)){if(h instanceof ye){if(r&Y.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,e,i-f,n);if(u>-1)return new Yt(new _u(o,h,t,f),null,u)}else if(r&Y.IncludeAnonymous||!h.type.isAnonymous||Dr(h)){let u;if(!(r&Y.IgnoreMounts)&&(u=Di.get(h))&&!u.overlay)return new ft(u.tree,f,t,o);let d=new ft(h,f,t,o);return r&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?h.children.length-1:0,e,i,n)}}}if(r&Y.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&Y.IgnoreOverlays)&&(n=Di.get(this._tree))&&n.overlay){let r=t-this.from;for(let{from:o,to:l}of n.overlay)if((e>0?o<=r:o=r:l>r))return new ft(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Jo(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function Qs(s,t,e=t.length-1){for(let i=s;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class _u{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Yt extends sh{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Yt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Yt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Yt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Yt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new U(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function rh(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;re.from||o.to=t){let l=new ft(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Oi(l,t,e,!1))}}return n?rh(n):i}class Mn{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ft)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof ft?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Y.IncludeAnonymous||l instanceof ye||!l.type.isAnonymous||Dr(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return Qs(this._tree,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function Dr(s){return s.children.some(t=>t instanceof ye||!t.type.isAnonymous||Dr(t))}function td(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=Ju,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new Mr(e,e.length):e,a=i.types,c=0,h=0;function f(w,v,A,R,I,z){let{id:E,start:P,end:W,size:V}=l,j=h,pt=c;for(;V<0;)if(l.next(),V==-1){let ee=r[E];A.push(ee),R.push(P-w);return}else if(V==-3){c=E;return}else if(V==-4){h=E;return}else throw new RangeError(`Unrecognized record size: ${V}`);let kt=a[E],zt,it,Ot=P-w;if(W-P<=n&&(it=m(l.pos-v,I))){let ee=new Uint16Array(it.size-it.skip),Tt=l.pos-it.size,qt=ee.length;for(;l.pos>Tt;)qt=y(it.start,ee,qt);zt=new ye(ee,W-it.start,i),Ot=it.start-w}else{let ee=l.pos-V;l.next();let Tt=[],qt=[],we=E>=o?E:-1,Ne=0,zi=W;for(;l.pos>ee;)we>=0&&l.id==we&&l.size>=0?(l.end<=zi-n&&(p(Tt,qt,P,Ne,l.end,zi,we,j,pt),Ne=Tt.length,zi=l.end),l.next()):z>2500?u(P,ee,Tt,qt):f(P,ee,Tt,qt,we,z+1);if(we>=0&&Ne>0&&Ne-1&&Ne>0){let Ur=d(kt,pt);zt=Or(kt,Tt,qt,0,Tt.length,0,W-P,Ur,Ur)}else zt=g(kt,Tt,qt,W-P,j-W,pt)}A.push(zt),R.push(Ot)}function u(w,v,A,R){let I=[],z=0,E=-1;for(;l.pos>v;){let{id:P,start:W,end:V,size:j}=l;if(j>4)l.next();else{if(E>-1&&W=0;V-=3)P[j++]=I[V],P[j++]=I[V+1]-W,P[j++]=I[V+2]-W,P[j++]=j;A.push(new ye(P,I[2]-W,i)),R.push(W-w)}}function d(w,v){return(A,R,I)=>{let z=0,E=A.length-1,P,W;if(E>=0&&(P=A[E])instanceof U){if(!E&&P.type==w&&P.length==I)return P;(W=P.prop(L.lookAhead))&&(z=R[E]+P.length+W)}return g(w,A,R,I,z,v)}}function p(w,v,A,R,I,z,E,P,W){let V=[],j=[];for(;w.length>R;)V.push(w.pop()),j.push(v.pop()+A-I);w.push(g(i.types[E],V,j,z-I,P-z,W)),v.push(I-A)}function g(w,v,A,R,I,z,E){if(z){let P=[L.contextHash,z];E=E?[P].concat(E):[P]}if(I>25){let P=[L.lookAhead,I];E=E?[P].concat(E):[P]}return new U(w,v,A,R,E)}function m(w,v){let A=l.fork(),R=0,I=0,z=0,E=A.end-n,P={size:0,start:0,skip:0};t:for(let W=A.pos-w;A.pos>W;){let V=A.size;if(A.id==v&&V>=0){P.size=R,P.start=I,P.skip=z,z+=4,R+=4,A.next();continue}let j=A.pos-V;if(V<0||j=o?4:0,kt=A.start;for(A.next();A.pos>j;){if(A.size<0)if(A.size==-3)pt+=4;else break t;else A.id>=o&&(pt+=4);A.next()}I=kt,R+=V,z+=pt}return(v<0||R==w)&&(P.size=R,P.start=I,P.skip=z),P.size>4?P:void 0}function y(w,v,A){let{id:R,start:I,end:z,size:E}=l;if(l.next(),E>=0&&R4){let W=l.pos-(E-4);for(;l.pos>W;)A=y(w,v,A)}v[--A]=P,v[--A]=z-w,v[--A]=I-w,v[--A]=R}else E==-3?c=R:E==-4&&(h=R);return A}let x=[],S=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,x,S,-1,0);let k=(t=s.length)!==null&&t!==void 0?t:x.length?S[0]+x[0].length:0;return new U(a[s.topID],x.reverse(),S.reverse(),k)}const Yo=new WeakMap;function mn(s,t){if(!s.isAnonymous||t instanceof ye||t.type!=s)return 1;let e=Yo.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof U)){e=1;break}e+=mn(s,i)}Yo.set(t,e)}return e}function Or(s,t,e,i,n,r,o,l,a){let c=0;for(let p=i;p=h)break;v+=A}if(S==k+1){if(v>h){let A=p[k];d(A.children,A.positions,0,A.children.length,g[k]+x);continue}f.push(p[k])}else{let A=g[S-1]+p[S-1].length-w;f.push(Or(s,p,g,k,S,w,A,null,a))}u.push(w+x-r)}}return d(t,e,i,n,0),(l||a)(f,u,o)}class Am{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Yt?this.setBuffer(t.context.buffer,t.index,e):t instanceof ft&&this.map.set(t.tree,e)}get(t){return t instanceof Yt?this.getBuffer(t.context.buffer,t.index):t instanceof ft?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class ne{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new ne(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,c=0;;l++){let h=l=i)for(;o&&o.from=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new ne(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&n.push(u),o.to>f)break;o=rnew Rt(n.from,n.to)):[new Rt(0,0)]:[new Rt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}}class ed{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Mm(s){return(t,e,i,n)=>new nd(t,s,e,i,n)}class Xo{constructor(t,e,i,n,r){this.parser=t,this.parse=e,this.overlay=i,this.target=n,this.from=r}}function _o(s){if(!s.length||s.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class id{constructor(t,e,i,n,r,o,l){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Zs=new L({perNode:!0});class nd{constructor(t,e,i,n,r){this.nest=e,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[Zs,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[L.mounted.id]=new Di(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)l=!1;else if(t.hasNode(n)){if(e){let c=e.mounts.find(h=>h.frag.from<=n.from&&h.frag.to>=n.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=n.from&&u<=n.to&&!e.ranges.some(d=>d.fromf)&&e.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=sd(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew Rt(f.from-n.from,f.to-n.from)):null,n.tree,h.length?h[0].from:n.from)),r.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(n))&&(a===!0&&(a=new Rt(n.from,n.to)),a.from=0&&e.ranges[c].to==a.from?e.ranges[c]={from:e.ranges[c].from,to:a.to}:e.ranges.push(a)}if(l&&n.firstChild())e&&e.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break t;if(e&&!--e.depth){let c=tl(this.ranges,e.ranges);c.length&&(_o(c),this.inner.splice(e.index,0,new Xo(e.parser,e.parser.startParse(this.input,el(e.mounts,c),c),e.ranges.map(h=>new Rt(h.from-e.start,h.to-e.start)),e.target,c[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function sd(s,t,e){for(let i of s){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function Qo(s,t,e,i,n,r){if(t=t&&e.enter(i,1,Y.IgnoreOverlays|Y.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof U)e=e.children[0];else break}return!1}}class od{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(Zs))!==null&&e!==void 0?e:i.to,this.inner=new Zo(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(Zs))!==null&&t!==void 0?t:e.to,this.inner=new Zo(e.tree,-e.offset)}}findMounts(t,e){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==e)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function tl(s,t){let e=null,i=t;for(let n=1,r=0;n=l)break;a.to<=o||(e||(i=e=t.slice()),a.froml&&e.splice(r+1,0,new Rt(l,a.to))):a.to>l?e[r--]=new Rt(l,a.to):e.splice(r--,1))}}return i}function ld(s,t,e,i){let n=0,r=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=n==s.length?1e9:o?s[n].to:s[n].from,f=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(h,f,i);unew Rt(u.from+i,u.to+i)),f=ld(t,h,a,c);for(let u=0,d=a;;u++){let p=u==f.length,g=p?c:f[u].from;if(g>d&&e.push(new ne(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else e.push(new ne(a,c,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let ad=0;class Pt{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=ad++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof Pt&&(e=t),e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new Pt(i,[],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(t){let e=new Dn(t);return i=>i.modified.indexOf(e)>-1?i:Dn.get(i.base||i,i.modified.concat(e).sort((n,r)=>n.id-r.id))}}let hd=0;class Dn{constructor(t){this.name=t,this.instances=[],this.id=hd++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&cd(e,l.modified));if(i)return i;let n=[],r=new Pt(t.name,n,t,e);for(let l of e)l.instances.push(r);let o=fd(e);for(let l of t.set)if(!l.modified.length)for(let a of o)n.push(Dn.get(l,a));return r}}function cd(s,t){return s.length==t.length&&s.every((e,i)=>e==t[i])}function fd(s){let t=[[]];for(let e=0;ei.length-e.length)}function ud(s){let t=Object.create(null);for(let e in s){let i=s[e];Array.isArray(i)||(i=[i]);for(let n of e.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+n);let h=new On(i,o,a>0?r.slice(0,a):null);t[c]=h.sort(t[c])}}return lh.add(t)}const lh=new L;class On{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=n;for(let l of r)for(let a of l.set){let c=e[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function dd(s,t){let e=null;for(let i of s){let n=i.style(t);n&&(e=e?e+" "+n:n)}return e}function pd(s,t,e,i=0,n=s.length){let r=new gd(i,Array.isArray(t)?t:[t],e);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class gd{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=n,h=md(t)||On.empty,f=dd(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(e,l),c),h.opaque)return;let u=t.tree&&t.tree.prop(L.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let x=m=S||!t.nextSibling())););if(!x||S>i)break;y=x.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&t.parent()}else if(t.firstChild()){u&&(n="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),c)}while(t.nextSibling());t.parent()}}}function md(s){let t=s.type.prop(lh);for(;t&&t.context&&!s.matchContext(t.context);)t=t.next;return t||null}const C=Pt.define,en=C(),oe=C(),il=C(oe),nl=C(oe),le=C(),nn=C(le),os=C(le),Ut=C(),Se=C(Ut),$t=C(),jt=C(),tr=C(),hi=C(tr),sn=C(),M={comment:en,lineComment:C(en),blockComment:C(en),docComment:C(en),name:oe,variableName:C(oe),typeName:il,tagName:C(il),propertyName:nl,attributeName:C(nl),className:C(oe),labelName:C(oe),namespace:C(oe),macroName:C(oe),literal:le,string:nn,docString:C(nn),character:C(nn),attributeValue:C(nn),number:os,integer:C(os),float:C(os),bool:C(le),regexp:C(le),escape:C(le),color:C(le),url:C(le),keyword:$t,self:C($t),null:C($t),atom:C($t),unit:C($t),modifier:C($t),operatorKeyword:C($t),controlKeyword:C($t),definitionKeyword:C($t),moduleKeyword:C($t),operator:jt,derefOperator:C(jt),arithmeticOperator:C(jt),logicOperator:C(jt),bitwiseOperator:C(jt),compareOperator:C(jt),updateOperator:C(jt),definitionOperator:C(jt),typeOperator:C(jt),controlOperator:C(jt),punctuation:tr,separator:C(tr),bracket:hi,angleBracket:C(hi),squareBracket:C(hi),paren:C(hi),brace:C(hi),content:Ut,heading:Se,heading1:C(Se),heading2:C(Se),heading3:C(Se),heading4:C(Se),heading5:C(Se),heading6:C(Se),contentSeparator:C(Ut),list:C(Ut),quote:C(Ut),emphasis:C(Ut),strong:C(Ut),link:C(Ut),monospace:C(Ut),strikethrough:C(Ut),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:sn,documentMeta:C(sn),annotation:C(sn),processingInstruction:C(sn),definition:Pt.defineModifier("definition"),constant:Pt.defineModifier("constant"),function:Pt.defineModifier("function"),standard:Pt.defineModifier("standard"),local:Pt.defineModifier("local"),special:Pt.defineModifier("special")};for(let s in M){let t=M[s];t instanceof Pt&&(t.name=s)}ah([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var ls;const Ae=new L;function hh(s){return T.define({combine:s?t=>t.concat(s):void 0})}const yd=new L;class Lt{constructor(t,e,i=[],n=""){this.data=t,this.name=n,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return yt(this)}}),this.parser=e,this.extension=[ti.of(this),H.languageData.of((r,o,l)=>{let a=sl(r,o,l),c=a.type.prop(Ae);if(!c)return[];let h=r.facet(c),f=a.type.prop(yd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(t,e,i=-1){return sl(t,e,i).type.prop(Ae)==this.data}findRegions(t){let e=t.facet(ti);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Ae)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ae)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?e:void 0)]}),t.name)}configure(t,e){return new er(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function yt(s){let t=s.field(Lt.state,!1);return t?t.tree:U.empty}class bd{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let ci=null;class Qe{constructor(t,e,i=[],n,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Qe(t,e,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new bd(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=U.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let n=Date.now()+t;t=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(ne.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=ci;ci=this;try{return t()}finally{ci=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=rl(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),i=ne.applyChanges(i,a),n=U.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);ht.from&&(this.fragments=rl(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends oh{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=ci;if(a){for(let c of n)a.tempSkipped.push(c);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new U(mt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return ci}}function rl(s,t,e){return ne.applyChanges(s,[{fromA:t,toA:e,fromB:t,toB:e}])}class Ze{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Ze(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Qe.create(t.facet(ti).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Ze(i)}}Lt.state=bt.define({create:Ze.init,update(s,t){for(let e of t.effects)if(e.is(Lt.setState))return e.value;return t.startState.facet(ti)!=t.state.facet(ti)?Ze.init(t.state):s.apply(t)}});let ch=s=>{let t=setTimeout(()=>s(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(ch=s=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(s,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const as=typeof navigator<"u"&&(!((ls=navigator.scheduling)===null||ls===void 0)&&ls.isInputPending)?()=>navigator.scheduling.isInputPending():null,xd=ut.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Lt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Lt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=ch(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndn+1e3,a=r.context.work(()=>as&&as()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Lt.setState.of(new Ze(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Mt(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ti=T.define({combine(s){return s.length?s[0]:null},enables:s=>[Lt.state,xd,O.contentAttributes.compute([s],t=>{let e=t.facet(s);return e&&e.name?{"data-language":e.name}:{}})]});class Om{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const fh=T.define(),qn=T.define({combine:s=>{if(!s.length)return" ";let t=s[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return t}});function Le(s){let t=s.facet(qn);return t.charCodeAt(0)==9?s.tabSize*t.length:t.length}function Tn(s,t){let e="",i=s.tabSize,n=s.facet(qn)[0];if(n==" "){for(;t>=i;)e+=" ",t-=i;n=" "}for(let r=0;r=t?Sd(s,e,t):null}class Kn{constructor(t,e={}){this.state=t,this.options=e,this.unit=Le(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ii(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const wd=new L;function Sd(s,t,e){let i=t.resolveStack(e),n=i.node.enterUnfinishedNodesBefore(e);if(n!=i.node){let r=[];for(let o=n;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return dh(i,s,e)}function dh(s,t,e){for(let i=s;i;i=i.next){let n=vd(i.node);if(n)return n(Tr.create(t,e,i))}return 0}function kd(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function vd(s){let t=s.type.prop(wd);if(t)return t;let e=s.firstChild,i;if(e&&(i=e.type.prop(L.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>ph(o,!0,1,void 0,r&&!kd(o)?n.from:void 0)}return s.parent==null?Cd:null}function Cd(){return 0}class Tr extends Kn{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Tr(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Ad(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return dh(this.context.next,this.base,this.pos)}}function Ad(s,t){for(let e=t;e;e=e.parent)if(s==e)return!0;return!1}function Md(s){let t=s.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(e.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+c}}l=a.to}}function Tm({closing:s,align:t=!0,units:e=1}){return i=>ph(i,t,e,s)}function ph(s,t,e,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=t?Md(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*e)}const Pm=s=>s.baseIndent;function Bm({except:s,units:t=1}={}){return e=>{let i=s&&s.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Rm=new L;function Lm(s){let t=s.firstChild,e=s.lastChild;return t&&t.tol.prop(Ae)==o.data:o?l=>l==o:void 0,this.style=ah(t.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new pe(i):null,this.themeType=e.themeType}static define(t,e){return new $n(t,e||{})}}const ir=T.define(),gh=T.define({combine(s){return s.length?[s[0]]:null}});function hs(s){let t=s.facet(ir);return t.length?t:s.facet(gh)}function Em(s,t){let e=[Od],i;return s instanceof $n&&(s.module&&e.push(O.styleModule.of(s.module)),i=s.themeType),t!=null&&t.fallback?e.push(gh.of(s)):i?e.push(ir.computeN([O.darkTheme],n=>n.facet(O.darkTheme)==(i=="dark")?[s]:[])):e.push(ir.of(s)),e}class Dd{constructor(t){this.markCache=Object.create(null),this.tree=yt(t.state),this.decorations=this.buildDeco(t,hs(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=yt(t.state),i=hs(t.state),n=i!=hs(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return B.none;let i=new Oe;for(let{from:n,to:r}of t.visibleRanges)pd(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},n,r);return i.finish()}}const Od=be.high(ut.fromClass(Dd,{decorations:s=>s.decorations})),Im=$n.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),Td=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),mh=1e4,yh="()[]{}",bh=T.define({combine(s){return Ee(s,{afterCursor:!0,brackets:yh,maxScanDistance:mh,renderMatch:Rd})}}),Pd=B.mark({class:"cm-matchingBracket"}),Bd=B.mark({class:"cm-nonmatchingBracket"});function Rd(s){let t=[],e=s.matched?Pd:Bd;return t.push(e.range(s.start.from,s.start.to)),s.end&&t.push(e.range(s.end.from,s.end.to)),t}const Ld=bt.define({create(){return B.none},update(s,t){if(!t.docChanged&&!t.selection)return s;let e=[],i=t.state.facet(bh);for(let n of t.state.selection.ranges){if(!n.empty)continue;let r=Xt(t.state,n.head,-1,i)||n.head>0&&Xt(t.state,n.head-1,1,i)||i.afterCursor&&(Xt(t.state,n.head,1,i)||n.headO.decorations.from(s)}),Ed=[Ld,Td];function Nm(s={}){return[bh.of(s),Ed]}const Id=new L;function nr(s,t,e){let i=s.prop(t<0?L.openedBy:L.closedBy);if(i)return i;if(s.name.length==1){let n=e.indexOf(s.name);if(n>-1&&n%2==(t<0?1:0))return[e[n+t]]}return null}function sr(s){let t=s.type.prop(Id);return t?t(s.node):s}function Xt(s,t,e,i={}){let n=i.maxScanDistance||mh,r=i.brackets||yh,o=yt(s),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let c=nr(a.type,e,r);if(c&&a.from0?t>=h.from&&th.from&&t<=h.to))return Nd(s,t,e,a,h,c,r)}}return Fd(s,t,e,o,l.type,n,r)}function Nd(s,t,e,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},c=0,h=l==null?void 0:l.cursor();if(h&&(e<0?h.childBefore(i.from):h.childAfter(i.to)))do if(e<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:e<0?t-1:t,to:e>0?t+1:t},h=s.doc.iterRange(t,e>0?s.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=n))if(y%2==0==e>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}e>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}function ol(s,t,e,i=0,n=0){t==null&&(t=s.search(/[^\s\u00a0]/),t==-1&&(t=s.length));let r=n;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pose}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return n(r)==n(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Vd(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||Hd,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||Br}}function Hd(s){if(typeof s!="object")return s;let t={};for(let e in s){let i=s[e];t[e]=i instanceof Array?i.slice():i}return t}const ll=new WeakMap;class wh extends Lt{constructor(t){let e=hh(t.languageData),i=Vd(t),n,r=new class extends oh{createParse(o,l,a){return new zd(n,o,l,a)}};super(e,r,[fh.of((o,l)=>this.getIndent(o,l))],t.name),this.topNode=$d(e),n=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=t.tokenTable?new Ch(i.tokenTable):Kd}static define(t){return new wh(t)}getIndent(t,e){let i=yt(t.state),n=i.resolve(e);for(;n&&n.type!=this.topNode;)n=n.parent;if(!n)return null;let r,{overrideIndentation:o}=t.options;o&&(r=ll.get(t.state),r!=null&&r1e4)return null;for(;a=i&&e+t.length<=n&&t.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],c=l instanceof U&&a=t.length)return t;!n&&t.type==s.topNode&&(n=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(oe&&Pr(s,n.tree,0-n.offset,e,o),a;if(l&&(a=Sh(s,n.tree,e+n.offset,l.pos+n.offset,!1)))return{state:l.state,tree:a}}return{state:s.streamParser.startState(i?Le(i):4),tree:U.empty}}class zd{constructor(t,e,i,n){this.lang=t,this.input=e,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Qe.get(),o=n[0].from,{state:l,tree:a}=Wd(t,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==` +`&&(e="");else{let i=e.indexOf(` +`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(e,r,1),e+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,n+=this.chunk.length-o}return this.chunk.push(t,e,i,n),r}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new xh(e,t?t.state.tabSize:4,t?Le(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=kh(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return n}throw new Error("Stream parser failed to advance stream.")}const Br=Object.create(null),Ti=[mt.none],qd=new Ar(Ti),al=[],hl=Object.create(null),vh=Object.create(null);for(let[s,t]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"]])vh[s]=Ah(Br,t);class Ch{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),vh)}resolve(t){return t?this.table[t]||(this.table[t]=Ah(this.extra,t)):0}}const Kd=new Ch(Br);function cs(s,t){al.indexOf(s)>-1||(al.push(s),console.warn(t))}function Ah(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let c of l.split(".")){let h=s[c]||M[c];h?typeof h=="function"?a.length?a=a.map(h):cs(c,`Modifier ${c} used at start of tag`):a.length?cs(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:cs(c,`Unknown highlighting tag ${c}`)}for(let c of a)e.push(c)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=hl[n];if(r)return r.id;let o=hl[n]=mt.define({id:Ti.length,name:i,props:[ud({[i]:e})]});return Ti.push(o),o.id}function $d(s){let t=mt.define({id:Ti.length,name:"Document",props:[Ae.add(()=>s)],top:!0});return Ti.push(t),t}X.RTL,X.LTR;const jd=s=>{let{state:t}=s,e=t.doc.lineAt(t.selection.main.from),i=Lr(s.state,e.from);return i.line?Ud(s):i.block?Jd(s):!1};function Rr(s,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=s(t,e);return n?(i(e.update(n)),!0):!1}}const Ud=Rr(_d,0),Gd=Rr(Mh,0),Jd=Rr((s,t)=>Mh(s,t,Xd(t)),0);function Lr(s,t){let e=s.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const fi=50;function Yd(s,{open:t,close:e},i,n){let r=s.sliceDoc(i-fi,i),o=s.sliceDoc(n,n+fi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-t.length,c)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let h,f;n-i<=2*fi?h=f=s.sliceDoc(i,n):(h=s.sliceDoc(i,i+fi),f=s.sliceDoc(n-fi,n));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return h.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(h.charAt(u+t.length))?1:0},close:{pos:n-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Xd(s){let t=[];for(let e of s.selection.ranges){let i=s.doc.lineAt(e.from),n=e.to<=i.to?i:s.doc.lineAt(e.to);n.from>i.from&&n.from==e.to&&(n=e.to==i.to+1?i:s.doc.lineAt(e.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=n.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return t}function Mh(s,t,e=t.selection.ranges){let i=e.map(r=>Lr(t,r.from).block);if(!i.every(r=>r))return null;let n=e.map((r,o)=>Yd(t,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:t.changes(e.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;on&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of i)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const rr=re.define(),Qd=re.define(),Zd=T.define(),Dh=T.define({combine(s){return Ee(s,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}}),Oh=bt.define({create(){return _t.empty},update(s,t){let e=t.state.facet(Dh),i=t.annotation(rr);if(i){let a=St.fromTransaction(t,i.selection),c=i.side,h=c==0?s.undone:s.done;return a?h=Pn(h,h.length,e.minDepth,a):h=Bh(h,t.startState.selection),new _t(c==0?i.rest:h,c==0?h:i.rest)}let n=t.annotation(Qd);if((n=="full"||n=="before")&&(s=s.isolate()),t.annotation(Z.addToHistory)===!1)return t.changes.empty?s:s.addMapping(t.changes.desc);let r=St.fromTransaction(t),o=t.annotation(Z.time),l=t.annotation(Z.userEvent);return r?s=s.addChanges(r,o,l,e,t):t.selection&&(s=s.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(t=>t.toJSON()),undone:s.undone.map(t=>t.toJSON())}},fromJSON(s){return new _t(s.done.map(St.fromJSON),s.undone.map(St.fromJSON))}});function Fm(s={}){return[Oh,Dh.of(s),O.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?Th:t.inputType=="historyRedo"?or:null;return i?(t.preventDefault(),i(e)):!1}})]}function jn(s,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let n=e.field(Oh,!1);if(!n)return!1;let r=n.pop(s,e,t);return r?(i(r),!0):!1}}const Th=jn(0,!1),or=jn(1,!1),tp=jn(0,!0),ep=jn(1,!0);class St{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new St(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(t){return new St(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Qt.fromJSON(t.mapped),t.startSelection&&b.fromJSON(t.startSelection),t.selectionsAfter.map(b.fromJSON))}static fromTransaction(t,e){let i=Et;for(let n of t.startState.facet(Zd)){let r=n(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new St(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Et)}static selection(t){return new St(void 0,Et,void 0,void 0,t)}}function Pn(s,t,e,i){let n=t+1>e+20?t-e-1:0,r=s.slice(n,t);return r.push(i),r}function ip(s,t){let e=[],i=!1;return s.iterChangedRanges((n,r)=>e.push(n,r)),t.iterChangedRanges((n,r,o,l)=>{for(let a=0;a=c&&o<=h&&(i=!0)}}),i}function np(s,t){return s.ranges.length==t.ranges.length&&s.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Ph(s,t){return s.length?t.length?s.concat(t):s:t}const Et=[],sp=200;function Bh(s,t){if(s.length){let e=s[s.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-sp));return i.length&&i[i.length-1].eq(t)?s:(i.push(t),Pn(s,s.length-1,1e9,e.setSelAfter(i)))}else return[St.selection([t])]}function rp(s){let t=s[s.length-1],e=s.slice();return e[s.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function fs(s,t){if(!s.length)return s;let e=s.length,i=Et;for(;e;){let n=op(s[e-1],t,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,e);return r[e-1]=n,r}else t=n.mapped,e--,i=n.selectionsAfter}return i.length?[St.selection(i)]:Et}function op(s,t,e){let i=Ph(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(t)):Et,e);if(!s.changes)return St.selection(i);let n=s.changes.map(t),r=t.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new St(n,N.mapEffects(s.effects,t),o,s.startSelection.map(r),i)}const lp=/^(input\.type|delete)($|\.)/;class _t{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new _t(this.done,this.undone):this}addChanges(t,e,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||lp.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime0&&e-this.prevTimee.empty?s.moveByChar(e,t):Un(e,t))}function dt(s){return s.textDirectionAt(s.state.selection.main.head)==X.LTR}const Lh=s=>Rh(s,!dt(s)),Eh=s=>Rh(s,dt(s));function Ih(s,t){return Wt(s,e=>e.empty?s.moveByGroup(e,t):Un(e,t))}const ap=s=>Ih(s,!dt(s)),hp=s=>Ih(s,dt(s));function cp(s,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(t.from,t.to)))||t.firstChild}function Gn(s,t,e){let i=yt(s).resolveInner(t.head),n=e?L.closedBy:L.openedBy;for(let a=t.head;;){let c=e?i.childAfter(a):i.childBefore(a);if(!c)break;cp(s,c,n)?i=c:a=e?c.to:c.from}let r=i.type.prop(n),o,l;return r&&(o=e?Xt(s,i.from,1):Xt(s,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,b.cursor(l,e?-1:1)}const fp=s=>Wt(s,t=>Gn(s.state,t,!dt(s))),up=s=>Wt(s,t=>Gn(s.state,t,dt(s)));function Nh(s,t){return Wt(s,e=>{if(!e.empty)return Un(e,t);let i=s.moveVertically(e,t);return i.head!=e.head?i:s.moveToLineBoundary(e,t)})}const Fh=s=>Nh(s,!1),Vh=s=>Nh(s,!0);function Hh(s){let t=s.scrollDOM.clientHeighto.empty?s.moveVertically(o,t,e.height):Un(o,t));if(n.eq(i.selection))return!1;let r;if(e.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,c=l.bottom-e.marginBottom;o&&o.top>a&&o.bottomWh(s,!1),lr=s=>Wh(s,!0);function xe(s,t,e){let i=s.lineBlockAt(t.head),n=s.moveToLineBoundary(t,e);if(n.head==t.head&&n.head!=(e?i.to:i.from)&&(n=s.moveToLineBoundary(t,e,!1)),!e&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(n=b.cursor(i.from+r))}return n}const dp=s=>Wt(s,t=>xe(s,t,!0)),pp=s=>Wt(s,t=>xe(s,t,!1)),gp=s=>Wt(s,t=>xe(s,t,!dt(s))),mp=s=>Wt(s,t=>xe(s,t,dt(s))),yp=s=>Wt(s,t=>b.cursor(s.lineBlockAt(t.head).from,1)),bp=s=>Wt(s,t=>b.cursor(s.lineBlockAt(t.head).to,-1));function xp(s,t,e){let i=!1,n=ni(s.selection,r=>{let o=Xt(s,r.head,-1)||Xt(s,r.head,1)||r.head>0&&Xt(s,r.head-1,1)||r.headxp(s,t);function Ft(s,t){let e=ni(s.state.selection,i=>{let n=t(i);return b.range(i.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return e.eq(s.state.selection)?!1:(s.dispatch(te(s.state,e)),!0)}function zh(s,t){return Ft(s,e=>s.moveByChar(e,t))}const qh=s=>zh(s,!dt(s)),Kh=s=>zh(s,dt(s));function $h(s,t){return Ft(s,e=>s.moveByGroup(e,t))}const Sp=s=>$h(s,!dt(s)),kp=s=>$h(s,dt(s)),vp=s=>Ft(s,t=>Gn(s.state,t,!dt(s))),Cp=s=>Ft(s,t=>Gn(s.state,t,dt(s)));function jh(s,t){return Ft(s,e=>s.moveVertically(e,t))}const Uh=s=>jh(s,!1),Gh=s=>jh(s,!0);function Jh(s,t){return Ft(s,e=>s.moveVertically(e,t,Hh(s).height))}const fl=s=>Jh(s,!1),ul=s=>Jh(s,!0),Ap=s=>Ft(s,t=>xe(s,t,!0)),Mp=s=>Ft(s,t=>xe(s,t,!1)),Dp=s=>Ft(s,t=>xe(s,t,!dt(s))),Op=s=>Ft(s,t=>xe(s,t,dt(s))),Tp=s=>Ft(s,t=>b.cursor(s.lineBlockAt(t.head).from)),Pp=s=>Ft(s,t=>b.cursor(s.lineBlockAt(t.head).to)),dl=({state:s,dispatch:t})=>(t(te(s,{anchor:0})),!0),pl=({state:s,dispatch:t})=>(t(te(s,{anchor:s.doc.length})),!0),gl=({state:s,dispatch:t})=>(t(te(s,{anchor:s.selection.main.anchor,head:0})),!0),ml=({state:s,dispatch:t})=>(t(te(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Bp=({state:s,dispatch:t})=>(t(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),Rp=({state:s,dispatch:t})=>{let e=Jn(s).map(({from:i,to:n})=>b.range(i,Math.min(n+1,s.doc.length)));return t(s.update({selection:b.create(e),userEvent:"select"})),!0},Lp=({state:s,dispatch:t})=>{let e=ni(s.selection,i=>{let n=yt(s),r=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return b.range(l.to,l.from)}return i});return e.eq(s.selection)?!1:(t(te(s,e)),!0)},Ep=({state:s,dispatch:t})=>{let e=s.selection,i=null;return e.ranges.length>1?i=b.create([e.main]):e.main.empty||(i=b.create([b.cursor(e.main.head)])),i?(t(te(s,i)),!0):!1};function Vi(s,t){if(s.state.readOnly)return!1;let e="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);ao&&(e="delete.forward",a=rn(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=rn(s,o,!1),l=rn(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,on(s)))i.between(t,t,(n,r)=>{nt&&(t=e?r:n)});return t}const Yh=(s,t,e)=>Vi(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(e&&!t&&n>o.from&&nYh(s,!1,!0),Xh=s=>Yh(s,!0,!1),_h=(s,t)=>Vi(s,e=>{let i=e.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?n.doc.lines:1)&&(i+=t?1:-1);break}let a=ot(r.text,i-r.from,t)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=e.head)&&(l=h),i=a}return i}),Qh=s=>_h(s,!1),Ip=s=>_h(s,!0),Np=s=>Vi(s,t=>{let e=s.lineBlockAt(t.head).to;return t.headVi(s,t=>{let e=s.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),Vp=s=>Vi(s,t=>{let e=s.moveToLineBoundary(t,!0).head;return t.head{if(s.readOnly)return!1;let e=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:F.of(["",""])},range:b.cursor(i.from)}));return t(s.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},Wp=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:ot(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:ot(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:b.cursor(l)}});return e.changes.empty?!1:(t(s.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Jn(s){let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),e>=n.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:n.from,to:r.to,ranges:[i]});e=r.number+1}return t}function Zh(s,t,e){if(s.readOnly)return!1;let i=[],n=[];for(let r of Jn(s)){if(e?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(b.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(b.range(a.anchor-l,a.head-l))}}return i.length?(t(s.update({changes:i,scrollIntoView:!0,selection:b.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const zp=({state:s,dispatch:t})=>Zh(s,t,!1),qp=({state:s,dispatch:t})=>Zh(s,t,!0);function tc(s,t,e){if(s.readOnly)return!1;let i=[];for(let n of Jn(s))e?i.push({from:n.from,insert:s.doc.slice(n.from,n.to)+s.lineBreak}):i.push({from:n.to,insert:s.lineBreak+s.doc.slice(n.from,n.to)});return t(s.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Kp=({state:s,dispatch:t})=>tc(s,t,!1),$p=({state:s,dispatch:t})=>tc(s,t,!0),jp=s=>{if(s.state.readOnly)return!1;let{state:t}=s,e=t.changes(Jn(t).map(({from:n,to:r})=>(n>0?n--:r{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(e);return s.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Up(s,t){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=yt(s).resolveInner(t),i=e.childBefore(t),n=e.childAfter(t),r;return i&&n&&i.to<=t&&n.from>=t&&(r=i.type.prop(L.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const yl=ec(!1),Gp=ec(!0);function ec(s){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:r,to:o}=n,l=t.doc.lineAt(r),a=!s&&r==o&&Up(t,r);s&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let c=new Kn(t,{simulateBreak:r,simulateDoubleBreak:!!a}),h=uh(c,r);for(h==null&&(h=ii(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));ol.from&&r{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,n,i),e=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Jp=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=Object.create(null),i=new Kn(s,{overrideIndentation:r=>{let o=e[r];return o??-1}}),n=Er(s,(r,o,l)=>{let a=uh(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Tn(s,a);(c!=h||l.froms.readOnly?!1:(t(s.update(Er(s,(e,i)=>{i.push({from:e.from,insert:s.facet(qn)})}),{userEvent:"input.indent"})),!0),nc=({state:s,dispatch:t})=>s.readOnly?!1:(t(s.update(Er(s,(e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let r=ii(n,s.tabSize),o=0,l=Tn(s,Math.max(0,r-Le(s)));for(;o(s.setTabFocusMode(),!0),Xp=[{key:"Ctrl-b",run:Lh,shift:qh,preventDefault:!0},{key:"Ctrl-f",run:Eh,shift:Kh},{key:"Ctrl-p",run:Fh,shift:Uh},{key:"Ctrl-n",run:Vh,shift:Gh},{key:"Ctrl-a",run:yp,shift:Tp},{key:"Ctrl-e",run:bp,shift:Pp},{key:"Ctrl-d",run:Xh},{key:"Ctrl-h",run:ar},{key:"Ctrl-k",run:Np},{key:"Ctrl-Alt-h",run:Qh},{key:"Ctrl-o",run:Hp},{key:"Ctrl-t",run:Wp},{key:"Ctrl-v",run:lr}],_p=[{key:"ArrowLeft",run:Lh,shift:qh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ap,shift:Sp,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:gp,shift:Dp,preventDefault:!0},{key:"ArrowRight",run:Eh,shift:Kh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:hp,shift:kp,preventDefault:!0},{mac:"Cmd-ArrowRight",run:mp,shift:Op,preventDefault:!0},{key:"ArrowUp",run:Fh,shift:Uh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:dl,shift:gl},{mac:"Ctrl-ArrowUp",run:cl,shift:fl},{key:"ArrowDown",run:Vh,shift:Gh,preventDefault:!0},{mac:"Cmd-ArrowDown",run:pl,shift:ml},{mac:"Ctrl-ArrowDown",run:lr,shift:ul},{key:"PageUp",run:cl,shift:fl},{key:"PageDown",run:lr,shift:ul},{key:"Home",run:pp,shift:Mp,preventDefault:!0},{key:"Mod-Home",run:dl,shift:gl},{key:"End",run:dp,shift:Ap,preventDefault:!0},{key:"Mod-End",run:pl,shift:ml},{key:"Enter",run:yl,shift:yl},{key:"Mod-a",run:Bp},{key:"Backspace",run:ar,shift:ar},{key:"Delete",run:Xh},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Qh},{key:"Mod-Delete",mac:"Alt-Delete",run:Ip},{mac:"Mod-Backspace",run:Fp},{mac:"Mod-Delete",run:Vp}].concat(Xp.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),Hm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:fp,shift:vp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:up,shift:Cp},{key:"Alt-ArrowUp",run:zp},{key:"Shift-Alt-ArrowUp",run:Kp},{key:"Alt-ArrowDown",run:qp},{key:"Shift-Alt-ArrowDown",run:$p},{key:"Escape",run:Ep},{key:"Mod-Enter",run:Gp},{key:"Alt-l",mac:"Ctrl-l",run:Rp},{key:"Mod-i",run:Lp,preventDefault:!0},{key:"Mod-[",run:nc},{key:"Mod-]",run:ic},{key:"Mod-Alt-\\",run:Jp},{key:"Shift-Mod-k",run:jp},{key:"Shift-Mod-\\",run:wp},{key:"Mod-/",run:jd},{key:"Alt-A",run:Gd},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Yp}].concat(_p),Wm={key:"Tab",run:ic,shift:nc};function lt(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=e[i];typeof n=="string"?s.setAttribute(i,n):n!=null&&(s[i]=n)}t++}for(;ts.normalize("NFKD"):s=>s;class ei{constructor(t,e,i=0,n=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(bl(l)):bl,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return st(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=fr(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Bt(t);let n=this.normalize(e);if(n.length)for(let r=0,o=i;;r++){let l=n.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==n.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=Bn(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=e){let l=new je(e,t.sliceString(e,i));return us.set(t,l),l}if(n.from==e&&n.to==i)return n;let{text:r,from:o}=n;return o>e&&(r=t.sliceString(e,o)+r,o=e),n.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,n=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this.matchPos=Bn(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=je.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(oc.prototype[Symbol.iterator]=lc.prototype[Symbol.iterator]=function(){return this});function Qp(s){try{return new RegExp(s,Ir),!0}catch{return!1}}function Bn(s,t){if(t>=s.length)return t;let e=s.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}function hr(s){let t=String(s.state.doc.lineAt(s.state.selection.main.head).number),e=lt("input",{class:"cm-textfield",name:"line",value:t}),i=lt("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),s.dispatch({effects:Rn.of(!1)}),s.focus()):r.keyCode==13&&(r.preventDefault(),n())},onsubmit:r=>{r.preventDefault(),n()}},lt("label",s.state.phrase("Go to line"),": ",e)," ",lt("button",{class:"cm-button",type:"submit"},s.state.phrase("go")));function n(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=s,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[Rn.of(!1),O.scrollIntoView(g.from,{y:"center"})],selection:g}),s.focus()}return{dom:i}}const Rn=N.define(),xl=bt.define({create(){return!0},update(s,t){for(let e of t.effects)e.is(Rn)&&(s=e.value);return s},provide:s=>An.from(s,t=>t?hr:null)}),Zp=s=>{let t=Cn(s,hr);if(!t){let e=[Rn.of(!0)];s.state.field(xl,!1)==null&&e.push(N.appendConfig.of([xl,tg])),s.dispatch({effects:e}),t=Cn(s,hr)}return t&&t.dom.querySelector("input").select(),!0},tg=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),eg={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ig=T.define({combine(s){return Ee(s,eg,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function zm(s){return[lg,og]}const ng=B.mark({class:"cm-selectionMatch"}),sg=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function wl(s,t,e,i){return(e==0||s(t.sliceDoc(e-1,e))!=J.Word)&&(i==t.doc.length||s(t.sliceDoc(i,i+1))!=J.Word)}function rg(s,t,e,i){return s(t.sliceDoc(e,e+1))==J.Word&&s(t.sliceDoc(i-1,i))==J.Word}const og=ut.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.selectionSet||s.docChanged||s.viewportChanged)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let t=s.state.facet(ig),{state:e}=s,i=e.selection;if(i.ranges.length>1)return B.none;let n=i.main,r,o=null;if(n.empty){if(!t.highlightWordAroundCursor)return B.none;let a=e.wordAt(n.head);if(!a)return B.none;o=e.charCategorizer(n.head),r=e.sliceDoc(a.from,a.to)}else{let a=n.to-n.from;if(a200)return B.none;if(t.wholeWords){if(r=e.sliceDoc(n.from,n.to),o=e.charCategorizer(n.head),!(wl(o,e,n.from,n.to)&&rg(o,e,n.from,n.to)))return B.none}else if(r=e.sliceDoc(n.from,n.to),!r)return B.none}let l=[];for(let a of s.visibleRanges){let c=new ei(e.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||wl(o,e,h,f))&&(n.empty&&h<=n.from&&f>=n.to?l.push(sg.range(h,f)):(h>=n.to||f<=n.from)&&l.push(ng.range(h,f)),l.length>t.maxMatches))return B.none}}return B.set(l)}},{decorations:s=>s.decorations}),lg=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ag=({state:s,dispatch:t})=>{let{selection:e}=s,i=b.create(e.ranges.map(n=>s.wordAt(n.head)||b.cursor(n.head)),e.mainIndex);return i.eq(e)?!1:(t(s.update({selection:i})),!0)};function hg(s,t){let{main:e,ranges:i}=s.selection,n=s.wordAt(e.head),r=n&&n.from==e.from&&n.to==e.to;for(let o=!1,l=new ei(s.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ei(s.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const cg=({state:s,dispatch:t})=>{let{ranges:e}=s.selection;if(e.some(r=>r.from===r.to))return ag({state:s,dispatch:t});let i=s.sliceDoc(e[0].from,e[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=hg(s,i);return n?(t(s.update({selection:s.selection.addRange(b.range(n.from,n.to),!1),effects:O.scrollIntoView(n.to)})),!0):!1},si=T.define({combine(s){return Ee(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Sg(t),scrollToMatch:t=>O.scrollIntoView(t)})}});class ac{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Qp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new pg(this):new ug(this)}getCursor(t,e=0,i){let n=t.doc?t:H.create({doc:t});return i==null&&(i=n.doc.length),this.regexp?He(this,n,e,i):Ve(this,n,e,i)}}class hc{constructor(t){this.spec=t}}function Ve(s,t,e,i){return new ei(t.doc,s.unquoted,e,i,s.caseSensitive?void 0:n=>n.toLowerCase(),s.wholeWord?fg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function fg(s,t){return(e,i,n,r)=>((r>e||r+n.length=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=Ve(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function He(s,t,e,i){return new oc(t.doc,s.search,{ignoreCase:!s.caseSensitive,test:s.wholeWord?dg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Ln(s,t){return s.slice(ot(s,t,!1),t)}function En(s,t){return s.slice(t,ot(s,t))}function dg(s){return(t,e,i)=>!i[0].length||(s(Ln(i.input,i.index))!=J.Word||s(En(i.input,i.index))!=J.Word)&&(s(En(i.input,i.index+i[0].length))!=J.Word||s(Ln(i.input,i.index+i[0].length))!=J.Word)}class pg extends hc{nextMatch(t,e,i){let n=He(this.spec,t,i,t.doc.length).next();return n.done&&(n=He(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let r=Math.max(e,i-n*1e4),o=He(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=He(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Pi=N.define(),Nr=N.define(),ue=bt.define({create(s){return new ds(cr(s).create(),null)},update(s,t){for(let e of t.effects)e.is(Pi)?s=new ds(e.value.create(),s.panel):e.is(Nr)&&(s=new ds(s.query,e.value?Fr:null));return s},provide:s=>An.from(s,t=>t.panel)});class ds{constructor(t,e){this.query=t,this.panel=e}}const gg=B.mark({class:"cm-searchMatch"}),mg=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),yg=ut.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ue))}update(s){let t=s.state.field(ue);(t!=s.startState.field(ue)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:s,panel:t}){if(!t||!s.spec.valid)return B.none;let{view:e}=this,i=new Oe;for(let n=0,r=e.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(e.state,l,a,(c,h)=>{let f=e.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,f?mg:gg)})}return i.finish()}},{decorations:s=>s.decorations});function Hi(s){return t=>{let e=t.state.field(ue,!1);return e&&e.query.spec.valid?s(t,e):uc(t)}}const In=Hi((s,{query:t})=>{let{to:e}=s.state.selection.main,i=t.nextMatch(s.state,e,e);if(!i)return!1;let n=b.single(i.from,i.to),r=s.state.facet(si);return s.dispatch({selection:n,effects:[Vr(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),fc(s),!0}),Nn=Hi((s,{query:t})=>{let{state:e}=s,{from:i}=e.selection.main,n=t.prevMatch(e,i,i);if(!n)return!1;let r=b.single(n.from,n.to),o=s.state.facet(si);return s.dispatch({selection:r,effects:[Vr(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),fc(s),!0}),bg=Hi((s,{query:t})=>{let e=t.matchAll(s.state,1e3);return!e||!e.length?!1:(s.dispatch({selection:b.create(e.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),xg=({state:s,dispatch:t})=>{let e=s.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:n}=e.main,r=[],o=0;for(let l=new ei(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return t(s.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Sl=Hi((s,{query:t})=>{let{state:e}=s,{from:i,to:n}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=[],l,a,c=[];if(r.from==i&&r.to==n&&(a=e.toText(t.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=t.nextMatch(e,r.from,r.to),c.push(O.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),r){let h=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-h,r.to-h),c.push(Vr(s,r)),c.push(e.facet(si).scrollToMatch(l.main,s))}return s.dispatch({changes:o,selection:l,effects:c,userEvent:"input.replace"}),!0}),wg=Hi((s,{query:t})=>{if(s.state.readOnly)return!1;let e=t.matchAll(s.state,1e9).map(n=>{let{from:r,to:o}=n;return{from:r,to:o,insert:t.getReplacement(n)}});if(!e.length)return!1;let i=s.state.phrase("replaced $ matches",e.length)+".";return s.dispatch({changes:e,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function Fr(s){return s.state.facet(si).createPanel(s)}function cr(s,t){var e,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=s.facet(si);return new ac({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(n=t==null?void 0:t.literal)!==null&&n!==void 0?n:c.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function cc(s){let t=Cn(s,Fr);return t&&t.dom.querySelector("[main-field]")}function fc(s){let t=cc(s);t&&t==s.root.activeElement&&t.select()}const uc=s=>{let t=s.state.field(ue,!1);if(t&&t.panel){let e=cc(s);if(e&&e!=s.root.activeElement){let i=cr(s.state,t.query.spec);i.valid&&s.dispatch({effects:Pi.of(i)}),e.focus(),e.select()}}else s.dispatch({effects:[Nr.of(!0),t?Pi.of(cr(s.state,t.query.spec)):N.appendConfig.of(vg)]});return!0},dc=s=>{let t=s.state.field(ue,!1);if(!t||!t.panel)return!1;let e=Cn(s,Fr);return e&&e.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Nr.of(!1)}),!0},qm=[{key:"Mod-f",run:uc,scope:"editor search-panel"},{key:"F3",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:dc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:xg},{key:"Mod-Alt-g",run:Zp},{key:"Mod-d",run:cg,preventDefault:!0}];class Sg{constructor(t){this.view=t;let e=this.query=t.state.field(ue).query.spec;this.commit=this.commit.bind(this),this.searchField=lt("input",{value:e.search,placeholder:vt(t,"Find"),"aria-label":vt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lt("input",{value:e.replace,placeholder:vt(t,"Replace"),"aria-label":vt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lt("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=lt("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=lt("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(n,r,o){return lt("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=lt("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>In(t),[vt(t,"next")]),i("prev",()=>Nn(t),[vt(t,"previous")]),i("select",()=>bg(t),[vt(t,"all")]),lt("label",null,[this.caseField,vt(t,"match case")]),lt("label",null,[this.reField,vt(t,"regexp")]),lt("label",null,[this.wordField,vt(t,"by word")]),...t.state.readOnly?[]:[lt("br"),this.replaceField,i("replace",()=>Sl(t),[vt(t,"replace")]),i("replaceAll",()=>wg(t),[vt(t,"replace all")])],lt("button",{name:"close",onclick:()=>dc(t),"aria-label":vt(t,"close"),type:"button"},["×"])])}commit(){let t=new ac({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Pi.of(t)}))}keydown(t){yu(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Nn:In)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Sl(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Pi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(si).top}}function vt(s,t){return s.state.phrase(t)}const on=30,ln=/[\s\.,:;?!]/;function Vr(s,{from:t,to:e}){let i=s.state.doc.lineAt(t),n=s.state.doc.lineAt(e).to,r=Math.max(i.from,t-on),o=Math.min(n,e+on),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-on;a--)if(!ln.test(l[a-1])&&ln.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const kg=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vg=[ue,be.low(yg),kg];class pc{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=yt(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),r=n.search(gc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function kl(s){let t=Object.keys(s).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Cg(s){let t=Object.create(null),e=Object.create(null);for(let{label:n}of s){t[n[0]]=!0;for(let r=1;rtypeof n=="string"?{label:n}:n),[e,i]=t.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:Cg(t);return n=>{let r=n.matchBefore(i);return r||n.explicit?{from:r?r.from:n.pos,options:t,validFor:e}:null}}function Km(s,t){return e=>{for(let i=yt(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(s.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}class vl{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function de(s){return s.selection.main.from}function gc(s,t){var e;let{source:i}=s,n=t&&i[0]!="^",r=i[i.length-1]!="$";return!n&&!r?s:new RegExp(`${n?"^":""}(?:${i})${r?"$":""}`,(e=s.flags)!==null&&e!==void 0?e:s.ignoreCase?"i":"")}const Hr=re.define();function Mg(s,t,e,i){let{main:n}=s.selection,r=e-n.from,o=i-n.from;return Object.assign(Object.assign({},s.changeByRange(l=>{if(l!=n&&e!=i&&s.sliceDoc(l.from+r,l.from+o)!=s.sliceDoc(e,i))return{range:l};let a=s.toText(t);return{changes:{from:l.from+r,to:i==n.from?l.to:l.from+o,insert:a},range:b.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Cl=new WeakMap;function Dg(s){if(!Array.isArray(s))return s;let t=Cl.get(s);return t||Cl.set(s,t=Ag(s)),t}const Fn=N.define(),Bi=N.define();class Og{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(v=fr(w))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!x||A==1&&m||k==0&&A!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),k=A,x+=Bt(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,t):e.length==2?null:this.result((n[0]?-700:0)+-200+-1100,n,t)}result(t,e,i){let n=[],r=0;for(let o of e){let l=o+(this.astral?Bt(st(i,o)):1);r&&n[r-1]==o?n[r-1]=l:(n[r++]=o,n[r++]=l)}return this.ret(t-i.length,n)}}class Tg{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Pg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Al(t(i),e(i)),optionClass:(t,e)=>i=>Al(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function Al(s,t){return s?t?s+" "+t:s:t}function Pg(s,t,e,i,n,r){let o=s.textDirection==X.RTL,l=o,a=!1,c="top",h,f,u=t.left-n.left,d=n.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u=g||x>t.top?h=e.bottom-t.top:(c="bottom",h=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,y=(t.right-t.left)/r.offsetWidth;return{style:`${c}: ${h/m}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function Bg(s){let t=s.addToOptions.slice();return s.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(n=>"cm-completionIcon-"+n)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let c=0;ca&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return ae.position-i.position).map(e=>e.render)}function ps(s,t,e){if(s<=e)return{from:0,to:s};if(t<0&&(t=0),t<=s>>1){let n=Math.floor(t/e);return{from:n*e,to:(n+1)*e}}let i=Math.floor((s-t)/e);return{from:s-(i+1)*e,to:s-i*e}}class Rg{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:r,selected:o}=n.open,l=t.state.facet(et);this.optionContent=Bg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=ps(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=t.state.field(e).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(et).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Bi.of(null)})}),this.showOptions(r,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:r,selected:o,disabled:l}=i.open;(!n.open||n.open.options!=r)&&(this.range=ps(r.length,o,t.state.facet(et).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=n.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=ps(e.options.length,e.selected,this.view.state.facet(et).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let r=typeof n=="string"?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>Mt(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:n,destroy:r}=t;i.appendChild(n),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)i.nodeName!="LI"||!i.id?n--:n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&Eg(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return n.top>Math.min(r.bottom,e.bottom)-10||n.bottomi.from||i.from==0))if(r=u,typeof c!="string"&&c.header)n.appendChild(c.header(c));else{let d=n.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=n.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Rg(e,s,t)}function Eg(s,t){let e=s.getBoundingClientRect(),i=t.getBoundingClientRect(),n=e.height/s.offsetHeight;i.tope.bottom&&(s.scrollTop+=(i.bottom-e.bottom)/n)}function Ml(s){return(s.boost||0)*100+(s.apply?10:0)+(s.info?5:0)+(s.type?1:0)}function Ig(s,t){let e=[],i=null,n=c=>{e.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},r=t.facet(et);for(let c of s)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)n(new vl(f,c.source,h?h(f):[],1e9-e.length));else{let f=t.sliceDoc(c.from,c.to),u,d=r.filterStrict?new Tg(f):new Og(f);for(let p of c.result.options)if(u=d.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;n(new vl(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.namef.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):Ml(c.completion)>Ml(l)&&(o[o.length-1]=c),l=c.completion}return o}class We{constructor(t,e,i,n,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new We(this.options,Dl(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,r,o){if(n&&!o&&t.some(c=>c.state==1))return n.setDisabled();let l=Ig(t,e);if(!l.length)return n&&t.some(c=>c.state==1)?n.setDisabled():null;let a=e.facet(et).selectOnOpen?0:-1;if(n&&n.selected!=a&&n.selected!=-1){let c=n.options[n.selected].completion;for(let h=0;hh.hasResult()?Math.min(c,h.from):c,1e8),create:zg,above:r.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(t){return new We(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new We(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Vn{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Vn(Hg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(et),r=(i.override||e.languageDataAt("autocomplete",de(e)).map(Dg)).map(a=>(this.active.find(h=>h.source==a)||new At(a,this.active.some(h=>h.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open,l=t.effects.some(a=>a.is(Wr));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!Ng(r,this.active)||l?o=We.build(r,e,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.state==1)&&(o=null),!o&&r.every(a=>a.state!=1)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new At(a.source,0):a));for(let a of t.effects)a.is(yc)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Fg:Vg}}function Ng(s,t){if(s==t)return!0;for(let e=0,i=0;;){for(;e-1&&(e["aria-activedescendant"]=s+"-"+t),e}const Hg=[];function mc(s,t){if(s.isUserEvent("input.complete")){let i=s.annotation(Hr);if(i&&t.activateOnCompletion(i))return 12}let e=s.isUserEvent("input.type");return e&&t.activateOnTyping?5:e?1:s.isUserEvent("delete.backward")?2:s.selection?8:s.docChanged?16:0}class At{constructor(t,e,i=-1){this.source=t,this.state=e,this.explicitPos=i}hasResult(){return!1}update(t,e){let i=mc(t,e),n=this;(i&8||i&16&&this.touches(t))&&(n=new At(n.source,0)),i&4&&n.state==0&&(n=new At(this.source,1)),n=n.updateFor(t,i);for(let r of t.effects)if(r.is(Fn))n=new At(n.source,1,r.value?de(t.state):-1);else if(r.is(Bi))n=new At(n.source,0);else if(r.is(Wr))for(let o of r.value)o.source==n.source&&(n=o);return n}updateFor(t,e){return this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new At(this.source,this.state,t.mapPos(this.explicitPos))}touches(t){return t.changes.touchesRange(de(t.state))}}class Ue extends At{constructor(t,e,i,n,r){super(t,2,e),this.result=i,this.from=n,this.to=r}hasResult(){return!0}updateFor(t,e){var i;if(!(e&3))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=de(t.state);if((this.explicitPos<0?l<=r:lo||!n||e&2&&de(t.startState)==this.from)return new At(this.source,e&4?1:0);let a=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return Wg(n.validFor,t.state,r,o)?new Ue(this.source,a,n,r,o):n.update&&(n=n.update(n,r,o,new pc(t.state,l,a>=0)))?new Ue(this.source,a,n,n.from,(i=n.to)!==null&&i!==void 0?i:de(t.state)):new At(this.source,1,a)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new Ue(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new At(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function Wg(s,t,e,i){if(!s)return!1;let n=t.sliceDoc(e,i);return typeof s=="function"?s(n,e,i,t):gc(s,!0).test(n)}const Wr=N.define({map(s,t){return s.map(e=>e.map(t))}}),yc=N.define(),wt=bt.define({create(){return Vn.start()},update(s,t){return s.update(t)},provide:s=>[th.from(s,t=>t.tooltip),O.contentAttributes.from(s,t=>t.attrs)]});function zr(s,t){const e=t.completion.apply||t.completion.label;let i=s.state.field(wt).active.find(n=>n.source==t.source);return i instanceof Ue?(typeof e=="string"?s.dispatch(Object.assign(Object.assign({},Mg(s.state,e,i.from,i.to)),{annotations:Hr.of(t.completion)})):e(s,t.completion,i.from,i.to),!0):!1}const zg=Lg(wt,zr);function an(s,t="option"){return e=>{let i=e.state.field(wt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+n*(s?1:-1):s?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:yc.of(l)}),!0}}const qg=s=>{let t=s.state.field(wt,!1);return s.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamps.state.field(wt,!1)?(s.dispatch({effects:Fn.of(!0)}),!0):!1,Kg=s=>{let t=s.state.field(wt,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(s.dispatch({effects:Bi.of(null)}),!0)};class $g{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const jg=50,Ug=1e3,Gg=ut.fromClass(class{constructor(s){this.view=s,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of s.state.field(wt).active)t.state==1&&this.startQuery(t)}update(s){let t=s.state.field(wt),e=s.state.facet(et);if(!s.selectionSet&&!s.docChanged&&s.startState.field(wt)==t)return;let i=s.transactions.some(r=>{let o=mc(r,e);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rjg&&Date.now()-o.time>Ug){for(let l of o.context.abortListeners)try{l()}catch(a){Mt(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...s.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),s.transactions.some(r=>r.effects.some(o=>o.is(Fn)))&&(this.pendingStart=!0);let n=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.state==1&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),n):-1,this.composing!=0)for(let r of s.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:s}=this.view,t=s.field(wt);for(let e of t.active)e.state==1&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}startQuery(s){let{state:t}=this.view,e=de(t),i=new pc(t,e,s.explicitPos==e,this.view),n=new $g(s,i);this.running.push(n),Promise.resolve(s.source(i)).then(r=>{n.context.aborted||(n.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Bi.of(null)}),Mt(this.view.state,r)})}scheduleAccept(){this.running.every(s=>s.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}accept(){var s;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(et),i=this.view.state.field(wt);for(let n=0;nl.source==r.active.source);if(o&&o.state==1)if(r.done==null){let l=new At(r.active.source,0);for(let a of r.updates)l=l.update(a,e);l.state!=1&&t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Wr.of(t)})}},{eventHandlers:{blur(s){let t=this.view.state.field(wt,!1);if(t&&t.tooltip&&this.view.state.facet(et).closeOnBlur){let e=t.open&&eh(this.view,t.open.tooltip);(!e||!e.dom.contains(s.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Bi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Fn.of(!1)}),20),this.composing=0}}}),Jg=typeof navigator=="object"&&/Win/.test(navigator.platform),Yg=be.highest(O.domEventHandlers({keydown(s,t){let e=t.state.field(wt,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||s.key.length>1||s.ctrlKey&&!(Jg&&s.altKey)||s.metaKey)return!1;let i=e.open.options[e.open.selected],n=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||n.result.commitCharacters;return r&&r.indexOf(s.key)>-1&&zr(t,i),!1}})),bc=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Xg{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class qr{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,ht.TrackDel),i=t.mapPos(this.to,1,ht.TrackDel);return e==null||i==null?null:new qr(this.field,e,i)}}class Kr{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;fnew qr(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],n=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&u.field++}n.push(new Xg(c,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of n)h.line==i.length&&h.from>c&&(h.from--,h.to--);return a}),i.push(o)}return new Kr(i,n)}}let _g=B.widget({widget:new class extends Ie{toDOM(){let s=document.createElement("span");return s.className="cm-snippetFieldPosition",s}ignoreEvent(){return!1}}}),Qg=B.mark({class:"cm-snippetField"});class ri{constructor(t,e){this.ranges=t,this.active=e,this.deco=B.set(t.map(i=>(i.from==i.to?_g:Qg).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new ri(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const Wi=N.define({map(s,t){return s&&s.map(t)}}),Zg=N.define(),Ri=bt.define({create(){return null},update(s,t){for(let e of t.effects){if(e.is(Wi))return e.value;if(e.is(Zg)&&s)return new ri(s.ranges,e.value)}return s&&t.docChanged&&(s=s.map(t.changes)),s&&t.selection&&!s.selectionInsideField(t.selection)&&(s=null),s},provide:s=>O.decorations.from(s,t=>t?t.deco:B.none)});function $r(s,t){return b.create(s.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function tm(s){let t=Kr.parse(s);return(e,i,n,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,n),a={changes:{from:n,to:r,insert:F.of(o)},scrollIntoView:!0,annotations:i?[Hr.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=$r(l,0)),l.some(c=>c.field>0)){let c=new ri(l,0),h=a.effects=[Wi.of(c)];e.state.field(Ri,!1)===void 0&&h.push(N.appendConfig.of([Ri,rm,om,bc]))}e.dispatch(e.state.update(a))}}function xc(s){return({state:t,dispatch:e})=>{let i=t.field(Ri,!1);if(!i||s<0&&i.active==0)return!1;let n=i.active+s,r=s>0&&!i.ranges.some(o=>o.field==n+s);return e(t.update({selection:$r(i.ranges,n),effects:Wi.of(r?null:new ri(i.ranges,n)),scrollIntoView:!0})),!0}}const em=({state:s,dispatch:t})=>s.field(Ri,!1)?(t(s.update({effects:Wi.of(null)})),!0):!1,im=xc(1),nm=xc(-1),sm=[{key:"Tab",run:im,shift:nm},{key:"Escape",run:em}],Tl=T.define({combine(s){return s.length?s[0]:sm}}),rm=be.highest(Cr.compute([Tl],s=>s.facet(Tl)));function $m(s,t){return Object.assign(Object.assign({},t),{apply:tm(s)})}const om=O.domEventHandlers({mousedown(s,t){let e=t.state.field(Ri,!1),i;if(!e||(i=t.posAtCoords({x:s.clientX,y:s.clientY}))==null)return!1;let n=e.ranges.find(r=>r.from<=i&&r.to>=i);return!n||n.field==e.active?!1:(t.dispatch({selection:$r(e.ranges,n.field),effects:Wi.of(e.ranges.some(r=>r.field>n.field)?new ri(e.ranges,n.field):null),scrollIntoView:!0}),!0)}}),Li={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Me=N.define({map(s,t){let e=t.mapPos(s,-1,ht.TrackAfter);return e??void 0}}),jr=new class extends De{};jr.startSide=1;jr.endSide=-1;const wc=bt.define({create(){return K.empty},update(s,t){if(s=s.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);s=s.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(Me)&&(s=s.update({add:[jr.range(e.value,e.value+1)]}));return s}});function jm(){return[am,wc]}const gs="()[]{}<>";function Sc(s){for(let t=0;t{if((lm?s.composing:s.compositionStarted)||s.state.readOnly)return!1;let n=s.state.selection.main;if(i.length>2||i.length==2&&Bt(st(i,0))==1||t!=n.from||e!=n.to)return!1;let r=cm(s.state,i);return r?(s.dispatch(r),!0):!1}),hm=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let i=kc(s,s.selection.main.head).brackets||Li.brackets,n=null,r=s.changeByRange(o=>{if(o.empty){let l=fm(s.doc,o.head);for(let a of i)if(a==l&&Yn(s.doc,o.head)==Sc(st(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:n=o}});return n||t(s.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!n},Um=[{key:"Backspace",run:hm}];function cm(s,t){let e=kc(s,s.selection.main.head),i=e.brackets||Li.brackets;for(let n of i){let r=Sc(st(n,0));if(t==n)return r==n?pm(s,n,i.indexOf(n+n+n)>-1,e):um(s,n,r,e.before||Li.before);if(t==r&&vc(s,s.selection.main.from))return dm(s,n,r)}return null}function vc(s,t){let e=!1;return s.field(wc).between(0,s.doc.length,i=>{i==t&&(e=!0)}),e}function Yn(s,t){let e=s.sliceString(t,t+2);return e.slice(0,Bt(st(e,0)))}function fm(s,t){let e=s.sliceString(t-2,t);return Bt(st(e,0))==e.length?e:e.slice(1)}function um(s,t,e,i){let n=null,r=s.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:Me.of(o.to+t.length),range:b.range(o.anchor+t.length,o.head+t.length)};let l=Yn(s.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:Me.of(o.head+t.length),range:b.cursor(o.head+t.length)}:{range:n=o}});return n?null:s.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function dm(s,t,e){let i=null,n=s.changeByRange(r=>r.empty&&Yn(s.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:b.cursor(r.head+e.length)}:i={range:r});return i?null:s.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function pm(s,t,e,i){let n=i.stringPrefixes||Li.stringPrefixes,r=null,o=s.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Me.of(l.to+t.length),range:b.range(l.anchor+t.length,l.head+t.length)};let a=l.head,c=Yn(s.doc,a),h;if(c==t){if(Pl(s,a))return{changes:{insert:t+t,from:a},effects:Me.of(a+t.length),range:b.cursor(a+t.length)};if(vc(s,a)){let u=e&&s.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(e&&s.sliceDoc(a-2*t.length,a)==t+t&&(h=Bl(s,a-2*t.length,n))>-1&&Pl(s,h))return{changes:{insert:t+t+t+t,from:a},effects:Me.of(a+t.length),range:b.cursor(a+t.length)};if(s.charCategorizer(a)(c)!=J.Word&&Bl(s,a,n)>-1&&!gm(s,a,t,n))return{changes:{insert:t+t,from:a},effects:Me.of(a+t.length),range:b.cursor(a+t.length)}}return{range:r=l}});return r?null:s.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Pl(s,t){let e=yt(s).resolveInner(t+1);return e.parent&&e.from==t}function gm(s,t,e,i){let n=yt(s).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=s.sliceDoc(n.from,Math.min(n.to,n.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=n.firstChild;for(;h&&h.from==n.from&&h.to-h.from>e.length+a;){if(s.sliceDoc(h.to-e.length,h.to)==e)return!1;h=h.firstChild}return!0}let c=n.to==t&&n.parent;if(!c)break;n=c}return!1}function Bl(s,t,e){let i=s.charCategorizer(t);if(i(s.sliceDoc(t-1,t))!=J.Word)return t;for(let n of e){let r=t-n.length;if(s.sliceDoc(r,t)==n&&i(s.sliceDoc(r-1,r))!=J.Word)return r}return-1}function Gm(s={}){return[Yg,wt,et.of(s),Gg,ym,bc]}const mm=[{key:"Ctrl-Space",run:Ol},{mac:"Alt-`",run:Ol},{key:"Escape",run:Kg},{key:"ArrowDown",run:an(!0)},{key:"ArrowUp",run:an(!1)},{key:"PageDown",run:an(!0,"page")},{key:"PageUp",run:an(!1,"page")},{key:"Enter",run:qg}],ym=be.highest(Cr.computeN([et],s=>s.facet(et).defaultKeymap?[mm]:[]));export{Mm as A,wd as B,Hn as C,Ju as D,O as E,Bm as F,Rm as G,Lm as H,Y as I,Om as J,Am as K,er as L,Pm as M,Ar as N,Tm as O,oh as P,yd as Q,Km as R,wh as S,U as T,Ag as U,b as V,$m as W,hh as X,Id as Y,mm as a,H as b,Um as c,Hm as d,Cm as e,Sm as f,Fm as g,Vm as h,xm as i,wm as j,Em as k,Nm as l,jm as m,zm as n,Cr as o,Gm as p,km as q,vm as r,qm as s,Wm as t,Im as u,yt as v,mt as w,L as x,ud as y,M as z}; diff --git a/ui/dist/assets/index-BztyTJOx.js b/ui/dist/assets/index-BztyTJOx.js deleted file mode 100644 index c5d3b074bc..0000000000 --- a/ui/dist/assets/index-BztyTJOx.js +++ /dev/null @@ -1,14 +0,0 @@ -class V{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ue(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Gt.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ue(this,t,e);let i=[];return this.decompose(t,e,i,0),Gt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new gi(this),r=new gi(t);for(let o=e,l=e;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new gi(this,t)}iterRange(t,e=this.length){return new Sl(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new vl(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?V.empty:t.length<=32?new _(t):Gt.from(_.split(t,[]))}}class _ extends V{constructor(t,e=mc(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((e?i:l)>=t)return new yc(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new _(Vr(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=on(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new _(l,o.length+r.length));else{let a=l.length>>1;i.push(new _(l.slice(0,a)),new _(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof _))return super.replace(t,e,i);[t,e]=Ue(this,t,e);let n=on(this.text,on(i.text,Vr(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new _(n,r):Gt.from(_.split(n,[]),r)}sliceString(t,e=this.length,i=` -`){[t,e]=Ue(this,t,e);let n="";for(let r=0,o=0;r<=e&&ot&&o&&(n+=i),tr&&(n+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let r of t)i.push(r),n+=r.length+1,i.length==32&&(e.push(new _(i,n)),i=[],n=-1);return n>-1&&e.push(new _(i,n)),e}}class Gt extends V{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,n);n=l+1,i=a+1}}decompose(t,e,i,n){for(let r=0,o=0;o<=e&&r=o){let c=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!c?i.push(l):l.decompose(t-o,e-o,i,c)}o=a+1}}replace(t,e,i){if([t,e]=Ue(this,t,e),i.lines=r&&e<=l){let a=o.replace(t-r,e-r,i),c=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[n]=a,new Gt(h,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=` -`){[t,e]=Ue(this,t,e);let n="";for(let r=0,o=0;rt&&r&&(n+=i),to&&(n+=l.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Gt))return 0;let i=0,[n,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,r+=e){if(n==o||r==l)return i;let a=this.children[n],c=t.children[r];if(a!=c)return i+a.scanIdentical(c,e);i+=a.length+1}}static from(t,e=t.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new _(d,e)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,c=-1,h=[];function f(d){let p;if(d.lines>r&&d instanceof Gt)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,c+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Gt.from(h,c)),c=-1,a=h.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new Gt(l,e)}}V.empty=new _([""],0);function mc(s){let t=-1;for(let e of s)t+=e.length+1;return t}function on(s,t,e=0,i=1e9){for(let n=0,r=0,o=!0;r=e&&(a>i&&(l=l.slice(0,i-n)),n0?1:(t instanceof _?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof _?n.text.length:n.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(n instanceof _){let a=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=n.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Sl{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new gi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class vl{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(V.prototype[Symbol.iterator]=function(){return this.iter()},gi.prototype[Symbol.iterator]=Sl.prototype[Symbol.iterator]=vl.prototype[Symbol.iterator]=function(){return this});class yc{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Ue(s,t,e){return t=Math.max(0,Math.min(s.length,t)),[t,Math.max(t,Math.min(s.length,e))]}let He="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(s=>s?parseInt(s,36):1);for(let s=1;ss)return He[t-1]<=s;return!1}function Wr(s){return s>=127462&&s<=127487}const Hr=8205;function ot(s,t,e=!0,i=!0){return(e?kl:xc)(s,t,i)}function kl(s,t,e){if(t==s.length)return t;t&&Cl(s.charCodeAt(t))&&Al(s.charCodeAt(t-1))&&t--;let i=nt(s,t);for(t+=Bt(i);t=0&&Wr(nt(s,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function xc(s,t,e){for(;t>0;){let i=kl(s,t-2,e);if(i=56320&&s<57344}function Al(s){return s>=55296&&s<56320}function nt(s,t){let e=s.charCodeAt(t);if(!Al(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return Cl(i)?(e-55296<<10)+(i-56320)+65536:e}function or(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Bt(s){return s<65536?1:2}const us=/\r\n?|\n/;var ht=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(ht||(ht={}));class Qt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return r+(t-n);r+=l}else{if(i!=ht.Simple&&c>=t&&(i==ht.TrackDel&&nt||i==ht.TrackBefore&&nt))return null;if(c>t||c==t&&e<0&&!l)return t==n||e<0?r:r+a;r+=a}n=c}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return r}touchesRange(t,e=t){for(let i=0,n=0;i=0&&n<=e&&l>=t)return ne?"cover":!0;n=l}return!1}toString(){let t="";for(let e=0;e=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(t)}static create(t){return new Qt(t)}}class et extends Qt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return ds(this,(e,i,n,r,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return ps(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n=0){e[n]=l,e[n+1]=o;let a=n>>1;for(;i.length0&&he(i,e,r.text),r.forward(h),l+=h}let c=t[o++];for(;l>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!n.length)return;ou||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?V.of(d.split(i||us)):d:V.empty,g=p.length;if(f==u&&g==0)return;fo&&at(n,f-o,-1),at(n,u-f,g),he(r,n,p),o=u}}return c(t),a(!l),l}static empty(t){return new et(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;nl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length=0&&e<=0&&e==s[n+1]?s[n]+=t:t==0&&s[n]==0?s[n+1]+=e:i?(s[n]+=t,s[n+1]+=e):s.push(t,e)}function he(s,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i>1])),!(e||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];t(n,c,r,h,f),n=c,r=h}}}function ps(s,t,e,i=!1){let n=[],r=i?[]:null,o=new xi(s),l=new xi(t);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);at(n,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class xi{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?V.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?V.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ve{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new ve(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return b.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return b.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(t.anchor,t.head)}static create(t,e,i){return new ve(t,e,i)}}class b{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:b.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(t.ranges.map(e=>ve.fromJSON(e)),t.main)}static single(t,e=t){return new b([b.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;nt?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((n,r)=>n.from-r.from),e=t.indexOf(i);for(let n=1;nr.head?b.range(a,l):b.range(l,a))}}return new b(t,e)}}function Dl(s,t){for(let e of s.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let lr=0;class T{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=lr++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:ar),!!t.static,t.enables)}of(t){return new ln([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new ln(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new ln(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function ar(s,t){return s==t||s.length==t.length&&s.every((e,i)=>e===t[i])}class ln{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=lr++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||h.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||gs(f,h)){let d=i(f);if(l?!zr(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=gn(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===f.facet(m):m instanceof yt?u.field(m,!1)==f.field(m,!1):!0)||(l?zr(d=i(f),g,n):n(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function zr(s,t,e){if(s.length!=t.length)return!1;for(let i=0;is[a.id]),n=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[t.id]>>1;function l(a){let c=[];for(let h=0;hi===n),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(qr).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,n)=>{let r=i.values[e],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,n)=>n.config.address[this.id]!=null?(i.values[e]=n.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,qr.of({field:this,create:t})]}get extension(){return this}}const Se={lowest:4,low:3,default:2,high:1,highest:0};function si(s){return t=>new Ol(t,s)}const ye={highest:si(Se.highest),high:si(Se.high),default:si(Se.default),low:si(Se.low),lowest:si(Se.lowest)};class Ol{constructor(t,e){this.inner=t,this.prec=e}}class In{of(t){return new ms(this,t)}reconfigure(t){return In.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ms{constructor(t,e){this.compartment=t,this.inner=e}}class pn{constructor(t,e,i,n,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let n=[],r=Object.create(null),o=new Map;for(let u of Sc(t,e,o))u instanceof yt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of n)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=h&&h[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,ar(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(y=>m.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(m=>wc(m,p,d))}}let f=c.map(u=>u(l));return new pn(t,o,f,l,a,r)}}function Sc(s,t,e){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof ms&&e.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof ms){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(o.compartment)||o.inner;e.set(o.compartment,c),r(c,l)}else if(o instanceof Ol)r(o.inner,o.prec);else if(o instanceof yt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ln)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Se.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(s,Se.default),i.reduce((o,l)=>o.concat(l))}function mi(s,t){if(t&1)return 2;let e=t>>1,i=s.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[e]=4;let n=s.computeSlot(s,s.config.dynamicSlots[e]);return s.status[e]=2|n}function gn(s,t){return t&1?s.config.staticValues[t>>1]:s.values[t>>1]}const Tl=T.define(),ys=T.define({combine:s=>s.some(t=>t),static:!0}),Pl=T.define({combine:s=>s.length?s[0]:void 0,static:!0}),Bl=T.define(),Rl=T.define(),Ll=T.define(),El=T.define({combine:s=>s.length?s[0]:!1});class se{constructor(t,e){this.type=t,this.value=e}static define(){return new vc}}class vc{of(t){return new se(this,t)}}class kc{constructor(t){this.map=t}of(t){return new F(this,t)}}class F{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new F(this.type,e)}is(t){return this.type==t}static define(t={}){return new kc(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let r=n.map(e);r&&i.push(r)}return i}}F.reconfigure=F.define();F.appendConfig=F.define();class Z{constructor(t,e,i,n,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Dl(i,e.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(t,e,i,n,r,o){return new Z(t,e,i,n,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Z.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}Z.time=se.define();Z.userEvent=se.define();Z.addToHistory=se.define();Z.remote=se.define();function Cc(s,t){let e=[];for(let i=0,n=0;;){let r,o;if(i=s[i]))r=s[i++],o=s[i++];else if(n=0;n--){let r=i[n](s);r instanceof Z?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?s=r[0]:s=Nl(t,ze(r),!1)}return s}function Mc(s){let t=s.startState,e=t.facet(Ll),i=s;for(let n=e.length-1;n>=0;n--){let r=e[n](s);r&&Object.keys(r).length&&(i=Il(i,bs(t,r,s.changes.newLength),!0))}return i==s?s:Z.create(t,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const Dc=[];function ze(s){return s==null?Dc:Array.isArray(s)?s:[s]}var G=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(G||(G={}));const Oc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let xs;try{xs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Tc(s){if(xs)return xs.test(s);for(let t=0;t"€"&&(e.toUpperCase()!=e.toLowerCase()||Oc.test(e)))return!0}return!1}function Pc(s){return t=>{if(!/\S/.test(t))return G.Space;if(Tc(t))return G.Word;for(let e=0;e-1)return G.Word;return G.Other}}class H{constructor(t,e,i,n,r,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ln.set(c,a)),e=null),n.set(l.value.compartment,l.value.extension)):l.is(F.reconfigure)?(e=null,i=l.value):l.is(F.appendConfig)&&(e=null,i=ze(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=pn.resolve(i,n,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=t.startState.facet(ys)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:b.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],o=ze(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:b.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=pn.resolve(t.extensions||[],new Map),i=t.doc instanceof V?t.doc:V.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||us)),n=t.selection?t.selection instanceof b?t.selection:b.single(t.selection.anchor,t.selection.head):b.single(0);return Dl(n,i.length),e.staticFacet(ys)||(n=n.asSingle()),new H(e,i,n,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||` -`}get readOnly(){return this.facet(El)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let r=+(n||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let n=[];for(let r of this.facet(Tl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&n.push(o[t]);return n}charCategorizer(t){return Pc(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=ot(e,o,!1);if(r(e.slice(a,o))!=G.Word)break;o=a}for(;ls.length?s[0]:4});H.lineSeparator=Pl;H.readOnly=El;H.phrases=T.define({compare(s,t){let e=Object.keys(s),i=Object.keys(t);return e.length==i.length&&e.every(n=>s[n]==t[n])}});H.languageData=Tl;H.changeFilter=Bl;H.transactionFilter=Rl;H.transactionExtender=Ll;In.reconfigure=F.define();function Le(s,t,e={}){let i={};for(let n of s)for(let r of Object.keys(n)){let o=n[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let n in t)i[n]===void 0&&(i[n]=t[n]);return i}class Me{eq(t){return this==t}range(t,e=t){return ws.create(t,e,this)}}Me.prototype.startSide=Me.prototype.endSide=0;Me.prototype.point=!1;Me.prototype.mapMode=ht.TrackDel;let ws=class Fl{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Fl(t,e,i)}};function Ss(s,t){return s.from-t.from||s.value.startSide-t.value.startSide}class hr{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let r=i?this.to:this.from;for(let o=n,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(t,e,i,n){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),i.push(c),n.push(u-o),r.push(d-o))}return{mapped:i.length?new hr(n,r,i,l):null,pos:o}}}class K{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new K(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(Ss)),this.isEmpty)return e.length?K.of(e):this;let l=new Vl(this,null,-1).goto(0),a=0,c=[],h=new De;for(;l.value||a=0){let f=e[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return wi.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return wi.from(t).goto(e)}static compare(t,e,i,n,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Kr(o,l,i),c=new ri(o,a,r),h=new ri(l,a,r);i.iterGaps((f,u,d)=>$r(c,f,h,u,d,n)),i.empty&&i.length==0&&$r(c,0,h,0,0,n)}static eq(t,e,i=0,n){n==null&&(n=999999999);let r=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0),o=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Kr(r,o),a=new ri(r,l,0).goto(i),c=new ri(o,l,0).goto(i);for(;;){if(a.to!=c.to||!vs(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>n)return!0;a.next(),c.next()}}static spans(t,e,i,n,r=-1){let o=new ri(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFroml&&(n.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new De;for(let n of t instanceof ws?[t]:e?Bc(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return K.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=K.empty;n=n.nextLayer)e=new K(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}K.empty=new K([],[],null,-1);function Bc(s){if(s.length>1)for(let t=s[0],e=1;e0)return s.slice().sort(Ss);t=i}return s}K.empty.nextLayer=K.empty;class De{finishChunk(t){this.chunks.push(new hr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new De)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(K.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Kr(s,t,e){let i=new Map;for(let r of s)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Vl(o,e,i,r));return n.length==1?n[0]:new wi(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)Un(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)Un(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Un(this.heap,0)}}}function Un(s,t){for(let e=s[t];;){let i=(t<<1)+1;if(i>=s.length)break;let n=s[i];if(i+1=0&&(n=s[i+1],i++),e.compare(n)<0)break;s[i]=e,s[t]=n,t=i}}class ri{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=wi.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Wi(this.active,t),Wi(this.activeTo,t),Wi(this.activeRank,t),this.minActive=jr(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:r}=this.cursor;for(;e0;)e++;Hi(this.active,e,i),Hi(this.activeTo,e,n),Hi(this.activeRank,e,r),t&&Hi(t,e,this.cursor.from),this.minActive=jr(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Wi(i,n)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[n]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function $r(s,t,e,i,n,r){s.goto(t),e.goto(i);let o=i+n,l=i,a=i-t;for(;;){let c=s.to+a-e.to||s.endSide-e.endSide,h=c<0?s.to+a:e.to,f=Math.min(h,o);if(s.point||e.point?s.point&&e.point&&(s.point==e.point||s.point.eq(e.point))&&vs(s.activeForPoint(s.to),e.activeForPoint(e.to))||r.comparePoint(l,f,s.point,e.point):f>l&&!vs(s.active,e.active)&&r.compareRange(l,f,s.active,e.active),h>o)break;l=h,c<=0&&s.next(),c>=0&&e.next()}}function vs(s,t){if(s.length!=t.length)return!1;for(let e=0;e=t;i--)s[i+1]=s[i];s[t]=e}function jr(s,t){let e=-1,i=1e9;for(let n=0;n=t)return n;if(n==s.length)break;r+=s.charCodeAt(n)==9?e-r%e:1,n=ot(s,n)}return i===!0?-1:s.length}const Cs="ͼ",Ur=typeof Symbol>"u"?"__"+Cs:Symbol.for(Cs),As=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class de{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(n(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in t)r(n(o),t[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=Gr[Ur]||1;return Gr[Ur]=t+1,Cs+t.toString(36)}static mount(t,e,i){let n=t[As],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Rc(t,r),n.mount(Array.isArray(e)?e:[e],t)}}let Jr=new Map;class Rc{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let r=Jr.get(i);if(r)return t[As]=r;this.sheet=new n.CSSStyleSheet,Jr.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[As]=this}mount(t,e){let i=this.sheet,n=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lc=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ec=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)pe[48+st]=pe[96+st]=String(st);for(var st=1;st<=24;st++)pe[st+111]="F"+st;for(var st=65;st<=90;st++)pe[st]=String.fromCharCode(st+32),Si[st]=String.fromCharCode(st);for(var Gn in pe)Si.hasOwnProperty(Gn)||(Si[Gn]=pe[Gn]);function Ic(s){var t=Lc&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Ec&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",e=!t&&s.key||(s.shiftKey?Si:pe)[s.keyCode]||s.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function vi(s){let t;return s.nodeType==11?t=s.getSelection?s:s.ownerDocument:t=s,t.getSelection()}function Ms(s,t){return t?s==t||s.contains(t.nodeType!=1?t.parentNode:t):!1}function Nc(s){let t=s.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function an(s,t){if(!t.anchorNode)return!1;try{return Ms(s,t.anchorNode)}catch{return!1}}function Ge(s){return s.nodeType==3?Te(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function yi(s,t,e,i){return e?Yr(s,t,e,i,-1)||Yr(s,t,e,i,1):!1}function Oe(s){for(var t=0;;t++)if(s=s.previousSibling,!s)return t}function mn(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function Yr(s,t,e,i,n){for(;;){if(s==e&&t==i)return!0;if(t==(n<0?0:ie(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;t=Oe(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[t+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;t=n<0?ie(s):0}else return!1}}function ie(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Nn(s,t){let e=t?s.left:s.right;return{left:e,right:e,top:s.top,bottom:s.bottom}}function Fc(s){let t=s.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function Wl(s,t){let e=t.width/s.offsetWidth,i=t.height/s.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-s.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-s.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Vc(s,t,e,i,n,r,o,l){let a=s.ownerDocument,c=a.defaultView||window;for(let h=s,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=Fc(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=Wl(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(n=="nearest")t.top0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+y+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.lefte.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.assignedSlot||e.parentNode}else if(e.nodeType==11)e=e.host;else break;return null}class Hc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?ie(e):0),i,Math.min(t.focusOffset,i?ie(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let Ne=null;function Hl(s){if(s.setActive)return s.setActive();if(Ne)return s.focus(Ne);let t=[];for(let e=s;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(s.focus(Ne==null?{get preventScroll(){return Ne={preventScroll:!0},!0}}:void 0),!Ne){Ne=!1;for(let e=0;eMath.max(1,s.scrollHeight-s.clientHeight-4)}function Kl(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=ie(e)}else if(e.parentNode&&!mn(e))i=Oe(e),e=e.parentNode;else return null}}function $l(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&ie)return f.domBoundsAround(t,e,c);if(u>=t&&n==-1&&(n=a,r=c),c>e&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=cr){this.markDirty();for(let n=t;nthis.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ul(s,t,e,i,n,r,o,l,a){let{children:c}=s,h=c.length?c[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&h&&!o&&!u&&r.length<2&&h.merge(e,n,r.length?f:null,e==0,l,a))){if(i0&&(!o&&r.length&&h.merge(e,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(e2);var D={mac:to||/Mac/.test(wt.platform),windows:/Win/.test(wt.platform),linux:/Linux|X11/.test(wt.platform),ie:Fn,ie_version:Jl?Ds.documentMode||6:Ts?+Ts[1]:Os?+Os[1]:0,gecko:Qr,gecko_version:Qr?+(/Firefox\/(\d+)/.exec(wt.userAgent)||[0,0])[1]:0,chrome:!!Jn,chrome_version:Jn?+Jn[1]:0,ios:to,android:/Android\b/.test(wt.userAgent),webkit:Zr,safari:Yl,webkit_version:Zr?+(/\bAppleWebKit\/(\d+)/.exec(wt.userAgent)||[0,0])[1]:0,tabSize:Ds.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Kc=256;class Vt extends ${constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof Vt)||this.length-(e-t)+i.length>Kc||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Vt(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ct(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return $c(this.dom,t,e)}}class ne extends ${constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let n of e)n.setParent(this)}setAttrs(t){if(zl(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,r,o){return i&&(!(i instanceof ne&&i.mark.eq(this.mark))||t&&r<=0||et&&e.push(i=t&&(n=r),i=a,r++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new ne(this.mark,e,o)}domAtPos(t){return Xl(this,t)}coordsAt(t,e){return Ql(this,t,e)}}function $c(s,t,e){let i=s.nodeValue.length;t>i&&(t=i);let n=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?D.chrome||D.gecko||(t?(n--,o=1):r=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Nn(a,o<0):a||null}class ke extends ${static create(t,e,i){return new ke(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=ke.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,r,o){return i&&(!(i instanceof ke)||!this.widget.compare(i.widget)||t>0&&r<=0||e0)?ct.before(this.dom):ct.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?n.length-1:0;r=n[l],!(t>0?l==0:l==n.length-1||r.top0?ct.before(this.dom):ct.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return V.empty}get isHidden(){return!0}}Vt.prototype.children=ke.prototype.children=Je.prototype.children=cr;function Xl(s,t){let e=s.dom,{children:i}=s,n=0;for(let r=0;nr&&t0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=n;r0&&t instanceof ne&&n.length&&(i=n[n.length-1])instanceof ne&&i.mark.eq(t.mark)?_l(i,t.children[0],e-1):(n.push(t),t.setParent(s)),s.length+=t.length}function Ql(s,t,e){let i=null,n=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&e>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u-1?1:0)!=n.length-(e&&n.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(n.indexOf(r)==-1||s[r]!==t[r]))return!1;return!0}function Bs(s,t,e){let i=!1;if(t)for(let n in t)e&&n in e||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(e)for(let n in e)t&&t[n]==e[n]||(i=!0,n=="style"?s.style.cssText=e[n]:s.setAttribute(n,e[n]));return i}function Uc(s){let t=Object.create(null);for(let e=0;e0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){yn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){_l(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Ps(e,this.attrs||{})),i&&(this.attrs=Ps({class:i},this.attrs||{}))}domAtPos(t){return Xl(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(zl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Bs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&$.get(n)instanceof ne;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=$.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof Vt))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Vt)||/[^ -~]/.test(i.text))return null;let n=Ge(i.dom);if(n.length!=1)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=Ql(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-n.lineHeight)<2&&n.textHeight=e){if(r instanceof Q)return r;if(o>e)break}n=o+r.breakAfter}return null}}class te extends ${constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,r,o){return i&&(!(i instanceof te)||!this.widget.compare(i.widget)||t>0&&r<=0||e0}}class Ee{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Ot=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(Ot||(Ot={}));class P extends Me{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new Ri(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new ge(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,n;if(t.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=Zl(t,e);i=(r?e?-3e8:-1:5e8)-1,n=(o?e?2e8:1:-6e8)+1}return new ge(t,i,n,e,t.widget||null,!0)}static line(t){return new Li(t)}static set(t,e=!1){return K.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}P.none=K.empty;class Ri extends P{constructor(t){let{start:e,end:i}=Zl(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Ri&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&yn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Ri.prototype.point=!1;class Li extends P{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Li&&this.spec.class==t.spec.class&&yn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Li.prototype.mapMode=ht.TrackBefore;Li.prototype.point=!0;class ge extends P{constructor(t,e,i,n,r,o){super(e,i,r,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?ht.TrackBefore:ht.TrackAfter:ht.TrackDel}get type(){return this.startSide!=this.endSide?Ot.WidgetRange:this.startSide<=0?Ot.WidgetBefore:Ot.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ge&&Gc(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}ge.prototype.point=!0;function Zl(s,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=s;return e==null&&(e=s.inclusive),i==null&&(i=s.inclusive),{start:e??t,end:i??t}}function Gc(s,t){return s==t||!!(s&&t&&s.compare(t))}function Rs(s,t,e,i=0){let n=e.length-1;n>=0&&e[n]+i>=s?e[n]=Math.max(e[n],t):e.push(s,t)}class bi{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof te&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Q),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(zi(new Je(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof te)&&this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=r,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(zi(new Vt(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ge){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof ge)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new te(i.widget||Ye.block,l,i));else{let a=ke.create(i.widget||Ye.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=n.length&&(t0),h=!a.isEditable&&(tn.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),c&&(f.append(zi(new Je(1),n),r),r=n.length+Math.max(0,r-n.length)),f.append(zi(a,n),r),this.atCursorPos=h,this.pendingBuffer=h?tn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,n,r){let o=new bi(t,e,i,r);return o.openEnd=K.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function zi(s,t){for(let e of t)s=new ne(e,[s],s.length);return s}class Ye extends Ee{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ye.inline=new Ye("span");Ye.block=new Ye("div");var X=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(X||(X={}));const Pe=X.LTR,fr=X.RTL;function ta(s){let t=[];for(let e=0;e=e){if(l.level==i)return o;(r<0||(n!=0?n<0?l.frome:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ia(s,t){if(s.length!=t.length)return!1;for(let e=0;e=0;g-=3)if(qt[g+1]==-d){let m=qt[g+2],y=m&2?n:m&4?m&1?r:n:0;y&&(q[f]=q[qt[g]]=y),l=g;break}}else{if(qt.length==189)break;qt[l++]=f,qt[l++]=u,qt[l++]=a}else if((p=q[f])==2||p==1){let g=p==n;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=qt[m+2];if(y&2)break;if(g)qt[m+2]|=2;else{if(y&4)break;qt[m+2]|=4}}}}}function Zc(s,t,e,i){for(let n=0,r=i;n<=e.length;n++){let o=n?e[n-1].to:s,l=na;)p==m&&(p=e[--g].from,m=g?e[g-1].to:s),q[--p]=d;a=h}else r=c,a++}}}function Es(s,t,e,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=t,c=0;aa&&o.push(new ce(a,g.from,d));let m=g.direction==Pe!=!(d%2);Is(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(h?q[p]!=l:q[p]==l))break;p++}u?Es(s,a,p,i+1,n,u,o):at;){let h=!0,f=!1;if(!c||a>r[c-1].to){let g=q[a-1];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c&&p==r[c-1].to){if(f)break t;let g=r[--c];if(!h)for(let m=g.from,y=c;;){if(m==t)break t;if(y&&r[y-1].to==m)m=r[--y].from;else{if(q[m-1]==l)break t;break}}if(u)u.push(g);else{g.toq.length;)q[q.length]=256;let i=[],n=t==Pe?0:1;return Is(s,n,n,e,0,s.length,i),i}function na(s){return[new ce(0,s,0)]}let sa="";function ef(s,t,e,i,n){var r;let o=i.head-s.from,l=ce.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],c=a.side(n,e);if(o==c){let u=l+=n?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!n,e),c=a.side(n,e)}let h=ot(s.text,o,a.forward(n,e));(ha.to)&&(h=c),sa=s.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(n?t.length-1:0)?null:t[l+(n?1:-1)];return f&&h==c&&f.level+(n?0:1)s.some(t=>t)}),ua=T.define({combine:s=>s.some(t=>t)}),da=T.define();class Ke{constructor(t,e="nearest",i="nearest",n=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Ke(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Ke(b.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const qi=F.define({map:(s,t)=>s.map(t)}),pa=F.define();function Dt(s,t,e){let i=s.facet(aa);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const le=T.define({combine:s=>s.length?s[0]:!0});let sf=0;const ci=T.define();class ut{constructor(t,e,i,n,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=e||{};return new ut(sf++,t,i,n,l=>{let a=[ci.of(l)];return o&&a.push(ki.of(c=>{let h=c.plugin(l);return h?o(h):P.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return ut.define(i=>new t(i),e)}}class Yn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(Dt(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Dt(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){Dt(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ga=T.define(),ur=T.define(),ki=T.define(),ma=T.define(),dr=T.define(),ya=T.define();function io(s,t){let e=s.state.facet(ya);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(s):r),n=[];return K.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let c=r-t.from,h=o-t.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=nf(t.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let g={from:c,to:h,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const ba=T.define();function xa(s){let t=0,e=0,i=0,n=0;for(let r of s.state.facet(ba)){let o=r(s);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:t,right:e,top:i,bottom:n}}const fi=T.define();class It{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new It(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toAh)break;r+=2}if(!a)return i;new It(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class bn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=et.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges((r,o,l,a)=>n.push(new It(r,o,l,a))),this.changedRanges=n}static create(t,e,i){return new bn(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class no extends ${get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=P.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Q],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new It(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?n=this.domChanged.newSel.head:!ff(t.changes,this.hasComposition)&&!t.selectionSet&&(n=t.state.selection.main.head));let r=n>-1?of(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new It(c,h,t.changes.mapPos(c,-1),t.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=hf(o,l,t.changes);return i=It.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||n.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?n[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,g;if(i&&i.range.fromBh){let S=bi.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=bi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=S.breakAtStart,p=S.openStart,g=w.openEnd;let A=this.compositionView(i);w.breakAtStart?A.breakAfter=1:w.content.length&&A.merge(A.length,A.length,w.content[0],!1,w.openStart,0)&&(A.breakAfter=w.content[0].breakAfter,w.content.shift()),S.content.length&&A.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),u=S.content.concat(A).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=bi.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(c,1),{i:x,off:v}=r.findPos(a,-1);Ul(this,x,v,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(pa)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new Vt(t.text.nodeValue);e.flags|=8;for(let{deco:n}of t.marks)e=new ne(n,[e],e.length);let i=new Q;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=$.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let r=t.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],e(r>=0?t.marks[r].node:t.text,n)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&an(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&rf(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new ct(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!yi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!yi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&cf(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=vi(this.view.root);if(f)if(l.empty){if(D.gecko){let u=lf(a.node,a.offset);if(u&&u!=3){let d=(u==1?Kl:$l)(a.node,a.offset);d&&(a=new ct(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ct(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ct(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&yi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=vi(t.root),{anchorNode:n,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Q.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),c=this.coordsAt(e.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(n,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let n=t.offset;!i&&n=0;n--){let r=$.get(e.childNodes[n]);r instanceof Q&&(i=r.domAtPos(r.length))}return i?new ct(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=$.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(at||l.covers(1))&&(!i||l instanceof Q&&!(i instanceof Q&&e>=0)))i=l,n=c;else if(i&&c==t&&a==t&&l instanceof te&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Q))return null;for(;n.children.length;){let{i:l,off:a}=n.childPos(i,1);for(;;l++){if(l==n.children.length)return null;if((n=n.children[l]).length)break}i=a}if(!(n instanceof Vt))return null;let r=ot(n.text,i);if(r==i)return null;let o=Te(n.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let c=0,h=0;hn)break;if(c>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Ge(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Q){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,n;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Ge(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,n=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new jl(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let r=n==e.viewports.length?null:e.viewports[n],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(P.replace({widget:new so(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return P.set(t)}updateDeco(){let t=1,e=this.view.state.facet(ki).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,n=this.view.state.facet(ma).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(K.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];te.anchor?-1:1),n;if(!i)return;!e.empty&&(n=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let r=xa(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Vc(this.view.scrollDOM,o,e.head{it.from&&(e=!0)}),e}function uf(s,t,e=1){let i=s.charCategorizer(t),n=s.doc.lineAt(t),r=t-n.from;if(n.length==0)return b.cursor(t);r==0?e=1:r==n.length&&(e=-1);let o=r,l=r;e<0?o=ot(n.text,r,!1):l=ot(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let c=ot(n.text,o,!1);if(i(n.text.slice(c,o))!=a)break;o=c}for(;ls?t.left-s:Math.max(0,s-t.right)}function pf(s,t){return t.top>s?t.top-s:Math.max(0,s-t.bottom)}function Xn(s,t){return s.topt.top+1}function ro(s,t){return ts.bottom?{top:s.top,left:s.left,right:s.right,bottom:t}:s}function Fs(s,t,e){let i,n,r,o,l=!1,a,c,h,f;for(let p=s.firstChild;p;p=p.nextSibling){let g=Ge(p);for(let m=0;mv||o==v&&r>x){i=p,n=y,r=x,o=v;let S=v?e0?m0)}x==0?e>y.bottom&&(!h||h.bottomy.top)&&(c=p,f=y):h&&Xn(h,y)?h=oo(h,y.bottom):f&&Xn(f,y)&&(f=ro(f,y.top))}}if(h&&h.bottom>=e?(i=a,n=h):f&&f.top<=e&&(i=c,n=f),!i)return{node:s,offset:0};let u=Math.max(n.left,Math.min(n.right,t));if(i.nodeType==3)return lo(i,u,e);if(l&&i.contentEditable!="false")return Fs(i,u,e);let d=Array.prototype.indexOf.call(s.childNodes,i)+(t>=(n.left+n.right)/2?1:0);return{node:s,offset:d}}function lo(s,t,e){let i=s.nodeValue.length,n=-1,r=1e9,o=0;for(let l=0;le?h.top-e:e-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&f=(h.left+h.right)/2,d=u;if((D.chrome||D.gecko)&&Te(s,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:s,offset:l+(d?1:0)};n=l+(d?1:0),r=f}}}return{node:s,offset:n>-1?n:o>0?s.nodeValue.length:0}}function Sa(s,t,e,i=-1){var n,r;let o=s.contentDOM.getBoundingClientRect(),l=o.top+s.viewState.paddingTop,a,{docHeight:c}=s.viewState,{x:h,y:f}=t,u=f-l;if(u<0)return 0;if(u>c)return s.state.doc.length;for(let S=s.viewState.heightOracle.textHeight/2,w=!1;a=s.elementAtHeight(u),a.type!=Ot.Text;)for(;u=i>0?a.bottom+S:a.top-S,!(u>=0&&u<=c);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(ds.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:e?null:ao(s,o,a,h,f);let p=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:p,m=g.elementFromPoint(h,f);m&&!s.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=g.elementFromPoint(h,f),m&&!s.contentDOM.contains(m)&&(m=null));let y,x=-1;if(m&&((n=s.docView.nearest(m))===null||n===void 0?void 0:n.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(h,f);S&&({offsetNode:y,offset:x}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(h,f);S&&({startContainer:y,startOffset:x}=S,(!s.contentDOM.contains(y)||D.safari&&gf(y,x,h)||D.chrome&&mf(y,x,h))&&(y=void 0))}}if(!y||!s.docView.dom.contains(y)){let S=Q.find(s.docView,d);if(!S)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=Fs(S.dom,h,f))}let v=s.docView.nearest(y);if(!v)return null;if(v.isWidget&&((r=v.dom)===null||r===void 0?void 0:r.nodeType)==1){let S=v.dom.getBoundingClientRect();return t.ys.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-e.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(e.from,e.to);return e.from+ks(o,r,s.state.tabSize)}function gf(s,t,e){let i;if(s.nodeType!=3||t!=(i=s.nodeValue.length))return!1;for(let n=s.nextSibling;n;n=n.nextSibling)if(n.nodeType!=1||n.nodeName!="BR")return!1;return Te(s,i-1,i).getBoundingClientRect().left>e}function mf(s,t,e){if(t!=0)return!1;for(let n=s;;){let r=n.parentNode;if(!r||r.nodeType!=1||r.firstChild!=n)return!1;if(r.classList.contains("cm-line"))break;n=r}let i=s.nodeType==1?s.getBoundingClientRect():Te(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function Vs(s,t){let e=s.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Ot.Text))return i}return e}function yf(s,t,e,i){let n=Vs(s,t.head),r=!i||n.type!=Ot.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(t.assoc<0&&t.head>n.from?t.head-1:t.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:e==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,e?-1:1)}return b.cursor(e?n.to:n.from,e?-1:1)}function ho(s,t,e,i){let n=s.state.doc.lineAt(t.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=t,a=null;;){let c=ef(n,r,o,l,e),h=sa;if(!c){if(n.number==(e?s.state.doc.lines:1))return l;h=` -`,n=s.state.doc.line(n.number+(e?1:-1)),r=s.bidiSpans(n),c=s.visualLineSide(n,!e)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function bf(s,t,e){let i=s.state.charCategorizer(t),n=i(e);return r=>{let o=i(r);return n==G.Space&&(n=o),n==o}}function xf(s,t,e,i){let n=t.head,r=e?1:-1;if(n==(e?s.state.doc.length:0))return b.cursor(n,t.assoc);let o=t.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),c=s.coordsAtPos(n,t.assoc||-1),h=s.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=i??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Sa(s,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gn)){let m=s.docView.coordsForChar(g),y=!m||p{if(t>r&&tn(s)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,inull),D.gecko&&Nf(t.contentDOM.ownerDocument)}handleEvent(t){!Of(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let n of i.observers)n(this.view,e);for(let n of i.handlers){if(e.defaultPrevented)break;if(n(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Sf(t),i=this.handlers,n=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&n.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&ka.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return D.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=va.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||vf.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function co(s,t){return(e,i)=>{try{return t.call(s,i,e)}catch(n){Dt(e.state,n)}}}function Sf(s){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec;if(n&&n.domEventHandlers)for(let r in n.domEventHandlers){let o=n.domEventHandlers[r];o&&e(r).handlers.push(co(i.value,o))}if(n&&n.domEventObservers)for(let r in n.domEventObservers){let o=n.domEventObservers[r];o&&e(r).observers.push(co(i.value,o))}}for(let i in Wt)e(i).handlers.push(Wt[i]);for(let i in Nt)e(i).observers.push(Nt[i]);return t}const va=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],vf="dthko",ka=[16,17,18,20,91,92,224,225],Ki=6;function $i(s){return Math.max(0,s)*.7+8}function kf(s,t){return Math.max(Math.abs(s.clientX-t.clientX),Math.abs(s.clientY-t.clientY))}class Cf{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParent=Wc(t.contentDOM),this.atoms=t.state.facet(dr).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(H.allowMultipleSelections)&&Af(t,e),this.dragging=Df(t,e)&&Da(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){var e;if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&kf(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let i=0,n=0,r=((e=this.scrollParent)===null||e===void 0?void 0:e.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=xa(this.view);t.clientX-o.left<=r.left+Ki?i=-$i(r.left-t.clientX):t.clientX+o.right>=r.right-Ki&&(i=$i(t.clientX-r.right)),t.clientY-o.top<=r.top+Ki?n=-$i(r.top-t.clientY):t.clientY+o.bottom>=r.bottom-Ki&&(n=$i(t.clientY-r.bottom)),this.setScrollSpeed(i,n)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;ie.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Af(s,t){let e=s.state.facet(ra);return e.length?e[0](t):D.mac?t.metaKey:t.ctrlKey}function Mf(s,t){let e=s.state.facet(oa);return e.length?e[0](t):D.mac?!t.altKey:!t.ctrlKey}function Df(s,t){let{main:e}=s.state.selection;if(e.empty)return!1;let i=vi(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function Of(s,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=s.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=$.get(e))&&i.ignoreEvent(t))return!1;return!0}const Wt=Object.create(null),Nt=Object.create(null),Ca=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Tf(s){let t=s.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{s.focus(),e.remove(),Aa(s,e.value)},50)}function Aa(s,t){let{state:e}=s,i,n=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if(Ws!=null&&e.selection.ranges.every(a=>a.empty)&&Ws==r.toString()){let a=-1;i=e.changeByRange(c=>{let h=e.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=e.toText((o?r.line(n++).text:t)+e.lineBreak);return{changes:{from:h.from,insert:f},range:b.cursor(c.from+f.length)}})}else o?i=e.changeByRange(a=>{let c=r.line(n++);return{changes:{from:a.from,to:a.to,insert:c.text},range:b.cursor(a.from+c.length)}}):i=e.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Nt.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Wt.keydown=(s,t)=>(s.inputState.setSelectionOrigin("select"),t.keyCode==27&&s.inputState.tabFocusMode!=0&&(s.inputState.tabFocusMode=Date.now()+2e3),!1);Nt.touchstart=(s,t)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};Nt.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};Wt.mousedown=(s,t)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of s.state.facet(la))if(e=i(s,t),e)break;if(!e&&t.button==0&&(e=Rf(s,t)),e){let i=!s.hasFocus;s.inputState.startMouseSelection(new Cf(s,t,e,i)),i&&s.observer.ignore(()=>{Hl(s.contentDOM);let r=s.root.activeElement;r&&!r.contains(s.contentDOM)&&r.blur()});let n=s.inputState.mouseSelection;if(n)return n.start(t),n.dragging===!1}return!1};function fo(s,t,e,i){if(i==1)return b.cursor(t,e);if(i==2)return uf(s.state,t,e);{let n=Q.find(s.docView,t),r=s.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return ls>=t.top&&s<=t.bottom,uo=(s,t,e)=>Ma(t,e)&&s>=e.left&&s<=e.right;function Pf(s,t,e,i){let n=Q.find(s.docView,t);if(!n)return 1;let r=t-n.posAtStart;if(r==0)return 1;if(r==n.length)return-1;let o=n.coordsAt(r,-1);if(o&&uo(e,i,o))return-1;let l=n.coordsAt(r,1);return l&&uo(e,i,l)?1:o&&Ma(i,o)?-1:1}function po(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:Pf(s,e,t.clientX,t.clientY)}}const Bf=D.ie&&D.ie_version<=11;let go=null,mo=0,yo=0;function Da(s){if(!Bf)return s.detail;let t=go,e=yo;return go=s,yo=Date.now(),mo=!t||e>Date.now()-400&&Math.abs(t.clientX-s.clientX)<2&&Math.abs(t.clientY-s.clientY)<2?(mo+1)%3:1}function Rf(s,t){let e=po(s,t),i=Da(t),n=s.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),n=n.map(r.changes))},get(r,o,l){let a=po(s,r),c,h=fo(s,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=fo(s,e.pos,e.bias,i),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u1&&(c=Lf(n,a.pos))?c:l?n.addRange(h):b.create([h])}}}function Lf(s,t){for(let e=0;e=t)return b.create(s.ranges.slice(0,e).concat(s.ranges.slice(e+1)),s.mainIndex==e?0:s.mainIndex-(s.mainIndex>e?1:0))}return null}Wt.dragstart=(s,t)=>{let{selection:{main:e}}=s.state;if(t.target.draggable){let n=s.docView.nearest(t.target);if(n&&n.isWidget){let r=n.posAtStart,o=r+n.length;(r>=e.to||o<=e.from)&&(e=b.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",s.state.sliceDoc(e.from,e.to)),t.dataTransfer.effectAllowed="copyMove"),!1};Wt.dragend=s=>(s.inputState.draggedContent=null,!1);function bo(s,t,e,i){if(!e)return;let n=s.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&Mf(s,t)?{from:r.from,to:r.to}:null,l={from:n,insert:e},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}Wt.drop=(s,t)=>{if(!t.dataTransfer)return!1;if(s.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),n=0,r=()=>{++n==e.length&&bo(s,t,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return bo(s,t,i,!0),!0}return!1};Wt.paste=(s,t)=>{if(s.state.readOnly)return!0;s.observer.flush();let e=Ca?null:t.clipboardData;return e?(Aa(s,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Tf(s),!1)};function Ef(s,t){let e=s.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),s.focus()},50)}function If(s){let t=[],e=[],i=!1;for(let n of s.selection.ranges)n.empty||(t.push(s.sliceDoc(n.from,n.to)),e.push(n));if(!t.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(t.push(o.text),e.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:t.join(s.lineBreak),ranges:e,linewise:i}}let Ws=null;Wt.copy=Wt.cut=(s,t)=>{let{text:e,ranges:i,linewise:n}=If(s.state);if(!e&&!n)return!1;Ws=n?e:null,t.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Ca?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(Ef(s,e),!1)};const Oa=se.define();function Ta(s,t){let e=[];for(let i of s.facet(ca)){let n=i(s,t);n&&e.push(n)}return e?s.update({effects:e,annotations:Oa.of(!0)}):null}function Pa(s){setTimeout(()=>{let t=s.hasFocus;if(t!=s.inputState.notifiedFocused){let e=Ta(s.state,t);e?s.dispatch(e):s.update([])}},10)}Nt.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),Pa(s)};Nt.blur=s=>{s.observer.clearSelectionRange(),Pa(s)};Nt.compositionstart=Nt.compositionupdate=s=>{s.observer.editContext||(s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))};Nt.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,D.chrome&&D.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))};Nt.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};Wt.beforeinput=(s,t)=>{var e;let i;if(D.chrome&&D.android&&(i=va.find(n=>n.inputType==t.inputType))&&(s.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let n=((e=window.visualViewport)===null||e===void 0?void 0:e.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>n+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return D.ios&&t.inputType=="deleteContentForward"&&s.observer.flushSoon(),D.safari&&t.inputType=="insertText"&&s.inputState.composing>=0&&setTimeout(()=>Nt.compositionend(s,t),20),!1};const xo=new Set;function Nf(s){xo.has(s)||(xo.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const wo=["pre-wrap","normal","pre-line","break-spaces"];class Ff{constructor(t){this.lineWrapping=t,this.doc=V.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return wo.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let c=0;c0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t,e){this.height!=e&&(Math.abs(this.height-e)>cn&&(t.heightChanged=!0),this.height=e)}replace(t,e,i){return pt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=n[l],u=r.lineAt(a,U.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=c?u:r.lineAt(c,U.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,h=n[l-1].fromB,l--,ar*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n=r&&o(this.blockAt(0,i,n,r))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class At extends Ba{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Jt(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return i.length==1&&(n instanceof At||n instanceof it&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof it?n=new At(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):pt.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(t,n.heights[n.index++]):(i||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class it extends pt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(t,e,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let c=n+(t0){let r=i[i.length-1];r instanceof it?i[i.length-1]=new it(r.length+n):i.push(null,new it(n-1))}if(t>0){let r=i[0];r instanceof it?i[0]=new it(t+r.length):i.unshift(new it(t-1),null)}return pt.of(i)}decomposeLeft(t,e){e.push(new it(t-1),null)}decomposeRight(t,e){e.push(null,new it(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let r=e+this.length;if(n&&n.from<=e+this.length&&n.more){let o=[],l=Math.max(e,n.from),a=-1;for(n.from>e&&o.push(new it(n.from-e-1).updateHeight(t,e));l<=r&&n.more;){let h=t.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++];a==-1?a=f:Math.abs(f-a)>=cn&&(a=-2);let u=new At(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new it(r-l).updateHeight(t,l));let c=pt.of(o);return(a<0||Math.abs(c.height-this.height)>=cn||Math.abs(a-this.heightMetrics(t,e).perLine)>=cn)&&(t.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Wf extends pt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,n){let r=i+this.left.height;return tl))return c;let h=e==U.ByPosNoHeight?U.ByPosNoHeight:U.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,n,r).join(c)}forEachLine(t,e,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,l,a,o);else{let c=this.lineAt(a,U.ByPos,i,n,r);t=t&&c.from<=e&&o(c),e>c.to&&this.right.forEachLine(c.to+1,e,i,l,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&So(r,o-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?pt.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(t,l,i,n):o.updateHeight(t,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function So(s,t){let e,i;s[t]==null&&(e=s[t-1])instanceof it&&(i=s[t+1])instanceof it&&s.splice(t-1,3,new it(e.length+1+i.length))}const Hf=5;class pr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof At?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new At(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=Hf)&&this.addLineDeco(n,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new At(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new it(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof At)return t;let e=new At(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof At)&&!this.isCovered?this.nodes.push(new At(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==s.parentNode?u.bottom:Math.min(a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function $f(s,t){let e=s.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class Qn{constructor(t,e,i){this.from=t,this.to=e,this.size=i}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new Ff(e),this.stateDeco=t.facet(ki).filter(i=>typeof i!="function"),this.heightMap=pt.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle.setDoc(t.doc),[new It(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=P.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);t.push(new ji(r,o))}}return this.viewports=t.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?ko:new gr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(ui(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ki).filter(h=>typeof h!="function");let n=t.changedRanges,r=It.extendWithRanges(n,zf(i,this.stateDeco,t?t.changes:et.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(ua)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:S,scaleY:w}=Wl(e,l);(S>.005&&Math.abs(this.scaleX-S)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=S,this.scaleY=w,c|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=ql(t.scrollDOM);let p=(this.printing?$f:Kf)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),a){let S=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(S)&&(o=!0),o||n.lineWrapping&&Math.abs(x-this.contentDOMWidth)>n.charWidth){let{lineHeight:w,charWidth:A,textHeight:C}=t.docView.measureTextSize();o=w>0&&n.refresh(r,w,A,C,x/A,S),o&&(t.docView.minWidth=0,c|=8)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),n.heightChanged=!1;for(let w of this.viewports){let A=w.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?pt.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle,[new It(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Vf(w.from,A))}n.heightChanged&&(c|=2)}let v=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ji(n.lineAt(o-i*1e3,U.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,U.ByHeight,r,0,0).to);if(e){let{head:c}=e.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(c,U.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-h/2:e.y=="start"||e.y=="nearest"&&c=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r>1,o=n<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,f,u,d)=>{if(f-hh&&yy.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)y.fromx));if(!m){if(fy.from<=f&&y.to>=f)){let y=e.moveToLineBoundary(b.cursor(f),!1,!0).head;y>h&&(f=y)}m=new Qn(h,f,this.gapSize(u,h,f,d))}l.push(m)},c=h=>{if(h.lengthh.from&&a(h.from,d,h,f),pe.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];K.spans(t,this.viewport.from,this.viewport.to,{span(n,r){e.push({from:n,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((n,r)=>n.from!=e[r].from||n.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||ui(this.heightMap.lineAt(t,U.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||ui(this.heightMap.lineAt(this.scaler.fromDOM(t),U.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return ui(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ji{constructor(t,e){this.from=t,this.to=e}}function Uf(s,t,e){let i=[],n=s,r=0;return K.spans(e,s,t,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n=1)return t[t.length-1].to;let i=Math.floor(s*e);for(let n=0;;n++){let{from:r,to:o}=t[n],l=o-r;if(i<=l)return r+i;i-=l}}function Gi(s,t){let e=0;for(let{from:i,to:n}of s.ranges){if(t<=n){e+=t-i;break}e+=n-i}return e/s.total}function Gf(s,t){for(let e of s)if(t(e))return e}const ko={toDOM(s){return s},fromDOM(s){return s},scale:1,eq(s){return s==this}};class gr{constructor(t,e,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=e.lineAt(l,U.ByPos,t,0,0).top,h=e.lineAt(a,U.ByPos,t,0,0).bottom;return n+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let r=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function ui(s,t){if(t.scale==1)return s;let e=t.toDOM(s.top),i=t.toDOM(s.bottom);return new Jt(s.from,s.length,e,i-e,Array.isArray(s._content)?s._content.map(n=>ui(n,t)):s._content)}const Ji=T.define({combine:s=>s.join(" ")}),Hs=T.define({combine:s=>s.indexOf(!0)>-1}),zs=de.newName(),Ra=de.newName(),La=de.newName(),Ea={"&light":"."+Ra,"&dark":"."+La};function qs(s,t,e){return new de(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!e||!e[n])throw new RangeError(`Unsupported selector: ${n}`);return e[n]}):s+" "+i}})}const Jf=qs("."+zs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ea),di="￿";class Yf{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(H.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=di}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let r=this.text.length;this.readNode(n);let o=n.nextSibling;if(o==e)break;let l=$.get(n),a=$.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:mn(n))||mn(o)&&(n.nodeName!="BR"||n.cmIgnore)&&this.text.length>r)&&this.lineBreak(),n=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Xf(t,i.node,i.offset)?e:0))}}function Xf(s,t,e){for(;;){if(!t||e-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:tu(t),a=new Yf(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=eu(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ms(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ms(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?s.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=n.from,c=null;(r===8||D.android&&t.text.length=n.from&&e.to<=n.to&&(e.from!=n.from||e.to!=n.to)&&n.to-n.from-(e.to-e.from)<=4?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,e.from).append(e.insert).append(s.state.doc.slice(e.to,n.to))}:(D.mac||D.android)&&e&&e.from==e.to&&e.from==n.head-1&&/^\. ?$/.test(e.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:V.of([" "])}):D.chrome&&e&&e.from==e.to&&e.from==n.head&&e.insert.toString()==` - `&&s.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:V.of([" "])}),e)return Na(s,e,i,r);if(i&&!i.main.eq(n)){let o=!1,l="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(o=!0),l=s.inputState.lastSelectionOrigin),s.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Na(s,t,e,i=-1){if(D.ios&&s.inputState.flushIOSKey(t))return!0;let n=s.state.selection.main;if(D.android&&(t.to==n.to&&(t.from==n.from||t.from==n.from-1&&s.state.sliceDoc(t.from,n.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&qe(s.contentDOM,"Enter",13)||(t.from==n.from-1&&t.to==n.to&&t.insert.length==0||i==8&&t.insert.lengthn.head)&&qe(s.contentDOM,"Backspace",8)||t.from==n.from&&t.to==n.to+1&&t.insert.length==0&&qe(s.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,l=()=>o||(o=Qf(s,t,e));return s.state.facet(ha).some(a=>a(s,t.from,t.to,r,l))||s.dispatch(l()),!0}function Qf(s,t,e){let i,n=s.state,r=n.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&s.inputState.composing<0){let l=r.fromt.to?n.sliceDoc(t.to,r.to):"";i=n.replaceSelection(s.state.toText(l+t.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let l=n.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(n.selection.ranges.length>1&&s.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let c=s.state.sliceDoc(t.from,t.to),h,f=e&&wa(s,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);h={from:f.from,to:f.to-p}}else h=s.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-c.length;if(p.to-p.from!=d||s.state.sliceDoc(m,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=n.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&n.selection.replaceRange(a)}}let o="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,o+=".compose",s.inputState.compositionFirstChange&&(o+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function Zf(s,t,e,i){let n=Math.min(s.length,t.length),r=0;for(;r0&&l>0&&s.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function tu(s){let t=[];if(s.root.activeElement!=s.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return e&&(t.push(new Co(e,i)),(n!=e||r!=i)&&t.push(new Co(n,r))),t}function eu(s,t){if(s.length==0)return null;let e=s[0].pos,i=s.length==2?s[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}const iu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Zn=D.ie&&D.ie_version<=11;class nu{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Hc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new ru(t),t.state.facet(le)&&(t.contentDOM.editContext=this.editContext.editContext)),Zn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){t.type=="change"&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(le)?i.root.activeElement!=this.dom:!an(i.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&n.focusNode&&yi(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=vi(t.root);if(!e)return!1;let i=D.safari&&t.root.nodeType==11&&Nc(this.dom.ownerDocument)==this.dom&&su(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=an(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&qe(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&an(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new _f(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=Ia(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Ao(e,t.previousSibling||t.target.previousSibling,-1),n=Ao(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(le)!=t.state.facet(le)&&(t.view.contentDOM.editContext=t.state.facet(le)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Ao(s,t,e){for(;t;){let i=$.get(t);if(i&&i.parent==s)return i;let n=t.parentNode;t=n!=s.dom?n:e>0?t.nextSibling:t.previousSibling}return null}function Mo(s,t){let e=t.startContainer,i=t.startOffset,n=t.endContainer,r=t.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return yi(o.node,o.offset,n,r)&&([e,i,n,r]=[n,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}}function su(s,t){if(t.getComposedRanges){let n=t.getComposedRanges(s.root)[0];if(n)return Mo(s,n)}let e=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),e=n.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",i,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",i,!0),e?Mo(s,e):null}class ru{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});e.addEventListener("textupdate",i=>{let{anchor:n}=t.state.selection.main,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:V.of(i.text.split(` -`))};r.from==this.from&&nthis.to&&(r.to=n),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,Na(t,r,b.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&this.revertPending(t.state))}),e.addEventListener("characterboundsupdate",i=>{let n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;n.push(P.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}t.dispatch({effects:pa.of(P.set(n))})}),e.addEventListener("compositionstart",()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)}),e.addEventListener("compositionend",()=>{t.inputState.composing=-1,t.inputState.compositionFirstChange=null}),this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=vi(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(c)){n=this.pendingContextChange=null,e+=h,this.to+=h;return}else n=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}e+=h}),n&&!i&&this.revertPending(t.state),!i}update(t){!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.resetRange(t.state),this.editContext.updateText(0,this.editContext.text.length,t.state.doc.sliceString(this.from,this.to)),this.setSelection(t.state)):(t.docChanged||t.selectionSet)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.to+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to1e4*3)}toEditorPos(t){return t+this.from}toContextPos(t){return t-this.from}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:e}=t;this.dispatchTransactions=t.dispatchTransactions||e&&(i=>i.forEach(n=>e(n,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||zc(t.parent)||document,this.viewState=new vo(t.state||H.create(t)),t.scrollTo&&t.scrollTo.is(qi)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ci).map(i=>new Yn(i));for(let i of this.plugins)i.update(this);this.observer=new nu(this),this.inputState=new wf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new no(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...t){let e=t.length==1&&t[0]instanceof Z?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,n,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Oa))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Ta(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);n=bn.create(this,r,t),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Ke(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(qi)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=xn.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),e=this.docView.update(n),this.state.facet(fi)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(Ji)!=n.state.facet(Ji)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(Ns))try{u(n)}catch(d){Dt(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Ia(this,h)&&c.force&&qe(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new vo(t),this.plugins=t.facet(ci).map(i=>new Yn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new no(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ci),i=t.state.facet(ci);if(e!=i){let n=[];for(let r of i){let o=e.indexOf(r);if(o<0)n.push(new Yn(r));else{let l=this.plugins[o];l.mustUpdate=t,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=t;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ql(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(d=>{try{return d.read(this)}catch(p){return Dt(this.state,p),Do}}),f=bn.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){n=n+p,i.scrollTop=n/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(Ns))l(e)}get themeClasses(){return zs+" "+(this.state.facet(Hs)?La:Ra)+" "+this.state.facet(Ji)}updateAttrs(){let t=Oo(this,ga,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(le)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Oo(this,ur,e);let i=this.observer.ignore(()=>{let n=Bs(this.contentDOM,this.contentAttrs,e),r=Bs(this.dom,this.editorAttrs,t);return n||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let n of i.effects)if(n.is(O.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(fi);let t=this.state.facet(O.cspNonce);de.mount(this.root,this.styleModules.concat(Jf).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;ei.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return _n(this,t,ho(this,t,e,i))}moveByGroup(t,e){return _n(this,t,ho(this,t,e,i=>bf(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return b.cursor(r.side(e,n)+t.from,r.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return yf(this,t,e,i)}moveVertically(t,e,i){return _n(this,t,xf(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Sa(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),r=this.bidiSpans(n),o=r[ce.find(r,t-n.from,-1,e)];return Nn(i,o.dir==X.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(fa)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>ou)return na(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||ia(r.isolates,i=io(this,t))))return r.order;i||(i=io(this,t));let n=tf(t.text,e,i);return this.bidiCache.push(new xn(t.from,t.to,e,i,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||D.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Hl(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return qi.of(new Ke(typeof t=="number"?b.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return qi.of(new Ke(b.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ut.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ut.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=de.newName(),n=[Ji.of(i),fi.of(qs(`.${i}`,t))];return e&&e.dark&&n.push(Hs.of(!0)),n}static baseTheme(t){return ye.lowest(fi.of(qs("."+zs,t,Ea)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&$.get(i)||$.get(t);return((e=n==null?void 0:n.rootView)===null||e===void 0?void 0:e.view)||null}}O.styleModule=fi;O.inputHandler=ha;O.scrollHandler=da;O.focusChangeEffect=ca;O.perLineTextDirection=fa;O.exceptionSink=aa;O.updateListener=Ns;O.editable=le;O.mouseSelectionStyle=la;O.dragMovesSelection=oa;O.clickAddsSelectionRange=ra;O.decorations=ki;O.outerDecorations=ma;O.atomicRanges=dr;O.bidiIsolatedRanges=ya;O.scrollMargins=ba;O.darkTheme=Hs;O.cspNonce=T.define({combine:s=>s.length?s[0]:""});O.contentAttributes=ur;O.editorAttributes=ga;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=F.define();const ou=4096,Do={};class xn{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:X.LTR;for(let r=Math.max(0,t.length-10);r=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&Ps(o,e)}return e}const lu=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function au(s,t){const e=s.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;ai.concat(n),[]))),e}function cu(s,t,e){return Va(Fa(s.state),t,s,e)}let ae=null;const fu=4e3;function uu(s,t=lu){let e=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>au(y,t));for(let y=1;y{let S=ae={view:v,prefix:x,scope:o};return setTimeout(()=>{ae==S&&(ae=null)},fu),!0}]})}let g=p.join(" ");n(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=e[c]||(e[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,Ks))}let a=o[t]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Ks=null;function Va(s,t,e,i){Ks=t;let n=Ic(t),r=nt(n,0),o=Bt(r)==n.length&&n!=" ",l="",a=!1,c=!1,h=!1;ae&&ae.view==e&&ae.scope==i&&(l=ae.prefix+" ",ka.indexOf(t.keyCode)<0&&(c=!0,ae=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(e)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),c=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Yi(n,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(D.windows&&t.ctrlKey&&t.altKey)&&(p=pe[t.keyCode])&&p!=n?(u(d[l+Yi(p,t,!0)])||t.shiftKey&&(g=Si[t.keyCode])!=n&&g!=p&&u(d[l+Yi(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+Yi(n,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&t.stopPropagation(),Ks=null,a}class Ei{constructor(t,e,i,n,r){this.className=t,this.left=e,this.top=i,this.width=n,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=Wa(t);return[new Ei(e,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}else return du(t,e,i)}}function Wa(s){let t=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==X.LTR?t.left:t.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:t.top-s.scrollDOM.scrollTop*s.scaleY}}function Po(s,t,e,i){let n=s.coordsAtPos(t,e*2);if(!n)return i;let r=s.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,l=s.posAtCoords({x:r.left+1,y:o}),a=s.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function du(s,t,e){if(e.to<=s.viewport.from||e.from>=s.viewport.to)return[];let i=Math.max(e.from,s.viewport.from),n=Math.min(e.to,s.viewport.to),r=s.textDirection==X.LTR,o=s.contentDOM,l=o.getBoundingClientRect(),a=Wa(s),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=Vs(s,i),p=Vs(s,n),g=d.type==Ot.Text?d:null,m=p.type==Ot.Text?p:null;if(g&&(s.lineWrapping||d.widgetLineBreaks)&&(g=Po(s,i,1,g)),m&&(s.lineWrapping||p.widgetLineBreaks)&&(m=Po(s,n,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return x(v(e.from,e.to,g));{let w=g?v(e.from,null,g):S(d,!1),A=m?v(null,e.to,m):S(p,!0),C=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+s.defaultLineHeight/2R&&W.from=bt)break;tt>J&&E(Math.max(Tt,J),w==null&&Tt<=R,Math.min(tt,bt),A==null&&tt>=z,kt.dir)}if(J=xt.to+1,J>=bt)break}return N.length==0&&E(R,w==null,z,A==null,s.textDirection),{top:B,bottom:I,horizontal:N}}function S(w,A){let C=l.top+(A?w.top:w.bottom);return{top:C,bottom:C,horizontal:[]}}}function pu(s,t){return s.constructor==t.constructor&&s.eq(t)}class gu{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(fn)!=t.state.facet(fn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(fn);for(;e!pu(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let n=e.nextSibling;e.remove(),e=n}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const fn=T.define();function Ha(s){return[ut.define(t=>new gu(t,s)),fn.of(s)]}const za=!D.ios,Ci=T.define({combine(s){return Le(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function pm(s={}){return[Ci.of(s),mu,yu,bu,ua.of(!0)]}function qa(s){return s.startState.facet(Ci)!=s.state.facet(Ci)}const mu=Ha({above:!0,markers(s){let{state:t}=s,e=t.facet(Ci),i=[];for(let n of t.selection.ranges){let r=n==t.selection.main;if(n.empty?!r||za:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=n.empty?n:b.cursor(n.head,n.head>n.anchor?-1:1);for(let a of Ei.forRange(s,o,l))i.push(a)}}return i},update(s,t){s.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=qa(s);return e&&Bo(s.state,t),s.docChanged||s.selectionSet||e},mount(s,t){Bo(t.state,s)},class:"cm-cursorLayer"});function Bo(s,t){t.style.animationDuration=s.facet(Ci).cursorBlinkRate+"ms"}const yu=Ha({above:!1,markers(s){return s.state.selection.ranges.map(t=>t.empty?[]:Ei.forRange(s,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(s,t){return s.docChanged||s.selectionSet||s.viewportChanged||qa(s)},class:"cm-selectionLayer"}),$s={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};za&&($s[".cm-line"].caretColor=$s[".cm-content"].caretColor="transparent !important");const bu=ye.highest(O.theme($s)),Ka=F.define({map(s,t){return s==null?null:t.mapPos(s)}}),pi=yt.define({create(){return null},update(s,t){return s!=null&&(s=t.changes.mapPos(s)),t.effects.reduce((e,i)=>i.is(Ka)?i.value:e,s)}}),xu=ut.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var t;let e=s.state.field(pi);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(pi)!=e||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,t=s.state.field(pi),e=t!=null&&s.coordsAtPos(t);if(!e)return null;let i=s.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+s.scrollDOM.scrollLeft*s.scaleX,top:e.top-i.top+s.scrollDOM.scrollTop*s.scaleY,height:e.bottom-e.top}}drawCursor(s){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;s?(this.cursor.style.left=s.left/t+"px",this.cursor.style.top=s.top/e+"px",this.cursor.style.height=s.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(pi)!=s&&this.view.dispatch({effects:Ka.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function gm(){return[pi,xu]}function Ro(s,t,e,i,n){t.lastIndex=0;for(let r=s.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)n(o+l.index,l)}function wu(s,t){let e=s.visibleRanges;if(e.length==1&&e[0].from==s.viewport.from&&e[0].to==s.viewport.to)return e;let i=[];for(let{from:n,to:r}of e)n=Math.max(s.state.doc.lineAt(n).from,n-t),r=Math.min(s.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=n?i[i.length-1].to=r:i.push({from:n,to:r});return i}class Su{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(l,a,c,h)=>n(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let f=i(l,a,c);f&&h(c,c+l[0].length,f)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new De,i=e.add.bind(e);for(let{from:n,to:r}of wu(t,this.maxLength))Ro(t.state.doc,this.regexp,n,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>t.view.viewport.from&&l1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,n);if(l>o){let a=t.state.doc.lineAt(o),c=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lu.push(y.range(g,m));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,t,g,p));e=e.update({filterFrom:h,filterTo:f,filter:(g,m)=>gf,add:u})}}return e}}const js=/x/.unicode!=null?"gu":"g",vu=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,js),ku={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ts=null;function Cu(){var s;if(ts==null&&typeof document<"u"&&document.body){let t=document.body.style;ts=((s=t.tabSize)!==null&&s!==void 0?s:t.MozTabSize)!=null}return ts||!1}const un=T.define({combine(s){let t=Le(s,{render:null,specialChars:vu,addSpecialChars:null});return(t.replaceTabs=!Cu())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,js)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,js)),t}});function mm(s={}){return[un.of(s),Au()]}let Lo=null;function Au(){return Lo||(Lo=ut.fromClass(class{constructor(s){this.view=s,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(un)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new Su({regexp:s.specialChars,decoration:(t,e,i)=>{let{doc:n}=e.state,r=nt(t[0],0);if(r==9){let o=n.lineAt(i),l=e.state.tabSize,a=ti(o.text,l,i-o.from);return P.replace({widget:new Tu((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new Ou(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let t=s.state.facet(un);s.startState.facet(un)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const Mu="•";function Du(s){return s>=32?Mu:s==10?"␤":String.fromCharCode(9216+s)}class Ou extends Ee{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=Du(this.code),i=t.state.phrase("Control character")+" "+(ku[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Tu extends Ee{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class Pu extends Ee{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(t){let e=t.firstChild?Ge(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=Nn(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return n.bottom-n.top>r*1.5?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}function ym(s){return ut.fromClass(class{constructor(t){this.view=t,this.placeholder=s?P.set([P.widget({widget:new Pu(s),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:t=>t.decorations})}const Us=2e3;function Bu(s,t,e){let i=Math.min(t.line,e.line),n=Math.max(t.line,e.line),r=[];if(t.off>Us||e.off>Us||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=n;a++){let c=s.doc.line(a);c.length<=l&&r.push(b.range(c.from+o,c.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=n;a++){let c=s.doc.line(a),h=ks(c.text,o,s.tabSize,!0);if(h<0)r.push(b.cursor(c.to));else{let f=ks(c.text,l,s.tabSize);r.push(b.range(c.from+h,c.from+f))}}}return r}function Ru(s,t){let e=s.coordsAtPos(s.viewport.from);return e?Math.round(Math.abs((e.left-t)/s.defaultCharacterWidth)):-1}function Eo(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1),i=s.state.doc.lineAt(e),n=e-i.from,r=n>Us?-1:n==i.length?Ru(s,t.clientX):ti(i.text,s.state.tabSize,e-i.from);return{line:i.number,col:r,off:n}}function Lu(s,t){let e=Eo(s,t),i=s.state.selection;return e?{update(n){if(n.docChanged){let r=n.changes.mapPos(n.startState.doc.line(e.line).from),o=n.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(n.changes)}},get(n,r,o){let l=Eo(s,n);if(!l)return i;let a=Bu(s.state,e,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function bm(s){let t=e=>e.altKey&&e.button==0;return O.mouseSelectionStyle.of((e,i)=>t(i)?Lu(e,i):null)}const oi="-10000px";class Eu{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let n=t.state.facet(this.facet),r=n.filter(a=>a);if(n===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;ae[c]=a),e.length=l.length),this.input=n,this.tooltips=r,this.tooltipViews=o,!0}}function Iu(s){let{win:t}=s;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const es=T.define({combine:s=>{var t,e,i;return{position:D.ios?"absolute":((t=s.find(n=>n.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=s.find(n=>n.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=s.find(n=>n.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Iu}}}),Io=new WeakMap,$a=ut.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=s.state.facet(es);this.position=t.position,this.parent=t.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Eu(s,ja,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(s,this.above);t&&this.observeIntersection();let e=t||s.geometryChanged,i=s.state.facet(es);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let n of this.manager.tooltipViews)n.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let n of this.manager.tooltipViews)this.container.appendChild(n.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(s,t){let e=s.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let n=document.createElement("div");n.className="cm-tooltip-arrow",e.dom.appendChild(n)}return e.dom.style.position=this.position,e.dom.style.top=oi,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var s,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(s=i.destroy)===null||s===void 0||s.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect(),t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:n}=this.manager.tooltipViews[0];if(D.gecko)i=n.offsetParent!=this.container.ownerDocument.body;else if(n.style.top==oi&&n.style.left=="0px"){let r=n.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(t=n.width/this.parent.offsetWidth,e=n.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((n,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(n.pos):this.view.coordsAtPos(n.pos)}),size:this.manager.tooltipViews.map(({dom:n})=>n.getBoundingClientRect()),space:this.view.state.facet(es).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(s){var t;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:e,space:i,scaleX:n,scaleY:r}=s,o=[];for(let l=0;l=Math.min(e.bottom,i.bottom)||f.rightMath.min(e.right,i.right)+.1){h.style.top=oi;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=Io.get(c))!==null&&t!==void 0?t:u.bottom-u.top,y=c.offset||Fu,x=this.view.textDirection==X.LTR,v=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.min(f.left-(d?14:0)+y.x,i.right-g):Math.max(i.left,f.left-g+(d?14:0)-y.x),S=this.above[l];!a.strictSide&&(S?f.top-(u.bottom-u.top)-y.yi.bottom)&&S==i.bottom-f.bottom>f.top-i.top&&(S=this.above[l]=!S);let w=(S?f.top-i.top:i.bottom-f.bottom)-p;if(wv&&B.topA&&(A=S?B.top-m-2-p:B.bottom+p+2);if(this.position=="absolute"?(h.style.top=(A-s.parent.top)/r+"px",h.style.left=(v-s.parent.left)/n+"px"):(h.style.top=A/r+"px",h.style.left=v/n+"px"),d){let B=f.left+(x?y.x:-y.x)-(v+14-7);d.style.left=B/n+"px"}c.overlap!==!0&&o.push({left:v,top:A,right:C,bottom:A+m}),h.classList.toggle("cm-tooltip-above",S),h.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=oi}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Nu=O.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Fu={x:0,y:0},ja=T.define({enables:[$a,Nu]});function Ua(s,t){let e=s.plugin($a);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const No=T.define({combine(s){let t,e;for(let i of s)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function wn(s,t){let e=s.plugin(Ga),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const Ga=ut.fromClass(class{constructor(s){this.input=s.state.facet(Sn),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(s));let t=s.state.facet(No);this.top=new Xi(s,!0,t.topContainer),this.bottom=new Xi(s,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(s){let t=s.state.facet(No);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Xi(s.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xi(s.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=s.state.facet(Sn);if(e!=this.input){let i=e.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(s.view),l.push(h)):(h=this.panels[c],h.update&&h.update(s)),n.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>O.scrollMargins.of(t=>{let e=t.plugin(s);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Xi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Fo(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Fo(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Fo(s){let t=s.nextSibling;return s.remove(),t}const Sn=T.define({enables:Ga});class Be extends Me{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Be.prototype.elementClass="";Be.prototype.toDOM=void 0;Be.prototype.mapMode=ht.TrackBefore;Be.prototype.startSide=Be.prototype.endSide=-1;Be.prototype.point=!0;const Vu=T.define(),Wu=new class extends Be{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Hu=Vu.compute(["selection"],s=>{let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.head).from;n>e&&(e=n,t.push(Wu.range(n)))}return K.of(t)});function xm(){return Hu}const zu=1024;let qu=0;class Rt{constructor(t,e){this.from=t,this.to=e}}class L{constructor(t={}){this.id=qu++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=gt.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:s=>s.split(" ")});L.openedBy=new L({deserialize:s=>s.split(" ")});L.group=new L({deserialize:s=>s.split(" ")});L.isolate=new L({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Ai{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[L.mounted.id]}}const Ku=Object.create(null);class gt{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Ku,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new gt(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(L.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(L.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}}gt.none=new gt("",Object.create(null),0,8);class yr{constructor(t){this.types=t;for(let e=0;e0;for(let a=this.cursor(o|Y.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:wr(gt.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new j(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new j(gt.none,e,i,n)))}static build(t){return Gu(t)}}j.empty=new j(gt.none,[],[],0);class br{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new br(this.buffer,this.index)}}class me{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return gt.none}toString(){let t=[];for(let e=0;e0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l=t&&et;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Mi(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to0?l.length:-1;t!=c;t+=e){let h=l[t],f=a[t]+o.from;if(Ja(n,i,f,f+h.length)){if(h instanceof me){if(r&Y.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,e,i-f,n);if(u>-1)return new Yt(new $u(o,h,t,f),null,u)}else if(r&Y.IncludeAnonymous||!h.type.isAnonymous||xr(h)){let u;if(!(r&Y.IgnoreMounts)&&(u=Ai.get(h))&&!u.overlay)return new ft(u.tree,f,t,o);let d=new ft(h,f,t,o);return r&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?h.children.length-1:0,e,i,n)}}}if(r&Y.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&Y.IgnoreOverlays)&&(n=Ai.get(this._tree))&&n.overlay){let r=t-this.from;for(let{from:o,to:l}of n.overlay)if((e>0?o<=r:o=r:l>r))return new ft(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Wo(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function Gs(s,t,e=t.length-1){for(let i=s.parent;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class $u{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Yt extends Ya{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Yt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Yt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Yt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Yt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new j(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Xa(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;re.from||o.to=t){let l=new ft(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Mi(l,t,e,!1))}}return n?Xa(n):i}class vn{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ft)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof ft?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Y.IncludeAnonymous||l instanceof me||!l.type.isAnonymous||xr(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return Gs(this.node,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function xr(s){return s.children.some(t=>t instanceof me||!t.type.isAnonymous||xr(t))}function Gu(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=zu,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new br(e,e.length):e,a=i.types,c=0,h=0;function f(w,A,C,B,I,N){let{id:E,start:R,end:z,size:W}=l,J=h;for(;W<0;)if(l.next(),W==-1){let tt=r[E];C.push(tt),B.push(R-w);return}else if(W==-3){c=E;return}else if(W==-4){h=E;return}else throw new RangeError(`Unrecognized record size: ${W}`);let bt=a[E],xt,kt,Tt=R-w;if(z-R<=n&&(kt=m(l.pos-A,I))){let tt=new Uint16Array(kt.size-kt.skip),Pt=l.pos-kt.size,zt=tt.length;for(;l.pos>Pt;)zt=y(kt.start,tt,zt);xt=new me(tt,z-kt.start,i),Tt=kt.start-w}else{let tt=l.pos-W;l.next();let Pt=[],zt=[],xe=E>=o?E:-1,Ie=0,Vi=z;for(;l.pos>tt;)xe>=0&&l.id==xe&&l.size>=0?(l.end<=Vi-n&&(p(Pt,zt,R,Ie,l.end,Vi,xe,J),Ie=Pt.length,Vi=l.end),l.next()):N>2500?u(R,tt,Pt,zt):f(R,tt,Pt,zt,xe,N+1);if(xe>=0&&Ie>0&&Ie-1&&Ie>0){let Fr=d(bt);xt=wr(bt,Pt,zt,0,Pt.length,0,z-R,Fr,Fr)}else xt=g(bt,Pt,zt,z-R,J-z)}C.push(xt),B.push(Tt)}function u(w,A,C,B){let I=[],N=0,E=-1;for(;l.pos>A;){let{id:R,start:z,end:W,size:J}=l;if(J>4)l.next();else{if(E>-1&&z=0;W-=3)R[J++]=I[W],R[J++]=I[W+1]-z,R[J++]=I[W+2]-z,R[J++]=J;C.push(new me(R,I[2]-z,i)),B.push(z-w)}}function d(w){return(A,C,B)=>{let I=0,N=A.length-1,E,R;if(N>=0&&(E=A[N])instanceof j){if(!N&&E.type==w&&E.length==B)return E;(R=E.prop(L.lookAhead))&&(I=C[N]+E.length+R)}return g(w,A,C,B,I)}}function p(w,A,C,B,I,N,E,R){let z=[],W=[];for(;w.length>B;)z.push(w.pop()),W.push(A.pop()+C-I);w.push(g(i.types[E],z,W,N-I,R-N)),A.push(I-C)}function g(w,A,C,B,I=0,N){if(c){let E=[L.contextHash,c];N=N?[E].concat(N):[E]}if(I>25){let E=[L.lookAhead,I];N=N?[E].concat(N):[E]}return new j(w,A,C,B,N)}function m(w,A){let C=l.fork(),B=0,I=0,N=0,E=C.end-n,R={size:0,start:0,skip:0};t:for(let z=C.pos-w;C.pos>z;){let W=C.size;if(C.id==A&&W>=0){R.size=B,R.start=I,R.skip=N,N+=4,B+=4,C.next();continue}let J=C.pos-W;if(W<0||J=o?4:0,xt=C.start;for(C.next();C.pos>J;){if(C.size<0)if(C.size==-3)bt+=4;else break t;else C.id>=o&&(bt+=4);C.next()}I=xt,B+=W,N+=bt}return(A<0||B==w)&&(R.size=B,R.start=I,R.skip=N),R.size>4?R:void 0}function y(w,A,C){let{id:B,start:I,end:N,size:E}=l;if(l.next(),E>=0&&B4){let z=l.pos-(E-4);for(;l.pos>z;)C=y(w,A,C)}A[--C]=R,A[--C]=N-w,A[--C]=I-w,A[--C]=B}else E==-3?c=B:E==-4&&(h=B);return C}let x=[],v=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,x,v,-1,0);let S=(t=s.length)!==null&&t!==void 0?t:x.length?v[0]+x[0].length:0;return new j(a[s.topID],x.reverse(),v.reverse(),S)}const Ho=new WeakMap;function dn(s,t){if(!s.isAnonymous||t instanceof me||t.type!=s)return 1;let e=Ho.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof j)){e=1;break}e+=dn(s,i)}Ho.set(t,e)}return e}function wr(s,t,e,i,n,r,o,l,a){let c=0;for(let p=i;p=h)break;A+=C}if(v==S+1){if(A>h){let C=p[S];d(C.children,C.positions,0,C.children.length,g[S]+x);continue}f.push(p[S])}else{let C=g[v-1]+p[v-1].length-w;f.push(wr(s,p,g,S,v,w,C,null,a))}u.push(w+x-r)}}return d(t,e,i,n,0),(l||a)(f,u,o)}class wm{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Yt?this.setBuffer(t.context.buffer,t.index,e):t instanceof ft&&this.map.set(t.tree,e)}get(t){return t instanceof Yt?this.getBuffer(t.context.buffer,t.index):t instanceof ft?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class ee{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new ee(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,c=0;;l++){let h=l=i)for(;o&&o.from=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new ee(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&n.push(u),o.to>f)break;o=rnew Rt(n.from,n.to)):[new Rt(0,0)]:[new Rt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}}class Ju{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Sm(s){return(t,e,i,n)=>new Xu(t,s,e,i,n)}class zo{constructor(t,e,i,n,r){this.parser=t,this.parse=e,this.overlay=i,this.target=n,this.from=r}}function qo(s){if(!s.length||s.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class Yu{constructor(t,e,i,n,r,o,l){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Js=new L({perNode:!0});class Xu{constructor(t,e,i,n,r){this.nest=e,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new j(i.type,i.children,i.positions,i.length,i.propValues.concat([[Js,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[L.mounted.id]=new Ai(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)l=!1;else if(t.hasNode(n)){if(e){let c=e.mounts.find(h=>h.frag.from<=n.from&&h.frag.to>=n.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=n.from&&u<=n.to&&!e.ranges.some(d=>d.fromf)&&e.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=_u(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew Rt(f.from-n.from,f.to-n.from)):null,n.tree,h.length?h[0].from:n.from)),r.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else e&&(a=e.predicate(n))&&(a===!0&&(a=new Rt(n.from,n.to)),a.fromnew Rt(h.from-e.start,h.to-e.start)),e.target,c[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function _u(s,t,e){for(let i of s){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function Ko(s,t,e,i,n,r){if(t=t&&e.enter(i,1,Y.IgnoreOverlays|Y.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof j)e=e.children[0];else break}return!1}}class Zu{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(Js))!==null&&e!==void 0?e:i.to,this.inner=new $o(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(Js))!==null&&t!==void 0?t:e.to,this.inner=new $o(e.tree,-e.offset)}}findMounts(t,e){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==e)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function jo(s,t){let e=null,i=t;for(let n=1,r=0;n=l)break;a.to<=o||(e||(i=e=t.slice()),a.froml&&e.splice(r+1,0,new Rt(l,a.to))):a.to>l?e[r--]=new Rt(l,a.to):e.splice(r--,1))}}return i}function td(s,t,e,i){let n=0,r=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=n==s.length?1e9:o?s[n].to:s[n].from,f=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(h,f,i);unew Rt(u.from+i,u.to+i)),f=td(t,h,a,c);for(let u=0,d=a;;u++){let p=u==f.length,g=p?c:f[u].from;if(g>d&&e.push(new ee(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else e.push(new ee(a,c,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let ed=0;class Ut{constructor(t,e,i){this.set=t,this.base=e,this.modified=i,this.id=ed++}static define(t){if(t!=null&&t.base)throw new Error("Can not derive from a modified tag");let e=new Ut([],null,[]);if(e.set.push(e),t)for(let i of t.set)e.set.push(i);return e}static defineModifier(){let t=new kn;return e=>e.modified.indexOf(t)>-1?e:kn.get(e.base||e,e.modified.concat(t).sort((i,n)=>i.id-n.id))}}let id=0;class kn{constructor(){this.instances=[],this.id=id++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&nd(e,l.modified));if(i)return i;let n=[],r=new Ut(n,t,e);for(let l of e)l.instances.push(r);let o=sd(e);for(let l of t.set)if(!l.modified.length)for(let a of o)n.push(kn.get(l,a));return r}}function nd(s,t){return s.length==t.length&&s.every((e,i)=>e==t[i])}function sd(s){let t=[[]];for(let e=0;ei.length-e.length)}function rd(s){let t=Object.create(null);for(let e in s){let i=s[e];Array.isArray(i)||(i=[i]);for(let n of e.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+n);let h=new Cn(i,o,a>0?r.slice(0,a):null);t[c]=h.sort(t[c])}}return Qa.add(t)}const Qa=new L;class Cn{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=n;for(let l of r)for(let a of l.set){let c=e[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function od(s,t){let e=null;for(let i of s){let n=i.style(t);n&&(e=e?e+" "+n:n)}return e}function ld(s,t,e,i=0,n=s.length){let r=new ad(i,Array.isArray(t)?t:[t],e);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class ad{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=n,h=hd(t)||Cn.empty,f=od(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(e,l),c),h.opaque)return;let u=t.tree&&t.tree.prop(L.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let x=m=v||!t.nextSibling())););if(!x||v>i)break;y=x.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&t.parent()}else if(t.firstChild()){u&&(n="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),c)}while(t.nextSibling());t.parent()}}}function hd(s){let t=s.type.prop(Qa);for(;t&&t.context&&!s.matchContext(t.context);)t=t.next;return t||null}const k=Ut.define,Qi=k(),re=k(),Go=k(re),Jo=k(re),oe=k(),Zi=k(oe),is=k(oe),jt=k(),we=k(jt),Kt=k(),$t=k(),Ys=k(),li=k(Ys),tn=k(),M={comment:Qi,lineComment:k(Qi),blockComment:k(Qi),docComment:k(Qi),name:re,variableName:k(re),typeName:Go,tagName:k(Go),propertyName:Jo,attributeName:k(Jo),className:k(re),labelName:k(re),namespace:k(re),macroName:k(re),literal:oe,string:Zi,docString:k(Zi),character:k(Zi),attributeValue:k(Zi),number:is,integer:k(is),float:k(is),bool:k(oe),regexp:k(oe),escape:k(oe),color:k(oe),url:k(oe),keyword:Kt,self:k(Kt),null:k(Kt),atom:k(Kt),unit:k(Kt),modifier:k(Kt),operatorKeyword:k(Kt),controlKeyword:k(Kt),definitionKeyword:k(Kt),moduleKeyword:k(Kt),operator:$t,derefOperator:k($t),arithmeticOperator:k($t),logicOperator:k($t),bitwiseOperator:k($t),compareOperator:k($t),updateOperator:k($t),definitionOperator:k($t),typeOperator:k($t),controlOperator:k($t),punctuation:Ys,separator:k(Ys),bracket:li,angleBracket:k(li),squareBracket:k(li),paren:k(li),brace:k(li),content:jt,heading:we,heading1:k(we),heading2:k(we),heading3:k(we),heading4:k(we),heading5:k(we),heading6:k(we),contentSeparator:k(jt),list:k(jt),quote:k(jt),emphasis:k(jt),strong:k(jt),link:k(jt),monospace:k(jt),strikethrough:k(jt),inserted:k(),deleted:k(),changed:k(),invalid:k(),meta:tn,documentMeta:k(tn),annotation:k(tn),processingInstruction:k(tn),definition:Ut.defineModifier(),constant:Ut.defineModifier(),function:Ut.defineModifier(),standard:Ut.defineModifier(),local:Ut.defineModifier(),special:Ut.defineModifier()};Za([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var ns;const Ce=new L;function th(s){return T.define({combine:s?t=>t.concat(s):void 0})}const cd=new L;class Lt{constructor(t,e,i=[],n=""){this.data=t,this.name=n,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return mt(this)}}),this.parser=e,this.extension=[Qe.of(this),H.languageData.of((r,o,l)=>{let a=Yo(r,o,l),c=a.type.prop(Ce);if(!c)return[];let h=r.facet(c),f=a.type.prop(cd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(t,e,i=-1){return Yo(t,e,i).type.prop(Ce)==this.data}findRegions(t){let e=t.facet(Qe);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Ce)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ce)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?e:void 0)]}),t.name)}configure(t,e){return new Xs(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function mt(s){let t=s.field(Lt.state,!1);return t?t.tree:j.empty}class fd{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let ai=null;class Xe{constructor(t,e,i=[],n,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Xe(t,e,[],j.empty,0,i,[],null)}startParse(){return this.parser.startParse(new fd(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=j.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let n=Date.now()+t;t=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(ee.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=ai;ai=this;try{return t()}finally{ai=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Xo(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),i=ee.applyChanges(i,a),n=j.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);ht.from&&(this.fragments=Xo(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends _a{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=ai;if(a){for(let c of n)a.tempSkipped.push(c);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new j(gt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return ai}}function Xo(s,t,e){return ee.applyChanges(s,[{fromA:t,toA:e,fromB:t,toB:e}])}class _e{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new _e(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Xe.create(t.facet(Qe).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new _e(i)}}Lt.state=yt.define({create:_e.init,update(s,t){for(let e of t.effects)if(e.is(Lt.setState))return e.value;return t.startState.facet(Qe)!=t.state.facet(Qe)?_e.init(t.state):s.apply(t)}});let eh=s=>{let t=setTimeout(()=>s(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(eh=s=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(s,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const ss=typeof navigator<"u"&&(!((ns=navigator.scheduling)===null||ns===void 0)&&ns.isInputPending)?()=>navigator.scheduling.isInputPending():null,ud=ut.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Lt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Lt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=eh(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndn+1e3,a=r.context.work(()=>ss&&ss()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Lt.setState.of(new _e(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Dt(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Qe=T.define({combine(s){return s.length?s[0]:null},enables:s=>[Lt.state,ud,O.contentAttributes.compute([s],t=>{let e=t.facet(s);return e&&e.name?{"data-language":e.name}:{}})]});class km{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const ih=T.define(),Vn=T.define({combine:s=>{if(!s.length)return" ";let t=s[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return t}});function Re(s){let t=s.facet(Vn);return t.charCodeAt(0)==9?s.tabSize*t.length:t.length}function An(s,t){let e="",i=s.tabSize,n=s.facet(Vn)[0];if(n==" "){for(;t>=i;)e+=" ",t-=i;n=" "}for(let r=0;r=t?pd(s,e,t):null}class Wn{constructor(t,e={}){this.state=t,this.options=e,this.unit=Re(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ti(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const dd=new L;function pd(s,t,e){let i=t.resolveStack(e),n=i.node.enterUnfinishedNodesBefore(e);if(n!=i.node){let r=[];for(let o=n;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return sh(i,s,e)}function sh(s,t,e){for(let i=s;i;i=i.next){let n=md(i.node);if(n)return n(Sr.create(t,e,i))}return 0}function gd(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function md(s){let t=s.type.prop(dd);if(t)return t;let e=s.firstChild,i;if(e&&(i=e.type.prop(L.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>rh(o,!0,1,void 0,r&&!gd(o)?n.from:void 0)}return s.parent==null?yd:null}function yd(){return 0}class Sr extends Wn{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Sr(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(bd(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return sh(this.context.next,this.base,this.pos)}}function bd(s,t){for(let e=t;e;e=e.parent)if(s==e)return!0;return!1}function xd(s){let t=s.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(e.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromrh(i,t,e,s)}function rh(s,t,e,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=t?xd(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*e)}const Am=s=>s.baseIndent;function Mm({except:s,units:t=1}={}){return e=>{let i=s&&s.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Dm=new L;function Om(s){let t=s.firstChild,e=s.lastChild;return t&&t.tol.prop(Ce)==o.data:o?l=>l==o:void 0,this.style=Za(t.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new de(i):null,this.themeType=e.themeType}static define(t,e){return new Hn(t,e||{})}}const _s=T.define(),oh=T.define({combine(s){return s.length?[s[0]]:null}});function rs(s){let t=s.facet(_s);return t.length?t:s.facet(oh)}function Tm(s,t){let e=[Sd],i;return s instanceof Hn&&(s.module&&e.push(O.styleModule.of(s.module)),i=s.themeType),t!=null&&t.fallback?e.push(oh.of(s)):i?e.push(_s.computeN([O.darkTheme],n=>n.facet(O.darkTheme)==(i=="dark")?[s]:[])):e.push(_s.of(s)),e}class wd{constructor(t){this.markCache=Object.create(null),this.tree=mt(t.state),this.decorations=this.buildDeco(t,rs(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=mt(t.state),i=rs(t.state),n=i!=rs(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return P.none;let i=new De;for(let{from:n,to:r}of t.visibleRanges)ld(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=P.mark({class:a})))},n,r);return i.finish()}}const Sd=ye.high(ut.fromClass(wd,{decorations:s=>s.decorations})),Pm=Hn.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),vd=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),lh=1e4,ah="()[]{}",hh=T.define({combine(s){return Le(s,{afterCursor:!0,brackets:ah,maxScanDistance:lh,renderMatch:Ad})}}),kd=P.mark({class:"cm-matchingBracket"}),Cd=P.mark({class:"cm-nonmatchingBracket"});function Ad(s){let t=[],e=s.matched?kd:Cd;return t.push(e.range(s.start.from,s.start.to)),s.end&&t.push(e.range(s.end.from,s.end.to)),t}const Md=yt.define({create(){return P.none},update(s,t){if(!t.docChanged&&!t.selection)return s;let e=[],i=t.state.facet(hh);for(let n of t.state.selection.ranges){if(!n.empty)continue;let r=Xt(t.state,n.head,-1,i)||n.head>0&&Xt(t.state,n.head-1,1,i)||i.afterCursor&&(Xt(t.state,n.head,1,i)||n.headO.decorations.from(s)}),Dd=[Md,vd];function Bm(s={}){return[hh.of(s),Dd]}const Od=new L;function Qs(s,t,e){let i=s.prop(t<0?L.openedBy:L.closedBy);if(i)return i;if(s.name.length==1){let n=e.indexOf(s.name);if(n>-1&&n%2==(t<0?1:0))return[e[n+t]]}return null}function Zs(s){let t=s.type.prop(Od);return t?t(s.node):s}function Xt(s,t,e,i={}){let n=i.maxScanDistance||lh,r=i.brackets||ah,o=mt(s),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let c=Qs(a.type,e,r);if(c&&a.from0?t>=h.from&&th.from&&t<=h.to))return Td(s,t,e,a,h,c,r)}}return Pd(s,t,e,o,l.type,n,r)}function Td(s,t,e,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},c=0,h=l==null?void 0:l.cursor();if(h&&(e<0?h.childBefore(i.from):h.childAfter(i.to)))do if(e<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:e<0?t-1:t,to:e>0?t+1:t},h=s.doc.iterRange(t,e>0?s.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=n))if(y%2==0==e>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}e>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}function _o(s,t,e,i=0,n=0){t==null&&(t=s.search(/[^\s\u00a0]/),t==-1&&(t=s.length));let r=n;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pose}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return n(r)==n(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Bd(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||Rd,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||kr}}function Rd(s){if(typeof s!="object")return s;let t={};for(let e in s){let i=s[e];t[e]=i instanceof Array?i.slice():i}return t}const Qo=new WeakMap;class fh extends Lt{constructor(t){let e=th(t.languageData),i=Bd(t),n,r=new class extends _a{createParse(o,l,a){return new Ed(n,o,l,a)}};super(e,r,[ih.of((o,l)=>this.getIndent(o,l))],t.name),this.topNode=Fd(e),n=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=t.tokenTable?new gh(i.tokenTable):Nd}static define(t){return new fh(t)}getIndent(t,e){let i=mt(t.state),n=i.resolve(e);for(;n&&n.type!=this.topNode;)n=n.parent;if(!n)return null;let r,{overrideIndentation:o}=t.options;o&&(r=Qo.get(t.state),r!=null&&r1e4)return null;for(;a=i&&e+t.length<=n&&t.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],c=l instanceof j&&a=t.length)return t;!n&&t.type==s.topNode&&(n=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(oe&&vr(s,n.tree,0-n.offset,e,o),a;if(l&&(a=uh(s,n.tree,e+n.offset,l.pos+n.offset,!1)))return{state:l.state,tree:a}}return{state:s.streamParser.startState(i?Re(i):4),tree:j.empty}}class Ed{constructor(t,e,i,n){this.lang=t,this.input=e,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Xe.get(),o=n[0].from,{state:l,tree:a}=Ld(t,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==` -`&&(e="");else{let i=e.indexOf(` -`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(e,r,1),e+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,n+=this.chunk.length-o}return this.chunk.push(t,e,i,n),r}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new ch(e,t?t.state.tabSize:4,t?Re(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=dh(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return n}throw new Error("Stream parser failed to advance stream.")}const kr=Object.create(null),Di=[gt.none],Id=new yr(Di),Zo=[],tl=Object.create(null),ph=Object.create(null);for(let[s,t]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"]])ph[s]=mh(kr,t);class gh{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ph)}resolve(t){return t?this.table[t]||(this.table[t]=mh(this.extra,t)):0}}const Nd=new gh(kr);function os(s,t){Zo.indexOf(s)>-1||(Zo.push(s),console.warn(t))}function mh(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let c of l.split(".")){let h=s[c]||M[c];h?typeof h=="function"?a.length?a=a.map(h):os(c,`Modifier ${c} used at start of tag`):a.length?os(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:os(c,`Unknown highlighting tag ${c}`)}for(let c of a)e.push(c)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=tl[n];if(r)return r.id;let o=tl[n]=gt.define({id:Di.length,name:i,props:[rd({[i]:e})]});return Di.push(o),o.id}function Fd(s){let t=gt.define({id:Di.length,name:"Document",props:[Ce.add(()=>s)],top:!0});return Di.push(t),t}X.RTL,X.LTR;const Vd=s=>{let{state:t}=s,e=t.doc.lineAt(t.selection.main.from),i=Ar(s.state,e.from);return i.line?Wd(s):i.block?zd(s):!1};function Cr(s,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=s(t,e);return n?(i(e.update(n)),!0):!1}}const Wd=Cr($d,0),Hd=Cr(yh,0),zd=Cr((s,t)=>yh(s,t,Kd(t)),0);function Ar(s,t){let e=s.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const hi=50;function qd(s,{open:t,close:e},i,n){let r=s.sliceDoc(i-hi,i),o=s.sliceDoc(n,n+hi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-t.length,c)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let h,f;n-i<=2*hi?h=f=s.sliceDoc(i,n):(h=s.sliceDoc(i,i+hi),f=s.sliceDoc(n-hi,n));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return h.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(h.charAt(u+t.length))?1:0},close:{pos:n-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Kd(s){let t=[];for(let e of s.selection.ranges){let i=s.doc.lineAt(e.from),n=e.to<=i.to?i:s.doc.lineAt(e.to),r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=n.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return t}function yh(s,t,e=t.selection.ranges){let i=e.map(r=>Ar(t,r.from).block);if(!i.every(r=>r))return null;let n=e.map((r,o)=>qd(t,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:t.changes(e.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;on&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of i)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const tr=se.define(),jd=se.define(),Ud=T.define(),bh=T.define({combine(s){return Le(s,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}}),xh=yt.define({create(){return _t.empty},update(s,t){let e=t.state.facet(bh),i=t.annotation(tr);if(i){let a=vt.fromTransaction(t,i.selection),c=i.side,h=c==0?s.undone:s.done;return a?h=Mn(h,h.length,e.minDepth,a):h=vh(h,t.startState.selection),new _t(c==0?i.rest:h,c==0?h:i.rest)}let n=t.annotation(jd);if((n=="full"||n=="before")&&(s=s.isolate()),t.annotation(Z.addToHistory)===!1)return t.changes.empty?s:s.addMapping(t.changes.desc);let r=vt.fromTransaction(t),o=t.annotation(Z.time),l=t.annotation(Z.userEvent);return r?s=s.addChanges(r,o,l,e,t):t.selection&&(s=s.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(t=>t.toJSON()),undone:s.undone.map(t=>t.toJSON())}},fromJSON(s){return new _t(s.done.map(vt.fromJSON),s.undone.map(vt.fromJSON))}});function Rm(s={}){return[xh,bh.of(s),O.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?wh:t.inputType=="historyRedo"?er:null;return i?(t.preventDefault(),i(e)):!1}})]}function zn(s,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let n=e.field(xh,!1);if(!n)return!1;let r=n.pop(s,e,t);return r?(i(r),!0):!1}}const wh=zn(0,!1),er=zn(1,!1),Gd=zn(0,!0),Jd=zn(1,!0);class vt{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new vt(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(t){return new vt(t.changes&&et.fromJSON(t.changes),[],t.mapped&&Qt.fromJSON(t.mapped),t.startSelection&&b.fromJSON(t.startSelection),t.selectionsAfter.map(b.fromJSON))}static fromTransaction(t,e){let i=Et;for(let n of t.startState.facet(Ud)){let r=n(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new vt(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Et)}static selection(t){return new vt(void 0,Et,void 0,void 0,t)}}function Mn(s,t,e,i){let n=t+1>e+20?t-e-1:0,r=s.slice(n,t);return r.push(i),r}function Yd(s,t){let e=[],i=!1;return s.iterChangedRanges((n,r)=>e.push(n,r)),t.iterChangedRanges((n,r,o,l)=>{for(let a=0;a=c&&o<=h&&(i=!0)}}),i}function Xd(s,t){return s.ranges.length==t.ranges.length&&s.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Sh(s,t){return s.length?t.length?s.concat(t):s:t}const Et=[],_d=200;function vh(s,t){if(s.length){let e=s[s.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-_d));return i.length&&i[i.length-1].eq(t)?s:(i.push(t),Mn(s,s.length-1,1e9,e.setSelAfter(i)))}else return[vt.selection([t])]}function Qd(s){let t=s[s.length-1],e=s.slice();return e[s.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function ls(s,t){if(!s.length)return s;let e=s.length,i=Et;for(;e;){let n=Zd(s[e-1],t,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,e);return r[e-1]=n,r}else t=n.mapped,e--,i=n.selectionsAfter}return i.length?[vt.selection(i)]:Et}function Zd(s,t,e){let i=Sh(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(t)):Et,e);if(!s.changes)return vt.selection(i);let n=s.changes.map(t),r=t.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new vt(n,F.mapEffects(s.effects,t),o,s.startSelection.map(r),i)}const tp=/^(input\.type|delete)($|\.)/;class _t{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new _t(this.done,this.undone):this}addChanges(t,e,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||tp.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime0&&e-this.prevTimee.empty?s.moveByChar(e,t):qn(e,t))}function dt(s){return s.textDirectionAt(s.state.selection.main.head)==X.LTR}const Ch=s=>kh(s,!dt(s)),Ah=s=>kh(s,dt(s));function Mh(s,t){return Ht(s,e=>e.empty?s.moveByGroup(e,t):qn(e,t))}const ep=s=>Mh(s,!dt(s)),ip=s=>Mh(s,dt(s));function np(s,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(t.from,t.to)))||t.firstChild}function Kn(s,t,e){let i=mt(s).resolveInner(t.head),n=e?L.closedBy:L.openedBy;for(let a=t.head;;){let c=e?i.childAfter(a):i.childBefore(a);if(!c)break;np(s,c,n)?i=c:a=e?c.to:c.from}let r=i.type.prop(n),o,l;return r&&(o=e?Xt(s,i.from,1):Xt(s,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,b.cursor(l,e?-1:1)}const sp=s=>Ht(s,t=>Kn(s.state,t,!dt(s))),rp=s=>Ht(s,t=>Kn(s.state,t,dt(s)));function Dh(s,t){return Ht(s,e=>{if(!e.empty)return qn(e,t);let i=s.moveVertically(e,t);return i.head!=e.head?i:s.moveToLineBoundary(e,t)})}const Oh=s=>Dh(s,!1),Th=s=>Dh(s,!0);function Ph(s){let t=s.scrollDOM.clientHeighto.empty?s.moveVertically(o,t,e.height):qn(o,t));if(n.eq(i.selection))return!1;let r;if(e.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,c=l.bottom-e.marginBottom;o&&o.top>a&&o.bottomBh(s,!1),ir=s=>Bh(s,!0);function be(s,t,e){let i=s.lineBlockAt(t.head),n=s.moveToLineBoundary(t,e);if(n.head==t.head&&n.head!=(e?i.to:i.from)&&(n=s.moveToLineBoundary(t,e,!1)),!e&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(n=b.cursor(i.from+r))}return n}const op=s=>Ht(s,t=>be(s,t,!0)),lp=s=>Ht(s,t=>be(s,t,!1)),ap=s=>Ht(s,t=>be(s,t,!dt(s))),hp=s=>Ht(s,t=>be(s,t,dt(s))),cp=s=>Ht(s,t=>b.cursor(s.lineBlockAt(t.head).from,1)),fp=s=>Ht(s,t=>b.cursor(s.lineBlockAt(t.head).to,-1));function up(s,t,e){let i=!1,n=ei(s.selection,r=>{let o=Xt(s,r.head,-1)||Xt(s,r.head,1)||r.head>0&&Xt(s,r.head-1,1)||r.headup(s,t);function Ft(s,t){let e=ei(s.state.selection,i=>{let n=t(i);return b.range(i.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return e.eq(s.state.selection)?!1:(s.dispatch(Zt(s.state,e)),!0)}function Rh(s,t){return Ft(s,e=>s.moveByChar(e,t))}const Lh=s=>Rh(s,!dt(s)),Eh=s=>Rh(s,dt(s));function Ih(s,t){return Ft(s,e=>s.moveByGroup(e,t))}const pp=s=>Ih(s,!dt(s)),gp=s=>Ih(s,dt(s)),mp=s=>Ft(s,t=>Kn(s.state,t,!dt(s))),yp=s=>Ft(s,t=>Kn(s.state,t,dt(s)));function Nh(s,t){return Ft(s,e=>s.moveVertically(e,t))}const Fh=s=>Nh(s,!1),Vh=s=>Nh(s,!0);function Wh(s,t){return Ft(s,e=>s.moveVertically(e,t,Ph(s).height))}const il=s=>Wh(s,!1),nl=s=>Wh(s,!0),bp=s=>Ft(s,t=>be(s,t,!0)),xp=s=>Ft(s,t=>be(s,t,!1)),wp=s=>Ft(s,t=>be(s,t,!dt(s))),Sp=s=>Ft(s,t=>be(s,t,dt(s))),vp=s=>Ft(s,t=>b.cursor(s.lineBlockAt(t.head).from)),kp=s=>Ft(s,t=>b.cursor(s.lineBlockAt(t.head).to)),sl=({state:s,dispatch:t})=>(t(Zt(s,{anchor:0})),!0),rl=({state:s,dispatch:t})=>(t(Zt(s,{anchor:s.doc.length})),!0),ol=({state:s,dispatch:t})=>(t(Zt(s,{anchor:s.selection.main.anchor,head:0})),!0),ll=({state:s,dispatch:t})=>(t(Zt(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Cp=({state:s,dispatch:t})=>(t(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),Ap=({state:s,dispatch:t})=>{let e=$n(s).map(({from:i,to:n})=>b.range(i,Math.min(n+1,s.doc.length)));return t(s.update({selection:b.create(e),userEvent:"select"})),!0},Mp=({state:s,dispatch:t})=>{let e=ei(s.selection,i=>{var n;let r=mt(s).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&(!((n=l.parent)===null||n===void 0)&&n.parent))return b.range(l.to,l.from)}return i});return t(Zt(s,e)),!0},Dp=({state:s,dispatch:t})=>{let e=s.selection,i=null;return e.ranges.length>1?i=b.create([e.main]):e.main.empty||(i=b.create([b.cursor(e.main.head)])),i?(t(Zt(s,i)),!0):!1};function Ii(s,t){if(s.state.readOnly)return!1;let e="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);ao&&(e="delete.forward",a=en(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=en(s,o,!1),l=en(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,on(s)))i.between(t,t,(n,r)=>{nt&&(t=e?r:n)});return t}const Hh=(s,t,e)=>Ii(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(e&&!t&&n>o.from&&nHh(s,!1,!0),zh=s=>Hh(s,!0,!1),qh=(s,t)=>Ii(s,e=>{let i=e.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?n.doc.lines:1)&&(i+=t?1:-1);break}let a=ot(r.text,i-r.from,t)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=e.head)&&(l=h),i=a}return i}),Kh=s=>qh(s,!1),Op=s=>qh(s,!0),Tp=s=>Ii(s,t=>{let e=s.lineBlockAt(t.head).to;return t.headIi(s,t=>{let e=s.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),Bp=s=>Ii(s,t=>{let e=s.moveToLineBoundary(t,!0).head;return t.head{if(s.readOnly)return!1;let e=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:V.of(["",""])},range:b.cursor(i.from)}));return t(s.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},Lp=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:ot(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:ot(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:b.cursor(l)}});return e.changes.empty?!1:(t(s.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function $n(s){let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),e>=n.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:n.from,to:r.to,ranges:[i]});e=r.number+1}return t}function $h(s,t,e){if(s.readOnly)return!1;let i=[],n=[];for(let r of $n(s)){if(e?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(b.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(b.range(a.anchor-l,a.head-l))}}return i.length?(t(s.update({changes:i,scrollIntoView:!0,selection:b.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Ep=({state:s,dispatch:t})=>$h(s,t,!1),Ip=({state:s,dispatch:t})=>$h(s,t,!0);function jh(s,t,e){if(s.readOnly)return!1;let i=[];for(let n of $n(s))e?i.push({from:n.from,insert:s.doc.slice(n.from,n.to)+s.lineBreak}):i.push({from:n.to,insert:s.lineBreak+s.doc.slice(n.from,n.to)});return t(s.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Np=({state:s,dispatch:t})=>jh(s,t,!1),Fp=({state:s,dispatch:t})=>jh(s,t,!0),Vp=s=>{if(s.state.readOnly)return!1;let{state:t}=s,e=t.changes($n(t).map(({from:n,to:r})=>(n>0?n--:r{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(e);return s.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Wp(s,t){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=mt(s).resolveInner(t),i=e.childBefore(t),n=e.childAfter(t),r;return i&&n&&i.to<=t&&n.from>=t&&(r=i.type.prop(L.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const Hp=Uh(!1),zp=Uh(!0);function Uh(s){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:r,to:o}=n,l=t.doc.lineAt(r),a=!s&&r==o&&Wp(t,r);s&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let c=new Wn(t,{simulateBreak:r,simulateDoubleBreak:!!a}),h=nh(c,r);for(h==null&&(h=ti(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));ol.from&&r{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,n,i),e=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const qp=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=Object.create(null),i=new Wn(s,{overrideIndentation:r=>{let o=e[r];return o??-1}}),n=Mr(s,(r,o,l)=>{let a=nh(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=An(s,a);(c!=h||l.froms.readOnly?!1:(t(s.update(Mr(s,(e,i)=>{i.push({from:e.from,insert:s.facet(Vn)})}),{userEvent:"input.indent"})),!0),Jh=({state:s,dispatch:t})=>s.readOnly?!1:(t(s.update(Mr(s,(e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let r=ti(n,s.tabSize),o=0,l=An(s,Math.max(0,r-Re(s)));for(;o(s.setTabFocusMode(),!0),$p=[{key:"Ctrl-b",run:Ch,shift:Lh,preventDefault:!0},{key:"Ctrl-f",run:Ah,shift:Eh},{key:"Ctrl-p",run:Oh,shift:Fh},{key:"Ctrl-n",run:Th,shift:Vh},{key:"Ctrl-a",run:cp,shift:vp},{key:"Ctrl-e",run:fp,shift:kp},{key:"Ctrl-d",run:zh},{key:"Ctrl-h",run:nr},{key:"Ctrl-k",run:Tp},{key:"Ctrl-Alt-h",run:Kh},{key:"Ctrl-o",run:Rp},{key:"Ctrl-t",run:Lp},{key:"Ctrl-v",run:ir}],jp=[{key:"ArrowLeft",run:Ch,shift:Lh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ep,shift:pp,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ap,shift:wp,preventDefault:!0},{key:"ArrowRight",run:Ah,shift:Eh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ip,shift:gp,preventDefault:!0},{mac:"Cmd-ArrowRight",run:hp,shift:Sp,preventDefault:!0},{key:"ArrowUp",run:Oh,shift:Fh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:sl,shift:ol},{mac:"Ctrl-ArrowUp",run:el,shift:il},{key:"ArrowDown",run:Th,shift:Vh,preventDefault:!0},{mac:"Cmd-ArrowDown",run:rl,shift:ll},{mac:"Ctrl-ArrowDown",run:ir,shift:nl},{key:"PageUp",run:el,shift:il},{key:"PageDown",run:ir,shift:nl},{key:"Home",run:lp,shift:xp,preventDefault:!0},{key:"Mod-Home",run:sl,shift:ol},{key:"End",run:op,shift:bp,preventDefault:!0},{key:"Mod-End",run:rl,shift:ll},{key:"Enter",run:Hp},{key:"Mod-a",run:Cp},{key:"Backspace",run:nr,shift:nr},{key:"Delete",run:zh},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Kh},{key:"Mod-Delete",mac:"Alt-Delete",run:Op},{mac:"Mod-Backspace",run:Pp},{mac:"Mod-Delete",run:Bp}].concat($p.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),Em=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:sp,shift:mp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:rp,shift:yp},{key:"Alt-ArrowUp",run:Ep},{key:"Shift-Alt-ArrowUp",run:Np},{key:"Alt-ArrowDown",run:Ip},{key:"Shift-Alt-ArrowDown",run:Fp},{key:"Escape",run:Dp},{key:"Mod-Enter",run:zp},{key:"Alt-l",mac:"Ctrl-l",run:Ap},{key:"Mod-i",run:Mp,preventDefault:!0},{key:"Mod-[",run:Jh},{key:"Mod-]",run:Gh},{key:"Mod-Alt-\\",run:qp},{key:"Shift-Mod-k",run:Vp},{key:"Shift-Mod-\\",run:dp},{key:"Mod-/",run:Vd},{key:"Alt-A",run:Hd},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Kp}].concat(jp),Im={key:"Tab",run:Gh,shift:Jh};function lt(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=e[i];typeof n=="string"?s.setAttribute(i,n):n!=null&&(s[i]=n)}t++}for(;ts.normalize("NFKD"):s=>s;class Ze{constructor(t,e,i=0,n=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(al(l)):al,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return nt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=or(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Bt(t);let n=this.normalize(e);for(let r=0,o=i;;r++){let l=n.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==n.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=Dn(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=e){let l=new $e(e,t.sliceString(e,i));return as.set(t,l),l}if(n.from==e&&n.to==i)return n;let{text:r,from:o}=n;return o>e&&(r=t.sliceString(e,o)+r,o=e),n.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,n=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this.matchPos=Dn(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=$e.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(_h.prototype[Symbol.iterator]=Qh.prototype[Symbol.iterator]=function(){return this});function Up(s){try{return new RegExp(s,Dr),!0}catch{return!1}}function Dn(s,t){if(t>=s.length)return t;let e=s.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}function sr(s){let t=String(s.state.doc.lineAt(s.state.selection.main.head).number),e=lt("input",{class:"cm-textfield",name:"line",value:t}),i=lt("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),s.dispatch({effects:On.of(!1)}),s.focus()):r.keyCode==13&&(r.preventDefault(),n())},onsubmit:r=>{r.preventDefault(),n()}},lt("label",s.state.phrase("Go to line"),": ",e)," ",lt("button",{class:"cm-button",type:"submit"},s.state.phrase("go")));function n(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=s,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[On.of(!1),O.scrollIntoView(g.from,{y:"center"})],selection:g}),s.focus()}return{dom:i}}const On=F.define(),hl=yt.define({create(){return!0},update(s,t){for(let e of t.effects)e.is(On)&&(s=e.value);return s},provide:s=>Sn.from(s,t=>t?sr:null)}),Gp=s=>{let t=wn(s,sr);if(!t){let e=[On.of(!0)];s.state.field(hl,!1)==null&&e.push(F.appendConfig.of([hl,Jp])),s.dispatch({effects:e}),t=wn(s,sr)}return t&&t.dom.querySelector("input").select(),!0},Jp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Yp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Xp=T.define({combine(s){return Le(s,Yp,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function Nm(s){return[eg,tg]}const _p=P.mark({class:"cm-selectionMatch"}),Qp=P.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function cl(s,t,e,i){return(e==0||s(t.sliceDoc(e-1,e))!=G.Word)&&(i==t.doc.length||s(t.sliceDoc(i,i+1))!=G.Word)}function Zp(s,t,e,i){return s(t.sliceDoc(e,e+1))==G.Word&&s(t.sliceDoc(i-1,i))==G.Word}const tg=ut.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.selectionSet||s.docChanged||s.viewportChanged)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let t=s.state.facet(Xp),{state:e}=s,i=e.selection;if(i.ranges.length>1)return P.none;let n=i.main,r,o=null;if(n.empty){if(!t.highlightWordAroundCursor)return P.none;let a=e.wordAt(n.head);if(!a)return P.none;o=e.charCategorizer(n.head),r=e.sliceDoc(a.from,a.to)}else{let a=n.to-n.from;if(a200)return P.none;if(t.wholeWords){if(r=e.sliceDoc(n.from,n.to),o=e.charCategorizer(n.head),!(cl(o,e,n.from,n.to)&&Zp(o,e,n.from,n.to)))return P.none}else if(r=e.sliceDoc(n.from,n.to),!r)return P.none}let l=[];for(let a of s.visibleRanges){let c=new Ze(e.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||cl(o,e,h,f))&&(n.empty&&h<=n.from&&f>=n.to?l.push(Qp.range(h,f)):(h>=n.to||f<=n.from)&&l.push(_p.range(h,f)),l.length>t.maxMatches))return P.none}}return P.set(l)}},{decorations:s=>s.decorations}),eg=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ig=({state:s,dispatch:t})=>{let{selection:e}=s,i=b.create(e.ranges.map(n=>s.wordAt(n.head)||b.cursor(n.head)),e.mainIndex);return i.eq(e)?!1:(t(s.update({selection:i})),!0)};function ng(s,t){let{main:e,ranges:i}=s.selection,n=s.wordAt(e.head),r=n&&n.from==e.from&&n.to==e.to;for(let o=!1,l=new Ze(s.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Ze(s.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const sg=({state:s,dispatch:t})=>{let{ranges:e}=s.selection;if(e.some(r=>r.from===r.to))return ig({state:s,dispatch:t});let i=s.sliceDoc(e[0].from,e[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=ng(s,i);return n?(t(s.update({selection:s.selection.addRange(b.range(n.from,n.to),!1),effects:O.scrollIntoView(n.to)})),!0):!1},ii=T.define({combine(s){return Le(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new gg(t),scrollToMatch:t=>O.scrollIntoView(t)})}});class Zh{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Up(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new ag(this):new og(this)}getCursor(t,e=0,i){let n=t.doc?t:H.create({doc:t});return i==null&&(i=n.doc.length),this.regexp?Ve(this,n,e,i):Fe(this,n,e,i)}}class tc{constructor(t){this.spec=t}}function Fe(s,t,e,i){return new Ze(t.doc,s.unquoted,e,i,s.caseSensitive?void 0:n=>n.toLowerCase(),s.wholeWord?rg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function rg(s,t){return(e,i,n,r)=>((r>e||r+n.length=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=Fe(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Ve(s,t,e,i){return new _h(t.doc,s.search,{ignoreCase:!s.caseSensitive,test:s.wholeWord?lg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Tn(s,t){return s.slice(ot(s,t,!1),t)}function Pn(s,t){return s.slice(t,ot(s,t))}function lg(s){return(t,e,i)=>!i[0].length||(s(Tn(i.input,i.index))!=G.Word||s(Pn(i.input,i.index))!=G.Word)&&(s(Pn(i.input,i.index+i[0].length))!=G.Word||s(Tn(i.input,i.index+i[0].length))!=G.Word)}class ag extends tc{nextMatch(t,e,i){let n=Ve(this.spec,t,i,t.doc.length).next();return n.done&&(n=Ve(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let r=Math.max(e,i-n*1e4),o=Ve(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=Ve(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Oi=F.define(),Or=F.define(),fe=yt.define({create(s){return new hs(rr(s).create(),null)},update(s,t){for(let e of t.effects)e.is(Oi)?s=new hs(e.value.create(),s.panel):e.is(Or)&&(s=new hs(s.query,e.value?Tr:null));return s},provide:s=>Sn.from(s,t=>t.panel)});class hs{constructor(t,e){this.query=t,this.panel=e}}const hg=P.mark({class:"cm-searchMatch"}),cg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),fg=ut.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(fe))}update(s){let t=s.state.field(fe);(t!=s.startState.field(fe)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:s,panel:t}){if(!t||!s.spec.valid)return P.none;let{view:e}=this,i=new De;for(let n=0,r=e.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(e.state,l,a,(c,h)=>{let f=e.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,f?cg:hg)})}return i.finish()}},{decorations:s=>s.decorations});function Ni(s){return t=>{let e=t.state.field(fe,!1);return e&&e.query.spec.valid?s(t,e):nc(t)}}const Bn=Ni((s,{query:t})=>{let{to:e}=s.state.selection.main,i=t.nextMatch(s.state,e,e);if(!i)return!1;let n=b.single(i.from,i.to),r=s.state.facet(ii);return s.dispatch({selection:n,effects:[Pr(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),ic(s),!0}),Rn=Ni((s,{query:t})=>{let{state:e}=s,{from:i}=e.selection.main,n=t.prevMatch(e,i,i);if(!n)return!1;let r=b.single(n.from,n.to),o=s.state.facet(ii);return s.dispatch({selection:r,effects:[Pr(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),ic(s),!0}),ug=Ni((s,{query:t})=>{let e=t.matchAll(s.state,1e3);return!e||!e.length?!1:(s.dispatch({selection:b.create(e.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),dg=({state:s,dispatch:t})=>{let e=s.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:n}=e.main,r=[],o=0;for(let l=new Ze(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return t(s.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},fl=Ni((s,{query:t})=>{let{state:e}=s,{from:i,to:n}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=[],l,a,c=[];if(r.from==i&&r.to==n&&(a=e.toText(t.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=t.nextMatch(e,r.from,r.to),c.push(O.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),r){let h=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-h,r.to-h),c.push(Pr(s,r)),c.push(e.facet(ii).scrollToMatch(l.main,s))}return s.dispatch({changes:o,selection:l,effects:c,userEvent:"input.replace"}),!0}),pg=Ni((s,{query:t})=>{if(s.state.readOnly)return!1;let e=t.matchAll(s.state,1e9).map(n=>{let{from:r,to:o}=n;return{from:r,to:o,insert:t.getReplacement(n)}});if(!e.length)return!1;let i=s.state.phrase("replaced $ matches",e.length)+".";return s.dispatch({changes:e,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function Tr(s){return s.state.facet(ii).createPanel(s)}function rr(s,t){var e,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=s.facet(ii);return new Zh({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(n=t==null?void 0:t.literal)!==null&&n!==void 0?n:c.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function ec(s){let t=wn(s,Tr);return t&&t.dom.querySelector("[main-field]")}function ic(s){let t=ec(s);t&&t==s.root.activeElement&&t.select()}const nc=s=>{let t=s.state.field(fe,!1);if(t&&t.panel){let e=ec(s);if(e&&e!=s.root.activeElement){let i=rr(s.state,t.query.spec);i.valid&&s.dispatch({effects:Oi.of(i)}),e.focus(),e.select()}}else s.dispatch({effects:[Or.of(!0),t?Oi.of(rr(s.state,t.query.spec)):F.appendConfig.of(yg)]});return!0},sc=s=>{let t=s.state.field(fe,!1);if(!t||!t.panel)return!1;let e=wn(s,Tr);return e&&e.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Or.of(!1)}),!0},Fm=[{key:"Mod-f",run:nc,scope:"editor search-panel"},{key:"F3",run:Bn,shift:Rn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bn,shift:Rn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dg},{key:"Mod-Alt-g",run:Gp},{key:"Mod-d",run:sg,preventDefault:!0}];class gg{constructor(t){this.view=t;let e=this.query=t.state.field(fe).query.spec;this.commit=this.commit.bind(this),this.searchField=lt("input",{value:e.search,placeholder:Ct(t,"Find"),"aria-label":Ct(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lt("input",{value:e.replace,placeholder:Ct(t,"Replace"),"aria-label":Ct(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lt("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=lt("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=lt("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(n,r,o){return lt("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=lt("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Bn(t),[Ct(t,"next")]),i("prev",()=>Rn(t),[Ct(t,"previous")]),i("select",()=>ug(t),[Ct(t,"all")]),lt("label",null,[this.caseField,Ct(t,"match case")]),lt("label",null,[this.reField,Ct(t,"regexp")]),lt("label",null,[this.wordField,Ct(t,"by word")]),...t.state.readOnly?[]:[lt("br"),this.replaceField,i("replace",()=>fl(t),[Ct(t,"replace")]),i("replaceAll",()=>pg(t),[Ct(t,"replace all")])],lt("button",{name:"close",onclick:()=>sc(t),"aria-label":Ct(t,"close"),type:"button"},["×"])])}commit(){let t=new Zh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Oi.of(t)}))}keydown(t){cu(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Rn:Bn)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),fl(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Oi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ii).top}}function Ct(s,t){return s.state.phrase(t)}const nn=30,sn=/[\s\.,:;?!]/;function Pr(s,{from:t,to:e}){let i=s.state.doc.lineAt(t),n=s.state.doc.lineAt(e).to,r=Math.max(i.from,t-nn),o=Math.min(n,e+nn),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-nn;a--)if(!sn.test(l[a-1])&&sn.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const mg=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),yg=[fe,ye.low(fg),mg];class rc{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[]}tokenBefore(t){let e=mt(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),r=n.search(oc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e){t=="abort"&&this.abortListeners&&this.abortListeners.push(e)}}function ul(s){let t=Object.keys(s).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function bg(s){let t=Object.create(null),e=Object.create(null);for(let{label:n}of s){t[n[0]]=!0;for(let r=1;rtypeof n=="string"?{label:n}:n),[e,i]=t.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:bg(t);return n=>{let r=n.matchBefore(i);return r||n.explicit?{from:r?r.from:n.pos,options:t,validFor:e}:null}}function Vm(s,t){return e=>{for(let i=mt(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(s.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}class dl{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function ue(s){return s.selection.main.from}function oc(s,t){var e;let{source:i}=s,n=t&&i[0]!="^",r=i[i.length-1]!="$";return!n&&!r?s:new RegExp(`${n?"^":""}(?:${i})${r?"$":""}`,(e=s.flags)!==null&&e!==void 0?e:s.ignoreCase?"i":"")}const Br=se.define();function wg(s,t,e,i){let{main:n}=s.selection,r=e-n.from,o=i-n.from;return Object.assign(Object.assign({},s.changeByRange(l=>l!=n&&e!=i&&s.sliceDoc(l.from+r,l.from+o)!=s.sliceDoc(e,i)?{range:l}:{changes:{from:l.from+r,to:i==n.from?l.to:l.from+o,insert:t},range:b.cursor(l.from+r+t.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const pl=new WeakMap;function Sg(s){if(!Array.isArray(s))return s;let t=pl.get(s);return t||pl.set(s,t=xg(s)),t}const Ln=F.define(),Ti=F.define();class vg{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(A=or(w))!=A.toLowerCase()?1:A!=A.toUpperCase()?2:0;(!x||C==1&&m||S==0&&C!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),S=C,x+=Bt(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,t):e.length==2?null:this.result((n[0]?-700:0)+-200+-1100,n,t)}result(t,e,i){let n=[],r=0;for(let o of e){let l=o+(this.astral?Bt(nt(i,o)):1);r&&n[r-1]==o?n[r-1]=l:(n[r++]=o,n[r++]=l)}return this.ret(t-i.length,n)}}class kg{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Cg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>gl(t(i),e(i)),optionClass:(t,e)=>i=>gl(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function gl(s,t){return s?t?s+" "+t:s:t}function Cg(s,t,e,i,n,r){let o=s.textDirection==X.RTL,l=o,a=!1,c="top",h,f,u=t.left-n.left,d=n.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u=g||x>t.top?h=e.bottom-t.top:(c="bottom",h=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,y=(t.right-t.left)/r.offsetWidth;return{style:`${c}: ${h/m}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function Ag(s){let t=s.addToOptions.slice();return s.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(n=>"cm-completionIcon-"+n)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let c=0;ca&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return ae.position-i.position).map(e=>e.render)}function cs(s,t,e){if(s<=e)return{from:0,to:s};if(t<0&&(t=0),t<=s>>1){let n=Math.floor(t/e);return{from:n*e,to:(n+1)*e}}let i=Math.floor((s-t)/e);return{from:s-(i+1)*e,to:s-i*e}}class Mg{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:r,selected:o}=n.open,l=t.state.facet(rt);this.optionContent=Ag(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=cs(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=t.state.field(e).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(rt).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ti.of(null)})}),this.showOptions(r,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:r,selected:o,disabled:l}=i.open;(!n.open||n.open.options!=r)&&(this.range=cs(r.length,o,t.state.facet(rt).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=n.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=cs(e.options.length,e.selected,this.view.state.facet(rt).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let r=typeof n=="string"?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>Dt(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:n,destroy:r}=t;i.appendChild(n),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)i.nodeName!="LI"||!i.id?n--:n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&Og(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return n.top>Math.min(r.bottom,e.bottom)-10||n.bottomi.from||i.from==0))if(r=u,typeof c!="string"&&c.header)n.appendChild(c.header(c));else{let d=n.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=n.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Mg(e,s,t)}function Og(s,t){let e=s.getBoundingClientRect(),i=t.getBoundingClientRect(),n=e.height/s.offsetHeight;i.tope.bottom&&(s.scrollTop+=(i.bottom-e.bottom)/n)}function ml(s){return(s.boost||0)*100+(s.apply?10:0)+(s.info?5:0)+(s.type?1:0)}function Tg(s,t){let e=[],i=null,n=c=>{e.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},r=t.facet(rt);for(let c of s)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)n(new dl(f,c.source,h?h(f):[],1e9-e.length));else{let f=t.sliceDoc(c.from,c.to),u,d=r.filterStrict?new kg(f):new vg(f);for(let p of c.result.options)if(u=d.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;n(new dl(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.namef.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):ml(c.completion)>ml(l)&&(o[o.length-1]=c),l=c.completion}return o}class We{constructor(t,e,i,n,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new We(this.options,yl(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,r){let o=Tg(t,e);if(!o.length)return n&&t.some(a=>a.state==1)?new We(n.options,n.attrs,n.tooltip,n.timestamp,n.selected,!0):null;let l=e.facet(rt).selectOnOpen?0:-1;if(n&&n.selected!=l&&n.selected!=-1){let a=n.options[n.selected].completion;for(let c=0;cc.hasResult()?Math.min(a,c.from):a,1e8),create:Ig,above:r.aboveCursor},n?n.timestamp:Date.now(),l,!1)}map(t){return new We(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class En{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new En(Lg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(rt),r=(i.override||e.languageDataAt("autocomplete",ue(e)).map(Sg)).map(l=>(this.active.find(c=>c.source==l)||new Mt(l,this.active.some(c=>c.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!Pg(r,this.active)?o=We.build(r,e,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new Mt(l.source,0):l));for(let l of t.effects)l.is(hc)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new En(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Bg:Rg}}function Pg(s,t){if(s==t)return!0;for(let e=0,i=0;;){for(;e-1&&(e["aria-activedescendant"]=s+"-"+t),e}const Lg=[];function lc(s,t){if(s.isUserEvent("input.complete")){let i=s.annotation(Br);if(i&&t.activateOnCompletion(i))return 12}let e=s.isUserEvent("input.type");return e&&t.activateOnTyping?5:e?1:s.isUserEvent("delete.backward")?2:s.selection?8:s.docChanged?16:0}class Mt{constructor(t,e,i=-1){this.source=t,this.state=e,this.explicitPos=i}hasResult(){return!1}update(t,e){let i=lc(t,e),n=this;(i&8||i&16&&this.touches(t))&&(n=new Mt(n.source,0)),i&4&&n.state==0&&(n=new Mt(this.source,1)),n=n.updateFor(t,i);for(let r of t.effects)if(r.is(Ln))n=new Mt(n.source,1,r.value?ue(t.state):-1);else if(r.is(Ti))n=new Mt(n.source,0);else if(r.is(ac))for(let o of r.value)o.source==n.source&&(n=o);return n}updateFor(t,e){return this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new Mt(this.source,this.state,t.mapPos(this.explicitPos))}touches(t){return t.changes.touchesRange(ue(t.state))}}class je extends Mt{constructor(t,e,i,n,r){super(t,2,e),this.result=i,this.from=n,this.to=r}hasResult(){return!0}updateFor(t,e){var i;if(!(e&3))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=ue(t.state);if((this.explicitPos<0?l<=r:lo||!n||e&2&&ue(t.startState)==this.from)return new Mt(this.source,e&4?1:0);let a=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return Eg(n.validFor,t.state,r,o)?new je(this.source,a,n,r,o):n.update&&(n=n.update(n,r,o,new rc(t.state,l,a>=0)))?new je(this.source,a,n,n.from,(i=n.to)!==null&&i!==void 0?i:ue(t.state)):new Mt(this.source,1,a)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new je(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Mt(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function Eg(s,t,e,i){if(!s)return!1;let n=t.sliceDoc(e,i);return typeof s=="function"?s(n,e,i,t):oc(s,!0).test(n)}const ac=F.define({map(s,t){return s.map(e=>e.map(t))}}),hc=F.define(),St=yt.define({create(){return En.start()},update(s,t){return s.update(t)},provide:s=>[ja.from(s,t=>t.tooltip),O.contentAttributes.from(s,t=>t.attrs)]});function Rr(s,t){const e=t.completion.apply||t.completion.label;let i=s.state.field(St).active.find(n=>n.source==t.source);return i instanceof je?(typeof e=="string"?s.dispatch(Object.assign(Object.assign({},wg(s.state,e,i.from,i.to)),{annotations:Br.of(t.completion)})):e(s,t.completion,i.from,i.to),!0):!1}const Ig=Dg(St,Rr);function rn(s,t="option"){return e=>{let i=e.state.field(St,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+n*(s?1:-1):s?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:hc.of(l)}),!0}}const Ng=s=>{let t=s.state.field(St,!1);return s.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamps.state.field(St,!1)?(s.dispatch({effects:Ln.of(!0)}),!0):!1,Vg=s=>{let t=s.state.field(St,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(s.dispatch({effects:Ti.of(null)}),!0)};class Wg{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const Hg=50,zg=1e3,qg=ut.fromClass(class{constructor(s){this.view=s,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of s.state.field(St).active)t.state==1&&this.startQuery(t)}update(s){let t=s.state.field(St),e=s.state.facet(rt);if(!s.selectionSet&&!s.docChanged&&s.startState.field(St)==t)return;let i=s.transactions.some(r=>{let o=lc(r,e);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rHg&&Date.now()-o.time>zg){for(let l of o.context.abortListeners)try{l()}catch(a){Dt(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...s.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),s.transactions.some(r=>r.effects.some(o=>o.is(Ln)))&&(this.pendingStart=!0);let n=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.state==1&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),n):-1,this.composing!=0)for(let r of s.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:s}=this.view,t=s.field(St);for(let e of t.active)e.state==1&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e)}startQuery(s){let{state:t}=this.view,e=ue(t),i=new rc(t,e,s.explicitPos==e,this.view),n=new Wg(s,i);this.running.push(n),Promise.resolve(s.source(i)).then(r=>{n.context.aborted||(n.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Ti.of(null)}),Dt(this.view.state,r)})}scheduleAccept(){this.running.every(s=>s.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rt).updateSyncTime))}accept(){var s;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(rt);for(let i=0;io.source==n.active.source);if(r&&r.state==1)if(n.done==null){let o=new Mt(n.active.source,0);for(let l of n.updates)o=o.update(l,e);o.state!=1&&t.push(o)}else this.startQuery(r)}t.length&&this.view.dispatch({effects:ac.of(t)})}},{eventHandlers:{blur(s){let t=this.view.state.field(St,!1);if(t&&t.tooltip&&this.view.state.facet(rt).closeOnBlur){let e=t.open&&Ua(this.view,t.open.tooltip);(!e||!e.dom.contains(s.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Ti.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Ln.of(!1)}),20),this.composing=0}}}),Kg=typeof navigator=="object"&&/Win/.test(navigator.platform),$g=ye.highest(O.domEventHandlers({keydown(s,t){let e=t.state.field(St,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||s.key.length>1||s.ctrlKey&&!(Kg&&s.altKey)||s.metaKey)return!1;let i=e.open.options[e.open.selected],n=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||n.result.commitCharacters;return r&&r.indexOf(s.key)>-1&&Rr(t,i),!1}})),cc=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class jg{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class Lr{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,ht.TrackDel),i=t.mapPos(this.to,1,ht.TrackDel);return e==null||i==null?null:new Lr(this.field,e,i)}}class Er{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;fnew Lr(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],n=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&u.field++}n.push(new jg(c,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of n)h.line==i.length&&h.from>c&&(h.from--,h.to--);return a}),i.push(o)}return new Er(i,n)}}let Ug=P.widget({widget:new class extends Ee{toDOM(){let s=document.createElement("span");return s.className="cm-snippetFieldPosition",s}ignoreEvent(){return!1}}}),Gg=P.mark({class:"cm-snippetField"});class ni{constructor(t,e){this.ranges=t,this.active=e,this.deco=P.set(t.map(i=>(i.from==i.to?Ug:Gg).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new ni(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const Fi=F.define({map(s,t){return s&&s.map(t)}}),Jg=F.define(),Pi=yt.define({create(){return null},update(s,t){for(let e of t.effects){if(e.is(Fi))return e.value;if(e.is(Jg)&&s)return new ni(s.ranges,e.value)}return s&&t.docChanged&&(s=s.map(t.changes)),s&&t.selection&&!s.selectionInsideField(t.selection)&&(s=null),s},provide:s=>O.decorations.from(s,t=>t?t.deco:P.none)});function Ir(s,t){return b.create(s.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function Yg(s){let t=Er.parse(s);return(e,i,n,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,n),a={changes:{from:n,to:r,insert:V.of(o)},scrollIntoView:!0,annotations:i?[Br.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=Ir(l,0)),l.some(c=>c.field>0)){let c=new ni(l,0),h=a.effects=[Fi.of(c)];e.state.field(Pi,!1)===void 0&&h.push(F.appendConfig.of([Pi,tm,em,cc]))}e.dispatch(e.state.update(a))}}function fc(s){return({state:t,dispatch:e})=>{let i=t.field(Pi,!1);if(!i||s<0&&i.active==0)return!1;let n=i.active+s,r=s>0&&!i.ranges.some(o=>o.field==n+s);return e(t.update({selection:Ir(i.ranges,n),effects:Fi.of(r?null:new ni(i.ranges,n)),scrollIntoView:!0})),!0}}const Xg=({state:s,dispatch:t})=>s.field(Pi,!1)?(t(s.update({effects:Fi.of(null)})),!0):!1,_g=fc(1),Qg=fc(-1),Zg=[{key:"Tab",run:_g,shift:Qg},{key:"Escape",run:Xg}],bl=T.define({combine(s){return s.length?s[0]:Zg}}),tm=ye.highest(mr.compute([bl],s=>s.facet(bl)));function Wm(s,t){return Object.assign(Object.assign({},t),{apply:Yg(s)})}const em=O.domEventHandlers({mousedown(s,t){let e=t.state.field(Pi,!1),i;if(!e||(i=t.posAtCoords({x:s.clientX,y:s.clientY}))==null)return!1;let n=e.ranges.find(r=>r.from<=i&&r.to>=i);return!n||n.field==e.active?!1:(t.dispatch({selection:Ir(e.ranges,n.field),effects:Fi.of(e.ranges.some(r=>r.field>n.field)?new ni(e.ranges,n.field):null),scrollIntoView:!0}),!0)}}),Bi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ae=F.define({map(s,t){let e=t.mapPos(s,-1,ht.TrackAfter);return e??void 0}}),Nr=new class extends Me{};Nr.startSide=1;Nr.endSide=-1;const uc=yt.define({create(){return K.empty},update(s,t){if(s=s.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);s=s.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(Ae)&&(s=s.update({add:[Nr.range(e.value,e.value+1)]}));return s}});function Hm(){return[nm,uc]}const fs="()[]{}<>";function dc(s){for(let t=0;t{if((im?s.composing:s.compositionStarted)||s.state.readOnly)return!1;let n=s.state.selection.main;if(i.length>2||i.length==2&&Bt(nt(i,0))==1||t!=n.from||e!=n.to)return!1;let r=rm(s.state,i);return r?(s.dispatch(r),!0):!1}),sm=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let i=pc(s,s.selection.main.head).brackets||Bi.brackets,n=null,r=s.changeByRange(o=>{if(o.empty){let l=om(s.doc,o.head);for(let a of i)if(a==l&&jn(s.doc,o.head)==dc(nt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:n=o}});return n||t(s.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!n},zm=[{key:"Backspace",run:sm}];function rm(s,t){let e=pc(s,s.selection.main.head),i=e.brackets||Bi.brackets;for(let n of i){let r=dc(nt(n,0));if(t==n)return r==n?hm(s,n,i.indexOf(n+n+n)>-1,e):lm(s,n,r,e.before||Bi.before);if(t==r&&gc(s,s.selection.main.from))return am(s,n,r)}return null}function gc(s,t){let e=!1;return s.field(uc).between(0,s.doc.length,i=>{i==t&&(e=!0)}),e}function jn(s,t){let e=s.sliceString(t,t+2);return e.slice(0,Bt(nt(e,0)))}function om(s,t){let e=s.sliceString(t-2,t);return Bt(nt(e,0))==e.length?e:e.slice(1)}function lm(s,t,e,i){let n=null,r=s.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:Ae.of(o.to+t.length),range:b.range(o.anchor+t.length,o.head+t.length)};let l=jn(s.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:Ae.of(o.head+t.length),range:b.cursor(o.head+t.length)}:{range:n=o}});return n?null:s.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function am(s,t,e){let i=null,n=s.changeByRange(r=>r.empty&&jn(s.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:b.cursor(r.head+e.length)}:i={range:r});return i?null:s.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function hm(s,t,e,i){let n=i.stringPrefixes||Bi.stringPrefixes,r=null,o=s.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ae.of(l.to+t.length),range:b.range(l.anchor+t.length,l.head+t.length)};let a=l.head,c=jn(s.doc,a),h;if(c==t){if(xl(s,a))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(gc(s,a)){let u=e&&s.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(e&&s.sliceDoc(a-2*t.length,a)==t+t&&(h=wl(s,a-2*t.length,n))>-1&&xl(s,h))return{changes:{insert:t+t+t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(s.charCategorizer(a)(c)!=G.Word&&wl(s,a,n)>-1&&!cm(s,a,t,n))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)}}return{range:r=l}});return r?null:s.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function xl(s,t){let e=mt(s).resolveInner(t+1);return e.parent&&e.from==t}function cm(s,t,e,i){let n=mt(s).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=s.sliceDoc(n.from,Math.min(n.to,n.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=n.firstChild;for(;h&&h.from==n.from&&h.to-h.from>e.length+a;){if(s.sliceDoc(h.to-e.length,h.to)==e)return!1;h=h.firstChild}return!0}let c=n.to==t&&n.parent;if(!c)break;n=c}return!1}function wl(s,t,e){let i=s.charCategorizer(t);if(i(s.sliceDoc(t-1,t))!=G.Word)return t;for(let n of e){let r=t-n.length;if(s.sliceDoc(r,t)==n&&i(s.sliceDoc(r-1,r))!=G.Word)return r}return-1}function qm(s={}){return[$g,St,rt.of(s),qg,um,cc]}const fm=[{key:"Ctrl-Space",run:Fg},{key:"Escape",run:Vg},{key:"ArrowDown",run:rn(!0)},{key:"ArrowUp",run:rn(!1)},{key:"PageDown",run:rn(!0,"page")},{key:"PageUp",run:rn(!1,"page")},{key:"Enter",run:Ng}],um=ye.highest(mr.computeN([rt],s=>s.facet(rt).defaultKeymap?[fm]:[]));export{Sm as A,dd as B,In as C,zu as D,O as E,Mm as F,Dm as G,Om as H,Y as I,km as J,wm as K,Xs as L,Vm as M,yr as N,xg as O,_a as P,b as Q,Wm as R,fh as S,j as T,Am as U,Cm as V,cd as W,th as X,Od as Y,fm as a,H as b,zm as c,Em as d,xm as e,mm as f,Rm as g,Lm as h,pm as i,gm as j,Tm as k,Bm as l,Hm as m,Nm as n,mr as o,qm as p,ym as q,bm as r,Fm as s,Im as t,Pm as u,mt as v,gt as w,L as x,rd as y,M as z}; diff --git a/ui/dist/assets/index-DpAp7TiX.css b/ui/dist/assets/index-CyfS9YzQ.css similarity index 100% rename from ui/dist/assets/index-DpAp7TiX.css rename to ui/dist/assets/index-CyfS9YzQ.css diff --git a/ui/dist/index.html b/ui/dist/index.html index 5bf12ceea8..4243b0d1d0 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -47,8 +47,8 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - - + +
    diff --git a/ui/package-lock.json b/ui/package-lock.json index 2f9c4b68d0..c141c58284 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -34,6 +34,7 @@ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -43,10 +44,11 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.17.0", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.17.0.tgz", - "integrity": "sha512-fdfj6e6ZxZf8yrkMHUSJJir7OJkHkZKaOZGzLWIYp2PZ3jd+d+UjG8zVPqJF6d3bKxkhvXTPan/UZ1t7Bqm0gA==", + "version": "6.18.2", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.2.tgz", + "integrity": "sha512-wJGylKtMFR/Ds6Gh01+OovXE/pncPiKZNNBKuC39pKnH+XK5d9+WsNqcrdxPjFPFTigRBqse0rfxw9UxrfyhPg==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", @@ -61,10 +63,11 @@ } }, "node_modules/@codemirror/commands": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.6.0.tgz", - "integrity": "sha512-qnY+b7j1UNcTS31Eenuc/5YJB6gQOzkUoNmJQc0rznwqSRpeaWWpjkWy2C/MPTcePpsKJEM26hXrOXl1+nceXg==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.7.1.tgz", + "integrity": "sha512-llTrboQYw5H4THfhN4U3qCnSZ1SOJ60ohhz+SzU0ADGtwlc533DtklQP0vSFaQuCPDn3BPpOd1GbbnUtwNjsrw==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.4.0", @@ -73,16 +76,17 @@ } }, "node_modules/@codemirror/lang-css": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.2.1.tgz", - "integrity": "sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.0.tgz", + "integrity": "sha512-CyR4rUNG9OYcXDZwMPvJdtb6PHbBDKUc/6Na2BIwZ6dKab1JQqKa4di+RNRY9Myn7JB81vayKwJeQ7jEdmNVDA==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", "@lezer/common": "^1.0.2", - "@lezer/css": "^1.0.0" + "@lezer/css": "^1.1.7" } }, "node_modules/@codemirror/lang-html": { @@ -90,6 +94,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.9.tgz", "integrity": "sha512-aQv37pIMSlueybId/2PVSP6NPnmurFDVmZwzc7jszd2KAF8qd4VBbvNYPXWQq90WIARjsdVkPbw29pszmHws3Q==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/lang-css": "^6.0.0", @@ -107,6 +112,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.2.tgz", "integrity": "sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.6.0", @@ -122,16 +128,18 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.1.tgz", "integrity": "sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@lezer/json": "^1.0.0" } }, "node_modules/@codemirror/lang-sql": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.7.0.tgz", - "integrity": "sha512-KMXp6rtyPYz6RaElvkh/77ClEAoQoHRPZo0zutRRialeFs/B/X8YaUJBCnAV2zqyeJPLZ4hgo48mG8TKoNXfZA==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.8.0.tgz", + "integrity": "sha512-aGLmY4OwGqN3TdSx3h6QeA1NrvaYtF7kkoWR/+W7/JzB0gQtJ+VJxewlnE3+VImhA4WVlhmkJr109PefOOhjLg==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.0.0", @@ -142,10 +150,11 @@ } }, "node_modules/@codemirror/language": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.2.tgz", - "integrity": "sha512-kgbTYTo0Au6dCSc/TFy7fK3fpJmgHDv1sG1KNQKJXVi+xBTEeBPY/M30YXiU6mMXeH+YIDLsbrT4ZwNRdtF+SA==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.3.tgz", + "integrity": "sha512-kDqEU5sCP55Oabl6E7m5N+vZRoc0iWqgDVhEKifcHzPzjqCegcO4amfrYVL9PmPZpl4G0yjkpTpUO/Ui8CzO8A==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.23.0", @@ -156,19 +165,21 @@ } }, "node_modules/@codemirror/legacy-modes": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.4.0.tgz", - "integrity": "sha512-5m/K+1A6gYR0e+h/dEde7LoGimMjRtWXZFg4Lo70cc8HzjSdHe3fLwjWMR0VRl5KFT1SxalSap7uMgPKF28wBA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.4.1.tgz", + "integrity": "sha512-vdg3XY7OAs5uLDx2Iw+cGfnwtd7kM+Et/eMsqAGTfT/JKiVBQZXosTzjEbWAi/FrY6DcQIz8mQjBozFHZEUWQA==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0" } }, "node_modules/@codemirror/lint": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.1.tgz", - "integrity": "sha512-IZ0Y7S4/bpaunwggW2jYqwLuHj0QtESf5xcROewY6+lDNwZ/NzvR4t+vpYgg9m7V8UXLPYqG+lu3DF470E5Oxg==", + "version": "6.8.2", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.2.tgz", + "integrity": "sha512-PDFG5DjHxSEjOXk9TQYYVjZDqlZTFaDBfhQixHnQOEVDDNHUbEh/hstAjcQJaA6FQdZTD1hquXTK0rVBLADR1g==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", @@ -176,10 +187,11 @@ } }, "node_modules/@codemirror/search": { - "version": "6.5.6", - "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.6.tgz", - "integrity": "sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==", + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.7.tgz", + "integrity": "sha512-6+iLsXvITWKHYlkgHPCs/qiX4dNzn8N78YfhOFvPtPYCkuXqZq10rAfsUMhOq7O/1VjJqdXRflyExlfVcu/9VQ==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", @@ -190,13 +202,15 @@ "version": "6.4.1", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz", "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@codemirror/view": { - "version": "6.28.4", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.28.4.tgz", - "integrity": "sha512-QScv95fiviSQ/CaVGflxAvvvDy/9wi0RFyDl4LkHHWiMr/UPebyuTspmYSeN5Nx6eujcPYwsQzA6ZIZucKZVHQ==", + "version": "6.34.1", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.34.1.tgz", + "integrity": "sha512-t1zK/l9UiRqwUNPm+pdIT0qzJlzuVckbTEMVNFhfWkGiBQClstzg+78vedCvLSX0xJEZ6lwZbPpnljL7L6iwMQ==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.4.0", "style-mod": "^4.1.0", @@ -211,6 +225,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -227,6 +242,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -243,6 +259,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -259,6 +276,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -275,6 +293,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -291,6 +310,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -307,6 +327,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -323,6 +344,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -339,6 +361,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -355,6 +378,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -371,6 +395,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -387,6 +412,7 @@ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -403,6 +429,7 @@ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -419,6 +446,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -435,6 +463,7 @@ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -451,6 +480,7 @@ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -467,6 +497,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -483,6 +514,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -499,6 +531,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -515,6 +548,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -531,6 +565,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -547,6 +582,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -563,6 +599,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -576,6 +613,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -590,6 +628,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -599,21 +638,24 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -623,19 +665,22 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@lezer/common": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.1.tgz", - "integrity": "sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==", - "dev": true + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true, + "license": "MIT" }, "node_modules/@lezer/css": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.8.tgz", - "integrity": "sha512-7JhxupKuMBaWQKjQoLtzhGj83DdnZY9MckEOG5+/iLKNK2ZJqKc6hf6uc0HjwCX7Qlok44jBNqZhHKDhEhZYLA==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.9.tgz", + "integrity": "sha512-TYwgljcDv+YrV0MZFFvYFQHCfGgbPMR6nuqLabBdmZoFH3EP1gvw8t0vae326Ne3PszQkbXfVBjCnf3ZVCr0bA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", @@ -643,10 +688,11 @@ } }, "node_modules/@lezer/highlight": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz", - "integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.0.0" } @@ -656,6 +702,7 @@ "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.10.tgz", "integrity": "sha512-dqpT8nISx/p9Do3AchvYGV3qYc4/rKr3IBZxlHmpIKam56P47RSHkSF5f13Vu9hebS1jM0HmtJIwLbWz1VIY6w==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", @@ -663,10 +710,11 @@ } }, "node_modules/@lezer/javascript": { - "version": "1.4.17", - "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.17.tgz", - "integrity": "sha512-bYW4ctpyGK+JMumDApeUzuIezX01H76R1foD6LcRX224FWfyYit/HYxiPGDjXXe/wQWASjCvVGoukTH68+0HIA==", + "version": "1.4.19", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.19.tgz", + "integrity": "sha512-j44kbR1QL26l6dMunZ1uhKBFteVGLVCBGNUD2sUaMnic+rbTviVuoK0CD1l9FTW31EueWvFFswCKMH7Z+M3JRA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.1.3", @@ -678,6 +726,7 @@ "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.2.tgz", "integrity": "sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", @@ -685,227 +734,560 @@ } }, "node_modules/@lezer/lr": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.1.tgz", - "integrity": "sha512-CHsKq8DMKBf9b3yXPDIU4DbH+ZJd/sJdYOW2llbW/HudP5u0VS6Bfq1hLYfgU7uAYGFIyGGQIsSOXGPEErZiJw==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.0.0" } }, + "node_modules/@parcel/watcher": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", + "integrity": "sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.4.1", + "@parcel/watcher-darwin-arm64": "2.4.1", + "@parcel/watcher-darwin-x64": "2.4.1", + "@parcel/watcher-freebsd-x64": "2.4.1", + "@parcel/watcher-linux-arm-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-musl": "2.4.1", + "@parcel/watcher-linux-x64-glibc": "2.4.1", + "@parcel/watcher-linux-x64-musl": "2.4.1", + "@parcel/watcher-win32-arm64": "2.4.1", + "@parcel/watcher-win32-ia32": "2.4.1", + "@parcel/watcher-win32-x64": "2.4.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz", + "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz", + "integrity": "sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz", + "integrity": "sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz", + "integrity": "sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz", + "integrity": "sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz", + "integrity": "sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz", + "integrity": "sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz", + "integrity": "sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.1.tgz", + "integrity": "sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz", + "integrity": "sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz", + "integrity": "sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz", + "integrity": "sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", - "integrity": "sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.3.tgz", + "integrity": "sha512-ufb2CH2KfBWPJok95frEZZ82LtDl0A6QKTa8MoM+cWwDZvVGl5/jNb79pIhRvAalUu+7LD91VYR0nwRD799HkQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz", - "integrity": "sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.3.tgz", + "integrity": "sha512-iAHpft/eQk9vkWIV5t22V77d90CRofgR2006UiCjHcHJFVI1E0oBkQIAbz+pLtthFw3hWEmVB4ilxGyBf48i2Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.1.tgz", - "integrity": "sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.3.tgz", + "integrity": "sha512-QPW2YmkWLlvqmOa2OwrfqLJqkHm7kJCIMq9kOz40Zo9Ipi40kf9ONG5Sz76zszrmIZZ4hgRIkez69YnTHgEz1w==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.1.tgz", - "integrity": "sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.3.tgz", + "integrity": "sha512-KO0pN5x3+uZm1ZXeIfDqwcvnQ9UEGN8JX5ufhmgH5Lz4ujjZMAnxQygZAVGemFWn+ZZC0FQopruV4lqmGMshow==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.3.tgz", + "integrity": "sha512-CsC+ZdIiZCZbBI+aRlWpYJMSWvVssPuWqrDy/zi9YfnatKKSLFCe6fjna1grHuo/nVaHG+kiglpRhyBQYRTK4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.3.tgz", + "integrity": "sha512-F0nqiLThcfKvRQhZEzMIXOQG4EeX61im61VYL1jo4eBxv4aZRmpin6crnBJQ/nWnCsjH5F6J3W6Stdm0mBNqBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.1.tgz", - "integrity": "sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.3.tgz", + "integrity": "sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.1.tgz", - "integrity": "sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.3.tgz", + "integrity": "sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.1.tgz", - "integrity": "sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.3.tgz", + "integrity": "sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.1.tgz", - "integrity": "sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.3.tgz", + "integrity": "sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.1.tgz", - "integrity": "sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.3.tgz", + "integrity": "sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.1.tgz", - "integrity": "sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.3.tgz", + "integrity": "sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.1.tgz", - "integrity": "sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.3.tgz", + "integrity": "sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.1.tgz", - "integrity": "sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.3.tgz", + "integrity": "sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.1.tgz", - "integrity": "sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.3.tgz", + "integrity": "sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.1.tgz", - "integrity": "sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.3.tgz", + "integrity": "sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.1.tgz", - "integrity": "sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.3.tgz", + "integrity": "sha512-9SjYp1sPyxJsPWuhOCX6F4jUMXGbVVd5obVpoVEi8ClZqo52ViZewA6eFz85y8ezuOA+uJMP5A5zo6Oz4S5rVQ==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.1.tgz", - "integrity": "sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.3.tgz", + "integrity": "sha512-HGZgRFFYrMrP3TJlq58nR1xy8zHKId25vhmm5S9jETEfDf6xybPxsavFTJaufe2zgOGYJBskGlj49CwtEuFhWQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.1.tgz", - "integrity": "sha512-rimpFEAboBBHIlzISibg94iP09k/KYdHgVhJlcsTfn7KMBhc70jFX/GRWkRdFCc2fdnk+4+Bdfej23cMDnJS6A==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.2.tgz", + "integrity": "sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==", "dev": true, + "license": "MIT", "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", "debug": "^4.3.4", @@ -928,6 +1310,7 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.1.0.tgz", "integrity": "sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.3.4" }, @@ -941,16 +1324,18 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -958,47 +1343,24 @@ "node": ">=0.4.0" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/aria-query": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", "dev": true, - "dependencies": { - "dequal": "^2.0.3" + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" } }, "node_modules/axobject-query": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", - "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", - "dev": true, - "dependencies": { - "dequal": "^2.0.3" - } - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 0.4" } }, "node_modules/braces": { @@ -1006,6 +1368,8 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -1014,10 +1378,11 @@ } }, "node_modules/chart.js": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.3.tgz", - "integrity": "sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw==", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.6.tgz", + "integrity": "sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA==", "dev": true, + "license": "MIT", "dependencies": { "@kurkle/color": "^0.3.0" }, @@ -1030,33 +1395,26 @@ "resolved": "https://registry.npmjs.org/chartjs-adapter-luxon/-/chartjs-adapter-luxon-1.3.1.tgz", "integrity": "sha512-yxHov3X8y+reIibl1o+j18xzrcdddCLqsXhriV2+aQ4hCR66IYFchlRXUvrJVoxglJ380pgytU7YWtoqdIgqhg==", "dev": true, + "license": "MIT", "peerDependencies": { "chart.js": ">=3.0.0", "luxon": ">=1.0.0" } }, "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", "dev": true, + "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, "funding": { "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" } }, "node_modules/code-red": { @@ -1064,6 +1422,7 @@ "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz", "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15", "@types/estree": "^1.0.1", @@ -1076,13 +1435,15 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", "dev": true, + "license": "MIT", "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -1092,12 +1453,13 @@ } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1113,17 +1475,23 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", "dev": true, + "license": "Apache-2.0", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, "engines": { - "node": ">=6" + "node": ">=0.10" } }, "node_modules/esbuild": { @@ -1132,6 +1500,7 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -1169,6 +1538,7 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -1178,6 +1548,8 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1189,7 +1561,8 @@ "version": "4.6.13", "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fsevents": { "version": "2.3.3", @@ -1197,6 +1570,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1205,41 +1579,20 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/immutable": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.6.tgz", - "integrity": "sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", + "optional": true, "engines": { "node": ">=0.10.0" } @@ -1249,6 +1602,8 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1261,6 +1616,8 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", + "optional": true, "engines": { "node": ">=0.12.0" } @@ -1270,6 +1627,7 @@ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "*" } @@ -1279,6 +1637,7 @@ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1287,37 +1646,57 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/luxon": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", - "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, "node_modules/nanoid": { "version": "3.3.7", @@ -1330,6 +1709,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1337,20 +1717,20 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT", + "optional": true }, "node_modules/periscopic": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^3.0.0", @@ -1358,16 +1738,19 @@ } }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", + "optional": true, "engines": { "node": ">=8.6" }, @@ -1379,12 +1762,13 @@ "version": "0.20.3", "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.20.3.tgz", "integrity": "sha512-qembHhE7HumDBZpxWgFIbhJPeaCoUIdwhW59xF/VlMR79pDTYz/LaQ4q89y7GczKo4X9actFgFN8hs4dTl0spQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "dev": true, "funding": [ { @@ -1400,25 +1784,28 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, + "license": "MIT", "engines": { - "node": ">=8.10.0" + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/regexparam": { @@ -1426,17 +1813,19 @@ "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-2.0.2.tgz", "integrity": "sha512-A1PeDEYMrkLrfyOwv2jwihXbo9qxdGD3atBYQA9JJgreAx8/7rC6IUkWOw2NQlOxLp2wL0ifQbh1HuidDfYA6w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/rollup": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.1.tgz", - "integrity": "sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.3.tgz", + "integrity": "sha512-HBW896xR5HGmoksbi3JBDtmVzWiPAYqp7wip50hjQ67JbDz61nyoMPdqu1DvVW9asYb2M65Z20ZHsyJCMqMyDg==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -1446,32 +1835,35 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.1", - "@rollup/rollup-android-arm64": "4.18.1", - "@rollup/rollup-darwin-arm64": "4.18.1", - "@rollup/rollup-darwin-x64": "4.18.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.1", - "@rollup/rollup-linux-arm-musleabihf": "4.18.1", - "@rollup/rollup-linux-arm64-gnu": "4.18.1", - "@rollup/rollup-linux-arm64-musl": "4.18.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.1", - "@rollup/rollup-linux-riscv64-gnu": "4.18.1", - "@rollup/rollup-linux-s390x-gnu": "4.18.1", - "@rollup/rollup-linux-x64-gnu": "4.18.1", - "@rollup/rollup-linux-x64-musl": "4.18.1", - "@rollup/rollup-win32-arm64-msvc": "4.18.1", - "@rollup/rollup-win32-ia32-msvc": "4.18.1", - "@rollup/rollup-win32-x64-msvc": "4.18.1", + "@rollup/rollup-android-arm-eabi": "4.24.3", + "@rollup/rollup-android-arm64": "4.24.3", + "@rollup/rollup-darwin-arm64": "4.24.3", + "@rollup/rollup-darwin-x64": "4.24.3", + "@rollup/rollup-freebsd-arm64": "4.24.3", + "@rollup/rollup-freebsd-x64": "4.24.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.3", + "@rollup/rollup-linux-arm-musleabihf": "4.24.3", + "@rollup/rollup-linux-arm64-gnu": "4.24.3", + "@rollup/rollup-linux-arm64-musl": "4.24.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.3", + "@rollup/rollup-linux-riscv64-gnu": "4.24.3", + "@rollup/rollup-linux-s390x-gnu": "4.24.3", + "@rollup/rollup-linux-x64-gnu": "4.24.3", + "@rollup/rollup-linux-x64-musl": "4.24.3", + "@rollup/rollup-win32-arm64-msvc": "4.24.3", + "@rollup/rollup-win32-ia32-msvc": "4.24.3", + "@rollup/rollup-win32-x64-msvc": "4.24.3", "fsevents": "~2.3.2" } }, "node_modules/sass": { - "version": "1.77.6", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.6.tgz", - "integrity": "sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==", + "version": "1.80.6", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.80.6.tgz", + "integrity": "sha512-ccZgdHNiBF1NHBsWvacvT5rju3y1d/Eu+8Ex6c21nHp2lZGLBEtuwc415QfiI1PJa1TpCo3iXwwSRjRpn2Ckjg==", "dev": true, + "license": "MIT", "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", + "chokidar": "^4.0.0", "immutable": "^4.0.0", "source-map-js": ">=0.6.2 <2.0.0" }, @@ -1480,13 +1872,17 @@ }, "engines": { "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -1495,13 +1891,15 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/svelte": { - "version": "4.2.18", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.18.tgz", - "integrity": "sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==", + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", + "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", "dev": true, + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.1", "@jridgewell/sourcemap-codec": "^1.4.15", @@ -1527,6 +1925,7 @@ "resolved": "https://registry.npmjs.org/svelte-flatpickr/-/svelte-flatpickr-3.3.4.tgz", "integrity": "sha512-i+QqJRs8zPRKsxv8r2GIk1fsb8cI3ozn3/aHXtViAoNKLy0j4PV7OSWavgEZC1wlAa34qi2hMkUh+vg6qt2DRA==", "dev": true, + "license": "MIT", "dependencies": { "flatpickr": "^4.5.2" }, @@ -1539,6 +1938,7 @@ "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.16.0.tgz", "integrity": "sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==", "dev": true, + "license": "ISC", "engines": { "node": "^12.20 || ^14.13.1 || >= 16" }, @@ -1551,6 +1951,7 @@ "resolved": "https://registry.npmjs.org/svelte-spa-router/-/svelte-spa-router-4.0.1.tgz", "integrity": "sha512-2JkmUQ2f9jRluijL58LtdQBIpynSbem2eBGp4zXdi7aDY1znbR6yjw0KsonD0aq2QLwf4Yx4tBJQjxIjgjXHKg==", "dev": true, + "license": "MIT", "dependencies": { "regexparam": "2.0.2" }, @@ -1563,6 +1964,8 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { "is-number": "^7.0.0" }, @@ -1571,14 +1974,15 @@ } }, "node_modules/vite": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.3.tgz", - "integrity": "sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==", + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", + "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -1597,6 +2001,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -1614,6 +2019,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -1630,6 +2038,7 @@ "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "dev": true, + "license": "MIT", "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, @@ -1643,7 +2052,8 @@ "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", - "dev": true + "dev": true, + "license": "MIT" } } } From caaac6b145548759f48e2389c1a81cc6819b4687 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 3 Nov 2024 11:11:51 +0200 Subject: [PATCH 13/44] added topic length validator to avoid relying solely on the body limit for more user friendly error message --- CHANGELOG.md | 7 +++++++ forms/realtime_subscribe.go | 5 ++++- forms/realtime_subscribe_test.go | 14 ++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6394bfcfd..c275903c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.22.23 + +- + +- Other minor fixes (updated npm deps to fix the vulnerabilities warning, more user friendly realtime topic length error, regenerated JSVM types, etc.) + + ## v0.22.22 - Added deprecation log in case Instagram OAuth2 is used (_related to [#5652](https://github.com/pocketbase/pocketbase/discussions/5652)_). diff --git a/forms/realtime_subscribe.go b/forms/realtime_subscribe.go index def6534200..8fd5eb511d 100644 --- a/forms/realtime_subscribe.go +++ b/forms/realtime_subscribe.go @@ -19,6 +19,9 @@ func NewRealtimeSubscribe() *RealtimeSubscribe { func (form *RealtimeSubscribe) Validate() error { return validation.ValidateStruct(form, validation.Field(&form.ClientId, validation.Required, validation.Length(1, 255)), - validation.Field(&form.Subscriptions, validation.Length(0, 1000)), + validation.Field(&form.Subscriptions, + validation.Length(0, 1000), + validation.Each(validation.Length(0, 2500)), + ), ) } diff --git a/forms/realtime_subscribe_test.go b/forms/realtime_subscribe_test.go index d615c41411..36e5711166 100644 --- a/forms/realtime_subscribe_test.go +++ b/forms/realtime_subscribe_test.go @@ -43,15 +43,25 @@ func TestRealtimeSubscribeValidate(t *testing.T) { []string{}, }, { - "subscriptions > max limit", + "total subscriptions > max limit", `{"clientId":"test", "subscriptions":[` + strings.Join(invalidSubscriptionsLimit, ",") + `]}`, []string{"subscriptions"}, }, { - "subscriptions <= max limit", + "total subscriptions <= max limit", `{"clientId":"test", "subscriptions":[` + strings.Join(validSubscriptionsLimit, ",") + `]}`, []string{}, }, + { + "single subscription > max limit", + `{"clientId":"test", "subscriptions":["abc", "` + strings.Repeat("a", 2501) + `"]}`, + []string{"subscriptions"}, + }, + { + "single subscription <= max limit", + `{"clientId":"test", "subscriptions":["abc", "` + strings.Repeat("a", 2500) + `"]}`, + []string{}, + }, } for _, s := range scenarios { From 060a659f83d0a7832fa3e5eb0e5c7b4c1bbe3a94 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 3 Nov 2024 11:52:13 +0200 Subject: [PATCH 14/44] [#5789] updated the hooks watcher to account for the case when hooksDir is a symlink --- plugins/jsvm/jsvm.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/jsvm/jsvm.go b/plugins/jsvm/jsvm.go index d47d64191e..87b3648c6e 100644 --- a/plugins/jsvm/jsvm.go +++ b/plugins/jsvm/jsvm.go @@ -224,7 +224,7 @@ func (p *plugin) registerHooks() error { // initialize the hooks dir watcher if p.config.HooksWatch { if err := p.watchHooks(); err != nil { - return err + color.Yellow("Unable to init hooks watcher: %v", err) } } @@ -344,13 +344,23 @@ func (p *plugin) normalizeServeExceptions(oldErrorHandler echo.HTTPErrorHandler) // // This method does nothing if the hooks directory is missing. func (p *plugin) watchHooks() error { - if _, err := os.Stat(p.config.HooksDir); err != nil { + watchDir := p.config.HooksDir + + hooksDirInfo, err := os.Lstat(p.config.HooksDir) + if err != nil { if errors.Is(err, fs.ErrNotExist) { return nil // no hooks dir to watch } return err } + if hooksDirInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + watchDir, err = filepath.EvalSymlinks(p.config.HooksDir) + if err != nil { + return fmt.Errorf("failed to resolve hooksDir symink: %w", err) + } + } + watcher, err := fsnotify.NewWatcher() if err != nil { return err @@ -409,9 +419,9 @@ func (p *plugin) watchHooks() error { // add directories to watch // // @todo replace once recursive watcher is added (https://github.com/fsnotify/fsnotify/issues/18) - dirsErr := filepath.Walk(p.config.HooksDir, func(path string, info fs.FileInfo, err error) error { - // ignore hidden directories and node_modules - if !info.IsDir() || info.Name() == "node_modules" || strings.HasPrefix(info.Name(), ".") { + dirsErr := filepath.WalkDir(watchDir, func(path string, entry fs.DirEntry, err error) error { + // ignore hidden directories, node_modules, symlinks, sockets, etc. + if !entry.IsDir() || entry.Name() == "node_modules" || strings.HasPrefix(entry.Name(), ".") { return nil } From 75d1c0bc185c97556d63668c347d353f372d5bfb Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 3 Nov 2024 12:01:47 +0200 Subject: [PATCH 15/44] updated changelog and jsvm types --- CHANGELOG.md | 4 +- .../jsvm/internal/types/generated/types.d.ts | 9324 ++++++++--------- 2 files changed, 4664 insertions(+), 4664 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c275903c5c..073eaad183 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ ## v0.22.23 -- +- Updated the hooks watcher to account for the case when hooksDir is a symlink ([#5789](https://github.com/pocketbase/pocketbase/issues/5789)). -- Other minor fixes (updated npm deps to fix the vulnerabilities warning, more user friendly realtime topic length error, regenerated JSVM types, etc.) +- Other minor fixes (updated npm dev deps to fix the vulnerabilities warning, added more user friendly realtime topic length error, regenerated JSVM types, etc.) ## v0.22.22 diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index 7af79814f6..0ee8fd7dc9 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -1,4 +1,4 @@ -// 1729260365 +// 1730628021 // GENERATED CODE - DO NOT MODIFY BY HAND // ------------------------------------------------------------------- @@ -1721,8 +1721,8 @@ namespace os { * than ReadFrom. This is used to permit ReadFrom to call io.Copy * without leading to a recursive call to ReadFrom. */ - type _subQGbno = noReadFrom&File - interface fileWithoutReadFrom extends _subQGbno { + type _subpQHUo = noReadFrom&File + interface fileWithoutReadFrom extends _subpQHUo { } interface File { /** @@ -1766,8 +1766,8 @@ namespace os { * than WriteTo. This is used to permit WriteTo to call io.Copy * without leading to a recursive call to WriteTo. */ - type _subzUnAX = noWriteTo&File - interface fileWithoutWriteTo extends _subzUnAX { + type _subUePGm = noWriteTo&File + interface fileWithoutWriteTo extends _subUePGm { } interface File { /** @@ -2411,8 +2411,8 @@ namespace os { * * The methods of File are safe for concurrent use. */ - type _subJHFOr = file - interface File extends _subJHFOr { + type _subGANfA = file + interface File extends _subGANfA { } /** * A FileInfo describes a file and is returned by [Stat] and [Lstat]. @@ -2804,21 +2804,244 @@ namespace filepath { } } +namespace security { + interface s256Challenge { + /** + * S256Challenge creates base64 encoded sha256 challenge string derived from code. + * The padding of the result base64 string is stripped per [RFC 7636]. + * + * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 + */ + (code: string): string + } + interface md5 { + /** + * MD5 creates md5 hash from the provided plain text. + */ + (text: string): string + } + interface sha256 { + /** + * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. + */ + (text: string): string + } + interface sha512 { + /** + * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. + */ + (text: string): string + } + interface hs256 { + /** + * HS256 creates a HMAC hash with sha256 digest algorithm. + */ + (text: string, secret: string): string + } + interface hs512 { + /** + * HS512 creates a HMAC hash with sha512 digest algorithm. + */ + (text: string, secret: string): string + } + interface equal { + /** + * Equal compares two hash strings for equality without leaking timing information. + */ + (hash1: string, hash2: string): boolean + } + // @ts-ignore + import crand = rand + interface encrypt { + /** + * Encrypt encrypts "data" with the specified "key" (must be valid 32 char AES key). + * + * This method uses AES-256-GCM block cypher mode. + */ + (data: string|Array, key: string): string + } + interface decrypt { + /** + * Decrypt decrypts encrypted text with key (must be valid 32 chars AES key). + * + * This method uses AES-256-GCM block cypher mode. + */ + (cipherText: string, key: string): string|Array + } + interface parseUnverifiedJWT { + /** + * ParseUnverifiedJWT parses JWT and returns its claims + * but DOES NOT verify the signature. + * + * It verifies only the exp, iat and nbf claims. + */ + (token: string): jwt.MapClaims + } + interface parseJWT { + /** + * ParseJWT verifies and parses JWT and returns its claims. + */ + (token: string, verificationKey: string): jwt.MapClaims + } + interface newJWT { + /** + * NewJWT generates and returns new HS256 signed JWT. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + interface newToken { + /** + * Deprecated: + * Consider replacing with NewJWT(). + * + * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + // @ts-ignore + import cryptoRand = rand + // @ts-ignore + import mathRand = rand + interface randomString { + /** + * RandomString generates a cryptographically random string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + */ + (length: number): string + } + interface randomStringWithAlphabet { + /** + * RandomStringWithAlphabet generates a cryptographically random string + * with the specified length and characters set. + * + * It panics if for some reason rand.Int returns a non-nil error. + */ + (length: number, alphabet: string): string + } + interface pseudorandomString { + /** + * PseudorandomString generates a pseudorandom string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + * + * For a cryptographically random string (but a little bit slower) use RandomString instead. + */ + (length: number): string + } + interface pseudorandomStringWithAlphabet { + /** + * PseudorandomStringWithAlphabet generates a pseudorandom string + * with the specified length and characters set. + * + * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. + */ + (length: number, alphabet: string): string + } +} + /** - * Package validation provides configurable and extensible rules for validating data of various types. + * Package template is a thin wrapper around the standard html/template + * and text/template packages that implements a convenient registry to + * load and cache templates on the fly concurrently. + * + * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. + * + * Example: + * + * ``` + * registry := template.NewRegistry() + * + * html1, err := registry.LoadFiles( + * // the files set wil be parsed only once and then cached + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "John"}) + * + * html2, err := registry.LoadFiles( + * // reuse the already parsed and cached files set + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "Jane"}) + * ``` */ -namespace ozzo_validation { +namespace template { + interface newRegistry { + /** + * NewRegistry creates and initializes a new templates registry with + * some defaults (eg. global "raw" template function for unescaped HTML). + * + * Use the Registry.Load* methods to load templates into the registry. + */ + (): (Registry) + } /** - * Error interface represents an validation error + * Registry defines a templates registry that is safe to be used by multiple goroutines. + * + * Use the Registry.Load* methods to load templates into the registry. */ - interface Error { - [key:string]: any; - error(): string - code(): string - message(): string - setMessage(_arg0: string): Error - params(): _TygojaDict - setParams(_arg0: _TygojaDict): Error + interface Registry { + } + interface Registry { + /** + * AddFuncs registers new global template functions. + * + * The key of each map entry is the function name that will be used in the templates. + * If a function with the map entry name already exists it will be replaced with the new one. + * + * The value of each map entry is a function that must have either a + * single return value, or two return values of which the second has type error. + * + * Example: + * + * r.AddFuncs(map[string]any{ + * ``` + * "toUpper": func(str string) string { + * return strings.ToUppser(str) + * }, + * ... + * ``` + * }) + */ + addFuncs(funcs: _TygojaDict): (Registry) + } + interface Registry { + /** + * LoadFiles caches (if not already) the specified filenames set as a + * single template and returns a ready to use Renderer instance. + * + * There must be at least 1 filename specified. + */ + loadFiles(...filenames: string[]): (Renderer) + } + interface Registry { + /** + * LoadString caches (if not already) the specified inline string as a + * single template and returns a ready to use Renderer instance. + */ + loadString(text: string): (Renderer) + } + interface Registry { + /** + * LoadFS caches (if not already) the specified fs and globPatterns + * pair as single template and returns a ready to use Renderer instance. + * + * There must be at least 1 file matching the provided globPattern(s) + * (note that most file names serves as glob patterns matching themselves). + */ + loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer) + } + /** + * Renderer defines a single parsed template. + */ + interface Renderer { + } + interface Renderer { + /** + * Render executes the template with the specified data as the dot object + * and returns the result as plain string. + */ + render(data: any): string } } @@ -3158,14 +3381,14 @@ namespace dbx { /** * MssqlBuilder is the builder for SQL Server databases. */ - type _subXcJPM = BaseBuilder - interface MssqlBuilder extends _subXcJPM { + type _subEPLIN = BaseBuilder + interface MssqlBuilder extends _subEPLIN { } /** * MssqlQueryBuilder is the query builder for SQL Server databases. */ - type _subWcWPA = BaseQueryBuilder - interface MssqlQueryBuilder extends _subWcWPA { + type _subiJSYo = BaseQueryBuilder + interface MssqlQueryBuilder extends _subiJSYo { } interface newMssqlBuilder { /** @@ -3236,8 +3459,8 @@ namespace dbx { /** * MysqlBuilder is the builder for MySQL databases. */ - type _subErsOC = BaseBuilder - interface MysqlBuilder extends _subErsOC { + type _subMhtIq = BaseBuilder + interface MysqlBuilder extends _subMhtIq { } interface newMysqlBuilder { /** @@ -3312,14 +3535,14 @@ namespace dbx { /** * OciBuilder is the builder for Oracle databases. */ - type _subPcUPD = BaseBuilder - interface OciBuilder extends _subPcUPD { + type _subRBquP = BaseBuilder + interface OciBuilder extends _subRBquP { } /** * OciQueryBuilder is the query builder for Oracle databases. */ - type _subsNvOu = BaseQueryBuilder - interface OciQueryBuilder extends _subsNvOu { + type _subENSNc = BaseQueryBuilder + interface OciQueryBuilder extends _subENSNc { } interface newOciBuilder { /** @@ -3382,8 +3605,8 @@ namespace dbx { /** * PgsqlBuilder is the builder for PostgreSQL databases. */ - type _submlQbp = BaseBuilder - interface PgsqlBuilder extends _submlQbp { + type _subsShLv = BaseBuilder + interface PgsqlBuilder extends _subsShLv { } interface newPgsqlBuilder { /** @@ -3450,8 +3673,8 @@ namespace dbx { /** * SqliteBuilder is the builder for SQLite databases. */ - type _subRbLKA = BaseBuilder - interface SqliteBuilder extends _subRbLKA { + type _subeBnpF = BaseBuilder + interface SqliteBuilder extends _subeBnpF { } interface newSqliteBuilder { /** @@ -3550,8 +3773,8 @@ namespace dbx { /** * StandardBuilder is the builder that is used by DB for an unknown driver. */ - type _subYlvLr = BaseBuilder - interface StandardBuilder extends _subYlvLr { + type _subgxMwo = BaseBuilder + interface StandardBuilder extends _subgxMwo { } interface newStandardBuilder { /** @@ -3617,8 +3840,8 @@ namespace dbx { * DB enhances sql.DB by providing a set of DB-agnostic query building methods. * DB allows easier query building and population of data into Go variables. */ - type _subXZmGg = Builder - interface DB extends _subXZmGg { + type _subnBTRt = Builder + interface DB extends _subnBTRt { /** * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ @@ -4422,8 +4645,8 @@ namespace dbx { * Rows enhances sql.Rows by providing additional data query methods. * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. */ - type _subCDslK = sql.Rows - interface Rows extends _subCDslK { + type _subuSGqA = sql.Rows + interface Rows extends _subuSGqA { } interface Rows { /** @@ -4781,8 +5004,8 @@ namespace dbx { }): string } interface structInfo { } - type _subnkbkR = structInfo - interface structValue extends _subnkbkR { + type _subKbJZd = structInfo + interface structValue extends _subKbJZd { } interface fieldInfo { } @@ -4821,8 +5044,8 @@ namespace dbx { /** * Tx enhances sql.Tx with additional querying methods. */ - type _subWeWlx = Builder - interface Tx extends _subWeWlx { + type _subYNhcn = Builder + interface Tx extends _subYNhcn { } interface Tx { /** @@ -4839,17 +5062,35 @@ namespace dbx { } /** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the [path/filepath] package's Glob function. + * Package validation provides configurable and extensible rules for validating data of various types. + */ +namespace ozzo_validation { + /** + * Error interface represents an validation error + */ + interface Error { + [key:string]: any; + error(): string + code(): string + message(): string + setMessage(_arg0: string): Error + params(): _TygojaDict + setParams(_arg0: _TygojaDict): Error + } +} + +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. * To expand environment variables, use package os's ExpandEnv. * * Note that the examples in this package assume a Unix system. @@ -4964,142 +5205,6 @@ namespace exec { } } -namespace security { - interface s256Challenge { - /** - * S256Challenge creates base64 encoded sha256 challenge string derived from code. - * The padding of the result base64 string is stripped per [RFC 7636]. - * - * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 - */ - (code: string): string - } - interface md5 { - /** - * MD5 creates md5 hash from the provided plain text. - */ - (text: string): string - } - interface sha256 { - /** - * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface sha512 { - /** - * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface hs256 { - /** - * HS256 creates a HMAC hash with sha256 digest algorithm. - */ - (text: string, secret: string): string - } - interface hs512 { - /** - * HS512 creates a HMAC hash with sha512 digest algorithm. - */ - (text: string, secret: string): string - } - interface equal { - /** - * Equal compares two hash strings for equality without leaking timing information. - */ - (hash1: string, hash2: string): boolean - } - // @ts-ignore - import crand = rand - interface encrypt { - /** - * Encrypt encrypts "data" with the specified "key" (must be valid 32 char AES key). - * - * This method uses AES-256-GCM block cypher mode. - */ - (data: string|Array, key: string): string - } - interface decrypt { - /** - * Decrypt decrypts encrypted text with key (must be valid 32 chars AES key). - * - * This method uses AES-256-GCM block cypher mode. - */ - (cipherText: string, key: string): string|Array - } - interface parseUnverifiedJWT { - /** - * ParseUnverifiedJWT parses JWT and returns its claims - * but DOES NOT verify the signature. - * - * It verifies only the exp, iat and nbf claims. - */ - (token: string): jwt.MapClaims - } - interface parseJWT { - /** - * ParseJWT verifies and parses JWT and returns its claims. - */ - (token: string, verificationKey: string): jwt.MapClaims - } - interface newJWT { - /** - * NewJWT generates and returns new HS256 signed JWT. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - interface newToken { - /** - * Deprecated: - * Consider replacing with NewJWT(). - * - * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - // @ts-ignore - import cryptoRand = rand - // @ts-ignore - import mathRand = rand - interface randomString { - /** - * RandomString generates a cryptographically random string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - */ - (length: number): string - } - interface randomStringWithAlphabet { - /** - * RandomStringWithAlphabet generates a cryptographically random string - * with the specified length and characters set. - * - * It panics if for some reason rand.Int returns a non-nil error. - */ - (length: number, alphabet: string): string - } - interface pseudorandomString { - /** - * PseudorandomString generates a pseudorandom string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - * - * For a cryptographically random string (but a little bit slower) use RandomString instead. - */ - (length: number): string - } - interface pseudorandomStringWithAlphabet { - /** - * PseudorandomStringWithAlphabet generates a pseudorandom string - * with the specified length and characters set. - * - * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. - */ - (length: number, alphabet: string): string - } -} - namespace filesystem { /** * FileReader defines an interface for a file resource reader. @@ -5189,8 +5294,8 @@ namespace filesystem { */ open(): io.ReadSeekCloser } - type _subIhEHH = bytes.Reader - interface bytesReadSeekCloser extends _subIhEHH { + type _subazlvf = bytes.Reader + interface bytesReadSeekCloser extends _subazlvf { } interface bytesReadSeekCloser { /** @@ -5419,6 +5524,25 @@ namespace mails { } } +namespace middleware { + interface bodyLimit { + /** + * BodyLimit returns a BodyLimit middleware. + * + * BodyLimit middleware sets the maximum allowed size for a request body, if the size exceeds the configured limit, it + * sends "413 - Request Entity Too Large" response. The BodyLimit is determined based on both `Content-Length` request + * header and actual content read, which makes it super secure. + */ + (limitBytes: number): echo.MiddlewareFunc + } + interface gzip { + /** + * Gzip returns a middleware which compresses HTTP response using gzip compression scheme. + */ + (): echo.MiddlewareFunc + } +} + /** * Package models implements various services used for request data * validation and applying changes to existing DB models through the app Dao. @@ -6336,8 +6460,8 @@ namespace forms { /** * SettingsUpsert is a [settings.Settings] upsert (create/update) form. */ - type _subezsfi = settings.Settings - interface SettingsUpsert extends _subezsfi { + type _subHPqgL = settings.Settings + interface SettingsUpsert extends _subHPqgL { } interface newSettingsUpsert { /** @@ -6426,25 +6550,6 @@ namespace forms { } } -namespace middleware { - interface bodyLimit { - /** - * BodyLimit returns a BodyLimit middleware. - * - * BodyLimit middleware sets the maximum allowed size for a request body, if the size exceeds the configured limit, it - * sends "413 - Request Entity Too Large" response. The BodyLimit is determined based on both `Content-Length` request - * header and actual content read, which makes it super secure. - */ - (limitBytes: number): echo.MiddlewareFunc - } - interface gzip { - /** - * Gzip returns a middleware which compresses HTTP response using gzip compression scheme. - */ - (): echo.MiddlewareFunc - } -} - /** * Package apis implements the default PocketBase api services and middlewares. */ @@ -6783,135 +6888,30 @@ namespace apis { } } -/** - * Package template is a thin wrapper around the standard html/template - * and text/template packages that implements a convenient registry to - * load and cache templates on the fly concurrently. - * - * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. - * - * Example: - * - * ``` - * registry := template.NewRegistry() - * - * html1, err := registry.LoadFiles( - * // the files set wil be parsed only once and then cached - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "John"}) - * - * html2, err := registry.LoadFiles( - * // reuse the already parsed and cached files set - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "Jane"}) - * ``` - */ -namespace template { - interface newRegistry { - /** - * NewRegistry creates and initializes a new templates registry with - * some defaults (eg. global "raw" template function for unescaped HTML). - * - * Use the Registry.Load* methods to load templates into the registry. - */ - (): (Registry) +namespace pocketbase { + /** + * appWrapper serves as a private CoreApp instance wrapper. + */ + type _subKNSIF = CoreApp + interface appWrapper extends _subKNSIF { } /** - * Registry defines a templates registry that is safe to be used by multiple goroutines. + * PocketBase defines a PocketBase app launcher. * - * Use the Registry.Load* methods to load templates into the registry. + * It implements [CoreApp] via embedding and all of the app interface methods + * could be accessed directly through the instance (eg. PocketBase.DataDir()). */ - interface Registry { + type _subMNsmB = appWrapper + interface PocketBase extends _subMNsmB { + /** + * RootCmd is the main console command + */ + rootCmd?: cobra.Command } - interface Registry { - /** - * AddFuncs registers new global template functions. - * - * The key of each map entry is the function name that will be used in the templates. - * If a function with the map entry name already exists it will be replaced with the new one. - * - * The value of each map entry is a function that must have either a - * single return value, or two return values of which the second has type error. - * - * Example: - * - * r.AddFuncs(map[string]any{ - * ``` - * "toUpper": func(str string) string { - * return strings.ToUppser(str) - * }, - * ... - * ``` - * }) - */ - addFuncs(funcs: _TygojaDict): (Registry) - } - interface Registry { - /** - * LoadFiles caches (if not already) the specified filenames set as a - * single template and returns a ready to use Renderer instance. - * - * There must be at least 1 filename specified. - */ - loadFiles(...filenames: string[]): (Renderer) - } - interface Registry { - /** - * LoadString caches (if not already) the specified inline string as a - * single template and returns a ready to use Renderer instance. - */ - loadString(text: string): (Renderer) - } - interface Registry { - /** - * LoadFS caches (if not already) the specified fs and globPatterns - * pair as single template and returns a ready to use Renderer instance. - * - * There must be at least 1 file matching the provided globPattern(s) - * (note that most file names serves as glob patterns matching themselves). - */ - loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer) - } - /** - * Renderer defines a single parsed template. - */ - interface Renderer { - } - interface Renderer { - /** - * Render executes the template with the specified data as the dot object - * and returns the result as plain string. - */ - render(data: any): string - } -} - -namespace pocketbase { - /** - * appWrapper serves as a private CoreApp instance wrapper. - */ - type _subbEwaR = CoreApp - interface appWrapper extends _subbEwaR { - } - /** - * PocketBase defines a PocketBase app launcher. - * - * It implements [CoreApp] via embedding and all of the app interface methods - * could be accessed directly through the instance (eg. PocketBase.DataDir()). - */ - type _subbKhhl = appWrapper - interface PocketBase extends _subbKhhl { - /** - * RootCmd is the main console command - */ - rootCmd?: cobra.Command - } - /** - * Config is the PocketBase initialization config struct. - */ - interface Config { + /** + * Config is the PocketBase initialization config struct. + */ + interface Config { /** * optional default values for the console flags */ @@ -6985,163 +6985,6 @@ namespace pocketbase { } } -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { - /** - * Reader is the interface that wraps the basic Read method. - * - * Read reads up to len(p) bytes into p. It returns the number of bytes - * read (0 <= n <= len(p)) and any error encountered. Even if Read - * returns n < len(p), it may use all of p as scratch space during the call. - * If some data is available but not len(p) bytes, Read conventionally - * returns what is available instead of waiting for more. - * - * When Read encounters an error or end-of-file condition after - * successfully reading n > 0 bytes, it returns the number of - * bytes read. It may return the (non-nil) error from the same call - * or return the error (and n == 0) from a subsequent call. - * An instance of this general case is that a Reader returning - * a non-zero number of bytes at the end of the input stream may - * return either err == EOF or err == nil. The next Read should - * return 0, EOF. - * - * Callers should always process the n > 0 bytes returned before - * considering the error err. Doing so correctly handles I/O errors - * that happen after reading some bytes and also both of the - * allowed EOF behaviors. - * - * If len(p) == 0, Read should always return n == 0. It may return a - * non-nil error if some error condition is known, such as EOF. - * - * Implementations of Read are discouraged from returning a - * zero byte count with a nil error, except when len(p) == 0. - * Callers should treat a return of 0 and nil as indicating that - * nothing happened; in particular it does not indicate EOF. - * - * Implementations must not retain p. - */ - interface Reader { - [key:string]: any; - read(p: string|Array): number - } - /** - * Writer is the interface that wraps the basic Write method. - * - * Write writes len(p) bytes from p to the underlying data stream. - * It returns the number of bytes written from p (0 <= n <= len(p)) - * and any error encountered that caused the write to stop early. - * Write must return a non-nil error if it returns n < len(p). - * Write must not modify the slice data, even temporarily. - * - * Implementations must not retain p. - */ - interface Writer { - [key:string]: any; - write(p: string|Array): number - } - /** - * ReadSeekCloser is the interface that groups the basic Read, Seek and Close - * methods. - */ - interface ReadSeekCloser { - [key:string]: any; - } -} - -/** - * Package bytes implements functions for the manipulation of byte slices. - * It is analogous to the facilities of the [strings] package. - */ -namespace bytes { - /** - * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], - * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from - * a byte slice. - * Unlike a [Buffer], a Reader is read-only and supports seeking. - * The zero value for Reader operates like a Reader of an empty slice. - */ - interface Reader { - } - interface Reader { - /** - * Len returns the number of bytes of the unread portion of the - * slice. - */ - len(): number - } - interface Reader { - /** - * Size returns the original length of the underlying byte slice. - * Size is the number of bytes available for reading via [Reader.ReadAt]. - * The result is unaffected by any method calls except [Reader.Reset]. - */ - size(): number - } - interface Reader { - /** - * Read implements the [io.Reader] interface. - */ - read(b: string|Array): number - } - interface Reader { - /** - * ReadAt implements the [io.ReaderAt] interface. - */ - readAt(b: string|Array, off: number): number - } - interface Reader { - /** - * ReadByte implements the [io.ByteReader] interface. - */ - readByte(): number - } - interface Reader { - /** - * UnreadByte complements [Reader.ReadByte] in implementing the [io.ByteScanner] interface. - */ - unreadByte(): void - } - interface Reader { - /** - * ReadRune implements the [io.RuneReader] interface. - */ - readRune(): [number, number] - } - interface Reader { - /** - * UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface. - */ - unreadRune(): void - } - interface Reader { - /** - * Seek implements the [io.Seeker] interface. - */ - seek(offset: number, whence: number): number - } - interface Reader { - /** - * WriteTo implements the [io.WriterTo] interface. - */ - writeTo(w: io.Writer): number - } - interface Reader { - /** - * Reset resets the [Reader] to be reading from b. - */ - reset(b: string|Array): void - } -} - /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -8039,18 +7882,90 @@ namespace context { } /** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. * - * See the [testing/fstest] package for support with testing - * implementations of file systems. + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. */ -namespace fs { +namespace io { /** - * An FS provides access to a hierarchical file system. + * Reader is the interface that wraps the basic Read method. * - * The FS interface is the minimum implementation required of the file system. + * Read reads up to len(p) bytes into p. It returns the number of bytes + * read (0 <= n <= len(p)) and any error encountered. Even if Read + * returns n < len(p), it may use all of p as scratch space during the call. + * If some data is available but not len(p) bytes, Read conventionally + * returns what is available instead of waiting for more. + * + * When Read encounters an error or end-of-file condition after + * successfully reading n > 0 bytes, it returns the number of + * bytes read. It may return the (non-nil) error from the same call + * or return the error (and n == 0) from a subsequent call. + * An instance of this general case is that a Reader returning + * a non-zero number of bytes at the end of the input stream may + * return either err == EOF or err == nil. The next Read should + * return 0, EOF. + * + * Callers should always process the n > 0 bytes returned before + * considering the error err. Doing so correctly handles I/O errors + * that happen after reading some bytes and also both of the + * allowed EOF behaviors. + * + * If len(p) == 0, Read should always return n == 0. It may return a + * non-nil error if some error condition is known, such as EOF. + * + * Implementations of Read are discouraged from returning a + * zero byte count with a nil error, except when len(p) == 0. + * Callers should treat a return of 0 and nil as indicating that + * nothing happened; in particular it does not indicate EOF. + * + * Implementations must not retain p. + */ + interface Reader { + [key:string]: any; + read(p: string|Array): number + } + /** + * Writer is the interface that wraps the basic Write method. + * + * Write writes len(p) bytes from p to the underlying data stream. + * It returns the number of bytes written from p (0 <= n <= len(p)) + * and any error encountered that caused the write to stop early. + * Write must return a non-nil error if it returns n < len(p). + * Write must not modify the slice data, even temporarily. + * + * Implementations must not retain p. + */ + interface Writer { + [key:string]: any; + write(p: string|Array): number + } + /** + * ReadSeekCloser is the interface that groups the basic Read, Seek and Close + * methods. + */ + interface ReadSeekCloser { + [key:string]: any; + } +} + +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + * + * See the [testing/fstest] package for support with testing + * implementations of file systems. + */ +namespace fs { + /** + * An FS provides access to a hierarchical file system. + * + * The FS interface is the minimum implementation required of the file system. * A file system may implement additional interfaces, * such as [ReadFileFS], to provide additional or optimized functionality. * @@ -8239,376 +8154,158 @@ namespace fs { } /** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the [path/filepath] package's Glob function. - * To expand environment variables, use package os's ExpandEnv. - * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. - * - * # Executables in the current directory - * - * The functions [Command] and [LookPath] look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. - * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run [LookPath]("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying [errors.Is](err, [ErrDot]). - * - * For example, consider these two program snippets: - * - * ``` - * path, err := exec.LookPath("prog") - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * These will not find and run ./prog or .\prog.exe, - * no matter how the current path is configured. - * - * Code that always wants to run a program from the current directory - * can be rewritten to say "./prog" instead of "prog". - * - * Code that insists on including results from relative path entries - * can instead override the error using an errors.Is check: - * - * ``` - * path, err := exec.LookPath("prog") - * if errors.Is(err, exec.ErrDot) { - * err = nil - * } - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if errors.Is(cmd.Err, exec.ErrDot) { - * cmd.Err = nil - * } - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * Setting the environment variable GODEBUG=execerrdot=0 - * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 - * behavior for programs that are unable to apply more targeted fixes. - * A future version of Go may remove support for this variable. - * - * Before adding such overrides, make sure you understand the - * security implications of doing so. - * See https://go.dev/blog/path-security for more information. + * Package bytes implements functions for the manipulation of byte slices. + * It is analogous to the facilities of the [strings] package. */ -namespace exec { +namespace bytes { /** - * Cmd represents an external command being prepared or run. - * - * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] - * methods. + * A Reader implements the [io.Reader], [io.ReaderAt], [io.WriterTo], [io.Seeker], + * [io.ByteScanner], and [io.RuneScanner] interfaces by reading from + * a byte slice. + * Unlike a [Buffer], a Reader is read-only and supports seeking. + * The zero value for Reader operates like a Reader of an empty slice. */ - interface Cmd { + interface Reader { + } + interface Reader { /** - * Path is the path of the command to run. - * - * This is the only field that must be set to a non-zero - * value. If Path is relative, it is evaluated relative - * to Dir. + * Len returns the number of bytes of the unread portion of the + * slice. */ - path: string + len(): number + } + interface Reader { /** - * Args holds command line arguments, including the command as Args[0]. - * If the Args field is empty or nil, Run uses {Path}. - * - * In typical use, both Path and Args are set by calling Command. + * Size returns the original length of the underlying byte slice. + * Size is the number of bytes available for reading via [Reader.ReadAt]. + * The result is unaffected by any method calls except [Reader.Reset]. */ - args: Array + size(): number + } + interface Reader { /** - * Env specifies the environment of the process. - * Each entry is of the form "key=value". - * If Env is nil, the new process uses the current process's - * environment. - * If Env contains duplicate environment keys, only the last - * value in the slice for each duplicate key is used. - * As a special case on Windows, SYSTEMROOT is always added if - * missing and not explicitly set to the empty string. + * Read implements the [io.Reader] interface. */ - env: Array + read(b: string|Array): number + } + interface Reader { /** - * Dir specifies the working directory of the command. - * If Dir is the empty string, Run runs the command in the - * calling process's current directory. + * ReadAt implements the [io.ReaderAt] interface. */ - dir: string + readAt(b: string|Array, off: number): number + } + interface Reader { /** - * Stdin specifies the process's standard input. - * - * If Stdin is nil, the process reads from the null device (os.DevNull). - * - * If Stdin is an *os.File, the process's standard input is connected - * directly to that file. - * - * Otherwise, during the execution of the command a separate - * goroutine reads from Stdin and delivers that data to the command - * over a pipe. In this case, Wait does not complete until the goroutine - * stops copying, either because it has reached the end of Stdin - * (EOF or a read error), or because writing to the pipe returned an error, - * or because a nonzero WaitDelay was set and expired. + * ReadByte implements the [io.ByteReader] interface. */ - stdin: io.Reader + readByte(): number + } + interface Reader { /** - * Stdout and Stderr specify the process's standard output and error. - * - * If either is nil, Run connects the corresponding file descriptor - * to the null device (os.DevNull). - * - * If either is an *os.File, the corresponding output from the process - * is connected directly to that file. - * - * Otherwise, during the execution of the command a separate goroutine - * reads from the process over a pipe and delivers that data to the - * corresponding Writer. In this case, Wait does not complete until the - * goroutine reaches EOF or encounters an error or a nonzero WaitDelay - * expires. - * - * If Stdout and Stderr are the same writer, and have a type that can - * be compared with ==, at most one goroutine at a time will call Write. - */ - stdout: io.Writer - stderr: io.Writer - /** - * ExtraFiles specifies additional open files to be inherited by the - * new process. It does not include standard input, standard output, or - * standard error. If non-nil, entry i becomes file descriptor 3+i. - * - * ExtraFiles is not supported on Windows. - */ - extraFiles: Array<(os.File | undefined)> - /** - * SysProcAttr holds optional, operating system-specific attributes. - * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. - */ - sysProcAttr?: syscall.SysProcAttr - /** - * Process is the underlying process, once started. + * UnreadByte complements [Reader.ReadByte] in implementing the [io.ByteScanner] interface. */ - process?: os.Process + unreadByte(): void + } + interface Reader { /** - * ProcessState contains information about an exited process. - * If the process was started successfully, Wait or Run will - * populate its ProcessState when the command completes. + * ReadRune implements the [io.RuneReader] interface. */ - processState?: os.ProcessState - err: Error // LookPath error, if any. + readRune(): [number, number] + } + interface Reader { /** - * If Cancel is non-nil, the command must have been created with - * CommandContext and Cancel will be called when the command's - * Context is done. By default, CommandContext sets Cancel to - * call the Kill method on the command's Process. - * - * Typically a custom Cancel will send a signal to the command's - * Process, but it may instead take other actions to initiate cancellation, - * such as closing a stdin or stdout pipe or sending a shutdown request on a - * network socket. - * - * If the command exits with a success status after Cancel is - * called, and Cancel does not return an error equivalent to - * os.ErrProcessDone, then Wait and similar methods will return a non-nil - * error: either an error wrapping the one returned by Cancel, - * or the error from the Context. - * (If the command exits with a non-success status, or Cancel - * returns an error that wraps os.ErrProcessDone, Wait and similar methods - * continue to return the command's usual exit status.) - * - * If Cancel is set to nil, nothing will happen immediately when the command's - * Context is done, but a nonzero WaitDelay will still take effect. That may - * be useful, for example, to work around deadlocks in commands that do not - * support shutdown signals but are expected to always finish quickly. - * - * Cancel will not be called if Start returns a non-nil error. + * UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface. */ - cancel: () => void + unreadRune(): void + } + interface Reader { /** - * If WaitDelay is non-zero, it bounds the time spent waiting on two sources - * of unexpected delay in Wait: a child process that fails to exit after the - * associated Context is canceled, and a child process that exits but leaves - * its I/O pipes unclosed. - * - * The WaitDelay timer starts when either the associated Context is done or a - * call to Wait observes that the child process has exited, whichever occurs - * first. When the delay has elapsed, the command shuts down the child process - * and/or its I/O pipes. - * - * If the child process has failed to exit — perhaps because it ignored or - * failed to receive a shutdown signal from a Cancel function, or because no - * Cancel function was set — then it will be terminated using os.Process.Kill. - * - * Then, if the I/O pipes communicating with the child process are still open, - * those pipes are closed in order to unblock any goroutines currently blocked - * on Read or Write calls. - * - * If pipes are closed due to WaitDelay, no Cancel call has occurred, - * and the command has otherwise exited with a successful status, Wait and - * similar methods will return ErrWaitDelay instead of nil. - * - * If WaitDelay is zero (the default), I/O pipes will be read until EOF, - * which might not occur until orphaned subprocesses of the command have - * also closed their descriptors for the pipes. + * Seek implements the [io.Seeker] interface. */ - waitDelay: time.Duration + seek(offset: number, whence: number): number } - interface Cmd { + interface Reader { /** - * String returns a human-readable description of c. - * It is intended only for debugging. - * In particular, it is not suitable for use as input to a shell. - * The output of String may vary across Go releases. + * WriteTo implements the [io.WriterTo] interface. */ - string(): string + writeTo(w: io.Writer): number } - interface Cmd { + interface Reader { /** - * Run starts the specified command and waits for it to complete. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command starts but does not complete successfully, the error is of - * type [*ExitError]. Other error types may be returned for other situations. - * - * If the calling goroutine has locked the operating system thread - * with [runtime.LockOSThread] and modified any inheritable OS-level - * thread state (for example, Linux or Plan 9 name spaces), the new - * process will inherit the caller's thread state. + * Reset resets the [Reader] to be reading from b. */ - run(): void + reset(b: string|Array): void } - interface Cmd { +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonArray defines a slice that is safe for json and db read/write. + */ + interface JsonArray extends Array{} + interface JsonArray { /** - * Start starts the specified command but does not wait for it to complete. - * - * If Start returns successfully, the c.Process field will be set. - * - * After a successful call to Start the [Cmd.Wait] method must be called in - * order to release associated system resources. + * MarshalJSON implements the [json.Marshaler] interface. */ - start(): void + marshalJSON(): string|Array } - interface Cmd { + interface JsonArray { /** - * Wait waits for the command to exit and waits for any copying to - * stdin or copying from stdout or stderr to complete. - * - * The command must have been started by [Cmd.Start]. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command fails to run or doesn't complete successfully, the - * error is of type [*ExitError]. Other error types may be - * returned for I/O problems. - * - * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits - * for the respective I/O loop copying to or from the process to complete. - * - * Wait releases any resources associated with the [Cmd]. + * Value implements the [driver.Valuer] interface. */ - wait(): void + value(): any } - interface Cmd { + interface JsonArray { /** - * Output runs the command and returns its standard output. - * Any returned error will usually be of type [*ExitError]. - * If c.Stderr was nil, Output populates [ExitError.Stderr]. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonArray[T] instance. */ - output(): string|Array + scan(value: any): void } - interface Cmd { + /** + * JsonMap defines a map that is safe for json and db read/write. + */ + interface JsonMap extends _TygojaDict{} + interface JsonMap { /** - * CombinedOutput runs the command and returns its combined standard - * output and standard error. + * MarshalJSON implements the [json.Marshaler] interface. */ - combinedOutput(): string|Array + marshalJSON(): string|Array } - interface Cmd { + interface JsonMap { /** - * StdinPipe returns a pipe that will be connected to the command's - * standard input when the command starts. - * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. - * A caller need only call Close to force the pipe to close sooner. - * For example, if the command being run will not exit until standard input - * is closed, the caller must close the pipe. + * Get retrieves a single value from the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). */ - stdinPipe(): io.WriteCloser + get(key: string): any } - interface Cmd { + interface JsonMap { /** - * StdoutPipe returns a pipe that will be connected to the command's - * standard output when the command starts. + * Set sets a single value in the current JsonMap. * - * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. - * See the example for idiomatic usage. + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). */ - stdoutPipe(): io.ReadCloser + set(key: string, value: any): void } - interface Cmd { + interface JsonMap { /** - * StderrPipe returns a pipe that will be connected to the command's - * standard error when the command starts. - * - * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. - * See the StdoutPipe example for idiomatic usage. + * Value implements the [driver.Valuer] interface. */ - stderrPipe(): io.ReadCloser + value(): any } - interface Cmd { + interface JsonMap { /** - * Environ returns a copy of the environment in which the command would be run - * as it is currently configured. + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current `JsonMap` instance. */ - environ(): Array + scan(value: any): void } } @@ -8670,97 +8367,26 @@ namespace jwt { } /** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonArray defines a slice that is safe for json and db read/write. - */ - interface JsonArray extends Array{} - interface JsonArray { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonArray { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonArray { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonArray[T] instance. - */ - scan(value: any): void - } - /** - * JsonMap defines a map that is safe for json and db read/write. - */ - interface JsonMap extends _TygojaDict{} - interface JsonMap { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonMap { - /** - * Get retrieves a single value from the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - get(key: string): any - } - interface JsonMap { - /** - * Set sets a single value in the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - set(key: string, value: any): void - } - interface JsonMap { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonMap { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current `JsonMap` instance. - */ - scan(value: any): void - } -} - -/** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits - * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. - * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. - * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. */ namespace multipart { /** @@ -9850,1536 +9476,1826 @@ namespace auth { } /** - * Package echo implements high performance, minimalist Go web framework. - * - * Example: - * - * ``` - * package main - * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) - * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } - * - * func main() { - * // Echo instance - * e := echo.New() - * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. * - * // Routes - * e.GET("/", hello) + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` + * Drivers that do not support context cancellation will not return until + * after the query is completed. * - * Learn more at https://echo.labstack.com + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. */ -namespace echo { +namespace sql { /** - * Context represents the context of the current HTTP request. It holds request and - * response objects, path, path parameters, data and registered handler. + * TxOptions holds the transaction options to be used in [DB.BeginTx]. */ - interface Context { - [key:string]: any; - /** - * Request returns `*http.Request`. - */ - request(): (http.Request) - /** - * SetRequest sets `*http.Request`. - */ - setRequest(r: http.Request): void + interface TxOptions { /** - * SetResponse sets `*Response`. + * Isolation is the transaction isolation level. + * If zero, the driver or database's default level is used. */ - setResponse(r: Response): void + isolation: IsolationLevel + readOnly: boolean + } + /** + * DB is a database handle representing a pool of zero or more + * underlying connections. It's safe for concurrent use by multiple + * goroutines. + * + * The sql package creates and frees connections automatically; it + * also maintains a free pool of idle connections. If the database has + * a concept of per-connection state, such state can be reliably observed + * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the + * returned [Tx] is bound to a single connection. Once [Tx.Commit] or + * [Tx.Rollback] is called on the transaction, that transaction's + * connection is returned to [DB]'s idle connection pool. The pool size + * can be controlled with [DB.SetMaxIdleConns]. + */ + interface DB { + } + interface DB { /** - * Response returns `*Response`. + * PingContext verifies a connection to the database is still alive, + * establishing a connection if necessary. */ - response(): (Response) + pingContext(ctx: context.Context): void + } + interface DB { /** - * IsTLS returns true if HTTP connection is TLS otherwise false. + * Ping verifies a connection to the database is still alive, + * establishing a connection if necessary. + * + * Ping uses [context.Background] internally; to specify the context, use + * [DB.PingContext]. */ - isTLS(): boolean + ping(): void + } + interface DB { /** - * IsWebSocket returns true if HTTP connection is WebSocket otherwise false. + * Close closes the database and prevents new queries from starting. + * Close then waits for all queries that have started processing on the server + * to finish. + * + * It is rare to Close a [DB], as the [DB] handle is meant to be + * long-lived and shared between many goroutines. */ - isWebSocket(): boolean + close(): void + } + interface DB { /** - * Scheme returns the HTTP protocol scheme, `http` or `https`. + * SetMaxIdleConns sets the maximum number of connections in the idle + * connection pool. + * + * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, + * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. + * + * If n <= 0, no idle connections are retained. + * + * The default max idle connections is currently 2. This may change in + * a future release. */ - scheme(): string + setMaxIdleConns(n: number): void + } + interface DB { /** - * RealIP returns the client's network address based on `X-Forwarded-For` - * or `X-Real-IP` request header. - * The behavior can be configured using `Echo#IPExtractor`. + * SetMaxOpenConns sets the maximum number of open connections to the database. + * + * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than + * MaxIdleConns, then MaxIdleConns will be reduced to match the new + * MaxOpenConns limit. + * + * If n <= 0, then there is no limit on the number of open connections. + * The default is 0 (unlimited). */ - realIP(): string + setMaxOpenConns(n: number): void + } + interface DB { /** - * RouteInfo returns current request route information. Method, Path, Name and params if they exist for matched route. - * In case of 404 (route not found) and 405 (method not allowed) RouteInfo returns generic struct for these cases. + * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. + * + * Expired connections may be closed lazily before reuse. + * + * If d <= 0, connections are not closed due to a connection's age. */ - routeInfo(): RouteInfo + setConnMaxLifetime(d: time.Duration): void + } + interface DB { /** - * Path returns the registered path for the handler. + * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. + * + * Expired connections may be closed lazily before reuse. + * + * If d <= 0, connections are not closed due to a connection's idle time. */ - path(): string + setConnMaxIdleTime(d: time.Duration): void + } + interface DB { /** - * PathParam returns path parameter by name. + * Stats returns database statistics. */ - pathParam(name: string): string + stats(): DBStats + } + interface DB { /** - * PathParamDefault returns the path parameter or default value for the provided name. + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. * - * Notes for DefaultRouter implementation: - * Path parameter could be empty for cases like that: - * * route `/release-:version/bin` and request URL is `/release-/bin` - * * route `/api/:version/image.jpg` and request URL is `/api//image.jpg` - * but not when path parameter is last part of route path - * * route `/download/file.:ext` will not match request `/download/file.` + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. */ - pathParamDefault(name: string, defaultValue: string): string + prepareContext(ctx: context.Context, query: string): (Stmt) + } + interface DB { /** - * PathParams returns path parameter values. + * Prepare creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. + * + * Prepare uses [context.Background] internally; to specify the context, use + * [DB.PrepareContext]. */ - pathParams(): PathParams + prepare(query: string): (Stmt) + } + interface DB { /** - * SetPathParams sets path parameters for current request. + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. */ - setPathParams(params: PathParams): void + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface DB { /** - * QueryParam returns the query param for the provided name. + * Exec executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + * + * Exec uses [context.Background] internally; to specify the context, use + * [DB.ExecContext]. */ - queryParam(name: string): string + exec(query: string, ...args: any[]): Result + } + interface DB { /** - * QueryParamDefault returns the query param or default value for the provided name. + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. */ - queryParamDefault(name: string, defaultValue: string): string + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface DB { /** - * QueryParams returns the query parameters as `url.Values`. + * Query executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + * + * Query uses [context.Background] internally; to specify the context, use + * [DB.QueryContext]. */ - queryParams(): url.Values + query(query: string, ...args: any[]): (Rows) + } + interface DB { /** - * QueryString returns the URL query string. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. */ - queryString(): string + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface DB { /** - * FormValue returns the form field value for the provided name. + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [DB.QueryRowContext]. */ - formValue(name: string): string + queryRow(query: string, ...args: any[]): (Row) + } + interface DB { /** - * FormValueDefault returns the form field value or default value for the provided name. + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. + * + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. */ - formValueDefault(name: string, defaultValue: string): string + beginTx(ctx: context.Context, opts: TxOptions): (Tx) + } + interface DB { /** - * FormValues returns the form field values as `url.Values`. + * Begin starts a transaction. The default isolation level is dependent on + * the driver. + * + * Begin uses [context.Background] internally; to specify the context, use + * [DB.BeginTx]. */ - formValues(): url.Values + begin(): (Tx) + } + interface DB { /** - * FormFile returns the multipart form file for the provided name. + * Driver returns the database's underlying driver. */ - formFile(name: string): (multipart.FileHeader) + driver(): any + } + interface DB { /** - * MultipartForm returns the multipart form. + * Conn returns a single connection by either opening a new connection + * or returning an existing connection from the connection pool. Conn will + * block until either a connection is returned or ctx is canceled. + * Queries run on the same Conn will be run in the same database session. + * + * Every Conn must be returned to the database pool after use by + * calling [Conn.Close]. */ - multipartForm(): (multipart.Form) + conn(ctx: context.Context): (Conn) + } + /** + * Tx is an in-progress database transaction. + * + * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. + * + * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the + * transaction fail with [ErrTxDone]. + * + * The statements prepared for a transaction by calling + * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed + * by the call to [Tx.Commit] or [Tx.Rollback]. + */ + interface Tx { + } + interface Tx { /** - * Cookie returns the named cookie provided in the request. + * Commit commits the transaction. */ - cookie(name: string): (http.Cookie) + commit(): void + } + interface Tx { /** - * SetCookie adds a `Set-Cookie` header in HTTP response. + * Rollback aborts the transaction. */ - setCookie(cookie: http.Cookie): void + rollback(): void + } + interface Tx { /** - * Cookies returns the HTTP cookies sent with the request. + * PrepareContext creates a prepared statement for use within a transaction. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * + * The provided context will be used for the preparation of the context, not + * for the execution of the returned statement. The returned statement + * will run in the transaction context. */ - cookies(): Array<(http.Cookie | undefined)> + prepareContext(ctx: context.Context, query: string): (Stmt) + } + interface Tx { /** - * Get retrieves data from the context. + * Prepare creates a prepared statement for use within a transaction. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * + * Prepare uses [context.Background] internally; to specify the context, use + * [Tx.PrepareContext]. */ - get(key: string): { + prepare(query: string): (Stmt) } + interface Tx { /** - * Set saves data in the context. + * StmtContext returns a transaction-specific prepared statement from + * an existing statement. + * + * Example: + * + * ``` + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) + * ``` + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. */ - set(key: string, val: { - }): void + stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) + } + interface Tx { /** - * Bind binds path params, query params and the request body into provided type `i`. The default binder - * binds body based on Content-Type header. + * Stmt returns a transaction-specific prepared statement from + * an existing statement. + * + * Example: + * + * ``` + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) + * ``` + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * Stmt uses [context.Background] internally; to specify the context, use + * [Tx.StmtContext]. */ - bind(i: { - }): void + stmt(stmt: Stmt): (Stmt) + } + interface Tx { /** - * Validate validates provided `i`. It is usually called after `Context#Bind()`. - * Validator must be registered using `Echo#Validator`. + * ExecContext executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. */ - validate(i: { - }): void + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface Tx { /** - * Render renders a template with data and sends a text/html response with status - * code. Renderer must be registered using `Echo.Renderer`. + * Exec executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. + * + * Exec uses [context.Background] internally; to specify the context, use + * [Tx.ExecContext]. */ - render(code: number, name: string, data: { - }): void - /** - * HTML sends an HTTP response with status code. - */ - html(code: number, html: string): void - /** - * HTMLBlob sends an HTTP blob response with status code. - */ - htmlBlob(code: number, b: string|Array): void - /** - * String sends a string response with status code. - */ - string(code: number, s: string): void - /** - * JSON sends a JSON response with status code. - */ - json(code: number, i: { - }): void - /** - * JSONPretty sends a pretty-print JSON with status code. - */ - jsonPretty(code: number, i: { - }, indent: string): void - /** - * JSONBlob sends a JSON blob response with status code. - */ - jsonBlob(code: number, b: string|Array): void - /** - * JSONP sends a JSONP response with status code. It uses `callback` to construct - * the JSONP payload. - */ - jsonp(code: number, callback: string, i: { - }): void - /** - * JSONPBlob sends a JSONP blob response with status code. It uses `callback` - * to construct the JSONP payload. - */ - jsonpBlob(code: number, callback: string, b: string|Array): void - /** - * XML sends an XML response with status code. - */ - xml(code: number, i: { - }): void - /** - * XMLPretty sends a pretty-print XML with status code. - */ - xmlPretty(code: number, i: { - }, indent: string): void + exec(query: string, ...args: any[]): Result + } + interface Tx { /** - * XMLBlob sends an XML blob response with status code. + * QueryContext executes a query that returns rows, typically a SELECT. */ - xmlBlob(code: number, b: string|Array): void + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface Tx { /** - * Blob sends a blob response with status code and content type. + * Query executes a query that returns rows, typically a SELECT. + * + * Query uses [context.Background] internally; to specify the context, use + * [Tx.QueryContext]. */ - blob(code: number, contentType: string, b: string|Array): void + query(query: string, ...args: any[]): (Rows) + } + interface Tx { /** - * Stream sends a streaming response with status code and content type. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - stream(code: number, contentType: string, r: io.Reader): void + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface Tx { /** - * File sends a response with the content of the file. + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [Tx.QueryRowContext]. */ - file(file: string): void + queryRow(query: string, ...args: any[]): (Row) + } + /** + * Stmt is a prepared statement. + * A Stmt is safe for concurrent use by multiple goroutines. + * + * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single + * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will + * become unusable and all operations will return an error. + * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the + * [DB]. When the Stmt needs to execute on a new underlying connection, it will + * prepare itself on the new connection automatically. + */ + interface Stmt { + } + interface Stmt { /** - * FileFS sends a response with the content of the file from given filesystem. + * ExecContext executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. */ - fileFS(file: string, filesystem: fs.FS): void + execContext(ctx: context.Context, ...args: any[]): Result + } + interface Stmt { /** - * Attachment sends a response as attachment, prompting client to save the - * file. + * Exec executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. + * + * Exec uses [context.Background] internally; to specify the context, use + * [Stmt.ExecContext]. */ - attachment(file: string, name: string): void + exec(...args: any[]): Result + } + interface Stmt { /** - * Inline sends a response as inline, opening the file in the browser. + * QueryContext executes a prepared query statement with the given arguments + * and returns the query results as a [*Rows]. */ - inline(file: string, name: string): void + queryContext(ctx: context.Context, ...args: any[]): (Rows) + } + interface Stmt { /** - * NoContent sends a response with no body and a status code. + * Query executes a prepared query statement with the given arguments + * and returns the query results as a *Rows. + * + * Query uses [context.Background] internally; to specify the context, use + * [Stmt.QueryContext]. */ - noContent(code: number): void + query(...args: any[]): (Rows) + } + interface Stmt { /** - * Redirect redirects the request to a provided URL with status code. + * QueryRowContext executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. */ - redirect(code: number, url: string): void + queryRowContext(ctx: context.Context, ...args: any[]): (Row) + } + interface Stmt { /** - * Error invokes the registered global HTTP error handler. Generally used by middleware. - * A side-effect of calling global error handler is that now Response has been committed (sent to the client) and - * middlewares up in chain can not change Response status code or Response body anymore. + * QueryRow executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. * - * Avoid using this method in handlers as no middleware will be able to effectively handle errors after that. - * Instead of calling this method in handler return your error and let it be handled by middlewares or global error handler. + * Example usage: + * + * ``` + * var name string + * err := nameByUseridStmt.QueryRow(id).Scan(&name) + * ``` + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [Stmt.QueryRowContext]. */ - error(err: Error): void + queryRow(...args: any[]): (Row) + } + interface Stmt { /** - * Echo returns the `Echo` instance. - * - * WARNING: Remember that Echo public fields and methods are coroutine safe ONLY when you are NOT mutating them - * anywhere in your code after Echo server has started. + * Close closes the statement. */ - echo(): (Echo) + close(): void } - // @ts-ignore - import stdContext = context /** - * Echo is the top-level framework instance. - * - * Goroutine safety: Do not mutate Echo instance fields after server has started. Accessing these - * fields from handlers/middlewares and changing field values at the same time leads to data-races. - * Same rule applies to adding new routes after server has been started - Adding a route is not Goroutine safe action. + * Rows is the result of a query. Its cursor starts before the first row + * of the result set. Use [Rows.Next] to advance from row to row. */ - interface Echo { - /** - * NewContextFunc allows using custom context implementations, instead of default *echo.context - */ - newContextFunc: (e: Echo, pathParamAllocSize: number) => ServableContext - debug: boolean - httpErrorHandler: HTTPErrorHandler - binder: Binder - jsonSerializer: JSONSerializer - validator: Validator - renderer: Renderer - logger: Logger - ipExtractor: IPExtractor + interface Rows { + } + interface Rows { /** - * Filesystem is file system used by Static and File handlers to access files. - * Defaults to os.DirFS(".") + * Next prepares the next result row for reading with the [Rows.Scan] method. It + * returns true on success, or false if there is no next result row or an error + * happened while preparing it. [Rows.Err] should be consulted to distinguish between + * the two cases. * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. - */ - filesystem: fs.FS - /** - * OnAddRoute is called when Echo adds new route to specific host router. Handler is called for every router - * and before route is added to the host router. + * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. */ - onAddRoute: (host: string, route: Routable) => void + next(): boolean } - /** - * HandlerFunc defines a function to serve HTTP requests. - */ - interface HandlerFunc {(c: Context): void } - /** - * MiddlewareFunc defines a function to process middleware. - */ - interface MiddlewareFunc {(next: HandlerFunc): HandlerFunc } - interface Echo { + interface Rows { /** - * NewContext returns a new Context instance. + * NextResultSet prepares the next result set for reading. It reports whether + * there is further result sets, or false if there is no further result set + * or if there is an error advancing to it. The [Rows.Err] method should be consulted + * to distinguish between the two cases. * - * Note: both request and response can be left to nil as Echo.ServeHTTP will call c.Reset(req,resp) anyway - * these arguments are useful when creating context for tests and cases like that. + * After calling NextResultSet, the [Rows.Next] method should always be called before + * scanning. If there are further result sets they may not have rows in the result + * set. */ - newContext(r: http.Request, w: http.ResponseWriter): Context + nextResultSet(): boolean } - interface Echo { + interface Rows { /** - * Router returns the default router. + * Err returns the error, if any, that was encountered during iteration. + * Err may be called after an explicit or implicit [Rows.Close]. */ - router(): Router + err(): void } - interface Echo { + interface Rows { /** - * Routers returns the new map of host => router. + * Columns returns the column names. + * Columns returns an error if the rows are closed. */ - routers(): _TygojaDict + columns(): Array } - interface Echo { - /** - * RouterFor returns Router for given host. When host is left empty the default router is returned. - */ - routerFor(host: string): [Router, boolean] - } - interface Echo { + interface Rows { /** - * ResetRouterCreator resets callback for creating new router instances. - * Note: current (default) router is immediately replaced with router created with creator func and vhost routers are cleared. + * ColumnTypes returns column information such as column type, length, + * and nullable. Some information may not be available from some drivers. */ - resetRouterCreator(creator: (e: Echo) => Router): void + columnTypes(): Array<(ColumnType | undefined)> } - interface Echo { + interface Rows { /** - * Pre adds middleware to the chain which is run before router tries to find matching route. - * Meaning middleware is executed even for 404 (not found) cases. + * Scan copies the columns in the current row into the values pointed + * at by dest. The number of values in dest must be the same as the + * number of columns in [Rows]. + * + * Scan converts columns read from the database into the following + * common Go types and special types provided by the sql package: + * + * ``` + * *string + * *[]byte + * *int, *int8, *int16, *int32, *int64 + * *uint, *uint8, *uint16, *uint32, *uint64 + * *bool + * *float32, *float64 + * *interface{} + * *RawBytes + * *Rows (cursor value) + * any type implementing Scanner (see Scanner docs) + * ``` + * + * In the most simple case, if the type of the value from the source + * column is an integer, bool or string type T and dest is of type *T, + * Scan simply assigns the value through the pointer. + * + * Scan also converts between string and numeric types, as long as no + * information would be lost. While Scan stringifies all numbers + * scanned from numeric database columns into *string, scans into + * numeric types are checked for overflow. For example, a float64 with + * value 300 or a string with value "300" can scan into a uint16, but + * not into a uint8, though float64(255) or "255" can scan into a + * uint8. One exception is that scans of some float64 numbers to + * strings may lose information when stringifying. In general, scan + * floating point columns into *float64. + * + * If a dest argument has type *[]byte, Scan saves in that argument a + * copy of the corresponding data. The copy is owned by the caller and + * can be modified and held indefinitely. The copy can be avoided by + * using an argument of type [*RawBytes] instead; see the documentation + * for [RawBytes] for restrictions on its use. + * + * If an argument has type *interface{}, Scan copies the value + * provided by the underlying driver without conversion. When scanning + * from a source value of type []byte to *interface{}, a copy of the + * slice is made and the caller owns the result. + * + * Source values of type [time.Time] may be scanned into values of type + * *time.Time, *interface{}, *string, or *[]byte. When converting to + * the latter two, [time.RFC3339Nano] is used. + * + * Source values of type bool may be scanned into types *bool, + * *interface{}, *string, *[]byte, or [*RawBytes]. + * + * For scanning into *bool, the source may be true, false, 1, 0, or + * string inputs parseable by [strconv.ParseBool]. + * + * Scan can also convert a cursor returned from a query, such as + * "select cursor(select * from my_table) from dual", into a + * [*Rows] value that can itself be scanned from. The parent + * select query will close any cursor [*Rows] if the parent [*Rows] is closed. + * + * If any of the first arguments implementing [Scanner] returns an error, + * that error will be wrapped in the returned error. */ - pre(...middleware: MiddlewareFunc[]): void + scan(...dest: any[]): void } - interface Echo { + interface Rows { /** - * Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed. + * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called + * and returns false and there are no further result sets, + * the [Rows] are closed automatically and it will suffice to check the + * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. */ - use(...middleware: MiddlewareFunc[]): void + close(): void } - interface Echo { + /** + * A Result summarizes an executed SQL command. + */ + interface Result { + [key:string]: any; /** - * CONNECT registers a new CONNECT route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * LastInsertId returns the integer generated by the database + * in response to a command. Typically this will be from an + * "auto increment" column when inserting a new row. Not all + * databases support this feature, and the syntax of such + * statements varies. */ - connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + lastInsertId(): number /** - * DELETE registers a new DELETE route for a path with matching handler in the router - * with optional route-level middleware. Panics on error. + * RowsAffected returns the number of rows affected by an + * update, insert, or delete. Not every database or database + * driver may support this. */ - delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo + rowsAffected(): number } - interface Echo { +} + +/** + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } + * + * func main() { + * // Echo instance + * e := echo.New() + * + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) + * + * // Routes + * e.GET("/", hello) + * + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` + * + * Learn more at https://echo.labstack.com + */ +namespace echo { + /** + * Context represents the context of the current HTTP request. It holds request and + * response objects, path, path parameters, data and registered handler. + */ + interface Context { + [key:string]: any; /** - * GET registers a new GET route for a path with matching handler in the router - * with optional route-level middleware. Panics on error. + * Request returns `*http.Request`. */ - get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + request(): (http.Request) /** - * HEAD registers a new HEAD route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * SetRequest sets `*http.Request`. */ - head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + setRequest(r: http.Request): void /** - * OPTIONS registers a new OPTIONS route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * SetResponse sets `*Response`. */ - options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + setResponse(r: Response): void /** - * PATCH registers a new PATCH route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Response returns `*Response`. */ - patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + response(): (Response) /** - * POST registers a new POST route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * IsTLS returns true if HTTP connection is TLS otherwise false. */ - post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + isTLS(): boolean /** - * PUT registers a new PUT route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * IsWebSocket returns true if HTTP connection is WebSocket otherwise false. */ - put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + isWebSocket(): boolean /** - * TRACE registers a new TRACE route for a path with matching handler in the - * router with optional route-level middleware. Panics on error. + * Scheme returns the HTTP protocol scheme, `http` or `https`. */ - trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + scheme(): string /** - * RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) - * for current request URL. - * Path supports static and named/any parameters just like other http method is defined. Generally path is ended with - * wildcard/match-any character (`/*`, `/download/*` etc). - * - * Example: `e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` + * RealIP returns the client's network address based on `X-Forwarded-For` + * or `X-Real-IP` request header. + * The behavior can be configured using `Echo#IPExtractor`. */ - routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + realIP(): string /** - * Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler - * in the router with optional route-level middleware. - * - * Note: this method only adds specific set of supported HTTP methods as handler and is not true - * "catch-any-arbitrary-method" way of matching requests. + * RouteInfo returns current request route information. Method, Path, Name and params if they exist for matched route. + * In case of 404 (route not found) and 405 (method not allowed) RouteInfo returns generic struct for these cases. */ - any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes - } - interface Echo { + routeInfo(): RouteInfo /** - * Match registers a new route for multiple HTTP methods and path with matching - * handler in the router with optional route-level middleware. Panics on error. + * Path returns the registered path for the handler. */ - match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes - } - interface Echo { + path(): string /** - * Static registers a new route with path prefix to serve static files from the provided root directory. + * PathParam returns path parameter by name. */ - static(pathPrefix: string, fsRoot: string): RouteInfo - } - interface Echo { + pathParam(name: string): string /** - * StaticFS registers a new route with path prefix to serve static files from the provided file system. + * PathParamDefault returns the path parameter or default value for the provided name. * - * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary - * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths - * including `assets/images` as their prefix. + * Notes for DefaultRouter implementation: + * Path parameter could be empty for cases like that: + * * route `/release-:version/bin` and request URL is `/release-/bin` + * * route `/api/:version/image.jpg` and request URL is `/api//image.jpg` + * but not when path parameter is last part of route path + * * route `/download/file.:ext` will not match request `/download/file.` */ - staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo - } - interface Echo { + pathParamDefault(name: string, defaultValue: string): string /** - * FileFS registers a new route with path to serve file from the provided file system. + * PathParams returns path parameter values. */ - fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo - } - interface Echo { + pathParams(): PathParams /** - * File registers a new route with path to serve a static file with optional route-level middleware. Panics on error. + * SetPathParams sets path parameters for current request. */ - file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo - } - interface Echo { + setPathParams(params: PathParams): void /** - * AddRoute registers a new Route with default host Router + * QueryParam returns the query param for the provided name. */ - addRoute(route: Routable): RouteInfo - } - interface Echo { + queryParam(name: string): string /** - * Add registers a new route for an HTTP method and path with matching handler - * in the router with optional route-level middleware. + * QueryParamDefault returns the query param or default value for the provided name. */ - add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo - } - interface Echo { + queryParamDefault(name: string, defaultValue: string): string /** - * Host creates a new router group for the provided host and optional host-level middleware. + * QueryParams returns the query parameters as `url.Values`. */ - host(name: string, ...m: MiddlewareFunc[]): (Group) - } - interface Echo { + queryParams(): url.Values /** - * Group creates a new router group with prefix and optional group-level middleware. + * QueryString returns the URL query string. */ - group(prefix: string, ...m: MiddlewareFunc[]): (Group) - } - interface Echo { + queryString(): string /** - * AcquireContext returns an empty `Context` instance from the pool. - * You must return the context by calling `ReleaseContext()`. + * FormValue returns the form field value for the provided name. */ - acquireContext(): Context - } - interface Echo { + formValue(name: string): string /** - * ReleaseContext returns the `Context` instance back to the pool. - * You must call it after `AcquireContext()`. + * FormValueDefault returns the form field value or default value for the provided name. */ - releaseContext(c: Context): void - } - interface Echo { + formValueDefault(name: string, defaultValue: string): string /** - * ServeHTTP implements `http.Handler` interface, which serves HTTP requests. + * FormValues returns the form field values as `url.Values`. */ - serveHTTP(w: http.ResponseWriter, r: http.Request): void - } - interface Echo { + formValues(): url.Values /** - * Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by - * sending os.Interrupt signal with `ctrl+c`. - * - * Note: this method is created for use in examples/demos and is deliberately simple without providing configuration - * options. - * - * In need of customization use: - * - * ``` - * sc := echo.StartConfig{Address: ":8080"} - * if err := sc.Start(e); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * ``` - * - * // or standard library `http.Server` - * - * ``` - * s := http.Server{Addr: ":8080", Handler: e} - * if err := s.ListenAndServe(); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * ``` + * FormFile returns the multipart form file for the provided name. */ - start(address: string): void - } -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Reader reads bytes from a blob. - * It implements io.ReadSeekCloser, and must be closed after - * reads are finished. - */ - interface Reader { - } - interface Reader { + formFile(name: string): (multipart.FileHeader) /** - * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + * MultipartForm returns the multipart form. */ - read(p: string|Array): number - } - interface Reader { + multipartForm(): (multipart.Form) /** - * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + * Cookie returns the named cookie provided in the request. */ - seek(offset: number, whence: number): number - } - interface Reader { + cookie(name: string): (http.Cookie) /** - * Close implements io.Closer (https://golang.org/pkg/io/#Closer). + * SetCookie adds a `Set-Cookie` header in HTTP response. */ - close(): void - } - interface Reader { + setCookie(cookie: http.Cookie): void /** - * ContentType returns the MIME type of the blob. + * Cookies returns the HTTP cookies sent with the request. */ - contentType(): string - } - interface Reader { + cookies(): Array<(http.Cookie | undefined)> /** - * ModTime returns the time the blob was last modified. + * Get retrieves data from the context. */ - modTime(): time.Time + get(key: string): { } - interface Reader { /** - * Size returns the size of the blob content in bytes. + * Set saves data in the context. */ - size(): number - } - interface Reader { + set(key: string, val: { + }): void /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * Bind binds path params, query params and the request body into provided type `i`. The default binder + * binds body based on Content-Type header. */ - as(i: { - }): boolean - } - interface Reader { + bind(i: { + }): void /** - * WriteTo reads from r and writes to w until there's no more data or - * an error occurs. - * The return value is the number of bytes written to w. - * - * It implements the io.WriterTo interface. + * Validate validates provided `i`. It is usually called after `Context#Bind()`. + * Validator must be registered using `Echo#Validator`. */ - writeTo(w: io.Writer): number - } - /** - * Attributes contains attributes about a blob. - */ - interface Attributes { + validate(i: { + }): void /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + * Render renders a template with data and sends a text/html response with status + * code. Renderer must be registered using `Echo.Renderer`. */ - cacheControl: string + render(code: number, name: string, data: { + }): void /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + * HTML sends an HTTP response with status code. */ - contentDisposition: string + html(code: number, html: string): void /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + * HTMLBlob sends an HTTP blob response with status code. */ - contentEncoding: string + htmlBlob(code: number, b: string|Array): void /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language + * String sends a string response with status code. */ - contentLanguage: string + string(code: number, s: string): void /** - * ContentType is the MIME type of the blob. It will not be empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type + * JSON sends a JSON response with status code. */ - contentType: string + json(code: number, i: { + }): void /** - * Metadata holds key/value pairs associated with the blob. - * Keys are guaranteed to be in lowercase, even if the backend service - * has case-sensitive keys (although note that Metadata written via - * this package will always be lowercased). If there are duplicate - * case-insensitive keys (e.g., "foo" and "FOO"), only one value - * will be kept, and it is undefined which one. + * JSONPretty sends a pretty-print JSON with status code. */ - metadata: _TygojaDict + jsonPretty(code: number, i: { + }, indent: string): void /** - * CreateTime is the time the blob was created, if available. If not available, - * CreateTime will be the zero time. + * JSONBlob sends a JSON blob response with status code. */ - createTime: time.Time + jsonBlob(code: number, b: string|Array): void /** - * ModTime is the time the blob was last modified. + * JSONP sends a JSONP response with status code. It uses `callback` to construct + * the JSONP payload. */ - modTime: time.Time + jsonp(code: number, callback: string, i: { + }): void /** - * Size is the size of the blob's content in bytes. + * JSONPBlob sends a JSONP blob response with status code. It uses `callback` + * to construct the JSONP payload. */ - size: number + jsonpBlob(code: number, callback: string, b: string|Array): void /** - * MD5 is an MD5 hash of the blob contents or nil if not available. + * XML sends an XML response with status code. */ - md5: string|Array + xml(code: number, i: { + }): void /** - * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + * XMLPretty sends a pretty-print XML with status code. */ - eTag: string - } - interface Attributes { + xmlPretty(code: number, i: { + }, indent: string): void /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * XMLBlob sends an XML blob response with status code. */ - as(i: { - }): boolean - } - /** - * ListObject represents a single blob returned from List. - */ - interface ListObject { + xmlBlob(code: number, b: string|Array): void /** - * Key is the key for this blob. + * Blob sends a blob response with status code and content type. */ - key: string + blob(code: number, contentType: string, b: string|Array): void /** - * ModTime is the time the blob was last modified. + * Stream sends a streaming response with status code and content type. */ - modTime: time.Time + stream(code: number, contentType: string, r: io.Reader): void /** - * Size is the size of the blob's content in bytes. + * File sends a response with the content of the file. */ - size: number + file(file: string): void /** - * MD5 is an MD5 hash of the blob contents or nil if not available. + * FileFS sends a response with the content of the file from given filesystem. */ - md5: string|Array + fileFS(file: string, filesystem: fs.FS): void /** - * IsDir indicates that this result represents a "directory" in the - * hierarchical namespace, ending in ListOptions.Delimiter. Key can be - * passed as ListOptions.Prefix to list items in the "directory". - * Fields other than Key and IsDir will not be set if IsDir is true. + * Attachment sends a response as attachment, prompting client to save the + * file. */ - isDir: boolean - } - interface ListObject { + attachment(file: string, name: string): void /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. + * Inline sends a response as inline, opening the file in the browser. */ - as(i: { - }): boolean - } -} - -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * TxOptions holds the transaction options to be used in [DB.BeginTx]. - */ - interface TxOptions { + inline(file: string, name: string): void /** - * Isolation is the transaction isolation level. - * If zero, the driver or database's default level is used. + * NoContent sends a response with no body and a status code. */ - isolation: IsolationLevel - readOnly: boolean + noContent(code: number): void + /** + * Redirect redirects the request to a provided URL with status code. + */ + redirect(code: number, url: string): void + /** + * Error invokes the registered global HTTP error handler. Generally used by middleware. + * A side-effect of calling global error handler is that now Response has been committed (sent to the client) and + * middlewares up in chain can not change Response status code or Response body anymore. + * + * Avoid using this method in handlers as no middleware will be able to effectively handle errors after that. + * Instead of calling this method in handler return your error and let it be handled by middlewares or global error handler. + */ + error(err: Error): void + /** + * Echo returns the `Echo` instance. + * + * WARNING: Remember that Echo public fields and methods are coroutine safe ONLY when you are NOT mutating them + * anywhere in your code after Echo server has started. + */ + echo(): (Echo) } + // @ts-ignore + import stdContext = context /** - * DB is a database handle representing a pool of zero or more - * underlying connections. It's safe for concurrent use by multiple - * goroutines. + * Echo is the top-level framework instance. * - * The sql package creates and frees connections automatically; it - * also maintains a free pool of idle connections. If the database has - * a concept of per-connection state, such state can be reliably observed - * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the - * returned [Tx] is bound to a single connection. Once [Tx.Commit] or - * [Tx.Rollback] is called on the transaction, that transaction's - * connection is returned to [DB]'s idle connection pool. The pool size - * can be controlled with [DB.SetMaxIdleConns]. + * Goroutine safety: Do not mutate Echo instance fields after server has started. Accessing these + * fields from handlers/middlewares and changing field values at the same time leads to data-races. + * Same rule applies to adding new routes after server has been started - Adding a route is not Goroutine safe action. */ - interface DB { - } - interface DB { + interface Echo { /** - * PingContext verifies a connection to the database is still alive, - * establishing a connection if necessary. + * NewContextFunc allows using custom context implementations, instead of default *echo.context */ - pingContext(ctx: context.Context): void - } - interface DB { + newContextFunc: (e: Echo, pathParamAllocSize: number) => ServableContext + debug: boolean + httpErrorHandler: HTTPErrorHandler + binder: Binder + jsonSerializer: JSONSerializer + validator: Validator + renderer: Renderer + logger: Logger + ipExtractor: IPExtractor /** - * Ping verifies a connection to the database is still alive, - * establishing a connection if necessary. + * Filesystem is file system used by Static and File handlers to access files. + * Defaults to os.DirFS(".") * - * Ping uses [context.Background] internally; to specify the context, use - * [DB.PingContext]. + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - ping(): void - } - interface DB { + filesystem: fs.FS /** - * Close closes the database and prevents new queries from starting. - * Close then waits for all queries that have started processing on the server - * to finish. - * - * It is rare to Close a [DB], as the [DB] handle is meant to be - * long-lived and shared between many goroutines. + * OnAddRoute is called when Echo adds new route to specific host router. Handler is called for every router + * and before route is added to the host router. */ - close(): void + onAddRoute: (host: string, route: Routable) => void } - interface DB { + /** + * HandlerFunc defines a function to serve HTTP requests. + */ + interface HandlerFunc {(c: Context): void } + /** + * MiddlewareFunc defines a function to process middleware. + */ + interface MiddlewareFunc {(next: HandlerFunc): HandlerFunc } + interface Echo { /** - * SetMaxIdleConns sets the maximum number of connections in the idle - * connection pool. - * - * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, - * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. - * - * If n <= 0, no idle connections are retained. + * NewContext returns a new Context instance. * - * The default max idle connections is currently 2. This may change in - * a future release. + * Note: both request and response can be left to nil as Echo.ServeHTTP will call c.Reset(req,resp) anyway + * these arguments are useful when creating context for tests and cases like that. */ - setMaxIdleConns(n: number): void + newContext(r: http.Request, w: http.ResponseWriter): Context } - interface DB { + interface Echo { /** - * SetMaxOpenConns sets the maximum number of open connections to the database. - * - * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than - * MaxIdleConns, then MaxIdleConns will be reduced to match the new - * MaxOpenConns limit. - * - * If n <= 0, then there is no limit on the number of open connections. - * The default is 0 (unlimited). + * Router returns the default router. */ - setMaxOpenConns(n: number): void + router(): Router } - interface DB { + interface Echo { /** - * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's age. + * Routers returns the new map of host => router. */ - setConnMaxLifetime(d: time.Duration): void + routers(): _TygojaDict } - interface DB { + interface Echo { /** - * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's idle time. + * RouterFor returns Router for given host. When host is left empty the default router is returned. */ - setConnMaxIdleTime(d: time.Duration): void + routerFor(host: string): [Router, boolean] } - interface DB { + interface Echo { /** - * Stats returns database statistics. + * ResetRouterCreator resets callback for creating new router instances. + * Note: current (default) router is immediately replaced with router created with creator func and vhost routers are cleared. */ - stats(): DBStats + resetRouterCreator(creator: (e: Echo) => Router): void } - interface DB { + interface Echo { /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. + * Pre adds middleware to the chain which is run before router tries to find matching route. + * Meaning middleware is executed even for 404 (not found) cases. */ - prepareContext(ctx: context.Context, query: string): (Stmt) + pre(...middleware: MiddlewareFunc[]): void } - interface DB { + interface Echo { /** - * Prepare creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * Prepare uses [context.Background] internally; to specify the context, use - * [DB.PrepareContext]. + * Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed. */ - prepare(query: string): (Stmt) + use(...middleware: MiddlewareFunc[]): void } - interface DB { + interface Echo { /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. + * CONNECT registers a new CONNECT route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result + connect(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * Exec executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - * - * Exec uses [context.Background] internally; to specify the context, use - * [DB.ExecContext]. + * DELETE registers a new DELETE route for a path with matching handler in the router + * with optional route-level middleware. Panics on error. */ - exec(query: string, ...args: any[]): Result + delete(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. + * GET registers a new GET route for a path with matching handler in the router + * with optional route-level middleware. Panics on error. */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + get(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * Query executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - * - * Query uses [context.Background] internally; to specify the context, use - * [DB.QueryContext]. + * HEAD registers a new HEAD route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - query(query: string, ...args: any[]): (Rows) + head(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. + * OPTIONS registers a new OPTIONS route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + options(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [DB.QueryRowContext]. + * PATCH registers a new PATCH route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - queryRow(query: string, ...args: any[]): (Row) + patch(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. + * POST registers a new POST route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) + post(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * Begin starts a transaction. The default isolation level is dependent on - * the driver. - * - * Begin uses [context.Background] internally; to specify the context, use - * [DB.BeginTx]. + * PUT registers a new PUT route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - begin(): (Tx) + put(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * Driver returns the database's underlying driver. + * TRACE registers a new TRACE route for a path with matching handler in the + * router with optional route-level middleware. Panics on error. */ - driver(): any + trace(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface DB { + interface Echo { /** - * Conn returns a single connection by either opening a new connection - * or returning an existing connection from the connection pool. Conn will - * block until either a connection is returned or ctx is canceled. - * Queries run on the same Conn will be run in the same database session. + * RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) + * for current request URL. + * Path supports static and named/any parameters just like other http method is defined. Generally path is ended with + * wildcard/match-any character (`/*`, `/download/*` etc). * - * Every Conn must be returned to the database pool after use by - * calling [Conn.Close]. + * Example: `e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })` */ - conn(ctx: context.Context): (Conn) - } - /** - * Tx is an in-progress database transaction. - * - * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. - * - * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the - * transaction fail with [ErrTxDone]. - * - * The statements prepared for a transaction by calling - * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed - * by the call to [Tx.Commit] or [Tx.Rollback]. - */ - interface Tx { + routeNotFound(path: string, h: HandlerFunc, ...m: MiddlewareFunc[]): RouteInfo } - interface Tx { + interface Echo { /** - * Commit commits the transaction. + * Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler + * in the router with optional route-level middleware. + * + * Note: this method only adds specific set of supported HTTP methods as handler and is not true + * "catch-any-arbitrary-method" way of matching requests. */ - commit(): void + any(path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Tx { + interface Echo { /** - * Rollback aborts the transaction. + * Match registers a new route for multiple HTTP methods and path with matching + * handler in the router with optional route-level middleware. Panics on error. */ - rollback(): void + match(methods: Array, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): Routes } - interface Tx { + interface Echo { /** - * PrepareContext creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. - * - * The provided context will be used for the preparation of the context, not - * for the execution of the returned statement. The returned statement - * will run in the transaction context. + * Static registers a new route with path prefix to serve static files from the provided root directory. */ - prepareContext(ctx: context.Context, query: string): (Stmt) + static(pathPrefix: string, fsRoot: string): RouteInfo } - interface Tx { + interface Echo { /** - * Prepare creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. + * StaticFS registers a new route with path prefix to serve static files from the provided file system. * - * Prepare uses [context.Background] internally; to specify the context, use - * [Tx.PrepareContext]. + * When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary + * prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths + * including `assets/images` as their prefix. */ - prepare(query: string): (Stmt) + staticFS(pathPrefix: string, filesystem: fs.FS): RouteInfo } - interface Tx { + interface Echo { /** - * StmtContext returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) - * ``` - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. + * FileFS registers a new route with path to serve file from the provided file system. */ - stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) + fileFS(path: string, file: string, filesystem: fs.FS, ...m: MiddlewareFunc[]): RouteInfo } - interface Tx { + interface Echo { /** - * Stmt returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) - * ``` - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * Stmt uses [context.Background] internally; to specify the context, use - * [Tx.StmtContext]. + * File registers a new route with path to serve a static file with optional route-level middleware. Panics on error. */ - stmt(stmt: Stmt): (Stmt) + file(path: string, file: string, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Tx { + interface Echo { /** - * ExecContext executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. + * AddRoute registers a new Route with default host Router */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result + addRoute(route: Routable): RouteInfo } - interface Tx { + interface Echo { /** - * Exec executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Tx.ExecContext]. - */ - exec(query: string, ...args: any[]): Result - } - interface Tx { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface Tx { - /** - * Query executes a query that returns rows, typically a SELECT. - * - * Query uses [context.Background] internally; to specify the context, use - * [Tx.QueryContext]. + * Add registers a new route for an HTTP method and path with matching handler + * in the router with optional route-level middleware. */ - query(query: string, ...args: any[]): (Rows) + add(method: string, path: string, handler: HandlerFunc, ...middleware: MiddlewareFunc[]): RouteInfo } - interface Tx { + interface Echo { /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * Host creates a new router group for the provided host and optional host-level middleware. */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + host(name: string, ...m: MiddlewareFunc[]): (Group) } - interface Tx { + interface Echo { /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Tx.QueryRowContext]. + * Group creates a new router group with prefix and optional group-level middleware. */ - queryRow(query: string, ...args: any[]): (Row) - } - /** - * Stmt is a prepared statement. - * A Stmt is safe for concurrent use by multiple goroutines. - * - * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single - * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will - * become unusable and all operations will return an error. - * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the - * [DB]. When the Stmt needs to execute on a new underlying connection, it will - * prepare itself on the new connection automatically. - */ - interface Stmt { + group(prefix: string, ...m: MiddlewareFunc[]): (Group) } - interface Stmt { + interface Echo { /** - * ExecContext executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. + * AcquireContext returns an empty `Context` instance from the pool. + * You must return the context by calling `ReleaseContext()`. */ - execContext(ctx: context.Context, ...args: any[]): Result + acquireContext(): Context } - interface Stmt { + interface Echo { /** - * Exec executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Stmt.ExecContext]. + * ReleaseContext returns the `Context` instance back to the pool. + * You must call it after `AcquireContext()`. */ - exec(...args: any[]): Result + releaseContext(c: Context): void } - interface Stmt { + interface Echo { /** - * QueryContext executes a prepared query statement with the given arguments - * and returns the query results as a [*Rows]. + * ServeHTTP implements `http.Handler` interface, which serves HTTP requests. */ - queryContext(ctx: context.Context, ...args: any[]): (Rows) + serveHTTP(w: http.ResponseWriter, r: http.Request): void } - interface Stmt { + interface Echo { /** - * Query executes a prepared query statement with the given arguments - * and returns the query results as a *Rows. + * Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by + * sending os.Interrupt signal with `ctrl+c`. * - * Query uses [context.Background] internally; to specify the context, use - * [Stmt.QueryContext]. - */ - query(...args: any[]): (Rows) - } - interface Stmt { - /** - * QueryRowContext executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, ...args: any[]): (Row) - } - interface Stmt { - /** - * QueryRow executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. + * Note: this method is created for use in examples/demos and is deliberately simple without providing configuration + * options. * - * Example usage: + * In need of customization use: * * ``` - * var name string - * err := nameByUseridStmt.QueryRow(id).Scan(&name) + * sc := echo.StartConfig{Address: ":8080"} + * if err := sc.Start(e); err != http.ErrServerClosed { + * log.Fatal(err) + * } * ``` * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Stmt.QueryRowContext]. - */ - queryRow(...args: any[]): (Row) - } - interface Stmt { - /** - * Close closes the statement. - */ - close(): void - } - /** - * Rows is the result of a query. Its cursor starts before the first row - * of the result set. Use [Rows.Next] to advance from row to row. - */ - interface Rows { - } - interface Rows { - /** - * Next prepares the next result row for reading with the [Rows.Scan] method. It - * returns true on success, or false if there is no next result row or an error - * happened while preparing it. [Rows.Err] should be consulted to distinguish between - * the two cases. - * - * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. - */ - next(): boolean - } - interface Rows { - /** - * NextResultSet prepares the next result set for reading. It reports whether - * there is further result sets, or false if there is no further result set - * or if there is an error advancing to it. The [Rows.Err] method should be consulted - * to distinguish between the two cases. - * - * After calling NextResultSet, the [Rows.Next] method should always be called before - * scanning. If there are further result sets they may not have rows in the result - * set. - */ - nextResultSet(): boolean - } - interface Rows { - /** - * Err returns the error, if any, that was encountered during iteration. - * Err may be called after an explicit or implicit [Rows.Close]. - */ - err(): void - } - interface Rows { - /** - * Columns returns the column names. - * Columns returns an error if the rows are closed. - */ - columns(): Array - } - interface Rows { - /** - * ColumnTypes returns column information such as column type, length, - * and nullable. Some information may not be available from some drivers. - */ - columnTypes(): Array<(ColumnType | undefined)> - } - interface Rows { - /** - * Scan copies the columns in the current row into the values pointed - * at by dest. The number of values in dest must be the same as the - * number of columns in [Rows]. - * - * Scan converts columns read from the database into the following - * common Go types and special types provided by the sql package: + * // or standard library `http.Server` * * ``` - * *string - * *[]byte - * *int, *int8, *int16, *int32, *int64 - * *uint, *uint8, *uint16, *uint32, *uint64 - * *bool - * *float32, *float64 - * *interface{} - * *RawBytes - * *Rows (cursor value) - * any type implementing Scanner (see Scanner docs) + * s := http.Server{Addr: ":8080", Handler: e} + * if err := s.ListenAndServe(); err != http.ErrServerClosed { + * log.Fatal(err) + * } * ``` - * - * In the most simple case, if the type of the value from the source - * column is an integer, bool or string type T and dest is of type *T, - * Scan simply assigns the value through the pointer. - * - * Scan also converts between string and numeric types, as long as no - * information would be lost. While Scan stringifies all numbers - * scanned from numeric database columns into *string, scans into - * numeric types are checked for overflow. For example, a float64 with - * value 300 or a string with value "300" can scan into a uint16, but - * not into a uint8, though float64(255) or "255" can scan into a - * uint8. One exception is that scans of some float64 numbers to - * strings may lose information when stringifying. In general, scan - * floating point columns into *float64. - * - * If a dest argument has type *[]byte, Scan saves in that argument a - * copy of the corresponding data. The copy is owned by the caller and - * can be modified and held indefinitely. The copy can be avoided by - * using an argument of type [*RawBytes] instead; see the documentation - * for [RawBytes] for restrictions on its use. - * - * If an argument has type *interface{}, Scan copies the value - * provided by the underlying driver without conversion. When scanning - * from a source value of type []byte to *interface{}, a copy of the - * slice is made and the caller owns the result. - * - * Source values of type [time.Time] may be scanned into values of type - * *time.Time, *interface{}, *string, or *[]byte. When converting to - * the latter two, [time.RFC3339Nano] is used. - * - * Source values of type bool may be scanned into types *bool, - * *interface{}, *string, *[]byte, or [*RawBytes]. - * - * For scanning into *bool, the source may be true, false, 1, 0, or - * string inputs parseable by [strconv.ParseBool]. - * - * Scan can also convert a cursor returned from a query, such as - * "select cursor(select * from my_table) from dual", into a - * [*Rows] value that can itself be scanned from. The parent - * select query will close any cursor [*Rows] if the parent [*Rows] is closed. - * - * If any of the first arguments implementing [Scanner] returns an error, - * that error will be wrapped in the returned error. */ - scan(...dest: any[]): void + start(address: string): void } - interface Rows { +} + +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions [Command] and [LookPath] look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run [LookPath]("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * These will not find and run ./prog or .\prog.exe, + * no matter how the current path is configured. + * + * Code that always wants to run a program from the current directory + * can be rewritten to say "./prog" instead of "prog". + * + * Code that insists on including results from relative path entries + * can instead override the error using an errors.Is check: + * + * ``` + * path, err := exec.LookPath("prog") + * if errors.Is(err, exec.ErrDot) { + * err = nil + * } + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if errors.Is(cmd.Err, exec.ErrDot) { + * cmd.Err = nil + * } + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * Setting the environment variable GODEBUG=execerrdot=0 + * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 + * behavior for programs that are unable to apply more targeted fixes. + * A future version of Go may remove support for this variable. + * + * Before adding such overrides, make sure you understand the + * security implications of doing so. + * See https://go.dev/blog/path-security for more information. + */ +namespace exec { + /** + * Cmd represents an external command being prepared or run. + * + * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] + * methods. + */ + interface Cmd { + /** + * Path is the path of the command to run. + * + * This is the only field that must be set to a non-zero + * value. If Path is relative, it is evaluated relative + * to Dir. + */ + path: string + /** + * Args holds command line arguments, including the command as Args[0]. + * If the Args field is empty or nil, Run uses {Path}. + * + * In typical use, both Path and Args are set by calling Command. + */ + args: Array + /** + * Env specifies the environment of the process. + * Each entry is of the form "key=value". + * If Env is nil, the new process uses the current process's + * environment. + * If Env contains duplicate environment keys, only the last + * value in the slice for each duplicate key is used. + * As a special case on Windows, SYSTEMROOT is always added if + * missing and not explicitly set to the empty string. + */ + env: Array + /** + * Dir specifies the working directory of the command. + * If Dir is the empty string, Run runs the command in the + * calling process's current directory. + */ + dir: string + /** + * Stdin specifies the process's standard input. + * + * If Stdin is nil, the process reads from the null device (os.DevNull). + * + * If Stdin is an *os.File, the process's standard input is connected + * directly to that file. + * + * Otherwise, during the execution of the command a separate + * goroutine reads from Stdin and delivers that data to the command + * over a pipe. In this case, Wait does not complete until the goroutine + * stops copying, either because it has reached the end of Stdin + * (EOF or a read error), or because writing to the pipe returned an error, + * or because a nonzero WaitDelay was set and expired. + */ + stdin: io.Reader + /** + * Stdout and Stderr specify the process's standard output and error. + * + * If either is nil, Run connects the corresponding file descriptor + * to the null device (os.DevNull). + * + * If either is an *os.File, the corresponding output from the process + * is connected directly to that file. + * + * Otherwise, during the execution of the command a separate goroutine + * reads from the process over a pipe and delivers that data to the + * corresponding Writer. In this case, Wait does not complete until the + * goroutine reaches EOF or encounters an error or a nonzero WaitDelay + * expires. + * + * If Stdout and Stderr are the same writer, and have a type that can + * be compared with ==, at most one goroutine at a time will call Write. + */ + stdout: io.Writer + stderr: io.Writer + /** + * ExtraFiles specifies additional open files to be inherited by the + * new process. It does not include standard input, standard output, or + * standard error. If non-nil, entry i becomes file descriptor 3+i. + * + * ExtraFiles is not supported on Windows. + */ + extraFiles: Array<(os.File | undefined)> + /** + * SysProcAttr holds optional, operating system-specific attributes. + * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. + */ + sysProcAttr?: syscall.SysProcAttr + /** + * Process is the underlying process, once started. + */ + process?: os.Process + /** + * ProcessState contains information about an exited process. + * If the process was started successfully, Wait or Run will + * populate its ProcessState when the command completes. + */ + processState?: os.ProcessState + err: Error // LookPath error, if any. + /** + * If Cancel is non-nil, the command must have been created with + * CommandContext and Cancel will be called when the command's + * Context is done. By default, CommandContext sets Cancel to + * call the Kill method on the command's Process. + * + * Typically a custom Cancel will send a signal to the command's + * Process, but it may instead take other actions to initiate cancellation, + * such as closing a stdin or stdout pipe or sending a shutdown request on a + * network socket. + * + * If the command exits with a success status after Cancel is + * called, and Cancel does not return an error equivalent to + * os.ErrProcessDone, then Wait and similar methods will return a non-nil + * error: either an error wrapping the one returned by Cancel, + * or the error from the Context. + * (If the command exits with a non-success status, or Cancel + * returns an error that wraps os.ErrProcessDone, Wait and similar methods + * continue to return the command's usual exit status.) + * + * If Cancel is set to nil, nothing will happen immediately when the command's + * Context is done, but a nonzero WaitDelay will still take effect. That may + * be useful, for example, to work around deadlocks in commands that do not + * support shutdown signals but are expected to always finish quickly. + * + * Cancel will not be called if Start returns a non-nil error. + */ + cancel: () => void + /** + * If WaitDelay is non-zero, it bounds the time spent waiting on two sources + * of unexpected delay in Wait: a child process that fails to exit after the + * associated Context is canceled, and a child process that exits but leaves + * its I/O pipes unclosed. + * + * The WaitDelay timer starts when either the associated Context is done or a + * call to Wait observes that the child process has exited, whichever occurs + * first. When the delay has elapsed, the command shuts down the child process + * and/or its I/O pipes. + * + * If the child process has failed to exit — perhaps because it ignored or + * failed to receive a shutdown signal from a Cancel function, or because no + * Cancel function was set — then it will be terminated using os.Process.Kill. + * + * Then, if the I/O pipes communicating with the child process are still open, + * those pipes are closed in order to unblock any goroutines currently blocked + * on Read or Write calls. + * + * If pipes are closed due to WaitDelay, no Cancel call has occurred, + * and the command has otherwise exited with a successful status, Wait and + * similar methods will return ErrWaitDelay instead of nil. + * + * If WaitDelay is zero (the default), I/O pipes will be read until EOF, + * which might not occur until orphaned subprocesses of the command have + * also closed their descriptors for the pipes. + */ + waitDelay: time.Duration + } + interface Cmd { + /** + * String returns a human-readable description of c. + * It is intended only for debugging. + * In particular, it is not suitable for use as input to a shell. + * The output of String may vary across Go releases. + */ + string(): string + } + interface Cmd { + /** + * Run starts the specified command and waits for it to complete. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command starts but does not complete successfully, the error is of + * type [*ExitError]. Other error types may be returned for other situations. + * + * If the calling goroutine has locked the operating system thread + * with [runtime.LockOSThread] and modified any inheritable OS-level + * thread state (for example, Linux or Plan 9 name spaces), the new + * process will inherit the caller's thread state. + */ + run(): void + } + interface Cmd { + /** + * Start starts the specified command but does not wait for it to complete. + * + * If Start returns successfully, the c.Process field will be set. + * + * After a successful call to Start the [Cmd.Wait] method must be called in + * order to release associated system resources. + */ + start(): void + } + interface Cmd { + /** + * Wait waits for the command to exit and waits for any copying to + * stdin or copying from stdout or stderr to complete. + * + * The command must have been started by [Cmd.Start]. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command fails to run or doesn't complete successfully, the + * error is of type [*ExitError]. Other error types may be + * returned for I/O problems. + * + * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits + * for the respective I/O loop copying to or from the process to complete. + * + * Wait releases any resources associated with the [Cmd]. + */ + wait(): void + } + interface Cmd { + /** + * Output runs the command and returns its standard output. + * Any returned error will usually be of type [*ExitError]. + * If c.Stderr was nil, Output populates [ExitError.Stderr]. + */ + output(): string|Array + } + interface Cmd { + /** + * CombinedOutput runs the command and returns its combined standard + * output and standard error. + */ + combinedOutput(): string|Array + } + interface Cmd { + /** + * StdinPipe returns a pipe that will be connected to the command's + * standard input when the command starts. + * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. + * A caller need only call Close to force the pipe to close sooner. + * For example, if the command being run will not exit until standard input + * is closed, the caller must close the pipe. + */ + stdinPipe(): io.WriteCloser + } + interface Cmd { + /** + * StdoutPipe returns a pipe that will be connected to the command's + * standard output when the command starts. + * + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. + * See the example for idiomatic usage. + */ + stdoutPipe(): io.ReadCloser + } + interface Cmd { + /** + * StderrPipe returns a pipe that will be connected to the command's + * standard error when the command starts. + * + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. + * See the StdoutPipe example for idiomatic usage. + */ + stderrPipe(): io.ReadCloser + } + interface Cmd { + /** + * Environ returns a copy of the environment in which the command would be run + * as it is currently configured. + */ + environ(): Array + } +} + +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { + /** + * Reader reads bytes from a blob. + * It implements io.ReadSeekCloser, and must be closed after + * reads are finished. + */ + interface Reader { + } + interface Reader { /** - * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called - * and returns false and there are no further result sets, - * the [Rows] are closed automatically and it will suffice to check the - * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. + * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + */ + read(p: string|Array): number + } + interface Reader { + /** + * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * Close implements io.Closer (https://golang.org/pkg/io/#Closer). */ close(): void } - /** - * A Result summarizes an executed SQL command. - */ - interface Result { - [key:string]: any; + interface Reader { /** - * LastInsertId returns the integer generated by the database - * in response to a command. Typically this will be from an - * "auto increment" column when inserting a new row. Not all - * databases support this feature, and the syntax of such - * statements varies. + * ContentType returns the MIME type of the blob. */ - lastInsertId(): number + contentType(): string + } + interface Reader { /** - * RowsAffected returns the number of rows affected by an - * update, insert, or delete. Not every database or database - * driver may support this. + * ModTime returns the time the blob was last modified. */ - rowsAffected(): number + modTime(): time.Time } -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - /** - * Settings defines common app configuration options. - */ - interface Settings { - meta: MetaConfig - logs: LogsConfig - smtp: SmtpConfig - s3: S3Config - backups: BackupsConfig - adminAuthToken: TokenConfig - adminPasswordResetToken: TokenConfig - adminFileToken: TokenConfig - recordAuthToken: TokenConfig - recordPasswordResetToken: TokenConfig - recordEmailChangeToken: TokenConfig - recordVerificationToken: TokenConfig - recordFileToken: TokenConfig + interface Reader { /** - * Deprecated: Will be removed in v0.9+ + * Size returns the size of the blob content in bytes. */ - emailAuth: EmailAuthConfig - googleAuth: AuthProviderConfig - facebookAuth: AuthProviderConfig - githubAuth: AuthProviderConfig - gitlabAuth: AuthProviderConfig - discordAuth: AuthProviderConfig - twitterAuth: AuthProviderConfig - microsoftAuth: AuthProviderConfig - spotifyAuth: AuthProviderConfig - kakaoAuth: AuthProviderConfig - twitchAuth: AuthProviderConfig - stravaAuth: AuthProviderConfig - giteeAuth: AuthProviderConfig - livechatAuth: AuthProviderConfig - giteaAuth: AuthProviderConfig - oidcAuth: AuthProviderConfig - oidc2Auth: AuthProviderConfig - oidc3Auth: AuthProviderConfig - appleAuth: AuthProviderConfig - instagramAuth: AuthProviderConfig - vkAuth: AuthProviderConfig - yandexAuth: AuthProviderConfig - patreonAuth: AuthProviderConfig - mailcowAuth: AuthProviderConfig - bitbucketAuth: AuthProviderConfig - planningcenterAuth: AuthProviderConfig + size(): number } - interface Settings { + interface Reader { /** - * Validate makes Settings validatable by implementing [validation.Validatable] interface. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - validate(): void + as(i: { + }): boolean } - interface Settings { + interface Reader { /** - * Merge merges `other` settings into the current one. + * WriteTo reads from r and writes to w until there's no more data or + * an error occurs. + * The return value is the number of bytes written to w. + * + * It implements the io.WriterTo interface. */ - merge(other: Settings): void + writeTo(w: io.Writer): number } - interface Settings { + /** + * Attributes contains attributes about a blob. + */ + interface Attributes { /** - * Clone creates a new deep copy of the current settings. + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control */ - clone(): (Settings) + cacheControl: string + /** + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + */ + contentDisposition: string + /** + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + */ + contentEncoding: string + /** + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language + */ + contentLanguage: string + /** + * ContentType is the MIME type of the blob. It will not be empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type + */ + contentType: string + /** + * Metadata holds key/value pairs associated with the blob. + * Keys are guaranteed to be in lowercase, even if the backend service + * has case-sensitive keys (although note that Metadata written via + * this package will always be lowercased). If there are duplicate + * case-insensitive keys (e.g., "foo" and "FOO"), only one value + * will be kept, and it is undefined which one. + */ + metadata: _TygojaDict + /** + * CreateTime is the time the blob was created, if available. If not available, + * CreateTime will be the zero time. + */ + createTime: time.Time + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string|Array + /** + * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + */ + eTag: string } - interface Settings { + interface Attributes { /** - * RedactClone creates a new deep copy of the current settings, - * while replacing the secret values with `******`. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - redactClone(): (Settings) + as(i: { + }): boolean } - interface Settings { + /** + * ListObject represents a single blob returned from List. + */ + interface ListObject { /** - * NamedAuthProviderConfigs returns a map with all registered OAuth2 - * provider configurations (indexed by their name identifier). + * Key is the key for this blob. */ - namedAuthProviderConfigs(): _TygojaDict + key: string + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string|Array + /** + * IsDir indicates that this result represents a "directory" in the + * hierarchical namespace, ending in ListOptions.Delimiter. Key can be + * passed as ListOptions.Prefix to list items in the "directory". + * Fields other than Key and IsDir will not be set if IsDir is true. + */ + isDir: boolean + } + interface ListObject { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean } } @@ -11493,8 +11409,8 @@ namespace schema { * Package models implements all PocketBase DB models and DTOs. */ namespace models { - type _subtoHHr = BaseModel - interface Admin extends _subtoHHr { + type _subdxrsi = BaseModel + interface Admin extends _subdxrsi { avatar: number email: string tokenKey: string @@ -11529,8 +11445,8 @@ namespace models { } // @ts-ignore import validation = ozzo_validation - type _subeuljo = BaseModel - interface Collection extends _subeuljo { + type _subzAftL = BaseModel + interface Collection extends _subzAftL { name: string type: string system: boolean @@ -11623,8 +11539,8 @@ namespace models { */ setOptions(typedOptions: any): void } - type _subtGzgn = BaseModel - interface ExternalAuth extends _subtGzgn { + type _sublegJO = BaseModel + interface ExternalAuth extends _sublegJO { collectionId: string recordId: string provider: string @@ -11633,8 +11549,8 @@ namespace models { interface ExternalAuth { tableName(): string } - type _subsrBRs = BaseModel - interface Record extends _subsrBRs { + type _subFBhFW = BaseModel + interface Record extends _subFBhFW { } interface Record { /** @@ -12047,6 +11963,90 @@ namespace models { } } +namespace settings { + // @ts-ignore + import validation = ozzo_validation + /** + * Settings defines common app configuration options. + */ + interface Settings { + meta: MetaConfig + logs: LogsConfig + smtp: SmtpConfig + s3: S3Config + backups: BackupsConfig + adminAuthToken: TokenConfig + adminPasswordResetToken: TokenConfig + adminFileToken: TokenConfig + recordAuthToken: TokenConfig + recordPasswordResetToken: TokenConfig + recordEmailChangeToken: TokenConfig + recordVerificationToken: TokenConfig + recordFileToken: TokenConfig + /** + * Deprecated: Will be removed in v0.9+ + */ + emailAuth: EmailAuthConfig + googleAuth: AuthProviderConfig + facebookAuth: AuthProviderConfig + githubAuth: AuthProviderConfig + gitlabAuth: AuthProviderConfig + discordAuth: AuthProviderConfig + twitterAuth: AuthProviderConfig + microsoftAuth: AuthProviderConfig + spotifyAuth: AuthProviderConfig + kakaoAuth: AuthProviderConfig + twitchAuth: AuthProviderConfig + stravaAuth: AuthProviderConfig + giteeAuth: AuthProviderConfig + livechatAuth: AuthProviderConfig + giteaAuth: AuthProviderConfig + oidcAuth: AuthProviderConfig + oidc2Auth: AuthProviderConfig + oidc3Auth: AuthProviderConfig + appleAuth: AuthProviderConfig + instagramAuth: AuthProviderConfig + vkAuth: AuthProviderConfig + yandexAuth: AuthProviderConfig + patreonAuth: AuthProviderConfig + mailcowAuth: AuthProviderConfig + bitbucketAuth: AuthProviderConfig + planningcenterAuth: AuthProviderConfig + } + interface Settings { + /** + * Validate makes Settings validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface Settings { + /** + * Merge merges `other` settings into the current one. + */ + merge(other: Settings): void + } + interface Settings { + /** + * Clone creates a new deep copy of the current settings. + */ + clone(): (Settings) + } + interface Settings { + /** + * RedactClone creates a new deep copy of the current settings, + * while replacing the secret values with `******`. + */ + redactClone(): (Settings) + } + interface Settings { + /** + * NamedAuthProviderConfigs returns a map with all registered OAuth2 + * provider configurations (indexed by their name identifier). + */ + namedAuthProviderConfigs(): _TygojaDict + } +} + /** * Package daos handles common PocketBase DB model manipulations. * @@ -12695,2006 +12695,1981 @@ namespace daos { } } -namespace migrate { +/** + * Package core is the backbone of PocketBase. + * + * It defines the main PocketBase App interface and its base implementation. + */ +namespace core { /** - * MigrationsList defines a list with migration definitions + * App defines the main PocketBase app interface. */ - interface MigrationsList { - } - interface MigrationsList { + interface App { + [key:string]: any; /** - * Item returns a single migration from the list by its index. + * Deprecated: + * This method may get removed in the near future. + * It is recommended to access the app db instance from app.Dao().DB() or + * if you want more flexibility - app.Dao().ConcurrentDB() and app.Dao().NonconcurrentDB(). + * + * DB returns the default app database instance. */ - item(index: number): (Migration) - } - interface MigrationsList { + db(): (dbx.DB) /** - * Items returns the internal migrations list slice. + * Dao returns the default app Dao instance. + * + * This Dao could operate only on the tables and models + * associated with the default app database. For example, + * trying to access the request logs table will result in error. */ - items(): Array<(Migration | undefined)> - } - interface MigrationsList { + dao(): (daos.Dao) /** - * Register adds new migration definition to the list. + * Deprecated: + * This method may get removed in the near future. + * It is recommended to access the logs db instance from app.LogsDao().DB() or + * if you want more flexibility - app.LogsDao().ConcurrentDB() and app.LogsDao().NonconcurrentDB(). * - * If `optFilename` is not provided, it will try to get the name from its .go file. + * LogsDB returns the app logs database instance. + */ + logsDB(): (dbx.DB) + /** + * LogsDao returns the app logs Dao instance. * - * The list will be sorted automatically based on the migrations file name. + * This Dao could operate only on the tables and models + * associated with the logs database. For example, trying to access + * the users table from LogsDao will result in error. */ - register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void - } -} - -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface Command { + logsDao(): (daos.Dao) /** - * GenBashCompletion generates bash completion file and writes to the passed writer. + * Logger returns the active app logger. */ - genBashCompletion(w: io.Writer): void - } - interface Command { + logger(): (slog.Logger) /** - * GenBashCompletionFile generates bash completion file. + * DataDir returns the app data directory path. */ - genBashCompletionFile(filename: string): void - } - interface Command { + dataDir(): string /** - * GenBashCompletionFileV2 generates Bash completion version 2. + * EncryptionEnv returns the name of the app secret env key + * (used for settings encryption). */ - genBashCompletionFileV2(filename: string, includeDesc: boolean): void - } - interface Command { + encryptionEnv(): string /** - * GenBashCompletionV2 generates Bash completion file version 2 - * and writes it to the passed writer. + * IsDev returns whether the app is in dev mode. */ - genBashCompletionV2(w: io.Writer, includeDesc: boolean): void - } - // @ts-ignore - import flag = pflag - /** - * Command is just that, a command for your application. - * E.g. 'go run ...' - 'run' is the command. Cobra requires - * you to define the usage and description as part of your command - * definition to ensure usability. - */ - interface Command { + isDev(): boolean /** - * Use is the one-line usage message. - * Recommended syntax is as follows: - * ``` - * [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. - * ... indicates that you can specify multiple values for the previous argument. - * | indicates mutually exclusive information. You can use the argument to the left of the separator or the - * argument to the right of the separator. You cannot use both arguments in a single use of the command. - * { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are - * optional, they are enclosed in brackets ([ ]). - * ``` - * Example: add [-F file | -D dir]... [-f format] profile + * Settings returns the loaded app settings. */ - use: string + settings(): (settings.Settings) /** - * Aliases is an array of aliases that can be used instead of the first word in Use. + * Deprecated: Use app.Store() instead. */ - aliases: Array + cache(): (store.Store) + /** + * Store returns the app runtime store. + */ + store(): (store.Store) + /** + * SubscriptionsBroker returns the app realtime subscriptions broker instance. + */ + subscriptionsBroker(): (subscriptions.Broker) + /** + * NewMailClient creates and returns a configured app mail client. + */ + newMailClient(): mailer.Mailer + /** + * NewFilesystem creates and returns a configured filesystem.System instance + * for managing regular app files (eg. collection uploads). + * + * NB! Make sure to call Close() on the returned result + * after you are done working with it. + */ + newFilesystem(): (filesystem.System) + /** + * NewBackupsFilesystem creates and returns a configured filesystem.System instance + * for managing app backups. + * + * NB! Make sure to call Close() on the returned result + * after you are done working with it. + */ + newBackupsFilesystem(): (filesystem.System) + /** + * RefreshSettings reinitializes and reloads the stored application settings. + */ + refreshSettings(): void + /** + * IsBootstrapped checks if the application was initialized + * (aka. whether Bootstrap() was called). + */ + isBootstrapped(): boolean + /** + * Bootstrap takes care for initializing the application + * (open db connections, load settings, etc.). + * + * It will call ResetBootstrapState() if the application was already bootstrapped. + */ + bootstrap(): void + /** + * ResetBootstrapState takes care for releasing initialized app resources + * (eg. closing db connections). + */ + resetBootstrapState(): void + /** + * CreateBackup creates a new backup of the current app pb_data directory. + * + * Backups can be stored on S3 if it is configured in app.Settings().Backups. + * + * Please refer to the godoc of the specific CoreApp implementation + * for details on the backup procedures. + */ + createBackup(ctx: context.Context, name: string): void /** - * SuggestFor is an array of command names for which this command will be suggested - - * similar to aliases but only suggests. + * RestoreBackup restores the backup with the specified name and restarts + * the current running application process. + * + * The safely perform the restore it is recommended to have free disk space + * for at least 2x the size of the restored pb_data backup. + * + * Please refer to the godoc of the specific CoreApp implementation + * for details on the restore procedures. + * + * NB! This feature is experimental and currently is expected to work only on UNIX based systems. */ - suggestFor: Array + restoreBackup(ctx: context.Context, name: string): void /** - * Short is the short description shown in the 'help' output. + * Restart restarts the current running application process. + * + * Currently it is relying on execve so it is supported only on UNIX based systems. */ - short: string + restart(): void /** - * The group id under which this subcommand is grouped in the 'help' output of its parent. + * OnBeforeBootstrap hook is triggered before initializing the main + * application resources (eg. before db open and initial settings load). */ - groupID: string + onBeforeBootstrap(): (hook.Hook) /** - * Long is the long message shown in the 'help ' output. + * OnAfterBootstrap hook is triggered after initializing the main + * application resources (eg. after db open and initial settings load). */ - long: string + onAfterBootstrap(): (hook.Hook) /** - * Example is examples of how to use the command. + * OnBeforeServe hook is triggered before serving the internal router (echo), + * allowing you to adjust its options and attach new routes or middlewares. */ - example: string + onBeforeServe(): (hook.Hook) /** - * ValidArgs is list of all valid non-flag arguments that are accepted in shell completions + * OnBeforeApiError hook is triggered right before sending an error API + * response to the client, allowing you to further modify the error data + * or to return a completely different API response. */ - validArgs: Array + onBeforeApiError(): (hook.Hook) /** - * ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. - * It is a dynamic version of using ValidArgs. - * Only one of ValidArgs and ValidArgsFunction can be used for a command. + * OnAfterApiError hook is triggered right after sending an error API + * response to the client. + * It could be used to log the final API error in external services. */ - validArgsFunction: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective] + onAfterApiError(): (hook.Hook) /** - * Expected arguments + * OnTerminate hook is triggered when the app is in the process + * of being terminated (eg. on SIGTERM signal). */ - args: PositionalArgs + onTerminate(): (hook.Hook) /** - * ArgAliases is List of aliases for ValidArgs. - * These are not suggested to the user in the shell completion, - * but accepted if entered manually. + * OnModelBeforeCreate hook is triggered before inserting a new + * model in the DB, allowing you to modify or validate the stored data. + * + * If the optional "tags" list (table names and/or the Collection id for Record models) + * is specified, then all event handlers registered via the created hook + * will be triggered and called only if their event data origin matches the tags. */ - argAliases: Array + onModelBeforeCreate(...tags: string[]): (hook.TaggedHook) /** - * BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. - * For portability with other shells, it is recommended to instead use ValidArgsFunction + * OnModelAfterCreate hook is triggered after successfully + * inserting a new model in the DB. + * + * If the optional "tags" list (table names and/or the Collection id for Record models) + * is specified, then all event handlers registered via the created hook + * will be triggered and called only if their event data origin matches the tags. */ - bashCompletionFunction: string + onModelAfterCreate(...tags: string[]): (hook.TaggedHook) /** - * Deprecated defines, if this command is deprecated and should print this string when used. + * OnModelBeforeUpdate hook is triggered before updating existing + * model in the DB, allowing you to modify or validate the stored data. + * + * If the optional "tags" list (table names and/or the Collection id for Record models) + * is specified, then all event handlers registered via the created hook + * will be triggered and called only if their event data origin matches the tags. */ - deprecated: string + onModelBeforeUpdate(...tags: string[]): (hook.TaggedHook) /** - * Annotations are key/value pairs that can be used by applications to identify or - * group commands or set special options. + * OnModelAfterUpdate hook is triggered after successfully updating + * existing model in the DB. + * + * If the optional "tags" list (table names and/or the Collection id for Record models) + * is specified, then all event handlers registered via the created hook + * will be triggered and called only if their event data origin matches the tags. */ - annotations: _TygojaDict + onModelAfterUpdate(...tags: string[]): (hook.TaggedHook) /** - * Version defines the version for this command. If this value is non-empty and the command does not - * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, - * will print content of the "Version" variable. A shorthand "v" flag will also be added if the - * command does not define one. + * OnModelBeforeDelete hook is triggered before deleting an + * existing model from the DB. + * + * If the optional "tags" list (table names and/or the Collection id for Record models) + * is specified, then all event handlers registered via the created hook + * will be triggered and called only if their event data origin matches the tags. */ - version: string + onModelBeforeDelete(...tags: string[]): (hook.TaggedHook) /** - * The *Run functions are executed in the following order: - * ``` - * * PersistentPreRun() - * * PreRun() - * * Run() - * * PostRun() - * * PersistentPostRun() - * ``` - * All functions get the same args, the arguments after the command name. - * The *PreRun and *PostRun functions will only be executed if the Run function of the current - * command has been declared. + * OnModelAfterDelete hook is triggered after successfully deleting an + * existing model from the DB. * - * PersistentPreRun: children of this command will inherit and execute. + * If the optional "tags" list (table names and/or the Collection id for Record models) + * is specified, then all event handlers registered via the created hook + * will be triggered and called only if their event data origin matches the tags. */ - persistentPreRun: (cmd: Command, args: Array) => void + onModelAfterDelete(...tags: string[]): (hook.TaggedHook) /** - * PersistentPreRunE: PersistentPreRun but returns an error. + * OnMailerBeforeAdminResetPasswordSend hook is triggered right + * before sending a password reset email to an admin, allowing you + * to inspect and customize the email message that is being sent. */ - persistentPreRunE: (cmd: Command, args: Array) => void + onMailerBeforeAdminResetPasswordSend(): (hook.Hook) /** - * PreRun: children of this command will not inherit. + * OnMailerAfterAdminResetPasswordSend hook is triggered after + * admin password reset email was successfully sent. */ - preRun: (cmd: Command, args: Array) => void + onMailerAfterAdminResetPasswordSend(): (hook.Hook) /** - * PreRunE: PreRun but returns an error. + * OnMailerBeforeRecordResetPasswordSend hook is triggered right + * before sending a password reset email to an auth record, allowing + * you to inspect and customize the email message that is being sent. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - preRunE: (cmd: Command, args: Array) => void + onMailerBeforeRecordResetPasswordSend(...tags: string[]): (hook.TaggedHook) /** - * Run: Typically the actual work function. Most commands will only implement this. + * OnMailerAfterRecordResetPasswordSend hook is triggered after + * an auth record password reset email was successfully sent. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - run: (cmd: Command, args: Array) => void + onMailerAfterRecordResetPasswordSend(...tags: string[]): (hook.TaggedHook) /** - * RunE: Run but returns an error. + * OnMailerBeforeRecordVerificationSend hook is triggered right + * before sending a verification email to an auth record, allowing + * you to inspect and customize the email message that is being sent. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - runE: (cmd: Command, args: Array) => void + onMailerBeforeRecordVerificationSend(...tags: string[]): (hook.TaggedHook) /** - * PostRun: run after the Run command. + * OnMailerAfterRecordVerificationSend hook is triggered after a + * verification email was successfully sent to an auth record. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - postRun: (cmd: Command, args: Array) => void + onMailerAfterRecordVerificationSend(...tags: string[]): (hook.TaggedHook) /** - * PostRunE: PostRun but returns an error. + * OnMailerBeforeRecordChangeEmailSend hook is triggered right before + * sending a confirmation new address email to an auth record, allowing + * you to inspect and customize the email message that is being sent. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - postRunE: (cmd: Command, args: Array) => void + onMailerBeforeRecordChangeEmailSend(...tags: string[]): (hook.TaggedHook) /** - * PersistentPostRun: children of this command will inherit and execute after PostRun. + * OnMailerAfterRecordChangeEmailSend hook is triggered after a + * verification email was successfully sent to an auth record. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - persistentPostRun: (cmd: Command, args: Array) => void + onMailerAfterRecordChangeEmailSend(...tags: string[]): (hook.TaggedHook) /** - * PersistentPostRunE: PersistentPostRun but returns an error. + * OnRealtimeConnectRequest hook is triggered right before establishing + * the SSE client connection. */ - persistentPostRunE: (cmd: Command, args: Array) => void + onRealtimeConnectRequest(): (hook.Hook) /** - * FParseErrWhitelist flag parse errors to be ignored + * OnRealtimeDisconnectRequest hook is triggered on disconnected/interrupted + * SSE client connection. */ - fParseErrWhitelist: FParseErrWhitelist + onRealtimeDisconnectRequest(): (hook.Hook) /** - * CompletionOptions is a set of options to control the handling of shell completion + * OnRealtimeBeforeMessageSend hook is triggered right before sending + * an SSE message to a client. + * + * Returning [hook.StopPropagation] will prevent sending the message. + * Returning any other non-nil error will close the realtime connection. */ - completionOptions: CompletionOptions + onRealtimeBeforeMessageSend(): (hook.Hook) /** - * TraverseChildren parses flags on all parents before executing child command. + * OnRealtimeAfterMessageSend hook is triggered right after sending + * an SSE message to a client. */ - traverseChildren: boolean + onRealtimeAfterMessageSend(): (hook.Hook) /** - * Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + * OnRealtimeBeforeSubscribeRequest hook is triggered before changing + * the client subscriptions, allowing you to further validate and + * modify the submitted change. */ - hidden: boolean + onRealtimeBeforeSubscribeRequest(): (hook.Hook) /** - * SilenceErrors is an option to quiet errors down stream. + * OnRealtimeAfterSubscribeRequest hook is triggered after the client + * subscriptions were successfully changed. */ - silenceErrors: boolean + onRealtimeAfterSubscribeRequest(): (hook.Hook) /** - * SilenceUsage is an option to silence usage when an error occurs. + * OnSettingsListRequest hook is triggered on each successful + * API Settings list request. + * + * Could be used to validate or modify the response before + * returning it to the client. */ - silenceUsage: boolean + onSettingsListRequest(): (hook.Hook) /** - * DisableFlagParsing disables the flag parsing. - * If this is true all flags will be passed to the command as arguments. + * OnSettingsBeforeUpdateRequest hook is triggered before each API + * Settings update request (after request data load and before settings persistence). + * + * Could be used to additionally validate the request data or + * implement completely different persistence behavior. */ - disableFlagParsing: boolean + onSettingsBeforeUpdateRequest(): (hook.Hook) /** - * DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - * will be printed by generating docs for this command. + * OnSettingsAfterUpdateRequest hook is triggered after each + * successful API Settings update request. */ - disableAutoGenTag: boolean + onSettingsAfterUpdateRequest(): (hook.Hook) /** - * DisableFlagsInUseLine will disable the addition of [flags] to the usage - * line of a command when printing help or generating docs + * OnFileDownloadRequest hook is triggered before each API File download request. + * + * Could be used to validate or modify the file response before + * returning it to the client. */ - disableFlagsInUseLine: boolean + onFileDownloadRequest(...tags: string[]): (hook.TaggedHook) /** - * DisableSuggestions disables the suggestions based on Levenshtein distance - * that go along with 'unknown command' messages. + * OnFileBeforeTokenRequest hook is triggered before each file + * token API request. + * + * If no token or model was submitted, e.Model and e.Token will be empty, + * allowing you to implement your own custom model file auth implementation. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - disableSuggestions: boolean + onFileBeforeTokenRequest(...tags: string[]): (hook.TaggedHook) /** - * SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - * Must be > 0. + * OnFileAfterTokenRequest hook is triggered after each + * successful file token API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - suggestionsMinimumDistance: number - } - interface Command { + onFileAfterTokenRequest(...tags: string[]): (hook.TaggedHook) /** - * Context returns underlying command context. If command was executed - * with ExecuteContext or the context was set with SetContext, the - * previously set context will be returned. Otherwise, nil is returned. + * OnAdminsListRequest hook is triggered on each API Admins list request. * - * Notice that a call to Execute and ExecuteC will replace a nil context of - * a command with a context.Background, so a background context will be - * returned by Context after one of these functions has been called. + * Could be used to validate or modify the response before returning it to the client. */ - context(): context.Context - } - interface Command { + onAdminsListRequest(): (hook.Hook) /** - * SetContext sets context for the command. This context will be overwritten by - * Command.ExecuteContext or Command.ExecuteContextC. + * OnAdminViewRequest hook is triggered on each API Admin view request. + * + * Could be used to validate or modify the response before returning it to the client. */ - setContext(ctx: context.Context): void - } - interface Command { + onAdminViewRequest(): (hook.Hook) /** - * SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden - * particularly useful when testing. + * OnAdminBeforeCreateRequest hook is triggered before each API + * Admin create request (after request data load and before model persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. */ - setArgs(a: Array): void - } - interface Command { + onAdminBeforeCreateRequest(): (hook.Hook) /** - * SetOutput sets the destination for usage and error messages. - * If output is nil, os.Stderr is used. - * Deprecated: Use SetOut and/or SetErr instead + * OnAdminAfterCreateRequest hook is triggered after each + * successful API Admin create request. */ - setOutput(output: io.Writer): void - } - interface Command { + onAdminAfterCreateRequest(): (hook.Hook) /** - * SetOut sets the destination for usage messages. - * If newOut is nil, os.Stdout is used. + * OnAdminBeforeUpdateRequest hook is triggered before each API + * Admin update request (after request data load and before model persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. */ - setOut(newOut: io.Writer): void - } - interface Command { + onAdminBeforeUpdateRequest(): (hook.Hook) /** - * SetErr sets the destination for error messages. - * If newErr is nil, os.Stderr is used. + * OnAdminAfterUpdateRequest hook is triggered after each + * successful API Admin update request. */ - setErr(newErr: io.Writer): void - } - interface Command { + onAdminAfterUpdateRequest(): (hook.Hook) /** - * SetIn sets the source for input data - * If newIn is nil, os.Stdin is used. + * OnAdminBeforeDeleteRequest hook is triggered before each API + * Admin delete request (after model load and before actual deletion). + * + * Could be used to additionally validate the request data or implement + * completely different delete behavior. */ - setIn(newIn: io.Reader): void - } - interface Command { + onAdminBeforeDeleteRequest(): (hook.Hook) /** - * SetUsageFunc sets usage function. Usage can be defined by application. + * OnAdminAfterDeleteRequest hook is triggered after each + * successful API Admin delete request. */ - setUsageFunc(f: (_arg0: Command) => void): void - } - interface Command { + onAdminAfterDeleteRequest(): (hook.Hook) /** - * SetUsageTemplate sets usage template. Can be defined by Application. + * OnAdminAuthRequest hook is triggered on each successful API Admin + * authentication request (sign-in, token refresh, etc.). + * + * Could be used to additionally validate or modify the + * authenticated admin data and token. */ - setUsageTemplate(s: string): void - } - interface Command { + onAdminAuthRequest(): (hook.Hook) /** - * SetFlagErrorFunc sets a function to generate an error when flag parsing - * fails. + * OnAdminBeforeAuthWithPasswordRequest hook is triggered before each Admin + * auth with password API request (after request data load and before password validation). + * + * Could be used to implement for example a custom password validation + * or to locate a different Admin identity (by assigning [AdminAuthWithPasswordEvent.Admin]). */ - setFlagErrorFunc(f: (_arg0: Command, _arg1: Error) => void): void - } - interface Command { + onAdminBeforeAuthWithPasswordRequest(): (hook.Hook) /** - * SetHelpFunc sets help function. Can be defined by Application. + * OnAdminAfterAuthWithPasswordRequest hook is triggered after each + * successful Admin auth with password API request. */ - setHelpFunc(f: (_arg0: Command, _arg1: Array) => void): void - } - interface Command { + onAdminAfterAuthWithPasswordRequest(): (hook.Hook) /** - * SetHelpCommand sets help command. + * OnAdminBeforeAuthRefreshRequest hook is triggered before each Admin + * auth refresh API request (right before generating a new auth token). + * + * Could be used to additionally validate the request data or implement + * completely different auth refresh behavior. */ - setHelpCommand(cmd: Command): void - } - interface Command { + onAdminBeforeAuthRefreshRequest(): (hook.Hook) /** - * SetHelpCommandGroupID sets the group id of the help command. + * OnAdminAfterAuthRefreshRequest hook is triggered after each + * successful auth refresh API request (right after generating a new auth token). */ - setHelpCommandGroupID(groupID: string): void - } - interface Command { + onAdminAfterAuthRefreshRequest(): (hook.Hook) /** - * SetCompletionCommandGroupID sets the group id of the completion command. + * OnAdminBeforeRequestPasswordResetRequest hook is triggered before each Admin + * request password reset API request (after request data load and before sending the reset email). + * + * Could be used to additionally validate the request data or implement + * completely different password reset behavior. */ - setCompletionCommandGroupID(groupID: string): void - } - interface Command { + onAdminBeforeRequestPasswordResetRequest(): (hook.Hook) /** - * SetHelpTemplate sets help template to be used. Application can use it to set custom template. + * OnAdminAfterRequestPasswordResetRequest hook is triggered after each + * successful request password reset API request. */ - setHelpTemplate(s: string): void - } - interface Command { + onAdminAfterRequestPasswordResetRequest(): (hook.Hook) /** - * SetVersionTemplate sets version template to be used. Application can use it to set custom template. + * OnAdminBeforeConfirmPasswordResetRequest hook is triggered before each Admin + * confirm password reset API request (after request data load and before persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. */ - setVersionTemplate(s: string): void - } - interface Command { + onAdminBeforeConfirmPasswordResetRequest(): (hook.Hook) /** - * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. + * OnAdminAfterConfirmPasswordResetRequest hook is triggered after each + * successful confirm password reset API request. */ - setErrPrefix(s: string): void - } - interface Command { + onAdminAfterConfirmPasswordResetRequest(): (hook.Hook) /** - * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. - * The user should not have a cyclic dependency on commands. + * OnRecordAuthRequest hook is triggered on each successful API + * record authentication request (sign-in, token refresh, etc.). + * + * Could be used to additionally validate or modify the authenticated + * record data and token. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - setGlobalNormalizationFunc(n: (f: any, name: string) => any): void - } - interface Command { + onRecordAuthRequest(...tags: string[]): (hook.TaggedHook) /** - * OutOrStdout returns output to stdout. + * OnRecordBeforeAuthWithPasswordRequest hook is triggered before each Record + * auth with password API request (after request data load and before password validation). + * + * Could be used to implement for example a custom password validation + * or to locate a different Record model (by reassigning [RecordAuthWithPasswordEvent.Record]). + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - outOrStdout(): io.Writer - } - interface Command { + onRecordBeforeAuthWithPasswordRequest(...tags: string[]): (hook.TaggedHook) /** - * OutOrStderr returns output to stderr + * OnRecordAfterAuthWithPasswordRequest hook is triggered after each + * successful Record auth with password API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - outOrStderr(): io.Writer - } - interface Command { + onRecordAfterAuthWithPasswordRequest(...tags: string[]): (hook.TaggedHook) /** - * ErrOrStderr returns output to stderr + * OnRecordBeforeAuthWithOAuth2Request hook is triggered before each Record + * OAuth2 sign-in/sign-up API request (after token exchange and before external provider linking). + * + * If the [RecordAuthWithOAuth2Event.Record] is not set, then the OAuth2 + * request will try to create a new auth Record. + * + * To assign or link a different existing record model you can + * change the [RecordAuthWithOAuth2Event.Record] field. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - errOrStderr(): io.Writer - } - interface Command { + onRecordBeforeAuthWithOAuth2Request(...tags: string[]): (hook.TaggedHook) /** - * InOrStdin returns input to stdin + * OnRecordAfterAuthWithOAuth2Request hook is triggered after each + * successful Record OAuth2 API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - inOrStdin(): io.Reader - } - interface Command { - /** - * UsageFunc returns either the function set by SetUsageFunc for this command - * or a parent, or it returns a default usage function. + onRecordAfterAuthWithOAuth2Request(...tags: string[]): (hook.TaggedHook) + /** + * OnRecordBeforeAuthRefreshRequest hook is triggered before each Record + * auth refresh API request (right before generating a new auth token). + * + * Could be used to additionally validate the request data or implement + * completely different auth refresh behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - usageFunc(): (_arg0: Command) => void - } - interface Command { + onRecordBeforeAuthRefreshRequest(...tags: string[]): (hook.TaggedHook) /** - * Usage puts out the usage for the command. - * Used when a user provides invalid input. - * Can be defined by user by overriding UsageFunc. + * OnRecordAfterAuthRefreshRequest hook is triggered after each + * successful auth refresh API request (right after generating a new auth token). + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - usage(): void - } - interface Command { + onRecordAfterAuthRefreshRequest(...tags: string[]): (hook.TaggedHook) /** - * HelpFunc returns either the function set by SetHelpFunc for this command - * or a parent, or it returns a function with default help behavior. + * OnRecordListExternalAuthsRequest hook is triggered on each API record external auths list request. + * + * Could be used to validate or modify the response before returning it to the client. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - helpFunc(): (_arg0: Command, _arg1: Array) => void - } - interface Command { + onRecordListExternalAuthsRequest(...tags: string[]): (hook.TaggedHook) /** - * Help puts out the help for the command. - * Used when a user calls help [command]. - * Can be defined by user by overriding HelpFunc. + * OnRecordBeforeUnlinkExternalAuthRequest hook is triggered before each API record + * external auth unlink request (after models load and before the actual relation deletion). + * + * Could be used to additionally validate the request data or implement + * completely different delete behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - help(): void - } - interface Command { + onRecordBeforeUnlinkExternalAuthRequest(...tags: string[]): (hook.TaggedHook) /** - * UsageString returns usage string. + * OnRecordAfterUnlinkExternalAuthRequest hook is triggered after each + * successful API record external auth unlink request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - usageString(): string - } - interface Command { + onRecordAfterUnlinkExternalAuthRequest(...tags: string[]): (hook.TaggedHook) /** - * FlagErrorFunc returns either the function set by SetFlagErrorFunc for this - * command or a parent, or it returns a function which returns the original - * error. + * OnRecordBeforeRequestPasswordResetRequest hook is triggered before each Record + * request password reset API request (after request data load and before sending the reset email). + * + * Could be used to additionally validate the request data or implement + * completely different password reset behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - flagErrorFunc(): (_arg0: Command, _arg1: Error) => void - } - interface Command { + onRecordBeforeRequestPasswordResetRequest(...tags: string[]): (hook.TaggedHook) /** - * UsagePadding return padding for the usage. + * OnRecordAfterRequestPasswordResetRequest hook is triggered after each + * successful request password reset API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - usagePadding(): number - } - interface Command { + onRecordAfterRequestPasswordResetRequest(...tags: string[]): (hook.TaggedHook) /** - * CommandPathPadding return padding for the command path. + * OnRecordBeforeConfirmPasswordResetRequest hook is triggered before each Record + * confirm password reset API request (after request data load and before persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - commandPathPadding(): number - } - interface Command { + onRecordBeforeConfirmPasswordResetRequest(...tags: string[]): (hook.TaggedHook) /** - * NamePadding returns padding for the name. + * OnRecordAfterConfirmPasswordResetRequest hook is triggered after each + * successful confirm password reset API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - namePadding(): number - } - interface Command { + onRecordAfterConfirmPasswordResetRequest(...tags: string[]): (hook.TaggedHook) /** - * UsageTemplate returns usage template for the command. + * OnRecordBeforeRequestVerificationRequest hook is triggered before each Record + * request verification API request (after request data load and before sending the verification email). + * + * Could be used to additionally validate the loaded request data or implement + * completely different verification behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - usageTemplate(): string - } - interface Command { + onRecordBeforeRequestVerificationRequest(...tags: string[]): (hook.TaggedHook) /** - * HelpTemplate return help template for the command. + * OnRecordAfterRequestVerificationRequest hook is triggered after each + * successful request verification API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - helpTemplate(): string - } - interface Command { + onRecordAfterRequestVerificationRequest(...tags: string[]): (hook.TaggedHook) /** - * VersionTemplate return version template for the command. + * OnRecordBeforeConfirmVerificationRequest hook is triggered before each Record + * confirm verification API request (after request data load and before persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - versionTemplate(): string - } - interface Command { + onRecordBeforeConfirmVerificationRequest(...tags: string[]): (hook.TaggedHook) /** - * ErrPrefix return error message prefix for the command + * OnRecordAfterConfirmVerificationRequest hook is triggered after each + * successful confirm verification API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - errPrefix(): string - } - interface Command { + onRecordAfterConfirmVerificationRequest(...tags: string[]): (hook.TaggedHook) /** - * Find the target command given the args and command tree - * Meant to be run on the highest node. Only searches down. + * OnRecordBeforeRequestEmailChangeRequest hook is triggered before each Record request email change API request + * (after request data load and before sending the email link to confirm the change). + * + * Could be used to additionally validate the request data or implement + * completely different request email change behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - find(args: Array): [(Command), Array] - } - interface Command { + onRecordBeforeRequestEmailChangeRequest(...tags: string[]): (hook.TaggedHook) /** - * Traverse the command tree to find the command, and parse args for - * each parent. + * OnRecordAfterRequestEmailChangeRequest hook is triggered after each + * successful request email change API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - traverse(args: Array): [(Command), Array] - } - interface Command { + onRecordAfterRequestEmailChangeRequest(...tags: string[]): (hook.TaggedHook) /** - * SuggestionsFor provides suggestions for the typedName. + * OnRecordBeforeConfirmEmailChangeRequest hook is triggered before each Record + * confirm email change API request (after request data load and before persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - suggestionsFor(typedName: string): Array - } - interface Command { + onRecordBeforeConfirmEmailChangeRequest(...tags: string[]): (hook.TaggedHook) /** - * VisitParents visits all parents of the command and invokes fn on each parent. + * OnRecordAfterConfirmEmailChangeRequest hook is triggered after each + * successful confirm email change API request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - visitParents(fn: (_arg0: Command) => void): void - } - interface Command { + onRecordAfterConfirmEmailChangeRequest(...tags: string[]): (hook.TaggedHook) /** - * Root finds root command. + * OnRecordsListRequest hook is triggered on each API Records list request. + * + * Could be used to validate or modify the response before returning it to the client. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - root(): (Command) - } - interface Command { + onRecordsListRequest(...tags: string[]): (hook.TaggedHook) /** - * ArgsLenAtDash will return the length of c.Flags().Args at the moment - * when a -- was found during args parsing. + * OnRecordViewRequest hook is triggered on each API Record view request. + * + * Could be used to validate or modify the response before returning it to the client. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - argsLenAtDash(): number - } - interface Command { + onRecordViewRequest(...tags: string[]): (hook.TaggedHook) /** - * ExecuteContext is the same as Execute(), but sets the ctx on the command. - * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs - * functions. + * OnRecordBeforeCreateRequest hook is triggered before each API Record + * create request (after request data load and before model persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - executeContext(ctx: context.Context): void - } - interface Command { + onRecordBeforeCreateRequest(...tags: string[]): (hook.TaggedHook) /** - * Execute uses the args (os.Args[1:] by default) - * and run through the command tree finding appropriate matches - * for commands and then corresponding flags. + * OnRecordAfterCreateRequest hook is triggered after each + * successful API Record create request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - execute(): void - } - interface Command { + onRecordAfterCreateRequest(...tags: string[]): (hook.TaggedHook) /** - * ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. - * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs - * functions. + * OnRecordBeforeUpdateRequest hook is triggered before each API Record + * update request (after request data load and before model persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - executeContextC(ctx: context.Context): (Command) - } - interface Command { + onRecordBeforeUpdateRequest(...tags: string[]): (hook.TaggedHook) /** - * ExecuteC executes the command. + * OnRecordAfterUpdateRequest hook is triggered after each + * successful API Record update request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - executeC(): (Command) - } - interface Command { - validateArgs(args: Array): void - } - interface Command { + onRecordAfterUpdateRequest(...tags: string[]): (hook.TaggedHook) /** - * ValidateRequiredFlags validates all required flags are present and returns an error otherwise + * OnRecordBeforeDeleteRequest hook is triggered before each API Record + * delete request (after model load and before actual deletion). + * + * Could be used to additionally validate the request data or implement + * completely different delete behavior. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - validateRequiredFlags(): void - } - interface Command { + onRecordBeforeDeleteRequest(...tags: string[]): (hook.TaggedHook) /** - * InitDefaultHelpFlag adds default help flag to c. - * It is called automatically by executing the c or by calling help and usage. - * If c already has help flag, it will do nothing. + * OnRecordAfterDeleteRequest hook is triggered after each + * successful API Record delete request. + * + * If the optional "tags" list (Collection ids or names) is specified, + * then all event handlers registered via the created hook will be + * triggered and called only if their event data origin matches the tags. */ - initDefaultHelpFlag(): void - } - interface Command { + onRecordAfterDeleteRequest(...tags: string[]): (hook.TaggedHook) /** - * InitDefaultVersionFlag adds default version flag to c. - * It is called automatically by executing the c. - * If c already has a version flag, it will do nothing. - * If c.Version is empty, it will do nothing. + * OnCollectionsListRequest hook is triggered on each API Collections list request. + * + * Could be used to validate or modify the response before returning it to the client. */ - initDefaultVersionFlag(): void - } - interface Command { + onCollectionsListRequest(): (hook.Hook) /** - * InitDefaultHelpCmd adds default help command to c. - * It is called automatically by executing the c or by calling help and usage. - * If c already has help command or c has no subcommands, it will do nothing. + * OnCollectionViewRequest hook is triggered on each API Collection view request. + * + * Could be used to validate or modify the response before returning it to the client. */ - initDefaultHelpCmd(): void - } - interface Command { + onCollectionViewRequest(): (hook.Hook) /** - * ResetCommands delete parent, subcommand and help command from c. + * OnCollectionBeforeCreateRequest hook is triggered before each API Collection + * create request (after request data load and before model persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. */ - resetCommands(): void - } - interface Command { + onCollectionBeforeCreateRequest(): (hook.Hook) /** - * Commands returns a sorted slice of child commands. + * OnCollectionAfterCreateRequest hook is triggered after each + * successful API Collection create request. */ - commands(): Array<(Command | undefined)> - } - interface Command { + onCollectionAfterCreateRequest(): (hook.Hook) /** - * AddCommand adds one or more commands to this parent command. + * OnCollectionBeforeUpdateRequest hook is triggered before each API Collection + * update request (after request data load and before model persistence). + * + * Could be used to additionally validate the request data or implement + * completely different persistence behavior. */ - addCommand(...cmds: (Command | undefined)[]): void - } - interface Command { + onCollectionBeforeUpdateRequest(): (hook.Hook) /** - * Groups returns a slice of child command groups. + * OnCollectionAfterUpdateRequest hook is triggered after each + * successful API Collection update request. */ - groups(): Array<(Group | undefined)> - } - interface Command { + onCollectionAfterUpdateRequest(): (hook.Hook) /** - * AllChildCommandsHaveGroup returns if all subcommands are assigned to a group + * OnCollectionBeforeDeleteRequest hook is triggered before each API + * Collection delete request (after model load and before actual deletion). + * + * Could be used to additionally validate the request data or implement + * completely different delete behavior. */ - allChildCommandsHaveGroup(): boolean - } - interface Command { + onCollectionBeforeDeleteRequest(): (hook.Hook) /** - * ContainsGroup return if groupID exists in the list of command groups. + * OnCollectionAfterDeleteRequest hook is triggered after each + * successful API Collection delete request. */ - containsGroup(groupID: string): boolean - } - interface Command { + onCollectionAfterDeleteRequest(): (hook.Hook) /** - * AddGroup adds one or more command groups to this parent command. + * OnCollectionsBeforeImportRequest hook is triggered before each API + * collections import request (after request data load and before the actual import). + * + * Could be used to additionally validate the imported collections or + * to implement completely different import behavior. */ - addGroup(...groups: (Group | undefined)[]): void - } - interface Command { + onCollectionsBeforeImportRequest(): (hook.Hook) /** - * RemoveCommand removes one or more commands from a parent command. + * OnCollectionsAfterImportRequest hook is triggered after each + * successful API collections import request. */ - removeCommand(...cmds: (Command | undefined)[]): void + onCollectionsAfterImportRequest(): (hook.Hook) } - interface Command { +} + +namespace migrate { + /** + * MigrationsList defines a list with migration definitions + */ + interface MigrationsList { + } + interface MigrationsList { /** - * Print is a convenience method to Print to the defined output, fallback to Stderr if not set. + * Item returns a single migration from the list by its index. */ - print(...i: { - }[]): void + item(index: number): (Migration) } - interface Command { + interface MigrationsList { /** - * Println is a convenience method to Println to the defined output, fallback to Stderr if not set. + * Items returns the internal migrations list slice. */ - println(...i: { - }[]): void + items(): Array<(Migration | undefined)> } - interface Command { + interface MigrationsList { /** - * Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. + * Register adds new migration definition to the list. + * + * If `optFilename` is not provided, it will try to get the name from its .go file. + * + * The list will be sorted automatically based on the migrations file name. */ - printf(format: string, ...i: { - }[]): void + register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void } +} + +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { interface Command { /** - * PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. + * GenBashCompletion generates bash completion file and writes to the passed writer. */ - printErr(...i: { - }[]): void + genBashCompletion(w: io.Writer): void } interface Command { /** - * PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. + * GenBashCompletionFile generates bash completion file. */ - printErrln(...i: { - }[]): void + genBashCompletionFile(filename: string): void } interface Command { /** - * PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. + * GenBashCompletionFileV2 generates Bash completion version 2. */ - printErrf(format: string, ...i: { - }[]): void + genBashCompletionFileV2(filename: string, includeDesc: boolean): void } interface Command { /** - * CommandPath returns the full path to this command. + * GenBashCompletionV2 generates Bash completion file version 2 + * and writes it to the passed writer. */ - commandPath(): string + genBashCompletionV2(w: io.Writer, includeDesc: boolean): void } + // @ts-ignore + import flag = pflag + /** + * Command is just that, a command for your application. + * E.g. 'go run ...' - 'run' is the command. Cobra requires + * you to define the usage and description as part of your command + * definition to ensure usability. + */ interface Command { /** - * UseLine puts out the full usage for a given command (including parents). + * Use is the one-line usage message. + * Recommended syntax is as follows: + * ``` + * [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. + * ... indicates that you can specify multiple values for the previous argument. + * | indicates mutually exclusive information. You can use the argument to the left of the separator or the + * argument to the right of the separator. You cannot use both arguments in a single use of the command. + * { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are + * optional, they are enclosed in brackets ([ ]). + * ``` + * Example: add [-F file | -D dir]... [-f format] profile */ - useLine(): string - } - interface Command { + use: string /** - * DebugFlags used to determine which flags have been assigned to which commands - * and which persist. + * Aliases is an array of aliases that can be used instead of the first word in Use. */ - debugFlags(): void - } - interface Command { + aliases: Array + /** + * SuggestFor is an array of command names for which this command will be suggested - + * similar to aliases but only suggests. + */ + suggestFor: Array /** - * Name returns the command's name: the first word in the use line. + * Short is the short description shown in the 'help' output. */ - name(): string - } - interface Command { + short: string /** - * HasAlias determines if a given string is an alias of the command. + * The group id under which this subcommand is grouped in the 'help' output of its parent. */ - hasAlias(s: string): boolean - } - interface Command { + groupID: string /** - * CalledAs returns the command name or alias that was used to invoke - * this command or an empty string if the command has not been called. + * Long is the long message shown in the 'help ' output. */ - calledAs(): string - } - interface Command { + long: string /** - * NameAndAliases returns a list of the command name and all aliases + * Example is examples of how to use the command. */ - nameAndAliases(): string - } - interface Command { + example: string /** - * HasExample determines if the command has example. + * ValidArgs is list of all valid non-flag arguments that are accepted in shell completions */ - hasExample(): boolean - } - interface Command { + validArgs: Array /** - * Runnable determines if the command is itself runnable. + * ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. + * It is a dynamic version of using ValidArgs. + * Only one of ValidArgs and ValidArgsFunction can be used for a command. */ - runnable(): boolean - } - interface Command { + validArgsFunction: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective] /** - * HasSubCommands determines if the command has children commands. + * Expected arguments */ - hasSubCommands(): boolean - } - interface Command { + args: PositionalArgs /** - * IsAvailableCommand determines if a command is available as a non-help command - * (this includes all non deprecated/hidden commands). + * ArgAliases is List of aliases for ValidArgs. + * These are not suggested to the user in the shell completion, + * but accepted if entered manually. */ - isAvailableCommand(): boolean - } - interface Command { + argAliases: Array /** - * IsAdditionalHelpTopicCommand determines if a command is an additional - * help topic command; additional help topic command is determined by the - * fact that it is NOT runnable/hidden/deprecated, and has no sub commands that - * are runnable/hidden/deprecated. - * Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. + * BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. + * For portability with other shells, it is recommended to instead use ValidArgsFunction */ - isAdditionalHelpTopicCommand(): boolean - } - interface Command { + bashCompletionFunction: string /** - * HasHelpSubCommands determines if a command has any available 'help' sub commands - * that need to be shown in the usage/help default template under 'additional help - * topics'. + * Deprecated defines, if this command is deprecated and should print this string when used. */ - hasHelpSubCommands(): boolean - } - interface Command { + deprecated: string /** - * HasAvailableSubCommands determines if a command has available sub commands that - * need to be shown in the usage/help default template under 'available commands'. + * Annotations are key/value pairs that can be used by applications to identify or + * group commands or set special options. */ - hasAvailableSubCommands(): boolean - } - interface Command { + annotations: _TygojaDict /** - * HasParent determines if the command is a child command. + * Version defines the version for this command. If this value is non-empty and the command does not + * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + * will print content of the "Version" variable. A shorthand "v" flag will also be added if the + * command does not define one. */ - hasParent(): boolean - } - interface Command { + version: string /** - * GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. + * The *Run functions are executed in the following order: + * ``` + * * PersistentPreRun() + * * PreRun() + * * Run() + * * PostRun() + * * PersistentPostRun() + * ``` + * All functions get the same args, the arguments after the command name. + * The *PreRun and *PostRun functions will only be executed if the Run function of the current + * command has been declared. + * + * PersistentPreRun: children of this command will inherit and execute. */ - globalNormalizationFunc(): (f: any, name: string) => any - } - interface Command { + persistentPreRun: (cmd: Command, args: Array) => void /** - * Flags returns the complete FlagSet that applies - * to this command (local and persistent declared here and by all parents). + * PersistentPreRunE: PersistentPreRun but returns an error. */ - flags(): (any) - } - interface Command { + persistentPreRunE: (cmd: Command, args: Array) => void /** - * LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * PreRun: children of this command will not inherit. */ - localNonPersistentFlags(): (any) - } - interface Command { + preRun: (cmd: Command, args: Array) => void /** - * LocalFlags returns the local FlagSet specifically set in the current command. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * PreRunE: PreRun but returns an error. */ - localFlags(): (any) - } - interface Command { + preRunE: (cmd: Command, args: Array) => void /** - * InheritedFlags returns all flags which were inherited from parent commands. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * Run: Typically the actual work function. Most commands will only implement this. */ - inheritedFlags(): (any) - } - interface Command { + run: (cmd: Command, args: Array) => void /** - * NonInheritedFlags returns all flags which were not inherited from parent commands. - * This function does not modify the flags of the current command, it's purpose is to return the current state. + * RunE: Run but returns an error. */ - nonInheritedFlags(): (any) - } - interface Command { + runE: (cmd: Command, args: Array) => void /** - * PersistentFlags returns the persistent FlagSet specifically set in the current command. + * PostRun: run after the Run command. */ - persistentFlags(): (any) - } - interface Command { + postRun: (cmd: Command, args: Array) => void /** - * ResetFlags deletes all flags from command. + * PostRunE: PostRun but returns an error. */ - resetFlags(): void - } - interface Command { + postRunE: (cmd: Command, args: Array) => void /** - * HasFlags checks if the command contains any flags (local plus persistent from the entire structure). + * PersistentPostRun: children of this command will inherit and execute after PostRun. */ - hasFlags(): boolean - } - interface Command { + persistentPostRun: (cmd: Command, args: Array) => void /** - * HasPersistentFlags checks if the command contains persistent flags. + * PersistentPostRunE: PersistentPostRun but returns an error. */ - hasPersistentFlags(): boolean - } - interface Command { + persistentPostRunE: (cmd: Command, args: Array) => void /** - * HasLocalFlags checks if the command has flags specifically declared locally. + * FParseErrWhitelist flag parse errors to be ignored */ - hasLocalFlags(): boolean - } - interface Command { + fParseErrWhitelist: FParseErrWhitelist /** - * HasInheritedFlags checks if the command has flags inherited from its parent command. + * CompletionOptions is a set of options to control the handling of shell completion */ - hasInheritedFlags(): boolean - } - interface Command { + completionOptions: CompletionOptions /** - * HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire - * structure) which are not hidden or deprecated. + * TraverseChildren parses flags on all parents before executing child command. */ - hasAvailableFlags(): boolean - } - interface Command { + traverseChildren: boolean /** - * HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. + * Hidden defines, if this command is hidden and should NOT show up in the list of available commands. */ - hasAvailablePersistentFlags(): boolean - } - interface Command { + hidden: boolean /** - * HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden - * or deprecated. + * SilenceErrors is an option to quiet errors down stream. */ - hasAvailableLocalFlags(): boolean - } - interface Command { + silenceErrors: boolean /** - * HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are - * not hidden or deprecated. + * SilenceUsage is an option to silence usage when an error occurs. */ - hasAvailableInheritedFlags(): boolean - } - interface Command { + silenceUsage: boolean /** - * Flag climbs up the command tree looking for matching flag. + * DisableFlagParsing disables the flag parsing. + * If this is true all flags will be passed to the command as arguments. */ - flag(name: string): (any) - } - interface Command { + disableFlagParsing: boolean /** - * ParseFlags parses persistent flag tree and local flags. + * DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + * will be printed by generating docs for this command. */ - parseFlags(args: Array): void - } - interface Command { + disableAutoGenTag: boolean /** - * Parent returns a commands parent command. + * DisableFlagsInUseLine will disable the addition of [flags] to the usage + * line of a command when printing help or generating docs */ - parent(): (Command) - } - interface Command { + disableFlagsInUseLine: boolean /** - * RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. + * DisableSuggestions disables the suggestions based on Levenshtein distance + * that go along with 'unknown command' messages. */ - registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void - } - interface Command { + disableSuggestions: boolean /** - * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. + * SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + * Must be > 0. */ - getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] + suggestionsMinimumDistance: number } interface Command { /** - * InitDefaultCompletionCmd adds a default 'completion' command to c. - * This function will do nothing if any of the following is true: - * 1- the feature has been explicitly disabled by the program, - * 2- c has no subcommands (to avoid creating one), - * 3- c already has a 'completion' command provided by the program. + * Context returns underlying command context. If command was executed + * with ExecuteContext or the context was set with SetContext, the + * previously set context will be returned. Otherwise, nil is returned. + * + * Notice that a call to Execute and ExecuteC will replace a nil context of + * a command with a context.Background, so a background context will be + * returned by Context after one of these functions has been called. */ - initDefaultCompletionCmd(): void + context(): context.Context } interface Command { /** - * GenFishCompletion generates fish completion file and writes to the passed writer. + * SetContext sets context for the command. This context will be overwritten by + * Command.ExecuteContext or Command.ExecuteContextC. */ - genFishCompletion(w: io.Writer, includeDesc: boolean): void + setContext(ctx: context.Context): void } interface Command { /** - * GenFishCompletionFile generates fish completion file. + * SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden + * particularly useful when testing. */ - genFishCompletionFile(filename: string, includeDesc: boolean): void + setArgs(a: Array): void } interface Command { /** - * MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors - * if the command is invoked with a subset (but not all) of the given flags. + * SetOutput sets the destination for usage and error messages. + * If output is nil, os.Stderr is used. + * Deprecated: Use SetOut and/or SetErr instead */ - markFlagsRequiredTogether(...flagNames: string[]): void + setOutput(output: io.Writer): void } interface Command { /** - * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors - * if the command is invoked without at least one flag from the given set of flags. + * SetOut sets the destination for usage messages. + * If newOut is nil, os.Stdout is used. */ - markFlagsOneRequired(...flagNames: string[]): void + setOut(newOut: io.Writer): void } interface Command { /** - * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors - * if the command is invoked with more than one flag from the given set of flags. + * SetErr sets the destination for error messages. + * If newErr is nil, os.Stderr is used. */ - markFlagsMutuallyExclusive(...flagNames: string[]): void + setErr(newErr: io.Writer): void } interface Command { /** - * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the - * first error encountered. + * SetIn sets the source for input data + * If newIn is nil, os.Stdin is used. */ - validateFlagGroups(): void + setIn(newIn: io.Reader): void } interface Command { /** - * GenPowerShellCompletionFile generates powershell completion file without descriptions. + * SetUsageFunc sets usage function. Usage can be defined by application. */ - genPowerShellCompletionFile(filename: string): void + setUsageFunc(f: (_arg0: Command) => void): void } interface Command { /** - * GenPowerShellCompletion generates powershell completion file without descriptions - * and writes it to the passed writer. + * SetUsageTemplate sets usage template. Can be defined by Application. */ - genPowerShellCompletion(w: io.Writer): void + setUsageTemplate(s: string): void } interface Command { /** - * GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. + * SetFlagErrorFunc sets a function to generate an error when flag parsing + * fails. */ - genPowerShellCompletionFileWithDesc(filename: string): void + setFlagErrorFunc(f: (_arg0: Command, _arg1: Error) => void): void } interface Command { /** - * GenPowerShellCompletionWithDesc generates powershell completion file with descriptions - * and writes it to the passed writer. + * SetHelpFunc sets help function. Can be defined by Application. */ - genPowerShellCompletionWithDesc(w: io.Writer): void + setHelpFunc(f: (_arg0: Command, _arg1: Array) => void): void } interface Command { /** - * MarkFlagRequired instructs the various shell completion implementations to - * prioritize the named flag when performing completion, - * and causes your command to report an error if invoked without the flag. + * SetHelpCommand sets help command. */ - markFlagRequired(name: string): void + setHelpCommand(cmd: Command): void } interface Command { /** - * MarkPersistentFlagRequired instructs the various shell completion implementations to - * prioritize the named persistent flag when performing completion, - * and causes your command to report an error if invoked without the flag. + * SetHelpCommandGroupID sets the group id of the help command. */ - markPersistentFlagRequired(name: string): void + setHelpCommandGroupID(groupID: string): void } interface Command { /** - * MarkFlagFilename instructs the various shell completion implementations to - * limit completions for the named flag to the specified file extensions. + * SetCompletionCommandGroupID sets the group id of the completion command. */ - markFlagFilename(name: string, ...extensions: string[]): void + setCompletionCommandGroupID(groupID: string): void } interface Command { /** - * MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. - * The bash completion script will call the bash function f for the flag. - * - * This will only work for bash completion. - * It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows - * to register a Go function which will work across all shells. + * SetHelpTemplate sets help template to be used. Application can use it to set custom template. */ - markFlagCustom(name: string, f: string): void + setHelpTemplate(s: string): void } interface Command { /** - * MarkPersistentFlagFilename instructs the various shell completion - * implementations to limit completions for the named persistent flag to the - * specified file extensions. + * SetVersionTemplate sets version template to be used. Application can use it to set custom template. */ - markPersistentFlagFilename(name: string, ...extensions: string[]): void + setVersionTemplate(s: string): void } interface Command { /** - * MarkFlagDirname instructs the various shell completion implementations to - * limit completions for the named flag to directory names. + * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. */ - markFlagDirname(name: string): void + setErrPrefix(s: string): void } interface Command { /** - * MarkPersistentFlagDirname instructs the various shell completion - * implementations to limit completions for the named persistent flag to - * directory names. + * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. + * The user should not have a cyclic dependency on commands. */ - markPersistentFlagDirname(name: string): void + setGlobalNormalizationFunc(n: (f: any, name: string) => any): void } interface Command { /** - * GenZshCompletionFile generates zsh completion file including descriptions. + * OutOrStdout returns output to stdout. */ - genZshCompletionFile(filename: string): void + outOrStdout(): io.Writer } interface Command { /** - * GenZshCompletion generates zsh completion file including descriptions - * and writes it to the passed writer. + * OutOrStderr returns output to stderr */ - genZshCompletion(w: io.Writer): void + outOrStderr(): io.Writer } interface Command { /** - * GenZshCompletionFileNoDesc generates zsh completion file without descriptions. + * ErrOrStderr returns output to stderr */ - genZshCompletionFileNoDesc(filename: string): void + errOrStderr(): io.Writer } interface Command { /** - * GenZshCompletionNoDesc generates zsh completion file without descriptions - * and writes it to the passed writer. + * InOrStdin returns input to stdin */ - genZshCompletionNoDesc(w: io.Writer): void + inOrStdin(): io.Reader } interface Command { /** - * MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was - * not consistent with Bash completion. It has therefore been disabled. - * Instead, when no other completion is specified, file completion is done by - * default for every argument. One can disable file completion on a per-argument - * basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. - * To achieve file extension filtering, one can use ValidArgsFunction and - * ShellCompDirectiveFilterFileExt. - * - * Deprecated + * UsageFunc returns either the function set by SetUsageFunc for this command + * or a parent, or it returns a default usage function. */ - markZshCompPositionalArgumentFile(argPosition: number, ...patterns: string[]): void + usageFunc(): (_arg0: Command) => void } interface Command { /** - * MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore - * been disabled. - * To achieve the same behavior across all shells, one can use - * ValidArgs (for the first argument only) or ValidArgsFunction for - * any argument (can include the first one also). - * - * Deprecated + * Usage puts out the usage for the command. + * Used when a user provides invalid input. + * Can be defined by user by overriding UsageFunc. */ - markZshCompPositionalArgumentWords(argPosition: number, ...words: string[]): void + usage(): void } -} - -/** - * Package core is the backbone of PocketBase. - * - * It defines the main PocketBase App interface and its base implementation. - */ -namespace core { - /** - * App defines the main PocketBase app interface. - */ - interface App { - [key:string]: any; - /** - * Deprecated: - * This method may get removed in the near future. - * It is recommended to access the app db instance from app.Dao().DB() or - * if you want more flexibility - app.Dao().ConcurrentDB() and app.Dao().NonconcurrentDB(). - * - * DB returns the default app database instance. - */ - db(): (dbx.DB) - /** - * Dao returns the default app Dao instance. - * - * This Dao could operate only on the tables and models - * associated with the default app database. For example, - * trying to access the request logs table will result in error. - */ - dao(): (daos.Dao) - /** - * Deprecated: - * This method may get removed in the near future. - * It is recommended to access the logs db instance from app.LogsDao().DB() or - * if you want more flexibility - app.LogsDao().ConcurrentDB() and app.LogsDao().NonconcurrentDB(). - * - * LogsDB returns the app logs database instance. - */ - logsDB(): (dbx.DB) - /** - * LogsDao returns the app logs Dao instance. - * - * This Dao could operate only on the tables and models - * associated with the logs database. For example, trying to access - * the users table from LogsDao will result in error. - */ - logsDao(): (daos.Dao) - /** - * Logger returns the active app logger. - */ - logger(): (slog.Logger) - /** - * DataDir returns the app data directory path. - */ - dataDir(): string - /** - * EncryptionEnv returns the name of the app secret env key - * (used for settings encryption). - */ - encryptionEnv(): string - /** - * IsDev returns whether the app is in dev mode. - */ - isDev(): boolean - /** - * Settings returns the loaded app settings. - */ - settings(): (settings.Settings) - /** - * Deprecated: Use app.Store() instead. - */ - cache(): (store.Store) - /** - * Store returns the app runtime store. - */ - store(): (store.Store) - /** - * SubscriptionsBroker returns the app realtime subscriptions broker instance. - */ - subscriptionsBroker(): (subscriptions.Broker) - /** - * NewMailClient creates and returns a configured app mail client. - */ - newMailClient(): mailer.Mailer - /** - * NewFilesystem creates and returns a configured filesystem.System instance - * for managing regular app files (eg. collection uploads). - * - * NB! Make sure to call Close() on the returned result - * after you are done working with it. - */ - newFilesystem(): (filesystem.System) + interface Command { /** - * NewBackupsFilesystem creates and returns a configured filesystem.System instance - * for managing app backups. - * - * NB! Make sure to call Close() on the returned result - * after you are done working with it. + * HelpFunc returns either the function set by SetHelpFunc for this command + * or a parent, or it returns a function with default help behavior. */ - newBackupsFilesystem(): (filesystem.System) + helpFunc(): (_arg0: Command, _arg1: Array) => void + } + interface Command { /** - * RefreshSettings reinitializes and reloads the stored application settings. + * Help puts out the help for the command. + * Used when a user calls help [command]. + * Can be defined by user by overriding HelpFunc. */ - refreshSettings(): void + help(): void + } + interface Command { /** - * IsBootstrapped checks if the application was initialized - * (aka. whether Bootstrap() was called). + * UsageString returns usage string. */ - isBootstrapped(): boolean + usageString(): string + } + interface Command { /** - * Bootstrap takes care for initializing the application - * (open db connections, load settings, etc.). - * - * It will call ResetBootstrapState() if the application was already bootstrapped. + * FlagErrorFunc returns either the function set by SetFlagErrorFunc for this + * command or a parent, or it returns a function which returns the original + * error. */ - bootstrap(): void + flagErrorFunc(): (_arg0: Command, _arg1: Error) => void + } + interface Command { /** - * ResetBootstrapState takes care for releasing initialized app resources - * (eg. closing db connections). + * UsagePadding return padding for the usage. */ - resetBootstrapState(): void + usagePadding(): number + } + interface Command { /** - * CreateBackup creates a new backup of the current app pb_data directory. - * - * Backups can be stored on S3 if it is configured in app.Settings().Backups. - * - * Please refer to the godoc of the specific CoreApp implementation - * for details on the backup procedures. + * CommandPathPadding return padding for the command path. */ - createBackup(ctx: context.Context, name: string): void + commandPathPadding(): number + } + interface Command { /** - * RestoreBackup restores the backup with the specified name and restarts - * the current running application process. - * - * The safely perform the restore it is recommended to have free disk space - * for at least 2x the size of the restored pb_data backup. - * - * Please refer to the godoc of the specific CoreApp implementation - * for details on the restore procedures. - * - * NB! This feature is experimental and currently is expected to work only on UNIX based systems. + * NamePadding returns padding for the name. */ - restoreBackup(ctx: context.Context, name: string): void + namePadding(): number + } + interface Command { /** - * Restart restarts the current running application process. - * - * Currently it is relying on execve so it is supported only on UNIX based systems. + * UsageTemplate returns usage template for the command. */ - restart(): void + usageTemplate(): string + } + interface Command { /** - * OnBeforeBootstrap hook is triggered before initializing the main - * application resources (eg. before db open and initial settings load). + * HelpTemplate return help template for the command. */ - onBeforeBootstrap(): (hook.Hook) + helpTemplate(): string + } + interface Command { /** - * OnAfterBootstrap hook is triggered after initializing the main - * application resources (eg. after db open and initial settings load). + * VersionTemplate return version template for the command. */ - onAfterBootstrap(): (hook.Hook) + versionTemplate(): string + } + interface Command { /** - * OnBeforeServe hook is triggered before serving the internal router (echo), - * allowing you to adjust its options and attach new routes or middlewares. + * ErrPrefix return error message prefix for the command */ - onBeforeServe(): (hook.Hook) + errPrefix(): string + } + interface Command { /** - * OnBeforeApiError hook is triggered right before sending an error API - * response to the client, allowing you to further modify the error data - * or to return a completely different API response. + * Find the target command given the args and command tree + * Meant to be run on the highest node. Only searches down. */ - onBeforeApiError(): (hook.Hook) + find(args: Array): [(Command), Array] + } + interface Command { /** - * OnAfterApiError hook is triggered right after sending an error API - * response to the client. - * It could be used to log the final API error in external services. + * Traverse the command tree to find the command, and parse args for + * each parent. */ - onAfterApiError(): (hook.Hook) + traverse(args: Array): [(Command), Array] + } + interface Command { /** - * OnTerminate hook is triggered when the app is in the process - * of being terminated (eg. on SIGTERM signal). + * SuggestionsFor provides suggestions for the typedName. */ - onTerminate(): (hook.Hook) + suggestionsFor(typedName: string): Array + } + interface Command { /** - * OnModelBeforeCreate hook is triggered before inserting a new - * model in the DB, allowing you to modify or validate the stored data. - * - * If the optional "tags" list (table names and/or the Collection id for Record models) - * is specified, then all event handlers registered via the created hook - * will be triggered and called only if their event data origin matches the tags. + * VisitParents visits all parents of the command and invokes fn on each parent. */ - onModelBeforeCreate(...tags: string[]): (hook.TaggedHook) + visitParents(fn: (_arg0: Command) => void): void + } + interface Command { /** - * OnModelAfterCreate hook is triggered after successfully - * inserting a new model in the DB. - * - * If the optional "tags" list (table names and/or the Collection id for Record models) - * is specified, then all event handlers registered via the created hook - * will be triggered and called only if their event data origin matches the tags. + * Root finds root command. */ - onModelAfterCreate(...tags: string[]): (hook.TaggedHook) + root(): (Command) + } + interface Command { /** - * OnModelBeforeUpdate hook is triggered before updating existing - * model in the DB, allowing you to modify or validate the stored data. - * - * If the optional "tags" list (table names and/or the Collection id for Record models) - * is specified, then all event handlers registered via the created hook - * will be triggered and called only if their event data origin matches the tags. + * ArgsLenAtDash will return the length of c.Flags().Args at the moment + * when a -- was found during args parsing. */ - onModelBeforeUpdate(...tags: string[]): (hook.TaggedHook) + argsLenAtDash(): number + } + interface Command { /** - * OnModelAfterUpdate hook is triggered after successfully updating - * existing model in the DB. - * - * If the optional "tags" list (table names and/or the Collection id for Record models) - * is specified, then all event handlers registered via the created hook - * will be triggered and called only if their event data origin matches the tags. + * ExecuteContext is the same as Execute(), but sets the ctx on the command. + * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs + * functions. */ - onModelAfterUpdate(...tags: string[]): (hook.TaggedHook) + executeContext(ctx: context.Context): void + } + interface Command { /** - * OnModelBeforeDelete hook is triggered before deleting an - * existing model from the DB. - * - * If the optional "tags" list (table names and/or the Collection id for Record models) - * is specified, then all event handlers registered via the created hook - * will be triggered and called only if their event data origin matches the tags. + * Execute uses the args (os.Args[1:] by default) + * and run through the command tree finding appropriate matches + * for commands and then corresponding flags. */ - onModelBeforeDelete(...tags: string[]): (hook.TaggedHook) + execute(): void + } + interface Command { /** - * OnModelAfterDelete hook is triggered after successfully deleting an - * existing model from the DB. - * - * If the optional "tags" list (table names and/or the Collection id for Record models) - * is specified, then all event handlers registered via the created hook - * will be triggered and called only if their event data origin matches the tags. + * ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. + * Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs + * functions. */ - onModelAfterDelete(...tags: string[]): (hook.TaggedHook) + executeContextC(ctx: context.Context): (Command) + } + interface Command { /** - * OnMailerBeforeAdminResetPasswordSend hook is triggered right - * before sending a password reset email to an admin, allowing you - * to inspect and customize the email message that is being sent. + * ExecuteC executes the command. */ - onMailerBeforeAdminResetPasswordSend(): (hook.Hook) + executeC(): (Command) + } + interface Command { + validateArgs(args: Array): void + } + interface Command { /** - * OnMailerAfterAdminResetPasswordSend hook is triggered after - * admin password reset email was successfully sent. + * ValidateRequiredFlags validates all required flags are present and returns an error otherwise */ - onMailerAfterAdminResetPasswordSend(): (hook.Hook) + validateRequiredFlags(): void + } + interface Command { /** - * OnMailerBeforeRecordResetPasswordSend hook is triggered right - * before sending a password reset email to an auth record, allowing - * you to inspect and customize the email message that is being sent. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * InitDefaultHelpFlag adds default help flag to c. + * It is called automatically by executing the c or by calling help and usage. + * If c already has help flag, it will do nothing. */ - onMailerBeforeRecordResetPasswordSend(...tags: string[]): (hook.TaggedHook) + initDefaultHelpFlag(): void + } + interface Command { /** - * OnMailerAfterRecordResetPasswordSend hook is triggered after - * an auth record password reset email was successfully sent. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * InitDefaultVersionFlag adds default version flag to c. + * It is called automatically by executing the c. + * If c already has a version flag, it will do nothing. + * If c.Version is empty, it will do nothing. */ - onMailerAfterRecordResetPasswordSend(...tags: string[]): (hook.TaggedHook) + initDefaultVersionFlag(): void + } + interface Command { /** - * OnMailerBeforeRecordVerificationSend hook is triggered right - * before sending a verification email to an auth record, allowing - * you to inspect and customize the email message that is being sent. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * InitDefaultHelpCmd adds default help command to c. + * It is called automatically by executing the c or by calling help and usage. + * If c already has help command or c has no subcommands, it will do nothing. */ - onMailerBeforeRecordVerificationSend(...tags: string[]): (hook.TaggedHook) + initDefaultHelpCmd(): void + } + interface Command { /** - * OnMailerAfterRecordVerificationSend hook is triggered after a - * verification email was successfully sent to an auth record. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * ResetCommands delete parent, subcommand and help command from c. */ - onMailerAfterRecordVerificationSend(...tags: string[]): (hook.TaggedHook) + resetCommands(): void + } + interface Command { /** - * OnMailerBeforeRecordChangeEmailSend hook is triggered right before - * sending a confirmation new address email to an auth record, allowing - * you to inspect and customize the email message that is being sent. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * Commands returns a sorted slice of child commands. */ - onMailerBeforeRecordChangeEmailSend(...tags: string[]): (hook.TaggedHook) + commands(): Array<(Command | undefined)> + } + interface Command { /** - * OnMailerAfterRecordChangeEmailSend hook is triggered after a - * verification email was successfully sent to an auth record. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * AddCommand adds one or more commands to this parent command. */ - onMailerAfterRecordChangeEmailSend(...tags: string[]): (hook.TaggedHook) + addCommand(...cmds: (Command | undefined)[]): void + } + interface Command { /** - * OnRealtimeConnectRequest hook is triggered right before establishing - * the SSE client connection. + * Groups returns a slice of child command groups. */ - onRealtimeConnectRequest(): (hook.Hook) + groups(): Array<(Group | undefined)> + } + interface Command { /** - * OnRealtimeDisconnectRequest hook is triggered on disconnected/interrupted - * SSE client connection. + * AllChildCommandsHaveGroup returns if all subcommands are assigned to a group */ - onRealtimeDisconnectRequest(): (hook.Hook) + allChildCommandsHaveGroup(): boolean + } + interface Command { /** - * OnRealtimeBeforeMessageSend hook is triggered right before sending - * an SSE message to a client. - * - * Returning [hook.StopPropagation] will prevent sending the message. - * Returning any other non-nil error will close the realtime connection. + * ContainsGroup return if groupID exists in the list of command groups. */ - onRealtimeBeforeMessageSend(): (hook.Hook) + containsGroup(groupID: string): boolean + } + interface Command { /** - * OnRealtimeAfterMessageSend hook is triggered right after sending - * an SSE message to a client. + * AddGroup adds one or more command groups to this parent command. */ - onRealtimeAfterMessageSend(): (hook.Hook) + addGroup(...groups: (Group | undefined)[]): void + } + interface Command { /** - * OnRealtimeBeforeSubscribeRequest hook is triggered before changing - * the client subscriptions, allowing you to further validate and - * modify the submitted change. + * RemoveCommand removes one or more commands from a parent command. */ - onRealtimeBeforeSubscribeRequest(): (hook.Hook) + removeCommand(...cmds: (Command | undefined)[]): void + } + interface Command { /** - * OnRealtimeAfterSubscribeRequest hook is triggered after the client - * subscriptions were successfully changed. + * Print is a convenience method to Print to the defined output, fallback to Stderr if not set. */ - onRealtimeAfterSubscribeRequest(): (hook.Hook) + print(...i: { + }[]): void + } + interface Command { /** - * OnSettingsListRequest hook is triggered on each successful - * API Settings list request. - * - * Could be used to validate or modify the response before - * returning it to the client. + * Println is a convenience method to Println to the defined output, fallback to Stderr if not set. */ - onSettingsListRequest(): (hook.Hook) + println(...i: { + }[]): void + } + interface Command { /** - * OnSettingsBeforeUpdateRequest hook is triggered before each API - * Settings update request (after request data load and before settings persistence). - * - * Could be used to additionally validate the request data or - * implement completely different persistence behavior. + * Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. */ - onSettingsBeforeUpdateRequest(): (hook.Hook) + printf(format: string, ...i: { + }[]): void + } + interface Command { /** - * OnSettingsAfterUpdateRequest hook is triggered after each - * successful API Settings update request. + * PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. */ - onSettingsAfterUpdateRequest(): (hook.Hook) + printErr(...i: { + }[]): void + } + interface Command { /** - * OnFileDownloadRequest hook is triggered before each API File download request. - * - * Could be used to validate or modify the file response before - * returning it to the client. + * PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. */ - onFileDownloadRequest(...tags: string[]): (hook.TaggedHook) + printErrln(...i: { + }[]): void + } + interface Command { /** - * OnFileBeforeTokenRequest hook is triggered before each file - * token API request. - * - * If no token or model was submitted, e.Model and e.Token will be empty, - * allowing you to implement your own custom model file auth implementation. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. */ - onFileBeforeTokenRequest(...tags: string[]): (hook.TaggedHook) + printErrf(format: string, ...i: { + }[]): void + } + interface Command { /** - * OnFileAfterTokenRequest hook is triggered after each - * successful file token API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * CommandPath returns the full path to this command. */ - onFileAfterTokenRequest(...tags: string[]): (hook.TaggedHook) + commandPath(): string + } + interface Command { /** - * OnAdminsListRequest hook is triggered on each API Admins list request. - * - * Could be used to validate or modify the response before returning it to the client. + * UseLine puts out the full usage for a given command (including parents). */ - onAdminsListRequest(): (hook.Hook) + useLine(): string + } + interface Command { /** - * OnAdminViewRequest hook is triggered on each API Admin view request. - * - * Could be used to validate or modify the response before returning it to the client. + * DebugFlags used to determine which flags have been assigned to which commands + * and which persist. */ - onAdminViewRequest(): (hook.Hook) + debugFlags(): void + } + interface Command { /** - * OnAdminBeforeCreateRequest hook is triggered before each API - * Admin create request (after request data load and before model persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. + * Name returns the command's name: the first word in the use line. */ - onAdminBeforeCreateRequest(): (hook.Hook) + name(): string + } + interface Command { /** - * OnAdminAfterCreateRequest hook is triggered after each - * successful API Admin create request. + * HasAlias determines if a given string is an alias of the command. */ - onAdminAfterCreateRequest(): (hook.Hook) + hasAlias(s: string): boolean + } + interface Command { /** - * OnAdminBeforeUpdateRequest hook is triggered before each API - * Admin update request (after request data load and before model persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. + * CalledAs returns the command name or alias that was used to invoke + * this command or an empty string if the command has not been called. */ - onAdminBeforeUpdateRequest(): (hook.Hook) + calledAs(): string + } + interface Command { /** - * OnAdminAfterUpdateRequest hook is triggered after each - * successful API Admin update request. + * NameAndAliases returns a list of the command name and all aliases */ - onAdminAfterUpdateRequest(): (hook.Hook) + nameAndAliases(): string + } + interface Command { /** - * OnAdminBeforeDeleteRequest hook is triggered before each API - * Admin delete request (after model load and before actual deletion). - * - * Could be used to additionally validate the request data or implement - * completely different delete behavior. + * HasExample determines if the command has example. */ - onAdminBeforeDeleteRequest(): (hook.Hook) + hasExample(): boolean + } + interface Command { /** - * OnAdminAfterDeleteRequest hook is triggered after each - * successful API Admin delete request. + * Runnable determines if the command is itself runnable. */ - onAdminAfterDeleteRequest(): (hook.Hook) + runnable(): boolean + } + interface Command { /** - * OnAdminAuthRequest hook is triggered on each successful API Admin - * authentication request (sign-in, token refresh, etc.). - * - * Could be used to additionally validate or modify the - * authenticated admin data and token. + * HasSubCommands determines if the command has children commands. */ - onAdminAuthRequest(): (hook.Hook) + hasSubCommands(): boolean + } + interface Command { /** - * OnAdminBeforeAuthWithPasswordRequest hook is triggered before each Admin - * auth with password API request (after request data load and before password validation). - * - * Could be used to implement for example a custom password validation - * or to locate a different Admin identity (by assigning [AdminAuthWithPasswordEvent.Admin]). + * IsAvailableCommand determines if a command is available as a non-help command + * (this includes all non deprecated/hidden commands). */ - onAdminBeforeAuthWithPasswordRequest(): (hook.Hook) + isAvailableCommand(): boolean + } + interface Command { /** - * OnAdminAfterAuthWithPasswordRequest hook is triggered after each - * successful Admin auth with password API request. + * IsAdditionalHelpTopicCommand determines if a command is an additional + * help topic command; additional help topic command is determined by the + * fact that it is NOT runnable/hidden/deprecated, and has no sub commands that + * are runnable/hidden/deprecated. + * Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. */ - onAdminAfterAuthWithPasswordRequest(): (hook.Hook) + isAdditionalHelpTopicCommand(): boolean + } + interface Command { /** - * OnAdminBeforeAuthRefreshRequest hook is triggered before each Admin - * auth refresh API request (right before generating a new auth token). - * - * Could be used to additionally validate the request data or implement - * completely different auth refresh behavior. + * HasHelpSubCommands determines if a command has any available 'help' sub commands + * that need to be shown in the usage/help default template under 'additional help + * topics'. */ - onAdminBeforeAuthRefreshRequest(): (hook.Hook) + hasHelpSubCommands(): boolean + } + interface Command { /** - * OnAdminAfterAuthRefreshRequest hook is triggered after each - * successful auth refresh API request (right after generating a new auth token). + * HasAvailableSubCommands determines if a command has available sub commands that + * need to be shown in the usage/help default template under 'available commands'. */ - onAdminAfterAuthRefreshRequest(): (hook.Hook) + hasAvailableSubCommands(): boolean + } + interface Command { /** - * OnAdminBeforeRequestPasswordResetRequest hook is triggered before each Admin - * request password reset API request (after request data load and before sending the reset email). - * - * Could be used to additionally validate the request data or implement - * completely different password reset behavior. + * HasParent determines if the command is a child command. + */ + hasParent(): boolean + } + interface Command { + /** + * GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. */ - onAdminBeforeRequestPasswordResetRequest(): (hook.Hook) + globalNormalizationFunc(): (f: any, name: string) => any + } + interface Command { /** - * OnAdminAfterRequestPasswordResetRequest hook is triggered after each - * successful request password reset API request. + * Flags returns the complete FlagSet that applies + * to this command (local and persistent declared here and by all parents). */ - onAdminAfterRequestPasswordResetRequest(): (hook.Hook) + flags(): (any) + } + interface Command { /** - * OnAdminBeforeConfirmPasswordResetRequest hook is triggered before each Admin - * confirm password reset API request (after request data load and before persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. + * LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - onAdminBeforeConfirmPasswordResetRequest(): (hook.Hook) + localNonPersistentFlags(): (any) + } + interface Command { /** - * OnAdminAfterConfirmPasswordResetRequest hook is triggered after each - * successful confirm password reset API request. + * LocalFlags returns the local FlagSet specifically set in the current command. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - onAdminAfterConfirmPasswordResetRequest(): (hook.Hook) + localFlags(): (any) + } + interface Command { /** - * OnRecordAuthRequest hook is triggered on each successful API - * record authentication request (sign-in, token refresh, etc.). - * - * Could be used to additionally validate or modify the authenticated - * record data and token. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * InheritedFlags returns all flags which were inherited from parent commands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - onRecordAuthRequest(...tags: string[]): (hook.TaggedHook) + inheritedFlags(): (any) + } + interface Command { /** - * OnRecordBeforeAuthWithPasswordRequest hook is triggered before each Record - * auth with password API request (after request data load and before password validation). - * - * Could be used to implement for example a custom password validation - * or to locate a different Record model (by reassigning [RecordAuthWithPasswordEvent.Record]). - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * NonInheritedFlags returns all flags which were not inherited from parent commands. + * This function does not modify the flags of the current command, it's purpose is to return the current state. */ - onRecordBeforeAuthWithPasswordRequest(...tags: string[]): (hook.TaggedHook) + nonInheritedFlags(): (any) + } + interface Command { /** - * OnRecordAfterAuthWithPasswordRequest hook is triggered after each - * successful Record auth with password API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * PersistentFlags returns the persistent FlagSet specifically set in the current command. */ - onRecordAfterAuthWithPasswordRequest(...tags: string[]): (hook.TaggedHook) + persistentFlags(): (any) + } + interface Command { /** - * OnRecordBeforeAuthWithOAuth2Request hook is triggered before each Record - * OAuth2 sign-in/sign-up API request (after token exchange and before external provider linking). - * - * If the [RecordAuthWithOAuth2Event.Record] is not set, then the OAuth2 - * request will try to create a new auth Record. - * - * To assign or link a different existing record model you can - * change the [RecordAuthWithOAuth2Event.Record] field. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * ResetFlags deletes all flags from command. */ - onRecordBeforeAuthWithOAuth2Request(...tags: string[]): (hook.TaggedHook) + resetFlags(): void + } + interface Command { /** - * OnRecordAfterAuthWithOAuth2Request hook is triggered after each - * successful Record OAuth2 API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasFlags checks if the command contains any flags (local plus persistent from the entire structure). */ - onRecordAfterAuthWithOAuth2Request(...tags: string[]): (hook.TaggedHook) + hasFlags(): boolean + } + interface Command { /** - * OnRecordBeforeAuthRefreshRequest hook is triggered before each Record - * auth refresh API request (right before generating a new auth token). - * - * Could be used to additionally validate the request data or implement - * completely different auth refresh behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasPersistentFlags checks if the command contains persistent flags. */ - onRecordBeforeAuthRefreshRequest(...tags: string[]): (hook.TaggedHook) + hasPersistentFlags(): boolean + } + interface Command { /** - * OnRecordAfterAuthRefreshRequest hook is triggered after each - * successful auth refresh API request (right after generating a new auth token). - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasLocalFlags checks if the command has flags specifically declared locally. */ - onRecordAfterAuthRefreshRequest(...tags: string[]): (hook.TaggedHook) + hasLocalFlags(): boolean + } + interface Command { /** - * OnRecordListExternalAuthsRequest hook is triggered on each API record external auths list request. - * - * Could be used to validate or modify the response before returning it to the client. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasInheritedFlags checks if the command has flags inherited from its parent command. */ - onRecordListExternalAuthsRequest(...tags: string[]): (hook.TaggedHook) + hasInheritedFlags(): boolean + } + interface Command { /** - * OnRecordBeforeUnlinkExternalAuthRequest hook is triggered before each API record - * external auth unlink request (after models load and before the actual relation deletion). - * - * Could be used to additionally validate the request data or implement - * completely different delete behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire + * structure) which are not hidden or deprecated. */ - onRecordBeforeUnlinkExternalAuthRequest(...tags: string[]): (hook.TaggedHook) + hasAvailableFlags(): boolean + } + interface Command { /** - * OnRecordAfterUnlinkExternalAuthRequest hook is triggered after each - * successful API record external auth unlink request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. */ - onRecordAfterUnlinkExternalAuthRequest(...tags: string[]): (hook.TaggedHook) + hasAvailablePersistentFlags(): boolean + } + interface Command { /** - * OnRecordBeforeRequestPasswordResetRequest hook is triggered before each Record - * request password reset API request (after request data load and before sending the reset email). - * - * Could be used to additionally validate the request data or implement - * completely different password reset behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden + * or deprecated. */ - onRecordBeforeRequestPasswordResetRequest(...tags: string[]): (hook.TaggedHook) + hasAvailableLocalFlags(): boolean + } + interface Command { /** - * OnRecordAfterRequestPasswordResetRequest hook is triggered after each - * successful request password reset API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are + * not hidden or deprecated. */ - onRecordAfterRequestPasswordResetRequest(...tags: string[]): (hook.TaggedHook) + hasAvailableInheritedFlags(): boolean + } + interface Command { /** - * OnRecordBeforeConfirmPasswordResetRequest hook is triggered before each Record - * confirm password reset API request (after request data load and before persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * Flag climbs up the command tree looking for matching flag. */ - onRecordBeforeConfirmPasswordResetRequest(...tags: string[]): (hook.TaggedHook) + flag(name: string): (any) + } + interface Command { /** - * OnRecordAfterConfirmPasswordResetRequest hook is triggered after each - * successful confirm password reset API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * ParseFlags parses persistent flag tree and local flags. */ - onRecordAfterConfirmPasswordResetRequest(...tags: string[]): (hook.TaggedHook) + parseFlags(args: Array): void + } + interface Command { /** - * OnRecordBeforeRequestVerificationRequest hook is triggered before each Record - * request verification API request (after request data load and before sending the verification email). - * - * Could be used to additionally validate the loaded request data or implement - * completely different verification behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * Parent returns a commands parent command. */ - onRecordBeforeRequestVerificationRequest(...tags: string[]): (hook.TaggedHook) + parent(): (Command) + } + interface Command { /** - * OnRecordAfterRequestVerificationRequest hook is triggered after each - * successful request verification API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. */ - onRecordAfterRequestVerificationRequest(...tags: string[]): (hook.TaggedHook) + registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void + } + interface Command { /** - * OnRecordBeforeConfirmVerificationRequest hook is triggered before each Record - * confirm verification API request (after request data load and before persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. + */ + getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] + } + interface Command { + /** + * InitDefaultCompletionCmd adds a default 'completion' command to c. + * This function will do nothing if any of the following is true: + * 1- the feature has been explicitly disabled by the program, + * 2- c has no subcommands (to avoid creating one), + * 3- c already has a 'completion' command provided by the program. */ - onRecordBeforeConfirmVerificationRequest(...tags: string[]): (hook.TaggedHook) + initDefaultCompletionCmd(): void + } + interface Command { /** - * OnRecordAfterConfirmVerificationRequest hook is triggered after each - * successful confirm verification API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GenFishCompletion generates fish completion file and writes to the passed writer. */ - onRecordAfterConfirmVerificationRequest(...tags: string[]): (hook.TaggedHook) + genFishCompletion(w: io.Writer, includeDesc: boolean): void + } + interface Command { /** - * OnRecordBeforeRequestEmailChangeRequest hook is triggered before each Record request email change API request - * (after request data load and before sending the email link to confirm the change). - * - * Could be used to additionally validate the request data or implement - * completely different request email change behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GenFishCompletionFile generates fish completion file. */ - onRecordBeforeRequestEmailChangeRequest(...tags: string[]): (hook.TaggedHook) + genFishCompletionFile(filename: string, includeDesc: boolean): void + } + interface Command { /** - * OnRecordAfterRequestEmailChangeRequest hook is triggered after each - * successful request email change API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors + * if the command is invoked with a subset (but not all) of the given flags. */ - onRecordAfterRequestEmailChangeRequest(...tags: string[]): (hook.TaggedHook) + markFlagsRequiredTogether(...flagNames: string[]): void + } + interface Command { /** - * OnRecordBeforeConfirmEmailChangeRequest hook is triggered before each Record - * confirm email change API request (after request data load and before persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors + * if the command is invoked without at least one flag from the given set of flags. */ - onRecordBeforeConfirmEmailChangeRequest(...tags: string[]): (hook.TaggedHook) + markFlagsOneRequired(...flagNames: string[]): void + } + interface Command { /** - * OnRecordAfterConfirmEmailChangeRequest hook is triggered after each - * successful confirm email change API request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors + * if the command is invoked with more than one flag from the given set of flags. */ - onRecordAfterConfirmEmailChangeRequest(...tags: string[]): (hook.TaggedHook) + markFlagsMutuallyExclusive(...flagNames: string[]): void + } + interface Command { /** - * OnRecordsListRequest hook is triggered on each API Records list request. - * - * Could be used to validate or modify the response before returning it to the client. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the + * first error encountered. */ - onRecordsListRequest(...tags: string[]): (hook.TaggedHook) + validateFlagGroups(): void + } + interface Command { /** - * OnRecordViewRequest hook is triggered on each API Record view request. - * - * Could be used to validate or modify the response before returning it to the client. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GenPowerShellCompletionFile generates powershell completion file without descriptions. */ - onRecordViewRequest(...tags: string[]): (hook.TaggedHook) + genPowerShellCompletionFile(filename: string): void + } + interface Command { /** - * OnRecordBeforeCreateRequest hook is triggered before each API Record - * create request (after request data load and before model persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GenPowerShellCompletion generates powershell completion file without descriptions + * and writes it to the passed writer. */ - onRecordBeforeCreateRequest(...tags: string[]): (hook.TaggedHook) + genPowerShellCompletion(w: io.Writer): void + } + interface Command { /** - * OnRecordAfterCreateRequest hook is triggered after each - * successful API Record create request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. */ - onRecordAfterCreateRequest(...tags: string[]): (hook.TaggedHook) + genPowerShellCompletionFileWithDesc(filename: string): void + } + interface Command { /** - * OnRecordBeforeUpdateRequest hook is triggered before each API Record - * update request (after request data load and before model persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * GenPowerShellCompletionWithDesc generates powershell completion file with descriptions + * and writes it to the passed writer. */ - onRecordBeforeUpdateRequest(...tags: string[]): (hook.TaggedHook) + genPowerShellCompletionWithDesc(w: io.Writer): void + } + interface Command { /** - * OnRecordAfterUpdateRequest hook is triggered after each - * successful API Record update request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * MarkFlagRequired instructs the various shell completion implementations to + * prioritize the named flag when performing completion, + * and causes your command to report an error if invoked without the flag. */ - onRecordAfterUpdateRequest(...tags: string[]): (hook.TaggedHook) + markFlagRequired(name: string): void + } + interface Command { /** - * OnRecordBeforeDeleteRequest hook is triggered before each API Record - * delete request (after model load and before actual deletion). - * - * Could be used to additionally validate the request data or implement - * completely different delete behavior. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * MarkPersistentFlagRequired instructs the various shell completion implementations to + * prioritize the named persistent flag when performing completion, + * and causes your command to report an error if invoked without the flag. */ - onRecordBeforeDeleteRequest(...tags: string[]): (hook.TaggedHook) + markPersistentFlagRequired(name: string): void + } + interface Command { /** - * OnRecordAfterDeleteRequest hook is triggered after each - * successful API Record delete request. - * - * If the optional "tags" list (Collection ids or names) is specified, - * then all event handlers registered via the created hook will be - * triggered and called only if their event data origin matches the tags. + * MarkFlagFilename instructs the various shell completion implementations to + * limit completions for the named flag to the specified file extensions. */ - onRecordAfterDeleteRequest(...tags: string[]): (hook.TaggedHook) + markFlagFilename(name: string, ...extensions: string[]): void + } + interface Command { /** - * OnCollectionsListRequest hook is triggered on each API Collections list request. + * MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. + * The bash completion script will call the bash function f for the flag. * - * Could be used to validate or modify the response before returning it to the client. + * This will only work for bash completion. + * It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows + * to register a Go function which will work across all shells. */ - onCollectionsListRequest(): (hook.Hook) + markFlagCustom(name: string, f: string): void + } + interface Command { /** - * OnCollectionViewRequest hook is triggered on each API Collection view request. - * - * Could be used to validate or modify the response before returning it to the client. + * MarkPersistentFlagFilename instructs the various shell completion + * implementations to limit completions for the named persistent flag to the + * specified file extensions. */ - onCollectionViewRequest(): (hook.Hook) + markPersistentFlagFilename(name: string, ...extensions: string[]): void + } + interface Command { /** - * OnCollectionBeforeCreateRequest hook is triggered before each API Collection - * create request (after request data load and before model persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. + * MarkFlagDirname instructs the various shell completion implementations to + * limit completions for the named flag to directory names. */ - onCollectionBeforeCreateRequest(): (hook.Hook) + markFlagDirname(name: string): void + } + interface Command { /** - * OnCollectionAfterCreateRequest hook is triggered after each - * successful API Collection create request. + * MarkPersistentFlagDirname instructs the various shell completion + * implementations to limit completions for the named persistent flag to + * directory names. */ - onCollectionAfterCreateRequest(): (hook.Hook) + markPersistentFlagDirname(name: string): void + } + interface Command { /** - * OnCollectionBeforeUpdateRequest hook is triggered before each API Collection - * update request (after request data load and before model persistence). - * - * Could be used to additionally validate the request data or implement - * completely different persistence behavior. + * GenZshCompletionFile generates zsh completion file including descriptions. */ - onCollectionBeforeUpdateRequest(): (hook.Hook) + genZshCompletionFile(filename: string): void + } + interface Command { /** - * OnCollectionAfterUpdateRequest hook is triggered after each - * successful API Collection update request. + * GenZshCompletion generates zsh completion file including descriptions + * and writes it to the passed writer. */ - onCollectionAfterUpdateRequest(): (hook.Hook) + genZshCompletion(w: io.Writer): void + } + interface Command { /** - * OnCollectionBeforeDeleteRequest hook is triggered before each API - * Collection delete request (after model load and before actual deletion). - * - * Could be used to additionally validate the request data or implement - * completely different delete behavior. + * GenZshCompletionFileNoDesc generates zsh completion file without descriptions. */ - onCollectionBeforeDeleteRequest(): (hook.Hook) + genZshCompletionFileNoDesc(filename: string): void + } + interface Command { /** - * OnCollectionAfterDeleteRequest hook is triggered after each - * successful API Collection delete request. + * GenZshCompletionNoDesc generates zsh completion file without descriptions + * and writes it to the passed writer. */ - onCollectionAfterDeleteRequest(): (hook.Hook) + genZshCompletionNoDesc(w: io.Writer): void + } + interface Command { /** - * OnCollectionsBeforeImportRequest hook is triggered before each API - * collections import request (after request data load and before the actual import). + * MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was + * not consistent with Bash completion. It has therefore been disabled. + * Instead, when no other completion is specified, file completion is done by + * default for every argument. One can disable file completion on a per-argument + * basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. + * To achieve file extension filtering, one can use ValidArgsFunction and + * ShellCompDirectiveFilterFileExt. * - * Could be used to additionally validate the imported collections or - * to implement completely different import behavior. + * Deprecated */ - onCollectionsBeforeImportRequest(): (hook.Hook) + markZshCompPositionalArgumentFile(argPosition: number, ...patterns: string[]): void + } + interface Command { /** - * OnCollectionsAfterImportRequest hook is triggered after each - * successful API collections import request. + * MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore + * been disabled. + * To achieve the same behavior across all shells, one can use + * ValidArgs (for the first argument only) or ValidArgsFunction for + * any argument (can include the first one also). + * + * Deprecated */ - onCollectionsAfterImportRequest(): (hook.Hook) - } -} - -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { - /** - * ReadCloser is the interface that groups the basic Read and Close methods. - */ - interface ReadCloser { - [key:string]: any; - } - /** - * WriteCloser is the interface that groups the basic Write and Close methods. - */ - interface WriteCloser { - [key:string]: any; + markZshCompPositionalArgumentWords(argPosition: number, ...words: string[]): void } } @@ -14951,204 +14926,41 @@ namespace context { } /** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. - * - * See the [testing/fstest] package for support with testing - * implementations of file systems. - */ -namespace fs { -} - -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS - * request consumes only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement. - * - * On all systems (except Plan 9), when the cgo resolver is being used - * this package applies a concurrent cgo lookup limit to prevent the system - * from running out of system threads. Currently, it is limited to 500 concurrent lookups. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * The Go resolver will send an EDNS0 additional header with a DNS request, - * to signal a willingness to accept a larger DNS packet size. - * This can reportedly cause sporadic failures with the DNS server run - * by some modems and routers. Setting GODEBUG=netedns0=0 will disable - * sending the additional header. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. */ -namespace net { - /** - * Conn is a generic stream-oriented network connection. - * - * Multiple goroutines may invoke methods on a Conn simultaneously. - */ - interface Conn { - [key:string]: any; - /** - * Read reads data from the connection. - * Read can be made to time out and return an error after a fixed - * time limit; see SetDeadline and SetReadDeadline. - */ - read(b: string|Array): number - /** - * Write writes data to the connection. - * Write can be made to time out and return an error after a fixed - * time limit; see SetDeadline and SetWriteDeadline. - */ - write(b: string|Array): number - /** - * Close closes the connection. - * Any blocked Read or Write operations will be unblocked and return errors. - */ - close(): void - /** - * LocalAddr returns the local network address, if known. - */ - localAddr(): Addr - /** - * RemoteAddr returns the remote network address, if known. - */ - remoteAddr(): Addr - /** - * SetDeadline sets the read and write deadlines associated - * with the connection. It is equivalent to calling both - * SetReadDeadline and SetWriteDeadline. - * - * A deadline is an absolute time after which I/O operations - * fail instead of blocking. The deadline applies to all future - * and pending I/O, not just the immediately following call to - * Read or Write. After a deadline has been exceeded, the - * connection can be refreshed by setting a deadline in the future. - * - * If the deadline is exceeded a call to Read or Write or to other - * I/O methods will return an error that wraps os.ErrDeadlineExceeded. - * This can be tested using errors.Is(err, os.ErrDeadlineExceeded). - * The error's Timeout method will return true, but note that there - * are other possible errors for which the Timeout method will - * return true even if the deadline has not been exceeded. - * - * An idle timeout can be implemented by repeatedly extending - * the deadline after successful Read or Write calls. - * - * A zero value for t means I/O operations will not time out. - */ - setDeadline(t: time.Time): void - /** - * SetReadDeadline sets the deadline for future Read calls - * and any currently-blocked Read call. - * A zero value for t means Read will not time out. - */ - setReadDeadline(t: time.Time): void - /** - * SetWriteDeadline sets the deadline for future Write calls - * and any currently-blocked Write call. - * Even if write times out, it may return n > 0, indicating that - * some of the data was successfully written. - * A zero value for t means Write will not time out. - */ - setWriteDeadline(t: time.Time): void - } - /** - * A Listener is a generic network listener for stream-oriented protocols. - * - * Multiple goroutines may invoke methods on a Listener simultaneously. - */ - interface Listener { - [key:string]: any; - /** - * Accept waits for and returns the next connection to the listener. - */ - accept(): Conn - /** - * Close closes the listener. - * Any blocked Accept operations will be unblocked and return errors. - */ - close(): void - /** - * Addr returns the listener's network address. - */ - addr(): Addr +namespace io { + /** + * ReadCloser is the interface that groups the basic Read and Close methods. + */ + interface ReadCloser { + [key:string]: any; + } + /** + * WriteCloser is the interface that groups the basic Write and Close methods. + */ + interface WriteCloser { + [key:string]: any; } } +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + * + * See the [testing/fstest] package for support with testing + * implementations of file systems. + */ +namespace fs { +} + /** * Package url parses URLs and implements query escaping. */ @@ -15337,53 +15149,300 @@ namespace url { * base or reference. If ref is an absolute URL, then ResolveReference * ignores base and returns a copy of ref. */ - resolveReference(ref: URL): (URL) - } - interface URL { + resolveReference(ref: URL): (URL) + } + interface URL { + /** + * Query parses RawQuery and returns the corresponding values. + * It silently discards malformed value pairs. + * To check errors use [ParseQuery]. + */ + query(): Values + } + interface URL { + /** + * RequestURI returns the encoded path?query or opaque?query + * string that would be used in an HTTP request for u. + */ + requestURI(): string + } + interface URL { + /** + * Hostname returns u.Host, stripping any valid port number if present. + * + * If the result is enclosed in square brackets, as literal IPv6 addresses are, + * the square brackets are removed from the result. + */ + hostname(): string + } + interface URL { + /** + * Port returns the port part of u.Host, without the leading colon. + * + * If u.Host doesn't contain a valid numeric port, Port returns an empty string. + */ + port(): string + } + interface URL { + marshalBinary(): string|Array + } + interface URL { + unmarshalBinary(text: string|Array): void + } + interface URL { + /** + * JoinPath returns a new [URL] with the provided path elements joined to + * any existing path and the resulting path cleaned of any ./ or ../ elements. + * Any sequences of multiple / characters will be reduced to a single /. + */ + joinPath(...elem: string[]): (URL) + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * DateTime represents a [time.Time] instance in UTC that is wrapped + * and serialized using the app default date layout. + */ + interface DateTime { + } + interface DateTime { + /** + * Time returns the internal [time.Time] instance. + */ + time(): time.Time + } + interface DateTime { + /** + * IsZero checks whether the current DateTime instance has zero time value. + */ + isZero(): boolean + } + interface DateTime { + /** + * String serializes the current DateTime instance into a formatted + * UTC date string. + * + * The zero value is serialized to an empty string. + */ + string(): string + } + interface DateTime { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface DateTime { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string|Array): void + } + interface DateTime { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface DateTime { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current DateTime instance. + */ + scan(value: any): void + } +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { + /** + * Conn is a generic stream-oriented network connection. + * + * Multiple goroutines may invoke methods on a Conn simultaneously. + */ + interface Conn { + [key:string]: any; + /** + * Read reads data from the connection. + * Read can be made to time out and return an error after a fixed + * time limit; see SetDeadline and SetReadDeadline. + */ + read(b: string|Array): number + /** + * Write writes data to the connection. + * Write can be made to time out and return an error after a fixed + * time limit; see SetDeadline and SetWriteDeadline. + */ + write(b: string|Array): number + /** + * Close closes the connection. + * Any blocked Read or Write operations will be unblocked and return errors. + */ + close(): void + /** + * LocalAddr returns the local network address, if known. + */ + localAddr(): Addr + /** + * RemoteAddr returns the remote network address, if known. + */ + remoteAddr(): Addr /** - * Query parses RawQuery and returns the corresponding values. - * It silently discards malformed value pairs. - * To check errors use [ParseQuery]. + * SetDeadline sets the read and write deadlines associated + * with the connection. It is equivalent to calling both + * SetReadDeadline and SetWriteDeadline. + * + * A deadline is an absolute time after which I/O operations + * fail instead of blocking. The deadline applies to all future + * and pending I/O, not just the immediately following call to + * Read or Write. After a deadline has been exceeded, the + * connection can be refreshed by setting a deadline in the future. + * + * If the deadline is exceeded a call to Read or Write or to other + * I/O methods will return an error that wraps os.ErrDeadlineExceeded. + * This can be tested using errors.Is(err, os.ErrDeadlineExceeded). + * The error's Timeout method will return true, but note that there + * are other possible errors for which the Timeout method will + * return true even if the deadline has not been exceeded. + * + * An idle timeout can be implemented by repeatedly extending + * the deadline after successful Read or Write calls. + * + * A zero value for t means I/O operations will not time out. */ - query(): Values - } - interface URL { + setDeadline(t: time.Time): void /** - * RequestURI returns the encoded path?query or opaque?query - * string that would be used in an HTTP request for u. + * SetReadDeadline sets the deadline for future Read calls + * and any currently-blocked Read call. + * A zero value for t means Read will not time out. */ - requestURI(): string - } - interface URL { + setReadDeadline(t: time.Time): void /** - * Hostname returns u.Host, stripping any valid port number if present. - * - * If the result is enclosed in square brackets, as literal IPv6 addresses are, - * the square brackets are removed from the result. + * SetWriteDeadline sets the deadline for future Write calls + * and any currently-blocked Write call. + * Even if write times out, it may return n > 0, indicating that + * some of the data was successfully written. + * A zero value for t means Write will not time out. */ - hostname(): string + setWriteDeadline(t: time.Time): void } - interface URL { + /** + * A Listener is a generic network listener for stream-oriented protocols. + * + * Multiple goroutines may invoke methods on a Listener simultaneously. + */ + interface Listener { + [key:string]: any; /** - * Port returns the port part of u.Host, without the leading colon. - * - * If u.Host doesn't contain a valid numeric port, Port returns an empty string. + * Accept waits for and returns the next connection to the listener. */ - port(): string - } - interface URL { - marshalBinary(): string|Array - } - interface URL { - unmarshalBinary(text: string|Array): void - } - interface URL { + accept(): Conn /** - * JoinPath returns a new [URL] with the provided path elements joined to - * any existing path and the resulting path cleaned of any ./ or ../ elements. - * Any sequences of multiple / characters will be reduced to a single /. + * Close closes the listener. + * Any blocked Accept operations will be unblocked and return errors. */ - joinPath(...elem: string[]): (URL) + close(): void + /** + * Addr returns the listener's network address. + */ + addr(): Addr } } @@ -16081,65 +16140,6 @@ namespace oauth2 { } } -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * DateTime represents a [time.Time] instance in UTC that is wrapped - * and serialized using the app default date layout. - */ - interface DateTime { - } - interface DateTime { - /** - * Time returns the internal [time.Time] instance. - */ - time(): time.Time - } - interface DateTime { - /** - * IsZero checks whether the current DateTime instance has zero time value. - */ - isZero(): boolean - } - interface DateTime { - /** - * String serializes the current DateTime instance into a formatted - * UTC date string. - * - * The zero value is serialized to an empty string. - */ - string(): string - } - interface DateTime { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface DateTime { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string|Array): void - } - interface DateTime { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface DateTime { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current DateTime instance. - */ - scan(value: any): void - } -} - namespace store { /** * Store defines a concurrent safe in memory key-value data store. @@ -17281,8 +17281,8 @@ namespace models { */ validate(): void } - type _subWpQfF = BaseModel - interface Log extends _subWpQfF { + type _subwARCM = BaseModel + interface Log extends _subwARCM { data: types.JsonMap message: string level: number @@ -17290,8 +17290,8 @@ namespace models { interface Log { tableName(): string } - type _subuzORL = BaseModel - interface Param extends _subuzORL { + type _subqJNdp = BaseModel + interface Param extends _subqJNdp { key: string value: types.JsonRaw } @@ -17383,8 +17383,8 @@ namespace hook { * TaggedHook defines a proxy hook which register handlers that are triggered only * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). */ - type _sublZLEH = mainHook - interface TaggedHook extends _sublZLEH { + type _subTxVwj = mainHook + interface TaggedHook extends _subTxVwj { } interface TaggedHook { /** @@ -17961,12 +17961,12 @@ namespace core { httpContext: echo.Context error: Error } - type _subKMccQ = BaseModelEvent - interface ModelEvent extends _subKMccQ { + type _subCMPLw = BaseModelEvent + interface ModelEvent extends _subCMPLw { dao?: daos.Dao } - type _subbaMsx = BaseCollectionEvent - interface MailerRecordEvent extends _subbaMsx { + type _subCnFrG = BaseCollectionEvent + interface MailerRecordEvent extends _subCnFrG { mailClient: mailer.Mailer message?: mailer.Message record?: models.Record @@ -18006,50 +18006,50 @@ namespace core { oldSettings?: settings.Settings newSettings?: settings.Settings } - type _subwUSsg = BaseCollectionEvent - interface RecordsListEvent extends _subwUSsg { + type _suboUOVp = BaseCollectionEvent + interface RecordsListEvent extends _suboUOVp { httpContext: echo.Context records: Array<(models.Record | undefined)> result?: search.Result } - type _subSuCxZ = BaseCollectionEvent - interface RecordViewEvent extends _subSuCxZ { + type _subMmDXk = BaseCollectionEvent + interface RecordViewEvent extends _subMmDXk { httpContext: echo.Context record?: models.Record } - type _subOIUfd = BaseCollectionEvent - interface RecordCreateEvent extends _subOIUfd { + type _subTZYKy = BaseCollectionEvent + interface RecordCreateEvent extends _subTZYKy { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subndfPe = BaseCollectionEvent - interface RecordUpdateEvent extends _subndfPe { + type _subUPnol = BaseCollectionEvent + interface RecordUpdateEvent extends _subUPnol { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subhhPha = BaseCollectionEvent - interface RecordDeleteEvent extends _subhhPha { + type _subsOVxt = BaseCollectionEvent + interface RecordDeleteEvent extends _subsOVxt { httpContext: echo.Context record?: models.Record } - type _subjKIme = BaseCollectionEvent - interface RecordAuthEvent extends _subjKIme { + type _subdOcOX = BaseCollectionEvent + interface RecordAuthEvent extends _subdOcOX { httpContext: echo.Context record?: models.Record token: string meta: any } - type _subMzagN = BaseCollectionEvent - interface RecordAuthWithPasswordEvent extends _subMzagN { + type _subcXjwK = BaseCollectionEvent + interface RecordAuthWithPasswordEvent extends _subcXjwK { httpContext: echo.Context record?: models.Record identity: string password: string } - type _subnprfs = BaseCollectionEvent - interface RecordAuthWithOAuth2Event extends _subnprfs { + type _sublULwe = BaseCollectionEvent + interface RecordAuthWithOAuth2Event extends _sublULwe { httpContext: echo.Context providerName: string providerClient: auth.Provider @@ -18057,49 +18057,49 @@ namespace core { oAuth2User?: auth.AuthUser isNewRecord: boolean } - type _subBxwEM = BaseCollectionEvent - interface RecordAuthRefreshEvent extends _subBxwEM { + type _subyEweS = BaseCollectionEvent + interface RecordAuthRefreshEvent extends _subyEweS { httpContext: echo.Context record?: models.Record } - type _subxYtTe = BaseCollectionEvent - interface RecordRequestPasswordResetEvent extends _subxYtTe { + type _subGmfhi = BaseCollectionEvent + interface RecordRequestPasswordResetEvent extends _subGmfhi { httpContext: echo.Context record?: models.Record } - type _subRKUzR = BaseCollectionEvent - interface RecordConfirmPasswordResetEvent extends _subRKUzR { + type _subWgKmP = BaseCollectionEvent + interface RecordConfirmPasswordResetEvent extends _subWgKmP { httpContext: echo.Context record?: models.Record } - type _subCsAJx = BaseCollectionEvent - interface RecordRequestVerificationEvent extends _subCsAJx { + type _subboQDs = BaseCollectionEvent + interface RecordRequestVerificationEvent extends _subboQDs { httpContext: echo.Context record?: models.Record } - type _subWXfwy = BaseCollectionEvent - interface RecordConfirmVerificationEvent extends _subWXfwy { + type _subRQkZq = BaseCollectionEvent + interface RecordConfirmVerificationEvent extends _subRQkZq { httpContext: echo.Context record?: models.Record } - type _subDwvoH = BaseCollectionEvent - interface RecordRequestEmailChangeEvent extends _subDwvoH { + type _subCaQdu = BaseCollectionEvent + interface RecordRequestEmailChangeEvent extends _subCaQdu { httpContext: echo.Context record?: models.Record } - type _subwlCeW = BaseCollectionEvent - interface RecordConfirmEmailChangeEvent extends _subwlCeW { + type _subFeIqN = BaseCollectionEvent + interface RecordConfirmEmailChangeEvent extends _subFeIqN { httpContext: echo.Context record?: models.Record } - type _sublLDXl = BaseCollectionEvent - interface RecordListExternalAuthsEvent extends _sublLDXl { + type _subQtoYq = BaseCollectionEvent + interface RecordListExternalAuthsEvent extends _subQtoYq { httpContext: echo.Context record?: models.Record externalAuths: Array<(models.ExternalAuth | undefined)> } - type _subrvhdJ = BaseCollectionEvent - interface RecordUnlinkExternalAuthEvent extends _subrvhdJ { + type _subdbjaN = BaseCollectionEvent + interface RecordUnlinkExternalAuthEvent extends _subdbjaN { httpContext: echo.Context record?: models.Record externalAuth?: models.ExternalAuth @@ -18153,129 +18153,448 @@ namespace core { collections: Array<(models.Collection | undefined)> result?: search.Result } - type _subgkTpy = BaseCollectionEvent - interface CollectionViewEvent extends _subgkTpy { + type _subgEACr = BaseCollectionEvent + interface CollectionViewEvent extends _subgEACr { httpContext: echo.Context } - type _subthylS = BaseCollectionEvent - interface CollectionCreateEvent extends _subthylS { + type _subQmWZW = BaseCollectionEvent + interface CollectionCreateEvent extends _subQmWZW { httpContext: echo.Context } - type _subdwBvz = BaseCollectionEvent - interface CollectionUpdateEvent extends _subdwBvz { + type _subWgIts = BaseCollectionEvent + interface CollectionUpdateEvent extends _subWgIts { httpContext: echo.Context } - type _subEsmEe = BaseCollectionEvent - interface CollectionDeleteEvent extends _subEsmEe { + type _subwJThk = BaseCollectionEvent + interface CollectionDeleteEvent extends _subwJThk { httpContext: echo.Context } - interface CollectionsImportEvent { - httpContext: echo.Context - collections: Array<(models.Collection | undefined)> + interface CollectionsImportEvent { + httpContext: echo.Context + collections: Array<(models.Collection | undefined)> + } + type _subrFRLX = BaseModelEvent + interface FileTokenEvent extends _subrFRLX { + httpContext: echo.Context + token: string + } + type _subQDQbp = BaseCollectionEvent + interface FileDownloadEvent extends _subQDQbp { + httpContext: echo.Context + record?: models.Record + fileField?: schema.SchemaField + servedPath: string + servedName: string + } +} + +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } + // @ts-ignore + import flag = pflag + /** + * FParseErrWhitelist configures Flag parse errors to be ignored + */ + interface FParseErrWhitelist extends _TygojaAny{} + /** + * Group Structure to manage groups for commands + */ + interface Group { + id: string + title: string + } + /** + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. + */ + interface ShellCompDirective extends Number{} + /** + * CompletionOptions are the options to control shell completion + */ + interface CompletionOptions { + /** + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + */ + disableDefaultCmd: boolean + /** + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions + */ + disableNoDescFlag: boolean + /** + * DisableDescriptions turns off all completion descriptions for shells + * that support them + */ + disableDescriptions: boolean + /** + * HiddenDefaultCmd makes the default 'completion' command hidden + */ + hiddenDefaultCmd: boolean + } +} + +namespace migrate { + interface Migration { + file: string + up: (db: dbx.Builder) => void + down: (db: dbx.Builder) => void + } +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { + /** + * ReadWriter stores pointers to a [Reader] and a [Writer]. + * It implements [io.ReadWriter]. + */ + type _subLmeyk = Reader&Writer + interface ReadWriter extends _subLmeyk { + } +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { + /** + * Addr represents a network end point address. + * + * The two methods [Addr.Network] and [Addr.String] conventionally return strings + * that can be passed as the arguments to [Dial], but the exact form + * and meaning of the strings is up to the implementation. + */ + interface Addr { + [key:string]: any; + network(): string // name of the network (for example, "tcp", "udp") + string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") + } +} + +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { + /** + * The Userinfo type is an immutable encapsulation of username and + * password details for a [URL]. An existing Userinfo value is guaranteed + * to have a username set (potentially empty, as allowed by RFC 2396), + * and optionally a password. + */ + interface Userinfo { } - type _subCrHsh = BaseModelEvent - interface FileTokenEvent extends _subCrHsh { - httpContext: echo.Context - token: string + interface Userinfo { + /** + * Username returns the username. + */ + username(): string } - type _subilHAM = BaseCollectionEvent - interface FileDownloadEvent extends _subilHAM { - httpContext: echo.Context - record?: models.Record - fileField?: schema.SchemaField - servedPath: string - servedName: string + interface Userinfo { + /** + * Password returns the password in case it is set, and whether it is set. + */ + password(): [string, boolean] } -} - -namespace migrate { - interface Migration { - file: string - up: (db: dbx.Builder) => void - down: (db: dbx.Builder) => void + interface Userinfo { + /** + * String returns the encoded userinfo information in the standard form + * of "username[:password]". + */ + string(): string } } /** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} - /** - * Group Structure to manage groups for commands - */ - interface Group { - id: string - title: string - } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} +namespace multipart { /** - * CompletionOptions are the options to control shell completion + * A Part represents a single part in a multipart body. */ - interface CompletionOptions { + interface Part { /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + * The headers of the body, if any, with the keys canonicalized + * in the same fashion that the Go http.Request headers are. + * For example, "foo-bar" changes case to "Foo-Bar" */ - disableDefaultCmd: boolean + header: textproto.MIMEHeader + } + interface Part { /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions + * FormName returns the name parameter if p has a Content-Disposition + * of type "form-data". Otherwise it returns the empty string. */ - disableNoDescFlag: boolean + formName(): string + } + interface Part { /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them + * FileName returns the filename parameter of the [Part]'s Content-Disposition + * header. If not empty, the filename is passed through filepath.Base (which is + * platform dependent) before being returned. */ - disableDescriptions: boolean + fileName(): string + } + interface Part { /** - * HiddenDefaultCmd makes the default 'completion' command hidden + * Read reads the body of a part, after its headers and before the + * next part (if any) begins. */ - hiddenDefaultCmd: boolean + read(d: string|Array): number + } + interface Part { + close(): void } } /** - * Package url parses URLs and implements query escaping. + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. */ -namespace url { +namespace http { /** - * The Userinfo type is an immutable encapsulation of username and - * password details for a [URL]. An existing Userinfo value is guaranteed - * to have a username set (potentially empty, as allowed by RFC 2396), - * and optionally a password. + * SameSite allows a server to define a cookie attribute making it impossible for + * the browser to send this cookie along with cross-site requests. The main + * goal is to mitigate the risk of cross-origin information leakage, and provide + * some protection against cross-site request forgery attacks. + * + * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. */ - interface Userinfo { - } - interface Userinfo { - /** - * Username returns the username. - */ - username(): string - } - interface Userinfo { - /** - * Password returns the password in case it is set, and whether it is set. - */ - password(): [string, boolean] - } - interface Userinfo { - /** - * String returns the encoded userinfo information in the standard form - * of "username[:password]". - */ - string(): string - } + interface SameSite extends Number{} + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url } /** @@ -18320,191 +18639,165 @@ namespace types { } } -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS - * request consumes only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement. - * - * On all systems (except Plan 9), when the cgo resolver is being used - * this package applies a concurrent cgo lookup limit to prevent the system - * from running out of system threads. Currently, it is limited to 500 concurrent lookups. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * The Go resolver will send an EDNS0 additional header with a DNS request, - * to signal a willingness to accept a larger DNS packet size. - * This can reportedly cause sporadic failures with the DNS server run - * by some modems and routers. Setting GODEBUG=netedns0=0 will disable - * sending the additional header. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. - * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. - */ -namespace net { +namespace store { +} + +namespace search { /** - * Addr represents a network end point address. - * - * The two methods [Addr.Network] and [Addr.String] conventionally return strings - * that can be passed as the arguments to [Dial], but the exact form - * and meaning of the strings is up to the implementation. + * Result defines the returned search result structure. */ - interface Addr { - [key:string]: any; - network(): string // name of the network (for example, "tcp", "udp") - string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") + interface Result { + page: number + perPage: number + totalItems: number + totalPages: number + items: any } } -/** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. - */ -namespace bufio { +namespace mailer { /** - * ReadWriter stores pointers to a [Reader] and a [Writer]. - * It implements [io.ReadWriter]. + * Message defines a generic email message struct. */ - type _subFtvZa = Reader&Writer - interface ReadWriter extends _subFtvZa { + interface Message { + from: mail.Address + to: Array + bcc: Array + cc: Array + subject: string + html: string + text: string + headers: _TygojaDict + attachments: _TygojaDict } } /** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. + * Package echo implements high performance, minimalist Go web framework. + * + * Example: + * + * ``` + * package main + * + * import ( + * "github.com/labstack/echo/v5" + * "github.com/labstack/echo/v5/middleware" + * "log" + * "net/http" + * ) + * + * // Handler + * func hello(c echo.Context) error { + * return c.String(http.StatusOK, "Hello, World!") + * } * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. + * func main() { + * // Echo instance + * e := echo.New() * - * # Limits + * // Middleware + * e.Use(middleware.Logger()) + * e.Use(middleware.Recover()) * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. + * // Routes + * e.GET("/", hello) * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. + * // Start server + * if err := e.Start(":8080"); err != http.ErrServerClosed { + * log.Fatal(err) + * } + * } + * ``` * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. + * Learn more at https://echo.labstack.com */ -namespace multipart { +namespace echo { + // @ts-ignore + import stdContext = context /** - * A Part represents a single part in a multipart body. + * Route contains information to adding/registering new route with the router. + * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. */ - interface Part { + interface Route { + method: string + path: string + handler: HandlerFunc + middlewares: Array + name: string + } + interface Route { /** - * The headers of the body, if any, with the keys canonicalized - * in the same fashion that the Go http.Request headers are. - * For example, "foo-bar" changes case to "Foo-Bar" + * ToRouteInfo converts Route to RouteInfo */ - header: textproto.MIMEHeader + toRouteInfo(params: Array): RouteInfo } - interface Part { + interface Route { /** - * FormName returns the name parameter if p has a Content-Disposition - * of type "form-data". Otherwise it returns the empty string. + * ToRoute returns Route which Router uses to register the method handler for path. */ - formName(): string + toRoute(): Route } - interface Part { + interface Route { /** - * FileName returns the filename parameter of the [Part]'s Content-Disposition - * header. If not empty, the filename is passed through filepath.Base (which is - * platform dependent) before being returned. + * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. */ - fileName(): string + forGroup(pathPrefix: string, middlewares: Array): Routable } - interface Part { + /** + * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this + * interface are meant for request routing purposes and should not be used in middlewares. + */ + interface RoutableContext { + [key:string]: any; /** - * Read reads the body of a part, after its headers and before the - * next part (if any) begins. + * Request returns `*http.Request`. */ - read(d: string|Array): number + request(): (http.Request) + /** + * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. + */ + rawPathParams(): (PathParams) + /** + * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). + * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. + */ + setRawPathParams(params: PathParams): void + /** + * SetPath sets the registered path for the handler. + */ + setPath(p: string): void + /** + * SetRouteInfo sets the route info of this request to the context. + */ + setRouteInfo(ri: RouteInfo): void + /** + * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context + * for later use in middlewares/handler. + */ + set(key: string, val: { + }): void } - interface Part { - close(): void + /** + * PathParam is tuple pf path parameter name and its value in request path + */ + interface PathParam { + name: string + value: string } } -namespace store { +namespace hook { + /** + * Handler defines a hook handler function. + */ + interface Handler {(e: T): void } + /** + * wrapped local Hook embedded struct to limit the public API surface. + */ + type _subYquQA = Hook + interface mainHook extends _subYquQA { + } } /** @@ -18686,644 +18979,364 @@ namespace store { * new Logger with the same Handler as the original, but with all * its attributes qualified by the group name. * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: - * - * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. - * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, - * - * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement - * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` - * - * behaves the same as - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` - * - * is the most efficient way to achieve the same output as - * - * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: * * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) * ``` * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` + * # Contexts * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, * * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * slog.InfoContext(ctx, "message") * ``` * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: + * It is recommended to pass a context to an output method if one is available. * - * ``` - * type expensive struct { arg int } + * # Attrs and Values * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) * ``` * - * Then use a value of that type in log calls: + * behaves the same as * * ``` - * slog.Debug("frobbing", "value", expensive{arg}) + * slog.Info("hello", "count", 3) * ``` * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. * - * # Writing a handler + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - /** - * An Attr is a key-value pair. - */ - interface Attr { - key: string - value: Value - } - interface Attr { - /** - * Equal reports whether a and b have equal keys and values. - */ - equal(b: Attr): boolean - } - interface Attr { - string(): string - } - /** - * A Handler handles log records produced by a Logger. - * - * A typical handler may print log records to standard error, - * or write them to a file or database, or perhaps augment them - * with additional attributes and pass them on to another handler. - * - * Any of the Handler's methods may be called concurrently with itself - * or with other methods. It is the responsibility of the Handler to - * manage this concurrency. - * - * Users of the slog package should not invoke Handler methods directly. - * They should use the methods of [Logger] instead. - */ - interface Handler { - [key:string]: any; - /** - * Enabled reports whether the handler handles records at the given level. - * The handler ignores records whose level is lower. - * It is called early, before any arguments are processed, - * to save effort if the log event should be discarded. - * If called from a Logger method, the first argument is the context - * passed to that method, or context.Background() if nil was passed - * or the method does not take a context. - * The context is passed so Enabled can use its values - * to make a decision. - */ - enabled(_arg0: context.Context, _arg1: Level): boolean - /** - * Handle handles the Record. - * It will only be called when Enabled returns true. - * The Context argument is as for Enabled. - * It is present solely to provide Handlers access to the context's values. - * Canceling the context should not affect record processing. - * (Among other things, log messages may be necessary to debug a - * cancellation-related problem.) - * - * Handle methods that produce output should observe the following rules: - * ``` - * - If r.Time is the zero time, ignore the time. - * - If r.PC is zero, ignore it. - * - Attr's values should be resolved. - * - If an Attr's key and value are both the zero value, ignore the Attr. - * This can be tested with attr.Equal(Attr{}). - * - If a group's key is empty, inline the group's Attrs. - * - If a group has no Attrs (even if it has a non-empty key), - * ignore it. - * ``` - */ - handle(_arg0: context.Context, _arg1: Record): void - /** - * WithAttrs returns a new Handler whose attributes consist of - * both the receiver's attributes and the arguments. - * The Handler owns the slice: it may retain, modify or discard it. - */ - withAttrs(attrs: Array): Handler - /** - * WithGroup returns a new Handler with the given group appended to - * the receiver's existing groups. - * The keys of all subsequent attributes, whether added by With or in a - * Record, should be qualified by the sequence of group names. - * - * How this qualification happens is up to the Handler, so long as - * this Handler's attribute keys differ from those of another Handler - * with a different sequence of group names. - * - * A Handler should treat WithGroup as starting a Group of Attrs that ends - * at the end of the log event. That is, - * - * ``` - * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) - * ``` - * - * should behave like - * - * ``` - * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) - * ``` - * - * If the name is empty, WithGroup returns the receiver. - */ - withGroup(name: string): Handler - } - /** - * A Level is the importance or severity of a log event. - * The higher the level, the more important or severe the event. - */ - interface Level extends Number{} - interface Level { - /** - * String returns a name for the level. - * If the level has a name, then that name - * in uppercase is returned. - * If the level is between named values, then - * an integer is appended to the uppercased name. - * Examples: - * - * ``` - * LevelWarn.String() => "WARN" - * (LevelInfo+2).String() => "INFO+2" - * ``` - */ - string(): string - } - interface Level { - /** - * MarshalJSON implements [encoding/json.Marshaler] - * by quoting the output of [Level.String]. - */ - marshalJSON(): string|Array - } - interface Level { - /** - * UnmarshalJSON implements [encoding/json.Unmarshaler] - * It accepts any string produced by [Level.MarshalJSON], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". - */ - unmarshalJSON(data: string|Array): void - } - interface Level { - /** - * MarshalText implements [encoding.TextMarshaler] - * by calling [Level.String]. - */ - marshalText(): string|Array - } - interface Level { - /** - * UnmarshalText implements [encoding.TextUnmarshaler]. - * It accepts any string produced by [Level.MarshalText], - * ignoring case. - * It also accepts numeric offsets that would result in a different string on - * output. For example, "Error-8" would marshal as "INFO". - */ - unmarshalText(data: string|Array): void - } - interface Level { - /** - * Level returns the receiver. - * It implements [Leveler]. - */ - level(): Level - } - // @ts-ignore - import loginternal = internal -} - -namespace search { - /** - * Result defines the returned search result structure. - */ - interface Result { - page: number - perPage: number - totalItems: number - totalPages: number - items: any - } -} - -/** - * Package http provides HTTP client and server implementations. + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * The call * * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) * ``` * - * The caller must close the response body when finished with it: + * is the most efficient way to achieve the same output as * * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... + * slog.InfoContext(ctx, "hello", "count", 3) * ``` * - * # Clients and Transports + * # Customizing a type's logging behavior * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. * - * resp, err := client.Get("http://example.com") - * // ... + * # Wrapping output methods * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } * ``` * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: + * and you call it like this in main.go: * * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") + * Infof(slog.Default(), "hello, %s", "world") * ``` * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. + * then slog will report the source file as mylog.go, not main.go. * - * # Servers + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * # Working with Records * - * ``` - * http.Handle("/foo", fooHandler) + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) + * # Performance considerations * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. * - * More control over the server's behavior is available by creating a - * custom Server: + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call * * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily * ``` * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: * * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed * ``` * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - /** - * SameSite allows a server to define a cookie attribute making it impossible for - * the browser to send this cookie along with cross-site requests. The main - * goal is to mitigate the risk of cross-origin information leakage, and provide - * some protection against cross-site request forgery attacks. - * - * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. - */ - interface SameSite extends Number{} - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url -} - -/** - * Package echo implements high performance, minimalist Go web framework. + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: * - * Example: + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: * * ``` - * package main + * type expensive struct { arg int } * - * import ( - * "github.com/labstack/echo/v5" - * "github.com/labstack/echo/v5/middleware" - * "log" - * "net/http" - * ) + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` * - * // Handler - * func hello(c echo.Context) error { - * return c.String(http.StatusOK, "Hello, World!") - * } + * Then use a value of that type in log calls: * - * func main() { - * // Echo instance - * e := echo.New() + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` * - * // Middleware - * e.Use(middleware.Logger()) - * e.Use(middleware.Recover()) + * Now computeExpensiveValue will only be called when the line is enabled. * - * // Routes - * e.GET("/", hello) + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. * - * // Start server - * if err := e.Start(":8080"); err != http.ErrServerClosed { - * log.Fatal(err) - * } - * } - * ``` + * # Writing a handler * - * Learn more at https://echo.labstack.com + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. */ -namespace echo { - // @ts-ignore - import stdContext = context +namespace slog { /** - * Route contains information to adding/registering new route with the router. - * Method+Path pair uniquely identifies the Route. It is mandatory to provide Method+Path+Handler fields. + * An Attr is a key-value pair. */ - interface Route { - method: string - path: string - handler: HandlerFunc - middlewares: Array - name: string + interface Attr { + key: string + value: Value } - interface Route { + interface Attr { + /** + * Equal reports whether a and b have equal keys and values. + */ + equal(b: Attr): boolean + } + interface Attr { + string(): string + } + /** + * A Handler handles log records produced by a Logger. + * + * A typical handler may print log records to standard error, + * or write them to a file or database, or perhaps augment them + * with additional attributes and pass them on to another handler. + * + * Any of the Handler's methods may be called concurrently with itself + * or with other methods. It is the responsibility of the Handler to + * manage this concurrency. + * + * Users of the slog package should not invoke Handler methods directly. + * They should use the methods of [Logger] instead. + */ + interface Handler { + [key:string]: any; /** - * ToRouteInfo converts Route to RouteInfo + * Enabled reports whether the handler handles records at the given level. + * The handler ignores records whose level is lower. + * It is called early, before any arguments are processed, + * to save effort if the log event should be discarded. + * If called from a Logger method, the first argument is the context + * passed to that method, or context.Background() if nil was passed + * or the method does not take a context. + * The context is passed so Enabled can use its values + * to make a decision. */ - toRouteInfo(params: Array): RouteInfo - } - interface Route { + enabled(_arg0: context.Context, _arg1: Level): boolean /** - * ToRoute returns Route which Router uses to register the method handler for path. + * Handle handles the Record. + * It will only be called when Enabled returns true. + * The Context argument is as for Enabled. + * It is present solely to provide Handlers access to the context's values. + * Canceling the context should not affect record processing. + * (Among other things, log messages may be necessary to debug a + * cancellation-related problem.) + * + * Handle methods that produce output should observe the following rules: + * ``` + * - If r.Time is the zero time, ignore the time. + * - If r.PC is zero, ignore it. + * - Attr's values should be resolved. + * - If an Attr's key and value are both the zero value, ignore the Attr. + * This can be tested with attr.Equal(Attr{}). + * - If a group's key is empty, inline the group's Attrs. + * - If a group has no Attrs (even if it has a non-empty key), + * ignore it. + * ``` */ - toRoute(): Route - } - interface Route { + handle(_arg0: context.Context, _arg1: Record): void /** - * ForGroup recreates Route with added group prefix and group middlewares it is grouped to. + * WithAttrs returns a new Handler whose attributes consist of + * both the receiver's attributes and the arguments. + * The Handler owns the slice: it may retain, modify or discard it. */ - forGroup(pathPrefix: string, middlewares: Array): Routable + withAttrs(attrs: Array): Handler + /** + * WithGroup returns a new Handler with the given group appended to + * the receiver's existing groups. + * The keys of all subsequent attributes, whether added by With or in a + * Record, should be qualified by the sequence of group names. + * + * How this qualification happens is up to the Handler, so long as + * this Handler's attribute keys differ from those of another Handler + * with a different sequence of group names. + * + * A Handler should treat WithGroup as starting a Group of Attrs that ends + * at the end of the log event. That is, + * + * ``` + * logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) + * ``` + * + * should behave like + * + * ``` + * logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) + * ``` + * + * If the name is empty, WithGroup returns the receiver. + */ + withGroup(name: string): Handler } /** - * RoutableContext is additional interface that structures implementing Context must implement. Methods inside this - * interface are meant for request routing purposes and should not be used in middlewares. + * A Level is the importance or severity of a log event. + * The higher the level, the more important or severe the event. */ - interface RoutableContext { - [key:string]: any; + interface Level extends Number{} + interface Level { /** - * Request returns `*http.Request`. + * String returns a name for the level. + * If the level has a name, then that name + * in uppercase is returned. + * If the level is between named values, then + * an integer is appended to the uppercased name. + * Examples: + * + * ``` + * LevelWarn.String() => "WARN" + * (LevelInfo+2).String() => "INFO+2" + * ``` */ - request(): (http.Request) + string(): string + } + interface Level { /** - * RawPathParams returns raw path pathParams value. Allocation of PathParams is handled by Context. + * MarshalJSON implements [encoding/json.Marshaler] + * by quoting the output of [Level.String]. */ - rawPathParams(): (PathParams) + marshalJSON(): string|Array + } + interface Level { /** - * SetRawPathParams replaces any existing param values with new values for this context lifetime (request). - * Do not set any other value than what you got from RawPathParams as allocation of PathParams is handled by Context. + * UnmarshalJSON implements [encoding/json.Unmarshaler] + * It accepts any string produced by [Level.MarshalJSON], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". */ - setRawPathParams(params: PathParams): void + unmarshalJSON(data: string|Array): void + } + interface Level { /** - * SetPath sets the registered path for the handler. + * MarshalText implements [encoding.TextMarshaler] + * by calling [Level.String]. */ - setPath(p: string): void + marshalText(): string|Array + } + interface Level { /** - * SetRouteInfo sets the route info of this request to the context. + * UnmarshalText implements [encoding.TextUnmarshaler]. + * It accepts any string produced by [Level.MarshalText], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". */ - setRouteInfo(ri: RouteInfo): void + unmarshalText(data: string|Array): void + } + interface Level { /** - * Set saves data in the context. Allows router to store arbitrary (that only router has access to) data in context - * for later use in middlewares/handler. + * Level returns the receiver. + * It implements [Leveler]. */ - set(key: string, val: { - }): void - } - /** - * PathParam is tuple pf path parameter name and its value in request path - */ - interface PathParam { - name: string - value: string - } -} - -namespace mailer { - /** - * Message defines a generic email message struct. - */ - interface Message { - from: mail.Address - to: Array - bcc: Array - cc: Array - subject: string - html: string - text: string - headers: _TygojaDict - attachments: _TygojaDict + level(): Level } + // @ts-ignore + import loginternal = internal } namespace settings { @@ -19350,19 +19363,6 @@ namespace settings { } } -namespace hook { - /** - * Handler defines a hook handler function. - */ - interface Handler {(e: T): void } - /** - * wrapped local Hook embedded struct to limit the public API surface. - */ - type _subJIkCv = Hook - interface mainHook extends _subJIkCv { - } -} - namespace subscriptions { /** * Message defines a client's channel data. @@ -19463,9 +19463,6 @@ namespace core { } } -namespace subscriptions { -} - /** * Package types implements some commonly used db serializable types * like datetime, json, etc. @@ -19738,6 +19735,44 @@ namespace bufio { } } +namespace search { +} + +/** + * Package mail implements parsing of mail messages. + * + * For the most part, this package follows the syntax as specified by RFC 5322 and + * extended by RFC 6532. + * Notable divergences: + * ``` + * - Obsolete address formats are not parsed, including addresses with + * embedded route information. + * - The full range of spacing (the CFWS syntax element) is not supported, + * such as breaking addresses across lines. + * - No unicode normalization is performed. + * - A leading From line is permitted, as in mbox format (RFC 4155). + * ``` + */ +namespace mail { + /** + * Address represents a single mail address. + * An address such as "Barry Gibbs " is represented + * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. + */ + interface Address { + name: string // Proper name; may be empty. + address: string // user@domain + } + interface Address { + /** + * String formats the address as a valid RFC 5322 address. + * If the address's name contains non-ASCII characters + * the name will be rendered according to RFC 2047. + */ + string(): string + } +} + /** * Package slog provides structured logging, * in which log records include a message, @@ -20283,42 +20318,7 @@ namespace slog { } } -namespace search { -} - -/** - * Package mail implements parsing of mail messages. - * - * For the most part, this package follows the syntax as specified by RFC 5322 and - * extended by RFC 6532. - * Notable divergences: - * ``` - * - Obsolete address formats are not parsed, including addresses with - * embedded route information. - * - The full range of spacing (the CFWS syntax element) is not supported, - * such as breaking addresses across lines. - * - No unicode normalization is performed. - * - A leading From line is permitted, as in mbox format (RFC 4155). - * ``` - */ -namespace mail { - /** - * Address represents a single mail address. - * An address such as "Barry Gibbs " is represented - * as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. - */ - interface Address { - name: string // Proper name; may be empty. - address: string // user@domain - } - interface Address { - /** - * String formats the address as a valid RFC 5322 address. - * If the address's name contains non-ASCII characters - * the name will be rendered according to RFC 2047. - */ - string(): string - } +namespace subscriptions { } /** From 08793ee99fada9cef00b71768c6db6c3622b4168 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 3 Nov 2024 12:06:22 +0200 Subject: [PATCH 16/44] fixed error message typo --- plugins/jsvm/jsvm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jsvm/jsvm.go b/plugins/jsvm/jsvm.go index 87b3648c6e..658310f902 100644 --- a/plugins/jsvm/jsvm.go +++ b/plugins/jsvm/jsvm.go @@ -357,7 +357,7 @@ func (p *plugin) watchHooks() error { if hooksDirInfo.Mode()&os.ModeSymlink == os.ModeSymlink { watchDir, err = filepath.EvalSymlinks(p.config.HooksDir) if err != nil { - return fmt.Errorf("failed to resolve hooksDir symink: %w", err) + return fmt.Errorf("failed to resolve hooksDir symlink: %w", err) } } From 26ef0c697c5d95f4a9da13090797673ac36e5bc0 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 3 Nov 2024 12:25:54 +0200 Subject: [PATCH 17/44] registered a default http.Server.ErrorLog handler --- CHANGELOG.md | 2 ++ apis/serve.go | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 073eaad183..b711fb7512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ - Updated the hooks watcher to account for the case when hooksDir is a symlink ([#5789](https://github.com/pocketbase/pocketbase/issues/5789)). +- _(Backported from v0.23.0-rc)_ Registered a default `http.Server.ErrorLog` handler to report general server connection errors as app Debug level logs (e.g. invalid TLS handshakes caused by bots trying to access your server via its IP or other similar errors). + - Other minor fixes (updated npm dev deps to fix the vulnerabilities warning, added more user friendly realtime topic length error, regenerated JSVM types, etc.) diff --git a/apis/serve.go b/apis/serve.go index 1984c13145..90f4628b1e 100644 --- a/apis/serve.go +++ b/apis/serve.go @@ -159,6 +159,7 @@ func Serve(app core.App, config ServeConfig) (*http.Server, error) { BaseContext: func(l net.Listener) context.Context { return baseCtx }, + ErrorLog: log.New(&serverErrorLogWriter{app: app}, "", 0), } serveEvent := &core.ServeEvent{ @@ -275,3 +276,13 @@ func runMigrations(app core.App) error { return nil } + +type serverErrorLogWriter struct { + app core.App +} + +func (s *serverErrorLogWriter) Write(p []byte) (int, error) { + s.app.Logger().Debug(strings.TrimSpace(string(p))) + + return len(p), nil +} From 9a9b667d4ddfdf2253ae19fd472c4733ae97094f Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Tue, 12 Nov 2024 21:43:31 +0200 Subject: [PATCH 18/44] [#5845] delete new uploaded record files in case of DB persist error --- CHANGELOG.md | 5 ++ forms/record_upsert.go | 54 ++++++++++++------ forms/record_upsert_test.go | 88 +++++++++++++++++++++++++++++ tools/filesystem/filesystem.go | 20 +++++++ tools/filesystem/filesystem_test.go | 35 ++++++++++++ 5 files changed, 184 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b711fb7512..dc7ba11364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.22.24 + +- Delete new uploaded record files in case of record DB persist error ([#5845](https://github.com/pocketbase/pocketbase/issues/5845)). + + ## v0.22.23 - Updated the hooks watcher to account for the case when hooksDir is a symlink ([#5789](https://github.com/pocketbase/pocketbase/issues/5789)). diff --git a/forms/record_upsert.go b/forms/record_upsert.go index cdfe972b28..55358de110 100644 --- a/forms/record_upsert.go +++ b/forms/record_upsert.go @@ -756,6 +756,8 @@ func (form *RecordUpsert) Submit(interceptors ...InterceptorFunc[*models.Record] dao := form.dao.Clone() + var uploaded []string + // upload new files (if any) // // note: executed after the default BeforeCreateFunc and BeforeUpdateFunc hook actions @@ -765,7 +767,9 @@ func (form *RecordUpsert) Submit(interceptors ...InterceptorFunc[*models.Record] dao.BeforeCreateFunc = func(eventDao *daos.Dao, m models.Model, action func() error) error { newAction := func() error { if m.TableName() == form.record.TableName() && m.GetId() == form.record.GetId() { - if err := form.processFilesToUpload(); err != nil { + var err error + uploaded, err = form.processFilesToUpload() + if err != nil { return err } } @@ -783,7 +787,9 @@ func (form *RecordUpsert) Submit(interceptors ...InterceptorFunc[*models.Record] dao.BeforeUpdateFunc = func(eventDao *daos.Dao, m models.Model, action func() error) error { newAction := func() error { if m.TableName() == form.record.TableName() && m.GetId() == form.record.GetId() { - if err := form.processFilesToUpload(); err != nil { + var err error + uploaded, err = form.processFilesToUpload() + if err != nil { return err } } @@ -801,6 +807,9 @@ func (form *RecordUpsert) Submit(interceptors ...InterceptorFunc[*models.Record] // persist the record model if err := dao.SaveRecord(form.record); err != nil { + // cleanup - try to delete only the successfully uploaded files + form.deleteFilesByNamesList(uploaded) + return form.prepareError(err) } @@ -819,30 +828,30 @@ func (form *RecordUpsert) Submit(interceptors ...InterceptorFunc[*models.Record] }, interceptors...) } -func (form *RecordUpsert) processFilesToUpload() error { +func (form *RecordUpsert) processFilesToUpload() ([]string, error) { if len(form.filesToUpload) == 0 { - return nil // no parsed file fields + return nil, nil // no parsed file fields } if !form.record.HasId() { - return errors.New("the record doesn't have an id") + return nil, errors.New("the record doesn't have an id") } - fs, err := form.app.NewFilesystem() + fsys, err := form.app.NewFilesystem() if err != nil { - return err + return nil, err } - defer fs.Close() + defer fsys.Close() var uploadErrors []error // list of upload errors - var uploaded []string // list of uploaded file paths + var uploaded []string // list of uploaded file names for fieldKey := range form.filesToUpload { for i, file := range form.filesToUpload[fieldKey] { path := form.record.BaseFilesPath() + "/" + file.Name - if err := fs.UploadFile(file, path); err == nil { + if err := fsys.UploadFile(file, path); err == nil { // keep track of the already uploaded file - uploaded = append(uploaded, path) + uploaded = append(uploaded, file.Name) } else { // store the upload error uploadErrors = append(uploadErrors, fmt.Errorf("file %d: %v", i, err)) @@ -854,10 +863,10 @@ func (form *RecordUpsert) processFilesToUpload() error { // cleanup - try to delete the successfully uploaded files (if any) form.deleteFilesByNamesList(uploaded) - return fmt.Errorf("failed to upload all files: %v", uploadErrors) + return nil, fmt.Errorf("failed to upload all files: %v", uploadErrors) } - return nil + return uploaded, nil } func (form *RecordUpsert) processFilesToDelete() (err error) { @@ -876,24 +885,28 @@ func (form *RecordUpsert) deleteFilesByNamesList(filenames []string) ([]string, return filenames, errors.New("the record doesn't have an id") } - fs, err := form.app.NewFilesystem() + isNew := form.record.IsNew() + + baseDir := form.record.BaseFilesPath() + + fsys, err := form.app.NewFilesystem() if err != nil { return filenames, err } - defer fs.Close() + defer fsys.Close() var deleteErrors []error for i := len(filenames) - 1; i >= 0; i-- { filename := filenames[i] - path := form.record.BaseFilesPath() + "/" + filename + path := baseDir + "/" + filename - if err := fs.Delete(path); err == nil { + if err := fsys.Delete(path); err == nil { // remove the deleted file from the list filenames = append(filenames[:i], filenames[i+1:]...) // try to delete the related file thumbs (if any) - fs.DeletePrefix(form.record.BaseFilesPath() + "/thumbs_" + filename + "/") + fsys.DeletePrefix(baseDir + "/thumbs_" + filename + "/") } else { // store the delete error deleteErrors = append(deleteErrors, fmt.Errorf("file %d: %v", i, err)) @@ -904,6 +917,11 @@ func (form *RecordUpsert) deleteFilesByNamesList(filenames []string) ([]string, return filenames, fmt.Errorf("failed to delete all files: %v", deleteErrors) } + // cleanup empty dir for new records if there are no other files + if isNew && fsys.IsEmptyDir(baseDir) { + _ = fsys.Delete(baseDir) + } + return filenames, nil } diff --git a/forms/record_upsert_test.go b/forms/record_upsert_test.go index 6a730f81cc..b037f06b8e 100644 --- a/forms/record_upsert_test.go +++ b/forms/record_upsert_test.go @@ -619,6 +619,94 @@ func TestRecordUpsertSubmitInterceptors(t *testing.T) { } } +func TestRecordUpsertSubmitFailureFilesCleanup(t *testing.T) { + app, _ := tests.NewTestApp() + defer app.Cleanup() + + collection, err := app.Dao().FindCollectionByNameOrId("demo3") + if err != nil { + t.Fatal(err) + } + + // ensure that there is a unique index constraint + collection.Indexes = append(collection.Indexes, `CREATE UNIQUE INDEX "idx_unique_demo3_title" on "demo3" ("title")`) + if err := app.Dao().SaveCollection(collection); err != nil { + t.Fatal(err) + } + + f1, err := filesystem.NewFileFromBytes([]byte("test1"), "new_test1") + if err != nil { + t.Fatal(err) + } + + f2, err := filesystem.NewFileFromBytes([]byte("test1"), "new_test2") + if err != nil { + t.Fatal(err) + } + + uploadedFiles := []string{f1.Name, f2.Name} + + existing, err := app.Dao().FindRecordById(collection.Id, "mk5fmymtx4wsprk") + if err != nil { + t.Fatal(err) + } + + scenarios := []struct { + recordId string + }{ + {""}, + {"7nwo8tuiatetxdm"}, + {"1tmknxy2868d869"}, + } + + for _, s := range scenarios { + sname := s.recordId + if sname == "" { + sname = "new" + } + + t.Run(sname, func(t *testing.T) { + var originalFiles []string + + var record *models.Record + if s.recordId == "" { + record = models.NewRecord(collection) + } else { + record, err = app.Dao().FindRecordById(collection.Id, s.recordId) + if err != nil { + t.Fatal(err) + } + originalFiles = record.GetStringSlice("files") + } + + record.Set("title", existing.GetString("title")) + + form := forms.NewRecordUpsert(app, record) + + form.AddFiles("files", f1, f2) + + err := form.Submit() + if err == nil { + t.Fatal("Expected form submit to fail") + } + + // ensure that the original files still exists + for _, name := range originalFiles { + if !hasRecordFile(app, record, name) { + t.Fatalf("Missing original file %q", name) + } + } + + // ensure that the new uploaded files were deleted + for _, name := range uploadedFiles { + if hasRecordFile(app, record, name) { + t.Fatalf("Expected file %q to be deleted", name) + } + } + }) + } +} + func TestRecordUpsertWithCustomId(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() diff --git a/tools/filesystem/filesystem.go b/tools/filesystem/filesystem.go index bb0e6ec3f9..55fbdc0d34 100644 --- a/tools/filesystem/filesystem.go +++ b/tools/filesystem/filesystem.go @@ -344,6 +344,26 @@ func (s *System) DeletePrefix(prefix string) []error { return failed } +// Checks if the provided dir prefix doesn't have any files. +// +// A trailing slash will be appended to a non-empty dir string argument +// to ensure that the checked prefix is a "directory". +// +// Returns "false" in case the has at least one file, otherwise - "true". +func (s *System) IsEmptyDir(dir string) bool { + if dir != "" && !strings.HasSuffix(dir, "/") { + dir += "/" + } + + iter := s.bucket.List(&blob.ListOptions{ + Prefix: dir, + }) + + _, err := iter.Next(s.ctx) + + return err == io.EOF +} + var inlineServeContentTypes = []string{ // image "image/png", "image/jpg", "image/jpeg", "image/gif", "image/webp", "image/x-icon", "image/bmp", diff --git a/tools/filesystem/filesystem_test.go b/tools/filesystem/filesystem_test.go index 57e880ca08..60d5b2e2bc 100644 --- a/tools/filesystem/filesystem_test.go +++ b/tools/filesystem/filesystem_test.go @@ -169,6 +169,41 @@ func TestFileSystemDeletePrefixWithTrailingSlash(t *testing.T) { } } +func TestFileSystemIsEmptyDir(t *testing.T) { + dir := createTestDir(t) + defer os.RemoveAll(dir) + + fsys, err := filesystem.NewLocal(dir) + if err != nil { + t.Fatal(err) + } + defer fsys.Close() + + scenarios := []struct { + dir string + expected bool + }{ + {"", false}, // special case that shouldn't be suffixed with delimiter to search for any files within the bucket + {"/", true}, + {"missing", true}, + {"missing/", true}, + {"test", false}, + {"test/", false}, + {"empty", true}, + {"empty/", true}, + } + + for _, s := range scenarios { + t.Run(s.dir, func(t *testing.T) { + result := fsys.IsEmptyDir(s.dir) + + if result != s.expected { + t.Fatalf("Expected %v, got %v", s.expected, result) + } + }) + } +} + func TestFileSystemUploadMultipart(t *testing.T) { dir := createTestDir(t) defer os.RemoveAll(dir) From 8144ad1dda628b070aa88e9793e3abd5e868cd00 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Tue, 12 Nov 2024 21:45:19 +0200 Subject: [PATCH 19/44] updated ui/dist --- ui/.env | 2 +- ...ifPdWR1.js => AuthMethodsDocs-D7M5HLRz.js} | 2 +- ...dUir8-r.js => AuthRefreshDocs-Qii5vPCm.js} | 2 +- ...stLV.js => AuthWithOAuth2Docs-fAroZBFD.js} | 2 +- ...uX.js => AuthWithPasswordDocs-Day03rmY.js} | 2 +- ...tor-97oGZhvg.js => CodeEditor-iXaWdysu.js} | 2 +- ....js => ConfirmEmailChangeDocs-C8t_3a0s.js} | 2 +- ...s => ConfirmPasswordResetDocs-CqsVn5Wy.js} | 2 +- ...js => ConfirmVerificationDocs-DXzEcR9y.js} | 2 +- ...-cTL4BTwH.js => CreateApiDocs-DyFYshJx.js} | 2 +- ...-C521Da9d.js => DeleteApiDocs-BjlD4kbR.js} | 2 +- ...2XHXnv.js => FieldsQueryParam-DRCPhrsm.js} | 2 +- ...js => FilterAutocompleteInput-DG6SVeUP.js} | 2 +- ...cs-CtNZ5G9D.js => ListApiDocs-D0RToTF6.js} | 2 +- ...6.js => ListExternalAuthsDocs-FIkHZF7A.js} | 2 +- ...PageAdminConfirmPasswordReset-B5V9k9ND.js} | 2 +- ...PageAdminRequestPasswordReset-CLtpG3X-.js} | 2 +- ... => PageOAuth2RedirectFailure-tMl3bsYz.js} | 2 +- ... => PageOAuth2RedirectSuccess-DFTUTq4C.js} | 2 +- ... PageRecordConfirmEmailChange-B4LDtp4c.js} | 2 +- ...ageRecordConfirmPasswordReset-B1PSZ-qj.js} | 2 +- ...PageRecordConfirmVerification-CQyCw5g4.js} | 2 +- ...lyauiFo.js => RealtimeApiDocs-5_90JfZR.js} | 2 +- ....js => RequestEmailChangeDocs-W_T6yElq.js} | 2 +- ...s => RequestPasswordResetDocs-Iw-ugIBq.js} | 2 +- ...js => RequestVerificationDocs-C_sAThHJ.js} | 2 +- ...dkTabs-C9BIEbpG.js => SdkTabs-CofkKgiC.js} | 2 +- ....js => UnlinkExternalAuthDocs-BAfMmG5W.js} | 2 +- ...-B4w33bkJ.js => UpdateApiDocs-DY8egWRV.js} | 2 +- ...cs-Bt5koN3Z.js => ViewApiDocs-DaNIuuC4.js} | 2 +- .../{index-B6GxOPDi.js => index-C3DCbsuy.js} | 20 +++++++++---------- ui/dist/index.html | 2 +- 32 files changed, 41 insertions(+), 41 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-DifPdWR1.js => AuthMethodsDocs-D7M5HLRz.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-CdUir8-r.js => AuthRefreshDocs-Qii5vPCm.js} (97%) rename ui/dist/assets/{AuthWithOAuth2Docs-C9IystLV.js => AuthWithOAuth2Docs-fAroZBFD.js} (98%) rename ui/dist/assets/{AuthWithPasswordDocs-CaL3O2uX.js => AuthWithPasswordDocs-Day03rmY.js} (98%) rename ui/dist/assets/{CodeEditor-97oGZhvg.js => CodeEditor-iXaWdysu.js} (99%) rename ui/dist/assets/{ConfirmEmailChangeDocs-T4e4Bmxi.js => ConfirmEmailChangeDocs-C8t_3a0s.js} (97%) rename ui/dist/assets/{ConfirmPasswordResetDocs-DCQFPDN7.js => ConfirmPasswordResetDocs-CqsVn5Wy.js} (98%) rename ui/dist/assets/{ConfirmVerificationDocs-BKx9x0MU.js => ConfirmVerificationDocs-DXzEcR9y.js} (97%) rename ui/dist/assets/{CreateApiDocs-cTL4BTwH.js => CreateApiDocs-DyFYshJx.js} (98%) rename ui/dist/assets/{DeleteApiDocs-C521Da9d.js => DeleteApiDocs-BjlD4kbR.js} (97%) rename ui/dist/assets/{FieldsQueryParam-DB2XHXnv.js => FieldsQueryParam-DRCPhrsm.js} (96%) rename ui/dist/assets/{FilterAutocompleteInput-CFHe_5bb.js => FilterAutocompleteInput-DG6SVeUP.js} (99%) rename ui/dist/assets/{ListApiDocs-CtNZ5G9D.js => ListApiDocs-D0RToTF6.js} (99%) rename ui/dist/assets/{ListExternalAuthsDocs-DCCFJUK6.js => ListExternalAuthsDocs-FIkHZF7A.js} (97%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-C5ZKwumu.js => PageAdminConfirmPasswordReset-B5V9k9ND.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-DnoMIZGu.js => PageAdminRequestPasswordReset-CLtpG3X-.js} (98%) rename ui/dist/assets/{PageOAuth2RedirectFailure-Da-UeZbe.js => PageOAuth2RedirectFailure-tMl3bsYz.js} (86%) rename ui/dist/assets/{PageOAuth2RedirectSuccess-BBB69FeN.js => PageOAuth2RedirectSuccess-DFTUTq4C.js} (86%) rename ui/dist/assets/{PageRecordConfirmEmailChange-D9_-dnhk.js => PageRecordConfirmEmailChange-B4LDtp4c.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-CP5c1DP1.js => PageRecordConfirmPasswordReset-B1PSZ-qj.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-CfCN5jko.js => PageRecordConfirmVerification-CQyCw5g4.js} (97%) rename ui/dist/assets/{RealtimeApiDocs-DlyauiFo.js => RealtimeApiDocs-5_90JfZR.js} (98%) rename ui/dist/assets/{RequestEmailChangeDocs-DmKjgrzy.js => RequestEmailChangeDocs-W_T6yElq.js} (98%) rename ui/dist/assets/{RequestPasswordResetDocs-CCrC-X-J.js => RequestPasswordResetDocs-Iw-ugIBq.js} (97%) rename ui/dist/assets/{RequestVerificationDocs-B3KxCvqw.js => RequestVerificationDocs-C_sAThHJ.js} (97%) rename ui/dist/assets/{SdkTabs-C9BIEbpG.js => SdkTabs-CofkKgiC.js} (96%) rename ui/dist/assets/{UnlinkExternalAuthDocs-4JM4cUB_.js => UnlinkExternalAuthDocs-BAfMmG5W.js} (98%) rename ui/dist/assets/{UpdateApiDocs-B4w33bkJ.js => UpdateApiDocs-DY8egWRV.js} (98%) rename ui/dist/assets/{ViewApiDocs-Bt5koN3Z.js => ViewApiDocs-DaNIuuC4.js} (97%) rename ui/dist/assets/{index-B6GxOPDi.js => index-C3DCbsuy.js} (99%) diff --git a/ui/.env b/ui/.env index 768c582d51..489150fd66 100644 --- a/ui/.env +++ b/ui/.env @@ -9,4 +9,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/" PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk" PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk" PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases" -PB_VERSION = "v0.22.23" +PB_VERSION = "v0.22.24" diff --git a/ui/dist/assets/AuthMethodsDocs-DifPdWR1.js b/ui/dist/assets/AuthMethodsDocs-D7M5HLRz.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-DifPdWR1.js rename to ui/dist/assets/AuthMethodsDocs-D7M5HLRz.js index 1bc6986bca..f7fb2ac074 100644 --- a/ui/dist/assets/AuthMethodsDocs-DifPdWR1.js +++ b/ui/dist/assets/AuthMethodsDocs-D7M5HLRz.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-B6GxOPDi.js";import{S as Ke}from"./SdkTabs-C9BIEbpG.js";import{F as qe}from"./FieldsQueryParam-DB2XHXnv.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` +import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-C3DCbsuy.js";import{S as Ke}from"./SdkTabs-CofkKgiC.js";import{F as qe}from"./FieldsQueryParam-DRCPhrsm.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-CdUir8-r.js b/ui/dist/assets/AuthRefreshDocs-Qii5vPCm.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-CdUir8-r.js rename to ui/dist/assets/AuthRefreshDocs-Qii5vPCm.js index cb6d34ed17..70166987fe 100644 --- a/ui/dist/assets/AuthRefreshDocs-CdUir8-r.js +++ b/ui/dist/assets/AuthRefreshDocs-Qii5vPCm.js @@ -1,4 +1,4 @@ -import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-B6GxOPDi.js";import{S as Ze}from"./SdkTabs-C9BIEbpG.js";import{F as et}from"./FieldsQueryParam-DB2XHXnv.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function xe(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,Q=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` +import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-C3DCbsuy.js";import{S as Ze}from"./SdkTabs-CofkKgiC.js";import{F as et}from"./FieldsQueryParam-DRCPhrsm.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function xe(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,Q=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-C9IystLV.js b/ui/dist/assets/AuthWithOAuth2Docs-fAroZBFD.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-C9IystLV.js rename to ui/dist/assets/AuthWithOAuth2Docs-fAroZBFD.js index 254813757b..df2b3e27ec 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-C9IystLV.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-fAroZBFD.js @@ -1,4 +1,4 @@ -import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Ne,k as Qe,R as ze,n as Ie,t as L,a as x,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-B6GxOPDi.js";import{S as Xe}from"./SdkTabs-C9BIEbpG.js";import{F as Ye}from"./FieldsQueryParam-DB2XHXnv.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,E,be,J,R,me,Z,N=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Ne,k as Qe,R as ze,n as Ie,t as L,a as x,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-C3DCbsuy.js";import{S as Xe}from"./SdkTabs-CofkKgiC.js";import{F as Ye}from"./FieldsQueryParam-DRCPhrsm.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,E,be,J,R,me,Z,N=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-CaL3O2uX.js b/ui/dist/assets/AuthWithPasswordDocs-Day03rmY.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-CaL3O2uX.js rename to ui/dist/assets/AuthWithPasswordDocs-Day03rmY.js index f18cd0f8d1..a8ce0191f9 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-CaL3O2uX.js +++ b/ui/dist/assets/AuthWithPasswordDocs-Day03rmY.js @@ -1,4 +1,4 @@ -import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as m,g as r,h as t,m as se,x as De,P as pt,Q as Pt,k as Rt,R as Ct,n as Ot,t as Z,a as x,o as c,d as ie,C as ft,p as At,r as re,u as Tt}from"./index-B6GxOPDi.js";import{S as Ut}from"./SdkTabs-C9BIEbpG.js";import{F as Mt}from"./FieldsQueryParam-DB2XHXnv.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&De(g,i),C&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,Be,he,V,be,M,me,qe,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ce,Qe,k,je,q,Je,Ke,ze,Oe,Ge,Ae,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,A=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` +import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as m,g as r,h as t,m as se,x as De,P as pt,Q as Pt,k as Rt,R as Ct,n as Ot,t as Z,a as x,o as c,d as ie,C as ft,p as At,r as re,u as Tt}from"./index-C3DCbsuy.js";import{S as Ut}from"./SdkTabs-CofkKgiC.js";import{F as Mt}from"./FieldsQueryParam-DRCPhrsm.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&De(g,i),C&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,Be,he,V,be,M,me,qe,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ce,Qe,k,je,q,Je,Ke,ze,Oe,Ge,Ae,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,A=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); diff --git a/ui/dist/assets/CodeEditor-97oGZhvg.js b/ui/dist/assets/CodeEditor-iXaWdysu.js similarity index 99% rename from ui/dist/assets/CodeEditor-97oGZhvg.js rename to ui/dist/assets/CodeEditor-iXaWdysu.js index b56bb2ddf4..a3341f37da 100644 --- a/ui/dist/assets/CodeEditor-97oGZhvg.js +++ b/ui/dist/assets/CodeEditor-iXaWdysu.js @@ -1,4 +1,4 @@ -import{S as wt,i as vt,s as qt,e as Yt,f as Tt,U as OO,g as Rt,y as IO,o as Vt,J as _t,K as jt,L as zt,I as Gt,C as Ut,M as Ct}from"./index-B6GxOPDi.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-BJXhcZ8-.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { +import{S as wt,i as vt,s as qt,e as Yt,f as Tt,U as OO,g as Rt,y as IO,o as Vt,J as _t,K as jt,L as zt,I as Gt,C as Ut,M as Ct}from"./index-C3DCbsuy.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-BJXhcZ8-.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-T4e4Bmxi.js b/ui/dist/assets/ConfirmEmailChangeDocs-C8t_3a0s.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-T4e4Bmxi.js rename to ui/dist/assets/ConfirmEmailChangeDocs-C8t_3a0s.js index 5f79a45479..b042779cab 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-T4e4Bmxi.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-C8t_3a0s.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-B6GxOPDi.js";import{S as De}from"./SdkTabs-C9BIEbpG.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` +import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-C3DCbsuy.js";import{S as De}from"./SdkTabs-CofkKgiC.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-DCQFPDN7.js b/ui/dist/assets/ConfirmPasswordResetDocs-CqsVn5Wy.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-DCQFPDN7.js rename to ui/dist/assets/ConfirmPasswordResetDocs-CqsVn5Wy.js index b53dd82c64..5caa3bfaa6 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-DCQFPDN7.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-CqsVn5Wy.js @@ -1,4 +1,4 @@ -import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-B6GxOPDi.js";import{S as Ie}from"./SdkTabs-C9BIEbpG.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` +import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-C3DCbsuy.js";import{S as Ie}from"./SdkTabs-CofkKgiC.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-BKx9x0MU.js b/ui/dist/assets/ConfirmVerificationDocs-DXzEcR9y.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-BKx9x0MU.js rename to ui/dist/assets/ConfirmVerificationDocs-DXzEcR9y.js index 541db06853..810601f3ba 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-BKx9x0MU.js +++ b/ui/dist/assets/ConfirmVerificationDocs-DXzEcR9y.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-B6GxOPDi.js";import{S as Ae}from"./SdkTabs-C9BIEbpG.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-C3DCbsuy.js";import{S as Ae}from"./SdkTabs-CofkKgiC.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-cTL4BTwH.js b/ui/dist/assets/CreateApiDocs-DyFYshJx.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-cTL4BTwH.js rename to ui/dist/assets/CreateApiDocs-DyFYshJx.js index 4edca277b3..083645974c 100644 --- a/ui/dist/assets/CreateApiDocs-cTL4BTwH.js +++ b/ui/dist/assets/CreateApiDocs-DyFYshJx.js @@ -1,4 +1,4 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-B6GxOPDi.js";import{S as At}from"./SdkTabs-C9BIEbpG.js";import{F as Bt}from"./FieldsQueryParam-DB2XHXnv.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
    Optional username
    String The username of the auth record. +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-C3DCbsuy.js";import{S as At}from"./SdkTabs-CofkKgiC.js";import{F as Bt}from"./FieldsQueryParam-DRCPhrsm.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
    Optional username
    String The username of the auth record.
    If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
    Optional emailVisibility
    Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
    Required password
    String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
    Required passwordConfirm
    String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
    Optional verified
    Boolean Indicates whether the auth record is verified or not.
    diff --git a/ui/dist/assets/DeleteApiDocs-C521Da9d.js b/ui/dist/assets/DeleteApiDocs-BjlD4kbR.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-C521Da9d.js rename to ui/dist/assets/DeleteApiDocs-BjlD4kbR.js index d6b2fb078e..afb8c0945f 100644 --- a/ui/dist/assets/DeleteApiDocs-C521Da9d.js +++ b/ui/dist/assets/DeleteApiDocs-BjlD4kbR.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-B6GxOPDi.js";import{S as He}from"./SdkTabs-C9BIEbpG.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-C3DCbsuy.js";import{S as He}from"./SdkTabs-CofkKgiC.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/FieldsQueryParam-DB2XHXnv.js b/ui/dist/assets/FieldsQueryParam-DRCPhrsm.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-DB2XHXnv.js rename to ui/dist/assets/FieldsQueryParam-DRCPhrsm.js index 59e023d2d0..8df673261a 100644 --- a/ui/dist/assets/FieldsQueryParam-DB2XHXnv.js +++ b/ui/dist/assets/FieldsQueryParam-DRCPhrsm.js @@ -1,4 +1,4 @@ -import{S as J,i as O,s as P,N as Q,e as t,b as c,w as i,c as R,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-B6GxOPDi.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,k,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as O,s as P,N as Q,e as t,b as c,w as i,c as R,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-C3DCbsuy.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,k,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),h=t("em"),h.textContent="(by default returns all fields)",y=i(`. Ex.: `),R(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-CFHe_5bb.js b/ui/dist/assets/FilterAutocompleteInput-DG6SVeUP.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-CFHe_5bb.js rename to ui/dist/assets/FilterAutocompleteInput-DG6SVeUP.js index 460290ff02..8a872a1267 100644 --- a/ui/dist/assets/FilterAutocompleteInput-CFHe_5bb.js +++ b/ui/dist/assets/FilterAutocompleteInput-DG6SVeUP.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,e as ne,f as re,g as ae,y as D,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-B6GxOPDi.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as P,C as R,S as qe,t as ve,u as We,v as _e}from"./index-BJXhcZ8-.js";function Oe(e){return new Worker(""+new URL("autocomplete.worker-CGnTjHzG.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,v=new Oe,H=[],T=[],B=[],C="",W="";function _(){d==null||d.focus()}let O=null;v.onmessage=n=>{B=n.data.baseKeys||[],H=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function z(){clearTimeout(O),O=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function G(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(H||[])),c&&(l=l.concat(T||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};G();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(P(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(O),U(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!a&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),z()),e.$$.dirty[0]&4&&f&&G(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(P(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,C,W,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; +import{S as $,i as ee,s as te,e as ne,f as re,g as ae,y as D,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-C3DCbsuy.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as P,C as R,S as qe,t as ve,u as We,v as _e}from"./index-BJXhcZ8-.js";function Oe(e){return new Worker(""+new URL("autocomplete.worker-CGnTjHzG.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,v=new Oe,H=[],T=[],B=[],C="",W="";function _(){d==null||d.focus()}let O=null;v.onmessage=n=>{B=n.data.baseKeys||[],H=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function z(){clearTimeout(O),O=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function G(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(H||[])),c&&(l=l.concat(T||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};G();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(P(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(O),U(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!a&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),z()),e.$$.dirty[0]&4&&f&&G(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(P(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,C,W,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; diff --git a/ui/dist/assets/ListApiDocs-CtNZ5G9D.js b/ui/dist/assets/ListApiDocs-D0RToTF6.js similarity index 99% rename from ui/dist/assets/ListApiDocs-CtNZ5G9D.js rename to ui/dist/assets/ListApiDocs-D0RToTF6.js index 7911ff556c..6db7b4d436 100644 --- a/ui/dist/assets/ListApiDocs-CtNZ5G9D.js +++ b/ui/dist/assets/ListApiDocs-D0RToTF6.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-B6GxOPDi.js";import{S as dl}from"./SdkTabs-C9BIEbpG.js";import{F as pl}from"./FieldsQueryParam-DB2XHXnv.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-C3DCbsuy.js";import{S as dl}from"./SdkTabs-CofkKgiC.js";import{F as pl}from"./FieldsQueryParam-DRCPhrsm.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-DCCFJUK6.js b/ui/dist/assets/ListExternalAuthsDocs-FIkHZF7A.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-DCCFJUK6.js rename to ui/dist/assets/ListExternalAuthsDocs-FIkHZF7A.js index 42f19ea59d..a7b72baffe 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-DCCFJUK6.js +++ b/ui/dist/assets/ListExternalAuthsDocs-FIkHZF7A.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-B6GxOPDi.js";import{S as Ye}from"./SdkTabs-C9BIEbpG.js";import{F as Ze}from"./FieldsQueryParam-DB2XHXnv.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-C3DCbsuy.js";import{S as Ye}from"./SdkTabs-CofkKgiC.js";import{F as Ze}from"./FieldsQueryParam-DRCPhrsm.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-C5ZKwumu.js b/ui/dist/assets/PageAdminConfirmPasswordReset-B5V9k9ND.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-C5ZKwumu.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-B5V9k9ND.js index 20d4051c0c..c049b20797 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-C5ZKwumu.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-B5V9k9ND.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-B6GxOPDi.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-C3DCbsuy.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js b/ui/dist/assets/PageAdminRequestPasswordReset-CLtpG3X-.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js rename to ui/dist/assets/PageAdminRequestPasswordReset-CLtpG3X-.js index a4279bcda9..d942adeb20 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-DnoMIZGu.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-CLtpG3X-.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-B6GxOPDi.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

    Forgotten admin password

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

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

    Forgotten admin password

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

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

    Auth failed.

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

    Auth failed.

    You can close this window and go back to the app to try again.
    ',l(t,"class","content txt-hint txt-center p-base")},m(e,s){u(e,t,s)},p:a,i:a,o:a,d(e){e&&d(t)}}}function p(n){return h(()=>{window.close()}),[]}class g extends o{constructor(t){super(),i(this,t,p,f,c,{})}}export{g as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-BBB69FeN.js b/ui/dist/assets/PageOAuth2RedirectSuccess-DFTUTq4C.js similarity index 86% rename from ui/dist/assets/PageOAuth2RedirectSuccess-BBB69FeN.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-DFTUTq4C.js index 7eaf8fb285..cab3c62f4d 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-BBB69FeN.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-DFTUTq4C.js @@ -1 +1 @@ -import{S as o,i as c,s as i,e as r,f as u,g as l,y as s,o as d,I as h}from"./index-B6GxOPDi.js";function p(n){let t;return{c(){t=r("div"),t.innerHTML='

    Auth completed.

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

    Auth completed.

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

    Successfully changed the user email address.

    You can now sign in with your new email address.

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

    Successfully changed the user password.

    You can now sign in with your new password.

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

    Invalid or expired verification token.

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

    Successfully verified email address.

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

    Invalid or expired verification token.

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

    Successfully verified email address.

    ',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
    Please wait...
    ',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-DlyauiFo.js b/ui/dist/assets/RealtimeApiDocs-5_90JfZR.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-DlyauiFo.js rename to ui/dist/assets/RealtimeApiDocs-5_90JfZR.js index e7d7ab07e6..0120880825 100644 --- a/ui/dist/assets/RealtimeApiDocs-DlyauiFo.js +++ b/ui/dist/assets/RealtimeApiDocs-5_90JfZR.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-B6GxOPDi.js";import{S as de}from"./SdkTabs-C9BIEbpG.js";function he(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,w,v,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-C3DCbsuy.js";import{S as de}from"./SdkTabs-CofkKgiC.js";function he(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,w,v,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-DmKjgrzy.js b/ui/dist/assets/RequestEmailChangeDocs-W_T6yElq.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-DmKjgrzy.js rename to ui/dist/assets/RequestEmailChangeDocs-W_T6yElq.js index 88235c34e2..a4a7e7f44f 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-DmKjgrzy.js +++ b/ui/dist/assets/RequestEmailChangeDocs-W_T6yElq.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-B6GxOPDi.js";import{S as je}from"./SdkTabs-C9BIEbpG.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-C3DCbsuy.js";import{S as je}from"./SdkTabs-CofkKgiC.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-CCrC-X-J.js b/ui/dist/assets/RequestPasswordResetDocs-Iw-ugIBq.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-CCrC-X-J.js rename to ui/dist/assets/RequestPasswordResetDocs-Iw-ugIBq.js index 5315d42730..366b072a2f 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-CCrC-X-J.js +++ b/ui/dist/assets/RequestPasswordResetDocs-Iw-ugIBq.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-B6GxOPDi.js";import{S as Ue}from"./SdkTabs-C9BIEbpG.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-C3DCbsuy.js";import{S as Ue}from"./SdkTabs-CofkKgiC.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js b/ui/dist/assets/RequestVerificationDocs-C_sAThHJ.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js rename to ui/dist/assets/RequestVerificationDocs-C_sAThHJ.js index ecdfe13946..85ce111a87 100644 --- a/ui/dist/assets/RequestVerificationDocs-B3KxCvqw.js +++ b/ui/dist/assets/RequestVerificationDocs-C_sAThHJ.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-B6GxOPDi.js";import{S as Ae}from"./SdkTabs-C9BIEbpG.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` +import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-C3DCbsuy.js";import{S as Ae}from"./SdkTabs-CofkKgiC.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/SdkTabs-C9BIEbpG.js b/ui/dist/assets/SdkTabs-CofkKgiC.js similarity index 96% rename from ui/dist/assets/SdkTabs-C9BIEbpG.js rename to ui/dist/assets/SdkTabs-CofkKgiC.js index 55dc8c28b0..09a26ae8b6 100644 --- a/ui/dist/assets/SdkTabs-C9BIEbpG.js +++ b/ui/dist/assets/SdkTabs-CofkKgiC.js @@ -1 +1 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as P,a as T,o as C,w,r as E,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-B6GxOPDi.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function I(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function M(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(P(s.$$.fragment,b),d=!0)},o(b){T(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(N,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as P,a as T,o as C,w,r as E,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-C3DCbsuy.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function I(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function M(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(P(s.$$.fragment,b),d=!0)},o(b){T(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(N,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-4JM4cUB_.js b/ui/dist/assets/UnlinkExternalAuthDocs-BAfMmG5W.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-4JM4cUB_.js rename to ui/dist/assets/UnlinkExternalAuthDocs-BAfMmG5W.js index 2eee24cf2a..0aa11b2624 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-4JM4cUB_.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-BAfMmG5W.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-B6GxOPDi.js";import{S as Ke}from"./SdkTabs-C9BIEbpG.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-C3DCbsuy.js";import{S as Ke}from"./SdkTabs-CofkKgiC.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-B4w33bkJ.js b/ui/dist/assets/UpdateApiDocs-DY8egWRV.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-B4w33bkJ.js rename to ui/dist/assets/UpdateApiDocs-DY8egWRV.js index b45c2f0416..cb8e5a1202 100644 --- a/ui/dist/assets/UpdateApiDocs-B4w33bkJ.js +++ b/ui/dist/assets/UpdateApiDocs-DY8egWRV.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-B6GxOPDi.js";import{S as Ft}from"./SdkTabs-C9BIEbpG.js";import{F as Nt}from"./FieldsQueryParam-DB2XHXnv.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-C3DCbsuy.js";import{S as Ft}from"./SdkTabs-CofkKgiC.js";import{F as Nt}from"./FieldsQueryParam-DRCPhrsm.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
    Optional username
    String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
    Optional email
    String The auth record email address.
    diff --git a/ui/dist/assets/ViewApiDocs-Bt5koN3Z.js b/ui/dist/assets/ViewApiDocs-DaNIuuC4.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-Bt5koN3Z.js rename to ui/dist/assets/ViewApiDocs-DaNIuuC4.js index 4a6d21d6a6..b3c6dbe37c 100644 --- a/ui/dist/assets/ViewApiDocs-Bt5koN3Z.js +++ b/ui/dist/assets/ViewApiDocs-DaNIuuC4.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-B6GxOPDi.js";import{S as pt}from"./SdkTabs-C9BIEbpG.js";import{F as ut}from"./FieldsQueryParam-DB2XHXnv.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-C3DCbsuy.js";import{S as pt}from"./SdkTabs-CofkKgiC.js";import{F as ut}from"./FieldsQueryParam-DRCPhrsm.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-B6GxOPDi.js b/ui/dist/assets/index-C3DCbsuy.js similarity index 99% rename from ui/dist/assets/index-B6GxOPDi.js rename to ui/dist/assets/index-C3DCbsuy.js index 7ded84a769..17229f4373 100644 --- a/ui/dist/assets/index-B6GxOPDi.js +++ b/ui/dist/assets/index-C3DCbsuy.js @@ -1,18 +1,18 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-CFHe_5bb.js","./index-BJXhcZ8-.js","./CodeEditor-97oGZhvg.js","./ListApiDocs-CtNZ5G9D.js","./SdkTabs-C9BIEbpG.js","./SdkTabs-CSWLpEgj.css","./FieldsQueryParam-DB2XHXnv.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-Bt5koN3Z.js","./CreateApiDocs-cTL4BTwH.js","./UpdateApiDocs-B4w33bkJ.js","./DeleteApiDocs-C521Da9d.js","./RealtimeApiDocs-DlyauiFo.js","./AuthWithPasswordDocs-CaL3O2uX.js","./AuthWithOAuth2Docs-C9IystLV.js","./AuthRefreshDocs-CdUir8-r.js","./RequestVerificationDocs-B3KxCvqw.js","./ConfirmVerificationDocs-BKx9x0MU.js","./RequestPasswordResetDocs-CCrC-X-J.js","./ConfirmPasswordResetDocs-DCQFPDN7.js","./RequestEmailChangeDocs-DmKjgrzy.js","./ConfirmEmailChangeDocs-T4e4Bmxi.js","./AuthMethodsDocs-DifPdWR1.js","./ListExternalAuthsDocs-DCCFJUK6.js","./UnlinkExternalAuthDocs-4JM4cUB_.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-DG6SVeUP.js","./index-BJXhcZ8-.js","./CodeEditor-iXaWdysu.js","./ListApiDocs-D0RToTF6.js","./SdkTabs-CofkKgiC.js","./SdkTabs-CSWLpEgj.css","./FieldsQueryParam-DRCPhrsm.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DaNIuuC4.js","./CreateApiDocs-DyFYshJx.js","./UpdateApiDocs-DY8egWRV.js","./DeleteApiDocs-BjlD4kbR.js","./RealtimeApiDocs-5_90JfZR.js","./AuthWithPasswordDocs-Day03rmY.js","./AuthWithOAuth2Docs-fAroZBFD.js","./AuthRefreshDocs-Qii5vPCm.js","./RequestVerificationDocs-C_sAThHJ.js","./ConfirmVerificationDocs-DXzEcR9y.js","./RequestPasswordResetDocs-Iw-ugIBq.js","./ConfirmPasswordResetDocs-CqsVn5Wy.js","./RequestEmailChangeDocs-W_T6yElq.js","./ConfirmEmailChangeDocs-C8t_3a0s.js","./AuthMethodsDocs-D7M5HLRz.js","./ListExternalAuthsDocs-FIkHZF7A.js","./UnlinkExternalAuthDocs-BAfMmG5W.js"])))=>i.map(i=>d[i]); var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>p0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const ks=n=>n;function Ie(n,e){for(const t in e)n[t]=e[t];return n}function m0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Og(n){return n()}function Qa(){return Object.create(null)}function $e(n){n.forEach(Og)}function Ct(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Is;function en(n,e){return n===e?!0:(Is||(Is=document.createElement("a")),Is.href=e,n===Is.href)}function h0(n){return Object.keys(n).length===0}function fa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Mg(n){let e;return fa(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(fa(e,t))}function wt(n,e,t,i){if(n){const l=Dg(n,e,t,i);return n[0](l)}}function Dg(n,e,t,i){return n[1]&&i?Ie(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ua=Eg?n=>requestAnimationFrame(n):Q;const yl=new Set;function Ig(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ua(Ig)}function jo(n){let e;return yl.size===0&&ua(Ig),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function k(n,e){n.appendChild(e)}function Ag(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function _0(n){const e=b("style");return e.textContent="/* empty */",g0(Ag(n),e),e.sheet}function g0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const b0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&b0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function k0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function y0(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function v0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Lg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const yo=new Map;let vo=0;function w0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function S0(n,e){const t={stylesheet:_0(e),rules:{}};return yo.set(n,t),t}function ss(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ `;for(let g=0;g<=1;g+=a){const y=e+(t-e)*s(g);f+=g*100+`%{${o(y,1-y)}} `}const u=f+`100% {${o(t,1-t)}} }`,c=`__svelte_${w0(u)}_${r}`,d=Ag(n),{stylesheet:m,rules:h}=yo.get(d)||S0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,vo+=1,c}function os(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),vo-=l,vo||$0())}function $0(){ua(()=>{vo||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function T0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=ks,start:a=qo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=ss(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&os(n,h),d=!1}return jo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function C0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ng(n,l)}}function Ng(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let rs;function di(n){rs=n}function ys(){if(!rs)throw new Error("Function called outside component initialization");return rs}function Ht(n){ys().$$.on_mount.push(n)}function O0(n){ys().$$.after_update.push(n)}function vs(n){ys().$$.on_destroy.push(n)}function lt(){const n=ys();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Lg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gl=[],ee=[];let vl=[];const jr=[],Pg=Promise.resolve();let Hr=!1;function Fg(){Hr||(Hr=!0,Pg.then(ca))}function Qt(){return Fg(),Pg}function Ke(n){vl.push(n)}function ke(n){jr.push(n)}const ir=new Set;let cl=0;function ca(){if(cl!==0)return;const n=rs;do{try{for(;cln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vl=e}let jl;function da(){return jl||(jl=Promise.resolve(),jl.then(()=>{jl=null})),jl}function Ji(n,e,t){n.dispatchEvent(Lg(`${e?"intro":"outro"}${t}`))}const lo=new Set;let xn;function le(){xn={r:0,c:[],p:xn}}function se(){xn.r||$e(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(lo.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(lo.has(n))return;lo.add(n),xn.c.push(()=>{lo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Rg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&os(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=ks,tick:_=Q,css:g}=l||pa;g&&(o=ss(n,0,1,m,d,h,g,a++)),_(0,1);const y=qo()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Ji(n,!0,"start")),r=jo(T=>{if(s){if(T>=S)return _(1,0),Ji(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,os(n),Ct(l)?(l=l(i),da().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ma(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=ks,tick:m=Q,css:h}=l||pa;h&&(o=ss(n,1,0,c,u,d,h));const _=qo()+u,g=_+c;Ke(()=>Ji(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),jo(y=>{if(s){if(y>=g)return m(0,1),Ji(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Ct(l)?da().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&os(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&os(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=ks,tick:S=Q,css:T}=s||pa,$={start:qo()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=ss(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Ji(n,h,"start")),jo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ji(n,r.b,"start"),T&&(c(),f=ss(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ji(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Ct(s)?da().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function ef(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(le(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),se())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&ca()}if(m0(n)){const l=ys();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function E0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function ue(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ai(n,e){n.d(1),e.delete(n.key)}function Et(n,e){A(n,1,1,()=>{e.delete(n.key)})}function I0(n,e){n.f(),Et(n,e)}function at(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return $e(T),g}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ot(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Og).filter(Ct);n.$$.on_destroy?n.$$.on_destroy.push(...s):$e(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(D0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function A0(n,e){n.$$.dirty[0]===-1&&(gl.push(n),Fg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&A0(n,c)),d}):[],f.update(),u=!0,$e(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=y0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),z(n,e.target,e.anchor),ca()}di(a)}class ge{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!Ct(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!h0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const L0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(L0);const dl=[];function qg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function jg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return qg(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Ct(h)?h:Q},m=l.map((h,_)=>fa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){$e(m),c(),a=!1}})}function Hg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function N0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&4?pt(l,[Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function P0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function F0(n){let e,t,i,l;const s=[P0,N0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function tf(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ho=qg(null,function(e){e(tf());const t=()=>{e(tf())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});jg(Ho,n=>n.location);const zo=jg(Ho,n=>n.querystring),nf=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function ln(n,e){if(e=sf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return lf(n,e),{update(t){t=sf(t),lf(n,t)}}}function R0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function lf(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||q0(i.currentTarget.getAttribute("href"))})}function sf(n){return n&&typeof n=="string"?{href:n}:n||{}}function q0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function j0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Hg(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),O0(()=>{R0(m)}));let _=null,g=null;const y=Ho.subscribe(async $=>{_=$;let C=0;for(;C{nf.set(f)});return}t(0,a=null),g=null,nf.set(void 0)});vs(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class H0 extends ge{constructor(e){super(),_e(this,e,j0,F0,me,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let zg;function Vg(n){const e=n.pattern.test(zg);of(n,n.className,e),of(n,n.inactiveClassName,!e)}function of(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ho.subscribe(n=>{zg=n.location+(n.querystring?"?"+n.querystring:""),so.map(Vg)});function Ln(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Hg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Vg(i),{destroy(){so.splice(so.indexOf(i),1)}}}const z0="modulepreload",V0=function(n,e){return new URL(n,e).href},rf={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(f=>{if(f=V0(f,i),f in rf)return;rf[f]=!0;const u=f.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===f&&(!u||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${c}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":z0,u||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),u)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function At(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}Bg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const ff="pb_auth";class Y0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ha(this.token)}get isAdmin(){return oo(this.token).type==="admin"}get isAuthRecord(){return oo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ff){const i=B0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=ff){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=oo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=af(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=af(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Ug extends Y0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class K0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class _a extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function lr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class J0 extends _a{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||lr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){lr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&lr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&ha(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&f.authStore.token){$[O]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Z0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Wg(n){if(n){n.query=n.query||{};for(let e in n)Z0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Yg extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Wg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class G0 extends _a{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Yg(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=uf(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new gn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=uf(h)})(d)}catch(c){r(),f(new gn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function uf(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class X0 extends _a{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class Q0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class x0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class ek extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class tk extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Vo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Ug,this.admins=new J0(this),this.collections=new X0(this),this.files=new ek(this),this.logs=new Q0(this),this.settings=new K0(this),this.realtime=new Yg(this),this.health=new x0(this),this.backups=new tk(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new G0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Wg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class nk extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ik extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class lk extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class kl extends il{}class Kg extends il{constructor(e){super(`Invalid unit ${e}`)}}class tn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Me="numeric",Wn="short",$n="long",wo={year:Me,month:Me,day:Me},Jg={year:Me,month:Wn,day:Me},sk={year:Me,month:Wn,day:Me,weekday:Wn},Zg={year:Me,month:$n,day:Me},Gg={year:Me,month:$n,day:Me,weekday:$n},Xg={hour:Me,minute:Me},Qg={hour:Me,minute:Me,second:Me},xg={hour:Me,minute:Me,second:Me,timeZoneName:Wn},e1={hour:Me,minute:Me,second:Me,timeZoneName:$n},t1={hour:Me,minute:Me,hourCycle:"h23"},n1={hour:Me,minute:Me,second:Me,hourCycle:"h23"},i1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:Wn},l1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:$n},s1={year:Me,month:Me,day:Me,hour:Me,minute:Me},o1={year:Me,month:Me,day:Me,hour:Me,minute:Me,second:Me},r1={year:Me,month:Wn,day:Me,hour:Me,minute:Me},a1={year:Me,month:Wn,day:Me,hour:Me,minute:Me,second:Me},ok={year:Me,month:Wn,day:Me,weekday:Wn,hour:Me,minute:Me},f1={year:Me,month:$n,day:Me,hour:Me,minute:Me,timeZoneName:Wn},u1={year:Me,month:$n,day:Me,hour:Me,minute:Me,second:Me,timeZoneName:Wn},c1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,timeZoneName:$n},d1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,second:Me,timeZoneName:$n};class ws{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let sr=null;class Bo extends ws{static get instance(){return sr===null&&(sr=new Bo),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return v1(e,t,i)}formatOffset(e,t){return Xl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ro={};function rk(n){return ro[n]||(ro[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ro[n]}const ak={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function fk(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function uk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let cf={};function ck(n,e={}){const t=JSON.stringify([n,e]);let i=cf[t];return i||(i=new Intl.ListFormat(n,e),cf[t]=i),i}let zr={};function Vr(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Br={};function dk(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.NumberFormat(n,e),Br[t]=i),i}let Ur={};function pk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Ur[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Ur[l]=s),s}let Yl=null;function mk(){return Yl||(Yl=new Intl.DateTimeFormat().resolvedOptions().locale,Yl)}let df={};function hk(n){let e=df[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,df[n]=e}return e}function _k(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Vr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Vr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function gk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function bk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function kk(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function Ns(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function yk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class vk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=dk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):va(e,3);return Vt(t,this.padTo)}}}class wk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Vr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Sk{constructor(e,t,i){this.opts={style:"long",...i},!t&&k1()&&(this.rtf=pk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Yk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const $k={firstDay:1,minimalDays:4,weekend:[6,7]};class mt{static fromOpts(e){return mt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Rt.defaultLocale,r=o||(s?"en-US":mk()),a=t||Rt.defaultNumberingSystem,f=i||Rt.defaultOutputCalendar,u=Wr(l)||Rt.defaultWeekSettings;return new mt(r,a,f,u,o)}static resetCache(){Yl=null,zr={},Br={},Ur={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return mt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=_k(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=gk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=yk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:mt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Wr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ns(this,e,$1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=bk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Ns(this,e,O1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=kk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Ns(this,void 0,()=>M1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ns(this,e,D1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new vk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new wk(e,this.intl,t)}relFormatter(e={}){return new Sk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ck(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:y1()?hk(this.locale):$k}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let or=null;class cn extends ws{static get utcInstance(){return or===null&&(or=new cn(0)),or}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(Yo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Xl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Xl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Xl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Tk extends ws{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(Ue(n)||n===null)return e;if(n instanceof ws)return n;if(Ik(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Bo.instance:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||pi.create(n)}else return Oi(n)?cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Tk(n)}const ga={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},pf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ck=ga.hanidec.replace(/[\[|\]]/g,"").split("");function Ok(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let bl={};function Mk(){bl={}}function jn({numberingSystem:n},e=""){const t=n||"latn";return bl[t]||(bl[t]={}),bl[t][e]||(bl[t][e]=new RegExp(`${ga[t]}${e}`)),bl[t][e]}let mf=()=>Date.now(),hf="system",_f=null,gf=null,bf=null,kf=60,yf,vf=null;class Rt{static get now(){return mf}static set now(e){mf=e}static set defaultZone(e){hf=e}static get defaultZone(){return Si(hf,Bo.instance)}static get defaultLocale(){return _f}static set defaultLocale(e){_f=e}static get defaultNumberingSystem(){return gf}static set defaultNumberingSystem(e){gf=e}static get defaultOutputCalendar(){return bf}static set defaultOutputCalendar(e){bf=e}static get defaultWeekSettings(){return vf}static set defaultWeekSettings(e){vf=Wr(e)}static get twoDigitCutoffYear(){return kf}static set twoDigitCutoffYear(e){kf=e%100}static get throwOnInvalid(){return yf}static set throwOnInvalid(e){yf=e}static resetCaches(){mt.resetCache(),pi.resetCache(),je.resetCache(),Mk()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const p1=[0,31,59,90,120,151,181,212,243,273,304,334],m1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ba(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function h1(n,e,t){return t+(Ss(n)?m1:p1)[e-1]}function _1(n,e){const t=Ss(n)?m1:p1,i=t.findIndex(s=>sas(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Ko(n)}}function wf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ka(ba(i,1,e),t),r=wl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=wl(f)):a>r?(f=i+1,a-=wl(i)):f=i;const{month:u,day:c}=_1(f,a);return{year:f,month:u,day:c,...Ko(n)}}function rr(n){const{year:e,month:t,day:i}=n,l=h1(e,t,i);return{year:e,ordinal:l,...Ko(n)}}function Sf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=_1(e,t);return{year:e,month:i,day:l,...Ko(n)}}function $f(n,e){if(!Ue(n.localWeekday)||!Ue(n.localWeekNumber)||!Ue(n.localWeekYear)){if(!Ue(n.weekday)||!Ue(n.weekNumber)||!Ue(n.weekYear))throw new kl("Cannot mix locale-based week fields with ISO-based week fields");return Ue(n.localWeekday)||(n.weekday=n.localWeekday),Ue(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),Ue(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Dk(n,e=4,t=1){const i=Uo(n.weekYear),l=Pn(n.weekNumber,1,as(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function Ek(n){const e=Uo(n.year),t=Pn(n.ordinal,1,wl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function g1(n){const e=Uo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,$o(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function b1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function Ue(n){return typeof n>"u"}function Oi(n){return typeof n=="number"}function Uo(n){return typeof n=="number"&&n%1===0}function Ik(n){return typeof n=="string"}function Ak(n){return Object.prototype.toString.call(n)==="[object Date]"}function k1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function y1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Lk(n){return Array.isArray(n)?n:[n]}function Tf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Nk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ol(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Wr(n){if(n==null)return null;if(typeof n!="object")throw new tn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new tn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return Uo(n)&&n>=e&&n<=t}function Pk(n,e){return n-e*Math.floor(n/e)}function Vt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(Ue(n)||n===null||n===""))return parseInt(n,10)}function Pi(n){if(!(Ue(n)||n===null||n===""))return parseFloat(n)}function ya(n){if(!(Ue(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function va(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ss(n){return n%4===0&&(n%100!==0||n%400===0)}function wl(n){return Ss(n)?366:365}function $o(n,e){const t=Pk(e-1,12)+1,i=n+(e-t)/12;return t===2?Ss(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Wo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Cf(n,e,t){return-ka(ba(n,1,e),t)+e-1}function as(n,e=4,t=1){const i=Cf(n,e,t),l=Cf(n+1,e,t);return(wl(n)-i+l)/7}function Yr(n){return n>99?n:n>Rt.twoDigitCutoffYear?1900+n:2e3+n}function v1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Yo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function w1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new tn(`Invalid unit value ${n}`);return e}function To(n,e){const t={};for(const i in n)if(Ol(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=w1(l)}return t}function Xl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Vt(t,2)}:${Vt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Vt(t,2)}${Vt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ko(n){return Nk(n,["hour","minute","second","millisecond"])}const Fk=["January","February","March","April","May","June","July","August","September","October","November","December"],S1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Rk=["J","F","M","A","M","J","J","A","S","O","N","D"];function $1(n){switch(n){case"narrow":return[...Rk];case"short":return[...S1];case"long":return[...Fk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const T1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],C1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qk=["M","T","W","T","F","S","S"];function O1(n){switch(n){case"narrow":return[...qk];case"short":return[...C1];case"long":return[...T1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const M1=["AM","PM"],jk=["Before Christ","Anno Domini"],Hk=["BC","AD"],zk=["B","A"];function D1(n){switch(n){case"narrow":return[...zk];case"short":return[...Hk];case"long":return[...jk];default:return null}}function Vk(n){return M1[n.hour<12?0:1]}function Bk(n,e){return O1(e)[n.weekday-1]}function Uk(n,e){return $1(e)[n.month-1]}function Wk(n,e){return D1(e)[n.year<0?0:1]}function Yk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function Of(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Kk={D:wo,DD:Jg,DDD:Zg,DDDD:Gg,t:Xg,tt:Qg,ttt:xg,tttt:e1,T:t1,TT:n1,TTT:i1,TTTT:l1,f:s1,ff:r1,fff:f1,ffff:c1,F:o1,FF:a1,FFF:u1,FFFF:d1};class sn{static create(e,t={}){return new sn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Kk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Vt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Vk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Uk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Bk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=sn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Wk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Of(sn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=sn.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Of(s,l(r))}}const E1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Al(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ll(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Nl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function I1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Pi(t)),months:d(Pi(i)),weeks:d(Pi(l)),days:d(Pi(s)),hours:d(Pi(o)),minutes:d(Pi(r)),seconds:d(Pi(a),a==="-0"),milliseconds:d(ya(f),c)}]}const oy={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function $a(n,e,t,i,l,s,o){const r={year:e.length===2?Yr(vi(e)):vi(e),month:S1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?T1.indexOf(n)+1:C1.indexOf(n)+1),r}const ry=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ay(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=$a(e,l,i,t,s,o,r);let m;return a?m=oy[a]:f?m=0:m=Yo(u,c),[d,new cn(m)]}function fy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const uy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cy=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,dy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mf(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,l,i,t,s,o,r),cn.utcInstance]}function py(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,r,t,i,l,s,o),cn.utcInstance]}const my=Al(Zk,Sa),hy=Al(Gk,Sa),_y=Al(Xk,Sa),gy=Al(L1),P1=Ll(ny,Pl,$s,Ts),by=Ll(Qk,Pl,$s,Ts),ky=Ll(xk,Pl,$s,Ts),yy=Ll(Pl,$s,Ts);function vy(n){return Nl(n,[my,P1],[hy,by],[_y,ky],[gy,yy])}function wy(n){return Nl(fy(n),[ry,ay])}function Sy(n){return Nl(n,[uy,Mf],[cy,Mf],[dy,py])}function $y(n){return Nl(n,[ly,sy])}const Ty=Ll(Pl);function Cy(n){return Nl(n,[iy,Ty])}const Oy=Al(ey,ty),My=Al(N1),Dy=Ll(Pl,$s,Ts);function Ey(n){return Nl(n,[Oy,P1],[My,Dy])}const Df="Invalid Duration",F1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Iy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...F1},Dn=146097/400,pl=146097/4800,Ay={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...F1},Wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ly=Wi.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function R1(n,e){let t=e.milliseconds??0;for(const i of Ly.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Ef(n,e){const t=R1(n,e)<0?-1:1;Wi.reduceRight((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Wi.reduce((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function Ny(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Ay:Iy;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||mt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new tn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:To(e,st.normalizeUnit),loc:mt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Oi(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new tn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=$y(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Cy(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new lk(i);return new st({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Kg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?sn.create(this.loc,i).formatDurationFromString(this,e):Df}toHuman(e={}){if(!this.isValid)return Df;const t=Wi.map(i=>{const l=this.values[i];return Ue(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=va(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?R1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Wi)(Ol(t.values,l)||Ol(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=w1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...To(e,st.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ef(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Ny(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Wi)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Oi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Oi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Ef(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Wi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Py(n,e){return!n||!n.isValid?Ft.invalid("missing or invalid start"):!e||!e.isValid?Ft.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ft.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Ft.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Ft.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ft.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ft.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Ft.fromDateTimes(t,a.time)),t=null);return Ft.merge(l)}difference(...e){return Ft.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=wo,t={}){return this.isValid?sn.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return Ft.fromDateTimes(e(this.s),e(this.e))}}class Ps{static hasDST(e=Rt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,Rt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||mt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||mt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||mt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||mt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return mt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return mt.create(t,null,"gregory").eras(e)}static features(){return{relative:k1(),localeWeek:y1()}}}function If(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function Fy(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=If(a,f);return(u-u%7)/7}],["days",If]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Ry(n,e,t,i){let[l,s,o,r]=Fy(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?st.fromMillis(a,i).shiftTo(...f).plus(u):u}const qy="missing Intl.DateTimeFormat.formatToParts support";function ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Ok(t))}}const jy=" ",q1=`[ ${jy}]`,j1=new RegExp(q1,"g");function Hy(n){return n.replace(/\./g,"\\.?").replace(j1,q1)}function Af(n){return n.replace(/\./g,"").replace(j1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Hy).join("|")),deser:([t])=>n.findIndex(i=>Af(t)===Af(i))+e}}function Lf(n,e){return{regex:n,deser:([,t,i])=>Yo(t,i),groups:e}}function Fs(n){return{regex:n,deser:([e])=>e}}function zy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vy(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(zy(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ct(f);case"yy":return ct(c,Yr);case"yyyy":return ct(s);case"yyyyy":return ct(d);case"yyyyyy":return ct(o);case"M":return ct(r);case"MM":return ct(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ct(r);case"LL":return ct(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ct(r);case"dd":return ct(i);case"o":return ct(a);case"ooo":return ct(l);case"HH":return ct(i);case"H":return ct(r);case"hh":return ct(i);case"h":return ct(r);case"mm":return ct(i);case"m":return ct(r);case"q":return ct(r);case"qq":return ct(i);case"s":return ct(r);case"ss":return ct(i);case"S":return ct(a);case"SSS":return ct(l);case"u":return Fs(u);case"uu":return Fs(r);case"uuu":return ct(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ct(s);case"kk":return ct(c,Yr);case"W":return ct(r);case"WW":return ct(i);case"E":case"c":return ct(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Lf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Lf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Fs(/[a-z_+-/]{1,256}?/i);case" ":return Fs(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:qy};return _.token=n,_}const By={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Uy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=By[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Wy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Yy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Ol(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Ky(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return Ue(n.z)||(t=pi.create(n.z)),Ue(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),Ue(n.q)||(n.M=(n.q-1)*3+1),Ue(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),Ue(n.u)||(n.S=ya(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let ar=null;function Jy(){return ar||(ar=je.fromMillis(1555555555555)),ar}function Zy(n,e){if(n.literal)return n;const t=sn.macroTokenToFormatOpts(n.val),i=B1(t,e);return i==null||i.includes(void 0)?n:i}function H1(n,e){return Array.prototype.concat(...n.map(t=>Zy(t,e)))}class z1{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=H1(sn.parseFormat(t),e),this.units=this.tokens.map(i=>Vy(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=Wy(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=Yy(e,this.regex,this.handlers),[l,s,o]=i?Ky(i):[null,null,void 0];if(Ol(i,"a")&&Ol(i,"H"))throw new kl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function V1(n,e,t){return new z1(n,t).explainFromTokens(e)}function Gy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=V1(n,e,t);return[i,l,s,o]}function B1(n,e){if(!n)return null;const i=sn.create(e,n).dtFormatter(Jy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Uy(o,n,s))}const fr="Invalid DateTime",Nf=864e13;function Kl(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ur(n){return n.weekData===null&&(n.weekData=So(n.c)),n.weekData}function cr(n){return n.localWeekData===null&&(n.localWeekData=So(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Fi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function U1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Rs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ao(n,e,t){return U1(Wo(n),e,t)}function Pf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,$o(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Wo(s);let[a,f]=U1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function hl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function qs(n,e,t=!0){return n.isValid?sn.create(mt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function dr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Vt(n.c.year,t?6:4),e?(i+="-",i+=Vt(n.c.month),i+="-",i+=Vt(n.c.day)):(i+=Vt(n.c.month),i+=Vt(n.c.day)),i}function Ff(n,e,t,i,l,s){let o=Vt(n.c.hour);return e?(o+=":",o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Vt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Vt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Vt(Math.trunc(-n.o/60)),o+=":",o+=Vt(Math.trunc(-n.o%60))):(o+="+",o+=Vt(Math.trunc(n.o/60)),o+=":",o+=Vt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const W1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Xy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Y1=["year","month","day","hour","minute","second","millisecond"],xy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ev=["year","ordinal","hour","minute","second","millisecond"];function tv(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Kg(n);return e}function Rf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return tv(n)}}function nv(n){return uo[n]||(fo===void 0&&(fo=Rt.now()),uo[n]=n.offset(fo)),uo[n]}function qf(n,e){const t=Si(e.zone,Rt.defaultZone);if(!t.isValid)return je.invalid(Kl(t));const i=mt.fromObject(e);let l,s;if(Ue(n.year))l=Rt.now();else{for(const a of Y1)Ue(n[a])&&(n[a]=W1[a]);const o=g1(n)||b1(n);if(o)return je.invalid(o);const r=nv(t);[l,s]=ao(n,r,t)}return new je({ts:l,zone:t,loc:i,o:s})}function jf(n,e,t){const i=Ue(t.round)?!0:t.round,l=(o,r)=>(o=va(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Hf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let fo,uo={};class je{constructor(e){const t=e.zone||Rt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Kl(t));this.ts=Ue(e.ts)?Rt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=Oi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Rs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||mt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=cn.utcInstance,qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Ak(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,Rt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:mt.fromObject(t)}):je.invalid(Kl(l))}static fromMillis(e,t={}){if(Oi(e))return e<-Nf||e>Nf?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,Rt.defaultZone),loc:mt.fromObject(t)});throw new tn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Oi(e))return new je({ts:e*1e3,zone:Si(t.zone,Rt.defaultZone),loc:mt.fromObject(t)});throw new tn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,Rt.defaultZone);if(!i.isValid)return je.invalid(Kl(i));const l=mt.fromObject(t),s=To(e,Rf),{minDaysInFirstWeek:o,startOfWeek:r}=$f(s,l),a=Rt.now(),f=Ue(t.specificOffset)?i.offset(a):t.specificOffset,u=!Ue(s.ordinal),c=!Ue(s.year),d=!Ue(s.month)||!Ue(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new kl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Rs(a,f);_?(g=xy,y=Xy,S=So(S,o,r)):u?(g=ev,y=Qy,S=rr(S)):(g=Y1,y=W1);let T=!1;for(const R of g){const F=s[R];Ue(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Dk(s,o,r):u?Ek(s):g1(s),C=$||b1(s);if(C)return je.invalid(C);const O=_?wf(s,o,r):u?Sf(s):s,[D,I]=ao(O,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L.isValid?L:je.invalid(L.invalid)}static fromISO(e,t={}){const[i,l]=vy(e);return hl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=wy(e);return hl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=Sy(e);return hl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Gy(o,e,t);return u?je.invalid(u):hl(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=Ey(e);return hl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new nk(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=B1(e,mt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return H1(sn.parseFormat(e),mt.fromObject(t)).map(l=>l.val).join("")}static resetCache(){fo=void 0,uo={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ur(this).weekYear:NaN}get weekNumber(){return this.isValid?ur(this).weekNumber:NaN}get weekday(){return this.isValid?ur(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cr(this).weekday:NaN}get localWeekNumber(){return this.isValid?cr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cr(this).weekYear:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ps.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ps.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ps.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ps.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Wo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Rs(a,o),c=Rs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Fi(this,{ts:a}),Fi(this,{ts:f})]:[this]}get isInLeapYear(){return Ss(this.year)}get daysInMonth(){return $o(this.year,this.month)}get daysInYear(){return this.isValid?wl(this.year):NaN}get weeksInWeekYear(){return this.isValid?as(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?as(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=sn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(Rt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,Rt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ao(o,s,e)}return Fi(this,{ts:l,zone:e})}else return je.invalid(Kl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Fi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=To(e,Rf),{minDaysInFirstWeek:i,startOfWeek:l}=$f(t,this.loc),s=!Ue(t.weekYear)||!Ue(t.weekNumber)||!Ue(t.weekday),o=!Ue(t.ordinal),r=!Ue(t.year),a=!Ue(t.month)||!Ue(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new kl("Can't mix ordinal dates with month/day");let c;s?c=wf({...So(this.c,i,l),...t},i,l):Ue(t.ordinal)?(c={...this.toObject(),...t},Ue(t.day)&&(c.day=Math.min($o(c.year,c.month),c.day))):c=Sf({...rr(this.c),...t});const[d,m]=ao(c,this.o,this.zone);return Fi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Fi(this,Pf(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Fi(this,Pf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Ry(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Ft.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new tn("max requires all arguments be DateTimes");return Tf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return V1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=mt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new z1(s,e)}static fromFormatParser(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new tn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:f,invalidReason:u}=t.explainFromTokens(e);return u?je.invalid(u):hl(r,a,i,`format ${t.format}`,e,f)}static get DATE_SHORT(){return wo}static get DATE_MED(){return Jg}static get DATE_MED_WITH_WEEKDAY(){return sk}static get DATE_FULL(){return Zg}static get DATE_HUGE(){return Gg}static get TIME_SIMPLE(){return Xg}static get TIME_WITH_SECONDS(){return Qg}static get TIME_WITH_SHORT_OFFSET(){return xg}static get TIME_WITH_LONG_OFFSET(){return e1}static get TIME_24_SIMPLE(){return t1}static get TIME_24_WITH_SECONDS(){return n1}static get TIME_24_WITH_SHORT_OFFSET(){return i1}static get TIME_24_WITH_LONG_OFFSET(){return l1}static get DATETIME_SHORT(){return s1}static get DATETIME_SHORT_WITH_SECONDS(){return o1}static get DATETIME_MED(){return r1}static get DATETIME_MED_WITH_SECONDS(){return a1}static get DATETIME_MED_WITH_WEEKDAY(){return ok}static get DATETIME_FULL(){return f1}static get DATETIME_FULL_WITH_SECONDS(){return u1}static get DATETIME_HUGE(){return c1}static get DATETIME_HUGE_WITH_SECONDS(){return d1}}function Hl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Oi(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new tn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const iv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],lv=[".mp4",".avi",".mov",".3gp",".wmv"],sv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ov=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],K1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!iv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!ov.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,f;let s=e.find(u=>u.name==t||u.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const u of s.schema){const c=i+u.name;if(u.type=="relation"&&((r=u.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,u.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=u.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(u.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const u of e){u.schema=u.schema||[];for(const c of u.schema)if(c.type=="relation"&&((f=c.options)==null?void 0:f.collectionId)==s.id){const d=i+u.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,u.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Cn([]);function Co(n,e=4e3){return Zo(n,"info",e)}function Lt(n,e=3e3){return Zo(n,"success",e)}function ii(n,e=4500){return Zo(n,"error",e)}function rv(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ca(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ca(e,n),e))}function Ta(){Jo.update(n=>{for(let e of n)Ca(n,e);return[]})}function Ca(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const Oa=Cn({});function Kr(n){Oa.set(n||{})}const Rn=Cn([]),Yn=Cn({}),Oo=Cn(!1),Z1=Cn({});let Ql;typeof BroadcastChannel<"u"&&(Ql=new BroadcastChannel("collections"),Ql.onmessage=()=>{var n;X1((n=Mg(Yn))==null?void 0:n.id)});function G1(){Ql==null||Ql.postMessage("reload")}function av(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function fv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ma(),G1(),j.sortCollections(e)))}function uv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ma(),G1(),e))}async function X1(n=null){Oo.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ma()}catch(e){ae.error(e)}Oo.set(!1)}function Ma(){Z1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const pr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Mg(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ha(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class cv extends Ug{save(e,t){super.save(e,t),t&&!t.collectionId&&Kr(t)}clear(){super.clear(),Kr(null)}}const ae=new Vo("../",new cv("pb_admin_auth"));ae.authStore.model&&!ae.authStore.model.collectionId&&Kr(ae.authStore.model);const dv=n=>({}),zf=n=>({});function pv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],zf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.23",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,dv):Tt(S[2]),zf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function mv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,mv,pv,me,{center:0,class:1})}}function Vf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function hv(n){let e,t,i,l=!n[0]&&Vf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Vf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[hv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,gv,_v,me,{nobranding:0})}}function Go(n){const e=n-1;return e*e*e+1}function fs(n,{delay:e=0,duration:t=400,easing:i=ks}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Go,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=xa(l),[m,h]=xa(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Cn([]);function Co(n,e=4e3){return Zo(n,"info",e)}function Lt(n,e=3e3){return Zo(n,"success",e)}function ii(n,e=4500){return Zo(n,"error",e)}function rv(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ca(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ca(e,n),e))}function Ta(){Jo.update(n=>{for(let e of n)Ca(n,e);return[]})}function Ca(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const Oa=Cn({});function Kr(n){Oa.set(n||{})}const Rn=Cn([]),Yn=Cn({}),Oo=Cn(!1),Z1=Cn({});let Ql;typeof BroadcastChannel<"u"&&(Ql=new BroadcastChannel("collections"),Ql.onmessage=()=>{var n;X1((n=Mg(Yn))==null?void 0:n.id)});function G1(){Ql==null||Ql.postMessage("reload")}function av(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function fv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ma(),G1(),j.sortCollections(e)))}function uv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ma(),G1(),e))}async function X1(n=null){Oo.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ma()}catch(e){ae.error(e)}Oo.set(!1)}function Ma(){Z1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const pr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Mg(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ha(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class cv extends Ug{save(e,t){super.save(e,t),t&&!t.collectionId&&Kr(t)}clear(){super.clear(),Kr(null)}}const ae=new Vo("../",new cv("pb_admin_auth"));ae.authStore.model&&!ae.authStore.model.collectionId&&Kr(ae.authStore.model);const dv=n=>({}),zf=n=>({});function pv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],zf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.24",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,dv):Tt(S[2]),zf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function mv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,mv,pv,me,{center:0,class:1})}}function Vf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function hv(n){let e,t,i,l=!n[0]&&Vf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Vf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[hv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,gv,_v,me,{nobranding:0})}}function Go(n){const e=n-1;return e*e*e+1}function fs(n,{delay:e=0,duration:t=400,easing:i=ks}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Go,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=xa(l),[m,h]=xa(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` transform: ${f} translate(${(1-_)*c}${d}, ${(1-_)*m}${h}); opacity: ${a-u*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Go,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Wt(n,{delay:e=0,duration:t=400,easing:i=Go,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-f*d}); opacity: ${r-u*d} `}}let Jr,Ri;const Zr="app-tooltip";function Bf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Mi(){return Ri=Ri||document.querySelector("."+Zr),Ri||(Ri=document.createElement("div"),Ri.classList.add(Zr),document.body.appendChild(Ri)),Ri}function x1(n,e){let t=Mi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Gr();return}t.textContent=e.text,t.className=Zr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Gr(){clearTimeout(Jr),Mi().classList.remove("active"),Mi().activeNode=void 0}function bv(n,e){Mi().activeNode=n,clearTimeout(Jr),Jr=setTimeout(()=>{Mi().classList.add("active"),x1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Bf(e);function i(){bv(n,t)}function l(){Gr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Mi(),{update(s){var o,r;t=Bf(s),(r=(o=Mi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&x1(n,t)},destroy(){var s,o;(o=(s=Mi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Gr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Uf(n,e,t){const i=n.slice();return i[12]=e[t],i}const kv=n=>({}),Wf=n=>({uniqueId:n[4]});function yv(n){let e,t,i=ue(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Yf(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Mo(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function wv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Wf),u=[vv,yv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,kv):Tt(m[8]),Wf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Kf="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Kf:n||Kf}function Sv(n,e,t){let i;We(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Tv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[Tv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Cv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Mv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class Dv extends ge{constructor(e){super(),_e(this,e,Mv,Ov,me,{})}}function Jf(n){let e,t;return e=new Q1({props:{$$slots:{default:[Ev]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ev(n){let e,t;return e=new Dv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Jf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Jf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Av(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Lv extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{})}}const It=Cn(""),Do=Cn(""),Xi=Cn(!1);function Nv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Pv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Zf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Gf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Fv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Pv,Nv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zf(),g=(n[0].length||n[7].length)&&Gf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Zf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Gf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Rv(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CFHe_5bb.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class Cs extends ge{constructor(e){super(),_e(this,e,Rv,Fv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function qv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function jv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Xo extends ge{constructor(e){super(),_e(this,e,jv,qv,me,{tooltip:0,class:1})}}function Hv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function zv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,zv,Hv,me,{class:1,name:2,sort:0,disable:3})}}const Vv=n=>({}),Xf=n=>({}),Bv=n=>({}),Qf=n=>({});function Uv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Qf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Xf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,Bv):Tt(_[10]),Qf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Vv):Tt(_[10]),Xf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Wv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Qo extends ge{constructor(e){super(),_e(this,e,Wv,Uv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Yv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Kv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=K1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class eb extends ge{constructor(e){super(),_e(this,e,Kv,Yv,me,{level:0})}}function Jv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Zv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class tb extends ge{constructor(e){super(),_e(this,e,Zv,Jv,me,{date:0})}}function xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=r2(i[31]);return i[33]=s,i}function eu(n,e,t){const i=n.slice();return i[36]=e[t],i}function Gv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Xv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tu(n){let e;function t(s,o){return s[7]?n2:t2}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function t2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&nu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function n2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function iu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=iu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function s2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Xv:Gv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Qv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,su,null,xf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=tu(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function ru(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function o2(n){let e,t,i,l,s;e=new Qo({props:{class:"table-wrapper",$$slots:{default:[s2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ou(n),r=n[5]&&ru(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=ou(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=ru(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const au=50,mr=/[-:\. ]/gi;function r2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function a2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,au,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(mr,"")+".json");const Y=U[0].created.replaceAll(mr,""),ie=U[U.length-1].created.replaceAll(mr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=au),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class f2 extends ge{constructor(e){super(),_e(this,e,a2,o2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! +`)})},i(a){s||(a&&Ke(()=>{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Yf(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Mo(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function wv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Wf),u=[vv,yv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,kv):Tt(m[8]),Wf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Kf="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Kf:n||Kf}function Sv(n,e,t){let i;We(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Tv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[Tv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Cv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Mv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class Dv extends ge{constructor(e){super(),_e(this,e,Mv,Ov,me,{})}}function Jf(n){let e,t;return e=new Q1({props:{$$slots:{default:[Ev]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ev(n){let e,t;return e=new Dv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Jf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Jf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Av(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Lv extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{})}}const It=Cn(""),Do=Cn(""),Xi=Cn(!1);function Nv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Pv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Zf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Gf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Fv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Pv,Nv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zf(),g=(n[0].length||n[7].length)&&Gf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Zf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Gf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Rv(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-DG6SVeUP.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class Cs extends ge{constructor(e){super(),_e(this,e,Rv,Fv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function qv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function jv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Xo extends ge{constructor(e){super(),_e(this,e,jv,qv,me,{tooltip:0,class:1})}}function Hv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function zv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,zv,Hv,me,{class:1,name:2,sort:0,disable:3})}}const Vv=n=>({}),Xf=n=>({}),Bv=n=>({}),Qf=n=>({});function Uv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Qf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Xf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,Bv):Tt(_[10]),Qf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Vv):Tt(_[10]),Xf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Wv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Qo extends ge{constructor(e){super(),_e(this,e,Wv,Uv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Yv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Kv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=K1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class eb extends ge{constructor(e){super(),_e(this,e,Kv,Yv,me,{level:0})}}function Jv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Zv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class tb extends ge{constructor(e){super(),_e(this,e,Zv,Jv,me,{date:0})}}function xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=r2(i[31]);return i[33]=s,i}function eu(n,e,t){const i=n.slice();return i[36]=e[t],i}function Gv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Xv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tu(n){let e;function t(s,o){return s[7]?n2:t2}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function t2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&nu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function n2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function iu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=iu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function s2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Xv:Gv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Qv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,su,null,xf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=tu(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function ru(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function o2(n){let e,t,i,l,s;e=new Qo({props:{class:"table-wrapper",$$slots:{default:[s2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ou(n),r=n[5]&&ru(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=ou(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=ru(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const au=50,mr=/[-:\. ]/gi;function r2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function a2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,au,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(mr,"")+".json");const Y=U[0].created.replaceAll(mr,""),ie=U[U.length-1].created.replaceAll(mr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=au),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class f2 extends ge{constructor(e){super(),_e(this,e,a2,o2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela @@ -35,7 +35,7 @@ var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,config * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license */const hS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Tb._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return hS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function $c(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function _S(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&$c();return{c(){e=b("div"),t=b("div"),i=K("Found "),l=K(n[1]),s=M(),r=K(o),a=M(),c&&c.c(),f=M(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&oe(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&oe(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=$c(),c.c(),E(c,1),c.m(e,f)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function gS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}Ht(()=>(ci.register(Ti,_o,po,ra,hs,tS,fS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class bS extends ge{constructor(e){super(),_e(this,e,gS,_S,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function kS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function yS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Hb extends ge{constructor(e){super(),_e(this,e,yS,kS,me,{content:2,language:3,class:0})}}const vS=n=>({}),Tc=n=>({}),wS=n=>({}),Cc=n=>({});function Oc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Mc(n);const $=n[19].header,C=wt($,n,n[18],Cc);let O=n[4]&&n[2]&&Dc(n);const D=n[19].default,I=wt(D,n,n[18],null),L=n[19].footer,R=wt(L,n,n[18],Tc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),f=M(),u=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[J(t,"click",Be(n[20])),J(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Mc(n),T.c(),E(T,1),T.m(o,r)):T&&(le(),A(T,1,1,()=>{T=null}),se()),C&&C.p&&(!g||N[0]&262144)&&$t(C,$,n,n[18],g?St($,n[18],N,wS):Tt(n[18]),Cc),n[4]&&n[2]?O?O.p(n,N):(O=Dc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&$t(I,D,n,n[18],g?St(D,n[18],N,null):Tt(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&$t(R,L,n,n[18],g?St(L,n[18],N,vS):Tt(n[18]),Tc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=Rg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ma(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,$e(S)}}}function Mc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,fs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,fs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Dc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function SS(n){let e,t,i,l,s=n[0]&&Oc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Oc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,$e(l)}}}let zi,Cr=[];function zb(){return zi=zi||document.querySelector(".overlays"),zi||(zi=document.createElement("div"),zi.classList.add("overlays"),document.body.appendChild(zi)),zi}let wi=150;function Ec(){return 1e3+zb().querySelectorAll(".overlay-panel-container.active").length}function $S(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Ec(),_):t(6,_.style="",_))}function R(){j.pushUnique(Cr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Cr,h),Cr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Ec()&&(Y.preventDefault(),O())}function P(Y){o&&q(g)}function q(Y,ie){ie&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Ht(()=>(zb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const H=()=>a?O():!0;function W(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function U(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,O,_,g,T,N,P,q,u,c,d,C,D,$,l,i,H,W,G,U]}class Zt extends ge{constructor(e){super(),_e(this,e,$S,SS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function TS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[Se(i=Pe.call(null,e,n[3]?void 0:n[0])),J(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Ct(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function CS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function f(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Ht(()=>()=>{a&&clearTimeout(a)}),n.$$set=u=>{"value"in u&&t(5,i=u.value),"tooltip"in u&&t(0,l=u.tooltip),"idleClasses"in u&&t(1,s=u.idleClasses),"successClasses"in u&&t(2,o=u.successClasses),"successDuration"in u&&t(6,r=u.successDuration)},[l,s,o,a,f,i,r]}class sl extends ge{constructor(e){super(),_e(this,e,CS,TS,me,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Ic(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function OS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new eb({props:{level:n[1].level}}),I=new tb({props:{date:n[1].created}});let N=!n[4]&&Ac(n),P=ue(n[5](n[1].data)),q=[];for(let W=0;WA(q[W],1,1,()=>{q[W]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("div"),d=K(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),B(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),B(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let W=0;W',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ac(n){let e,t,i,l;function s(a,f){return a[1].message?ES:DS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function DS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ES(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&oe(i,t)},d(l){l&&v(e)}}}function IS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=K(t),s=K(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function AS(n){let e,t;return e=new Hb({props:{content:n[17],language:"html"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function LS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function NS(n){let e,t;return e=new Hb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Lc(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[PS,NS,LS,AS,IS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=K("data."),s=K(l),o=M(),r=b("td"),u.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&oe(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function FS(n){let e,t,i,l;const s=[MS,OS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(le(),A(o[u],1,1,()=>{o[u]=null}),se()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function RS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[J(e,"click",n[9]),J(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,$e(a)}}}function jS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[qS],header:[RS],default:[FS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}const Nc="log_view";function HS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Nc),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Nc})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class zS extends ge{constructor(e){super(),_e(this,e,HS,jS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function VS(n,e,t){const i=n.slice();return i[1]=e[t],i}function BS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function US(n){let e,t,i,l=ue(K1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Vb extends ge{constructor(e){super(),_e(this,e,WS,US,me,{class:0})}}function YS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[JS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[ZS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[GS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function KS(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function ZS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Vb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function GS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function XS(n){let e,t,i,l;const s=[KS,YS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function e$(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[xS],header:[QS],default:[XS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function t$(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Pc(n){let e,t;return e=new bS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Fc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new f2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Xo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[i$,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Cs({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Vb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Pc(n),N=Fc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Pc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Fc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function s$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[l$]},$$scope:{ctx:n}}});let r={};i=new zS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new n$({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const eo="logId",Rc="adminRequests",qc="adminLogRequests";function o$(n,e,t){var L;let i,l,s;We(n,zo,R=>t(19,l=R)),We(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Rc)||((L=window.localStorage)==null?void 0:L.getItem(qc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Rc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[eo]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[eo]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(eo)&&r&&r.show(o.get(eo)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(qc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class r$ extends ge{constructor(e){super(),_e(this,e,o$,s$,me,{})}}function a$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function f$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class u$ extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{tolerance:3})}}function c$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new u$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const jc="@adminSidebarWidth";function d$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(jc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(jc,a))},[s,o,a,r,l,i,f,u,c,d]}class Bb extends ge{constructor(e){super(),_e(this,e,d$,c$,me,{class:0})}}const Ua=Cn({});function un(n,e,t){Ua.set({text:n,yesCallback:e,noCallback:t})}function Ub(){Ua.set({})}function Hc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function p$(n){let e,t,i,l,s=n[0]&&Hc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Hc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function m$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,m$,p$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function zc(n,e,t){const i=n.slice();return i[27]=e[t],i}function h$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function _$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function g$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function b$(n){let e,t,i,l;const s=[g$,_$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Vc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[b$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Vc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Vc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function y$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Uc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function v$(n){let e,t,i,l,s,o,r=n[5]!=""&&Uc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Uc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function w$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[v$],header:[y$],default:[k$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-97oGZhvg.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class $$ extends ge{constructor(e){super(),_e(this,e,S$,w$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Wc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Yc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Jc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Yc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Yc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Jc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function T$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Jc=n=>n.name;function C$(n,e,t){let i;We(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class O$ extends ge{constructor(e){super(),_e(this,e,C$,T$,me,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function M$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class I$ extends ge{constructor(e){super(),_e(this,e,E$,D$,me,{class:0})}}const A$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]}),L$=n=>({interactive:n&64,hasErrors:n&32}),Qc=n=>({interactive:n[6],hasErrors:n[5]}),N$=n=>({interactive:n&64,hasErrors:n&32}),xc=n=>({interactive:n[6],hasErrors:n[5]});function ed(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function td(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&td(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=td(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function F$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function R$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function q$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function nd(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Qc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[j$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[H$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Xc);let g=!n[0].toDelete&&id(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,L$):Tt(y[19]),Qc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,A$):Tt(y[19]),Xc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=id(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function j$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function H$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function id(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function z$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function V$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&ed();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[P$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],xc),m=d||F$();function h(S,T){if(S[0].toDelete)return q$;if(S[6])return R$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&nd(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=ed(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,N$):Tt(S[19]),xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=nd(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function B$(n,e,t){let i,l,s,o;We(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of Or)N.id!=f&&N.collapse()}Ht(()=>(Or.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(Or,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,B$,V$,me,{key:1,field:0})}}function U$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function W$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[U$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[W$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[Y$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function J$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[K$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Z$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class G$ extends ge{constructor(e){super(),_e(this,e,Z$,J$,me,{field:0,key:1})}}function X$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Q$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[X$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Q$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function eT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function tT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[eT,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[tT],options:[x$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function iT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class lT extends ge{constructor(e){super(),_e(this,e,iT,nT,me,{field:0,key:1})}}function sT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class rT extends ge{constructor(e){super(),_e(this,e,oT,sT,me,{field:0,key:1})}}function aT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Fl extends ge{constructor(e){super(),_e(this,e,fT,aT,me,{value:0,separator:1,readonly:2,disabled:3})}}function uT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. + `),i=b("div");for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Vb extends ge{constructor(e){super(),_e(this,e,WS,US,me,{class:0})}}function YS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[JS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[ZS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[GS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function KS(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function ZS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Vb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function GS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function XS(n){let e,t,i,l;const s=[KS,YS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function e$(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[xS],header:[QS],default:[XS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function t$(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Pc(n){let e,t;return e=new bS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Fc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new f2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Xo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[i$,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Cs({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Vb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Pc(n),N=Fc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Pc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Fc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function s$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[l$]},$$scope:{ctx:n}}});let r={};i=new zS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new n$({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const eo="logId",Rc="adminRequests",qc="adminLogRequests";function o$(n,e,t){var L;let i,l,s;We(n,zo,R=>t(19,l=R)),We(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Rc)||((L=window.localStorage)==null?void 0:L.getItem(qc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Rc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[eo]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[eo]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(eo)&&r&&r.show(o.get(eo)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(qc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class r$ extends ge{constructor(e){super(),_e(this,e,o$,s$,me,{})}}function a$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function f$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class u$ extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{tolerance:3})}}function c$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new u$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const jc="@adminSidebarWidth";function d$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(jc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(jc,a))},[s,o,a,r,l,i,f,u,c,d]}class Bb extends ge{constructor(e){super(),_e(this,e,d$,c$,me,{class:0})}}const Ua=Cn({});function un(n,e,t){Ua.set({text:n,yesCallback:e,noCallback:t})}function Ub(){Ua.set({})}function Hc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function p$(n){let e,t,i,l,s=n[0]&&Hc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Hc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function m$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,m$,p$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function zc(n,e,t){const i=n.slice();return i[27]=e[t],i}function h$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function _$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function g$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function b$(n){let e,t,i,l;const s=[g$,_$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Vc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[b$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Vc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Vc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function y$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Uc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function v$(n){let e,t,i,l,s,o,r=n[5]!=""&&Uc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Uc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function w$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[v$],header:[y$],default:[k$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-iXaWdysu.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class $$ extends ge{constructor(e){super(),_e(this,e,S$,w$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Wc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Yc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Jc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Yc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Yc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Jc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function T$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Jc=n=>n.name;function C$(n,e,t){let i;We(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class O$ extends ge{constructor(e){super(),_e(this,e,C$,T$,me,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function M$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class I$ extends ge{constructor(e){super(),_e(this,e,E$,D$,me,{class:0})}}const A$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]}),L$=n=>({interactive:n&64,hasErrors:n&32}),Qc=n=>({interactive:n[6],hasErrors:n[5]}),N$=n=>({interactive:n&64,hasErrors:n&32}),xc=n=>({interactive:n[6],hasErrors:n[5]});function ed(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function td(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&td(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=td(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function F$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function R$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function q$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function nd(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Qc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[j$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[H$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Xc);let g=!n[0].toDelete&&id(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,L$):Tt(y[19]),Qc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,A$):Tt(y[19]),Xc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=id(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function j$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function H$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function id(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function z$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function V$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&ed();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[P$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],xc),m=d||F$();function h(S,T){if(S[0].toDelete)return q$;if(S[6])return R$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&nd(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=ed(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,N$):Tt(S[19]),xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=nd(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function B$(n,e,t){let i,l,s,o;We(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of Or)N.id!=f&&N.collapse()}Ht(()=>(Or.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(Or,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,B$,V$,me,{key:1,field:0})}}function U$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function W$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[U$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[W$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[Y$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function J$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[K$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Z$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class G$ extends ge{constructor(e){super(),_e(this,e,Z$,J$,me,{field:0,key:1})}}function X$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Q$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[X$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Q$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function eT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function tT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[eT,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[tT],options:[x$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function iT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class lT extends ge{constructor(e){super(),_e(this,e,iT,nT,me,{field:0,key:1})}}function sT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class rT extends ge{constructor(e){super(),_e(this,e,oT,sT,me,{field:0,key:1})}}function aT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Fl extends ge{constructor(e){super(),_e(this,e,fT,aT,me,{value:0,separator:1,readonly:2,disabled:3})}}function uT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function cT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are ONLY allowed. This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function dT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[uT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[cT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function pT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[dT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Wb extends ge{constructor(e){super(),_e(this,e,mT,pT,me,{field:0,key:1})}}function hT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function _T(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class gT extends ge{constructor(e){super(),_e(this,e,_T,hT,me,{field:0,key:1})}}function bT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function kT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[bT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[kT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function vT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class wT extends ge{constructor(e){super(),_e(this,e,vT,yT,me,{field:0,key:1})}}var Mr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$l={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},_s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function ld(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function fn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function dt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Yb(n,e){if(e(n))return n;if(n.parentNode)return Yb(n.parentNode,e)}function no(n,e){var t=dt("div","numInputWrapper"),i=dt("input","numInput "+n),l=dt("span","arrowUp"),s=dt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Ro=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},ST={D:Er,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Er,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Ui={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ls={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ls.w(n,e,t)]},F:function(n,e,t){return Ro(ls.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ls.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Ro(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Kb=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ls[c]&&m[d-1]!=="\\"?ls[c](r,u,t):c!=="\\"?c:""}).join("")}},aa=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||$l).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ar(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var fe=t._input.value;c(),Kt(),t._input.value!==fe&&t._debouncedChange()}function f(Z,X){return Z%12+12*In(X===t.l10n.amPM[1])}function u(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=f(Z,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Ir(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Ir(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Ir(Z,X,ne);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(Z){var X=yn(Z),ne=parseInt(X.value)+(Z.delta||0);(ne/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&Mt(ne)}function _(Z,X,ne,fe){if(X instanceof Array)return X.forEach(function(Te){return _(Z,Te,ne,fe)});if(Z instanceof Array)return Z.forEach(function(Te){return _(Te,X,ne,fe)});Z.addEventListener(X,ne,fe),t._handlers.push({remove:function(){return Z.removeEventListener(X,ne,fe)}})}function g(){kt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(fe){return _(fe,"click",t[ne])})}),t.isMobile){al();return}var Z=ld(ze,50);if(t._debouncedChange=ld(g,OT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ae(yn(ne))}),_(t._input,"keydown",De),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",De),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ut),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(Z,X){var ne=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=dt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Z,X,ne,fe){var Te=ft(X,!0),Le=dt("span",Z,X.getDate().toString());return Le.dateObj=X,Le.$i=fe,Le.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Te?(Le.tabIndex=-1,Mn(X)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(fn(Le,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),fn(Le,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),kt("onDayCreate",Le),Le}function D(Z){Z.focus(),t.config.mode==="range"&&Ae(Z)}function I(Z){for(var X=Z>0?0:t.config.showMonths-1,ne=Z>0?t.config.showMonths:-1,fe=X;fe!=ne;fe+=Z)for(var Te=t.daysContainer.children[fe],Le=Z>0?0:Te.children.length-1,Je=Z>0?Te.children.length:-1,qe=Le;qe!=Je;qe+=Z){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&ft(Qe.dateObj))return Qe}}function L(Z,X){for(var ne=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,fe=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Le=ne-t.currentMonth;Le!=fe;Le+=Te)for(var Je=t.daysContainer.children[Le],qe=ne-t.currentMonth===Le?Z.$i+X:X<0?Je.children.length-1:0,Qe=Je.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=Te){var Ve=Je.children[Re];if(Ve.className.indexOf("hidden")===-1&&ft(Ve.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(Z,X){var ne=s(),fe=ht(ne||document.body),Te=Z!==void 0?Z:fe?ne:t.selectedDateElem!==void 0&&ht(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&ht(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():fe?L(Te,X):D(Te)}function F(Z,X){for(var ne=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((X-1+12)%12,Z),Te=t.utils.getDaysInMonth(X,Z),Le=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",Qe=Je?"nextMonthDay hidden":"nextMonthDay",Re=fe+1-ne,Ve=0;Re<=fe;Re++,Ve++)Le.appendChild(O("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Le.appendChild(O("flatpickr-day",new Date(Z,X,Re),Re,Ve));for(var yt=Te+1;yt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);yt++,Ve++)Le.appendChild(O("flatpickr-day "+Qe,new Date(Z,X+1,yt%Te),yt,Ve));var Jn=dt("div","dayContainer");return Jn.appendChild(Le),Jn}function N(){if(t.daysContainer!==void 0){to(t.daysContainer),t.weekNumbers&&to(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ne=dt("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Ro(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Z=dt("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=dt("span","cur-month"):(t.monthsDropdownContainer=dt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),kt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var fe=no("cur-year",{tabindex:"-1"}),Te=fe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=dt("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(fe),X.appendChild(Le),Z.appendChild(X),{container:Z,yearElement:Te,monthElement:ne}}function H(){to(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){return t.monthNav=dt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(fn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(fn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Oe(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Ar(t.config);t.timeContainer=dt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=dt("span","flatpickr-time-separator",":"),ne=no("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var fe=no("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:u(Z.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=no("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(dt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=dt("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function U(){t.weekdayContainer?to(t.weekdayContainer):t.weekdayContainer=dt("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=dt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=sd(t.l10n.weekdays.shorthand);Z>0&&Z @@ -67,7 +67,7 @@ var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,config `),l=b("code"),l.textContent="id",s=K(` , `),o=b("code"),o.textContent="created",r=K(` , `),a=b("code"),a.textContent="updated",f=M(),D&&D.c(),u=K(` - .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class GC extends ge{constructor(e){super(),_e(this,e,ZC,JC,me,{collection:0})}}const XC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),QC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]}),xC=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function e5(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[n5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function t5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Rd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Pd),C=n[12].afterLabel,O=wt(C,n,n[15],Nd);let D=!n[9]&&Fd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Rd(n);const N=n[12].default,P=wt(N,n,n[15],Ld);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,xC):Tt(q[15]),Pd),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,QC):Tt(q[15]),Nd),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Fd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Rd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,XC):Tt(q[15]),Ld)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function i5(n){let e,t,i,l;const s=[t5,e5],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let qd;function l5(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=qd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CFHe_5bb.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),qd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class Cl extends ge{constructor(e){super(),_e(this,e,l5,i5,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request
    filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule: + .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class GC extends ge{constructor(e){super(),_e(this,e,ZC,JC,me,{collection:0})}}const XC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),QC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]}),xC=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function e5(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[n5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function t5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Rd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Pd),C=n[12].afterLabel,O=wt(C,n,n[15],Nd);let D=!n[9]&&Fd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Rd(n);const N=n[12].default,P=wt(N,n,n[15],Ld);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,xC):Tt(q[15]),Pd),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,QC):Tt(q[15]),Nd),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Fd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Rd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,XC):Tt(q[15]),Ld)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function i5(n){let e,t,i,l;const s=[t5,e5],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let qd;function l5(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=qd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-DG6SVeUP.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),qd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class Cl extends ge{constructor(e){super(),_e(this,e,l5,i5,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule:
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function zd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&oe(i,t)},d(l){l&&v(e)}}}function Vd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[s5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cl({props:c}),ee.push(()=>be(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Cl({props:m}),ee.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Cl({props:_}),ee.push(()=>be(r,"rule",h)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(g,y){z(e,g,y),w(g,i,y),z(l,g,y),w(g,o,y),z(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),V(e,g),V(l,g),V(r,g)}}}function Bd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function s5(n){let e,t=!n[10]&&Bd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Bd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Ud(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[o5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Cl({props:s}),ee.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function o5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function r5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&Hd(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new Cl({props:D}),ee.push(()=>be(u,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Cl({props:L}),ee.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Vd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Ud(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the @@ -76,7 +76,7 @@ var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,config
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Yd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function p5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[d5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function m5(n,e,t){let i;We(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-97oGZhvg.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class h5 extends ge{constructor(e){super(),_e(this,e,m5,p5,me,{collection:0})}}const _5=n=>({active:n&1}),Jd=n=>({active:n[0]});function Zd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function g5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Jd);let u=n[0]&&Zd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,_5):Tt(c[14]),Jd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Zd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function b5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class go extends ge{constructor(e){super(),_e(this,e,b5,g5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function y5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[k5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function v5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?w5:v5}let a=r(n),f=a(n),u=n[3]&&Gd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function $5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[T5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[C5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function T5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. + MAX(balance) as maxBalance).`,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Yd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function p5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[d5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function m5(n,e,t){let i;We(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-iXaWdysu.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class h5 extends ge{constructor(e){super(),_e(this,e,m5,p5,me,{collection:0})}}const _5=n=>({active:n&1}),Jd=n=>({active:n[0]});function Zd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function g5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Jd);let u=n[0]&&Zd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,_5):Tt(c[14]),Jd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Zd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function b5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class go extends ge{constructor(e){super(),_e(this,e,b5,g5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function y5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[k5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function v5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?w5:v5}let a=r(n),f=a(n),u=n[3]&&Gd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function $5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[T5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[C5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function T5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function C5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function O5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[$5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Xd(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Xd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function E5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?D5:M5}let a=r(n),f=a(n),u=n[2]&&Qd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Qd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function xd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function A5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[I5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&xd();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=xd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function L5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function N5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ep(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function P5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?N5:L5}let a=r(n),f=a(n),u=n[1]&&ep();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=ep(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function R5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[11]),Se(Pe.call(null,r,{text:`The constraint is applied only for new records. Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function q5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[12]),Se(Pe.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` @@ -84,9 +84,9 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),l=b("strong"),o=K(s),r=M(),a=b("i"),f=M(),u=b("strong"),d=K(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&oe(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&oe(d,c)},d(_){_&&v(e)}}}function rp(n){let e,t,i,l=ue(n[6]),s=[];for(let u=0;u',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=lp(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=sp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function B5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function W5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[U5],header:[B5],default:[V5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function Y5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class K5 extends ge{constructor(e){super(),_e(this,e,Y5,W5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function J5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new GC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Z5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new h5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function pp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new z5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Il)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function G5(n){let e,t,i,l,s,o,r;const a=[Z5,J5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===gs&&dp(n),d=n[15]&&pp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===gs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=dp(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=pp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function mp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[X5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function X5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function hp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[Q5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function _p(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function Q5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=hp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=gp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function bp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function yp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&vp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=vp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Il)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function vp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e6(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&mp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[x5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&bp(n),P=O&&kp(),q=n[15]&&yp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===gs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,ht,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=mp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=bp(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((ht=pe[5])==null?void 0:ht.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=kp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===gs),pe[15]?q?q.p(pe,Ne):(q=yp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function t6(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function n6(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[t6],header:[e6],default:[G5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new K5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",gs="api_rules",Il="options",i6="base",wp="auth",Sp="view";function Lr(n){return JSON.stringify(n)}function l6(n,e,t){let i,l,s,o,r,a;We(n,mi,ve=>t(5,a=ve));const f={};f[i6]="Base",f[Sp]="View",f[wp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Lr(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Lr(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{Ta(),fv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&un(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),uv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(gs),Xe=()=>$(Il);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function ht(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function bt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===wp),n.$$.dirty[0]&4&&t(14,l=h.type===Sp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Lr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Il&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De,Ae,ze,bt,de]}class Ya extends ge{constructor(e){super(),_e(this,e,l6,n6,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function s6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function o6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function r6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?o6:s6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(ln.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function a6(n,e,t){let i,l;We(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Zb extends ge{constructor(e){super(),_e(this,e,a6,r6,me,{collection:0,pinnedIds:4})}}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cp(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Mp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Dp(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Ip(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ap(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function f6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Cp(n),T=n[5].length&&Mp(n),$=n[3].length&&!n[2].length&&Ip(),C=!n[9]&&Ap(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=Cp(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Mp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Ip(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ap(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function u6(n){let e,t,i,l;e=new Bb({props:{class:"collection-sidebar",$$slots:{default:[f6]},$$scope:{ctx:n}}});let s={};return i=new Ya({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Lp="@pinnedCollections";function c6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function d6(n,e,t){let i,l,s,o,r,a,f,u,c;We(n,Rn,L=>t(11,a=L)),We(n,Yn,L=>t(19,f=L)),We(n,Oo,L=>t(8,u=L)),We(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Lp);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),c6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Lp,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class p6 extends ge{constructor(e){super(),_e(this,e,d6,u6,me,{})}}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Pp(n){n[18]=n[19].default}function Fp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Rp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Rp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Rp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function jp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:_6,then:h6,catch:m6,value:19,blocks:[,,,]};return ef(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&ef(t,l)||E0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function m6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function h6(n){Pp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Pp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function _6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Hp(n,e){let t,i,l,s=e[5]===e[14]&&jp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=jp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function g6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function k6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[b6],default:[g6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function y6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-CtNZ5G9D.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-Bt5koN3Z.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-cTL4BTwH.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-B4w33bkJ.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-C521Da9d.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-DlyauiFo.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-CaL3O2uX.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-C9IystLV.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-CdUir8-r.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-B3KxCvqw.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-BKx9x0MU.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-CCrC-X-J.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-DCQFPDN7.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-DmKjgrzy.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-T4e4Bmxi.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-DifPdWR1.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-DCCFJUK6.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-4JM4cUB_.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class v6 extends ge{constructor(e){super(),_e(this,e,y6,k6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function w6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` + you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=lp(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=sp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function B5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function W5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[U5],header:[B5],default:[V5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function Y5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class K5 extends ge{constructor(e){super(),_e(this,e,Y5,W5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function J5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new GC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Z5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new h5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function pp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new z5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Il)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function G5(n){let e,t,i,l,s,o,r;const a=[Z5,J5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===gs&&dp(n),d=n[15]&&pp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===gs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=dp(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=pp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function mp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[X5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function X5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function hp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[Q5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function _p(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function Q5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=hp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=gp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function bp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function yp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&vp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=vp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Il)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function vp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e6(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&mp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[x5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&bp(n),P=O&&kp(),q=n[15]&&yp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===gs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,ht,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=mp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=bp(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((ht=pe[5])==null?void 0:ht.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=kp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===gs),pe[15]?q?q.p(pe,Ne):(q=yp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function t6(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function n6(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[t6],header:[e6],default:[G5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new K5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",gs="api_rules",Il="options",i6="base",wp="auth",Sp="view";function Lr(n){return JSON.stringify(n)}function l6(n,e,t){let i,l,s,o,r,a;We(n,mi,ve=>t(5,a=ve));const f={};f[i6]="Base",f[Sp]="View",f[wp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Lr(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Lr(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{Ta(),fv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&un(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),uv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(gs),Xe=()=>$(Il);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function ht(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function bt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===wp),n.$$.dirty[0]&4&&t(14,l=h.type===Sp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Lr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Il&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De,Ae,ze,bt,de]}class Ya extends ge{constructor(e){super(),_e(this,e,l6,n6,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function s6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function o6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function r6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?o6:s6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(ln.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function a6(n,e,t){let i,l;We(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Zb extends ge{constructor(e){super(),_e(this,e,a6,r6,me,{collection:0,pinnedIds:4})}}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cp(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Mp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Dp(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Ip(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ap(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function f6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Cp(n),T=n[5].length&&Mp(n),$=n[3].length&&!n[2].length&&Ip(),C=!n[9]&&Ap(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=Cp(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Mp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Ip(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ap(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function u6(n){let e,t,i,l;e=new Bb({props:{class:"collection-sidebar",$$slots:{default:[f6]},$$scope:{ctx:n}}});let s={};return i=new Ya({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Lp="@pinnedCollections";function c6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function d6(n,e,t){let i,l,s,o,r,a,f,u,c;We(n,Rn,L=>t(11,a=L)),We(n,Yn,L=>t(19,f=L)),We(n,Oo,L=>t(8,u=L)),We(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Lp);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),c6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Lp,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class p6 extends ge{constructor(e){super(),_e(this,e,d6,u6,me,{})}}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Pp(n){n[18]=n[19].default}function Fp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Rp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Rp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Rp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function jp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:_6,then:h6,catch:m6,value:19,blocks:[,,,]};return ef(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&ef(t,l)||E0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function m6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function h6(n){Pp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Pp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function _6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Hp(n,e){let t,i,l,s=e[5]===e[14]&&jp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=jp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function g6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function k6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[b6],default:[g6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function y6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-D0RToTF6.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-DaNIuuC4.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-DyFYshJx.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-DY8egWRV.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-BjlD4kbR.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-5_90JfZR.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-Day03rmY.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-fAroZBFD.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-Qii5vPCm.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-C_sAThHJ.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-DXzEcR9y.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-Iw-ugIBq.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-CqsVn5Wy.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-W_T6yElq.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-C8t_3a0s.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-D7M5HLRz.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-FIkHZF7A.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-BAfMmG5W.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class v6 extends ge{constructor(e){super(),_e(this,e,y6,k6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function w6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&Ct(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const zp="yyyy-MM-dd HH:mm:ss.SSS";function S6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,zp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,zp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Gb extends ge{constructor(e){super(),_e(this,e,S6,w6,me,{model:1})}}function $6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function T6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[$6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function C6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Xb extends ge{constructor(e){super(),_e(this,e,C6,T6,me,{class:0,length:5})}}function O6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function M6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Vp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[D6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[E6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[I6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function E6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function I6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function A6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function L6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[M6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Vp(n),_=(n[2]||n[3])&&Bp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[A6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Vp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Bp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function N6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||un("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class P6 extends ge{constructor(e){super(),_e(this,e,N6,L6,me,{record:0,collection:1,isNew:2})}}function F6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class q6 extends ge{constructor(e){super(),_e(this,e,R6,F6,me,{value:0,maxHeight:4})}}function j6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new q6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function H6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class V6 extends ge{constructor(e){super(),_e(this,e,z6,H6,me,{field:1,value:0})}}function B6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function U6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Y6 extends ge{constructor(e){super(),_e(this,e,W6,U6,me,{field:1,value:0})}}function K6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function J6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class G6 extends ge{constructor(e){super(),_e(this,e,Z6,J6,me,{field:1,value:0})}}function X6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function Q6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class eO extends ge{constructor(e){super(),_e(this,e,x6,Q6,me,{field:1,value:0})}}function tO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function nO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function iO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class lO extends ge{constructor(e){super(),_e(this,e,iO,nO,me,{field:1,value:0})}}function Up(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function sO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Up(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Wa({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Up($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function oO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class aO extends ge{constructor(e){super(),_e(this,e,rO,oO,me,{field:1,value:0})}}function Wp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function fO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Jb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Wp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Wp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function uO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class dO extends ge{constructor(e){super(),_e(this,e,cO,uO,me,{field:1,value:0})}}function pO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function _O(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function gO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?mO:pO}let $=T(n),C=$(n);const O=[_O,hO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function bO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yp(n){return typeof n=="string"&&Qb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Qb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function kO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Yp(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-97oGZhvg.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Yp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Qb(r))},[s,l,r,o,i,a]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{field:1,value:0})}}function vO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){let e;function t(s,o){return s[2]?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function $O(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class TO extends ge{constructor(e){super(),_e(this,e,$O,SO,me,{file:0,size:1})}}function Kp(n){let e;function t(s,o){return s[4]==="image"?OO:CO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function CO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function OO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function MO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Kp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Kp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function DO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function EO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function IO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[EO],header:[DO],default:[MO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function AO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class LO extends ge{constructor(e){super(),_e(this,e,AO,IO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function NO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?qO:f[3]==="video"||f[3]==="audio"?RO:FO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function PO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function FO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function RO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Jp(n){let e,t,i={};return e=new LO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function jO(n){let e,t,i;function l(a,f){return a[2]?PO:NO}let s=l(n),o=s(n),r=n[7]&&Jp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Jp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function HO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ka extends ge{constructor(e){super(),_e(this,e,HO,jO,me,{record:9,filename:0,size:1})}}function Zp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Gp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function zO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function VO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function BO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ka({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?VO:zO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Xp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[BO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function UO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new TO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Qp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[UO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function WO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Gb extends ge{constructor(e){super(),_e(this,e,S6,w6,me,{model:1})}}function $6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function T6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[$6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function C6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Xb extends ge{constructor(e){super(),_e(this,e,C6,T6,me,{class:0,length:5})}}function O6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function M6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Vp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[D6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[E6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[I6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function E6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function I6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function A6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function L6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[M6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Vp(n),_=(n[2]||n[3])&&Bp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[A6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Vp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Bp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function N6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||un("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class P6 extends ge{constructor(e){super(),_e(this,e,N6,L6,me,{record:0,collection:1,isNew:2})}}function F6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class q6 extends ge{constructor(e){super(),_e(this,e,R6,F6,me,{value:0,maxHeight:4})}}function j6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new q6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function H6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class V6 extends ge{constructor(e){super(),_e(this,e,z6,H6,me,{field:1,value:0})}}function B6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function U6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Y6 extends ge{constructor(e){super(),_e(this,e,W6,U6,me,{field:1,value:0})}}function K6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function J6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class G6 extends ge{constructor(e){super(),_e(this,e,Z6,J6,me,{field:1,value:0})}}function X6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function Q6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class eO extends ge{constructor(e){super(),_e(this,e,x6,Q6,me,{field:1,value:0})}}function tO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function nO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function iO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class lO extends ge{constructor(e){super(),_e(this,e,iO,nO,me,{field:1,value:0})}}function Up(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function sO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Up(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Wa({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Up($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function oO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class aO extends ge{constructor(e){super(),_e(this,e,rO,oO,me,{field:1,value:0})}}function Wp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function fO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Jb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Wp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Wp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function uO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class dO extends ge{constructor(e){super(),_e(this,e,cO,uO,me,{field:1,value:0})}}function pO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function _O(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function gO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?mO:pO}let $=T(n),C=$(n);const O=[_O,hO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function bO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yp(n){return typeof n=="string"&&Qb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Qb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function kO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Yp(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-iXaWdysu.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Yp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Qb(r))},[s,l,r,o,i,a]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{field:1,value:0})}}function vO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){let e;function t(s,o){return s[2]?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function $O(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class TO extends ge{constructor(e){super(),_e(this,e,$O,SO,me,{file:0,size:1})}}function Kp(n){let e;function t(s,o){return s[4]==="image"?OO:CO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function CO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function OO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function MO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Kp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Kp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function DO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function EO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function IO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[EO],header:[DO],default:[MO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function AO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class LO extends ge{constructor(e){super(),_e(this,e,AO,IO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function NO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?qO:f[3]==="video"||f[3]==="audio"?RO:FO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function PO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function FO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function RO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Jp(n){let e,t,i={};return e=new LO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function jO(n){let e,t,i;function l(a,f){return a[2]?PO:NO}let s=l(n),o=s(n),r=n[7]&&Jp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Jp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function HO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ka extends ge{constructor(e){super(),_e(this,e,HO,jO,me,{record:9,filename:0,size:1})}}function Zp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Gp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function zO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function VO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function BO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ka({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?VO:zO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Xp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[BO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function UO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new TO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Qp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[UO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function WO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function oI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[tI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[nI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[sI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function rI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Qh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function aI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[rI],default:[oI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-97oGZhvg.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),Co(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Xa extends ge{constructor(e){super(),_e(this,e,fI,aI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function e_(n,e,t){const i=n.slice();return i[21]=e[t],i}function t_(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=k0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function uI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[cI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function pI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function hI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mI],header:[pI],default:[dI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Rr="last_email_test",n_="email_test_request";function _I(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Rr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(n_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:n_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class gI extends ge{constructor(e){super(),_e(this,e,_I,hI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function bI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&i_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&l_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&s_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[wI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&o_(n);function L(N,P){return N[5]?LI:AI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=i_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=l_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=s_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=o_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function kI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function i_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function s_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[SI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$I,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[TI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[CI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?MI:OI}let O=C(n),D=O(n),I=n[4]&&r_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=r_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function SI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function TI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function OI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function MI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[EI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[II,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function DI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function EI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function II(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function AI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function NI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[kI,bI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function PI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}});let r={};return s=new gI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function FI(n,e,t){let i,l,s;We(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class RI extends ge{constructor(e){super(),_e(this,e,FI,PI,me,{},null,[-1,-1])}}const qI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),a_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function jI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function f_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[VI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[BI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[UI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[WI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function HI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function UI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function WI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function YI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[jI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],a_);let a=n[0].enabled&&f_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,qI):Tt(f[15]),a_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=f_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const qr="s3_test_request";function KI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(qr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:qr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class e0 extends ge{constructor(e){super(),_e(this,e,KI,YI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function JI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[GI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new e0({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&c_(n),O=n[6]&&d_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=c_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=d_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function ZI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function u_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually + `),g=b("button"),g.textContent="{ACTION_URL} ",y=K("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[J(u,"click",n[22]),J(d,"click",n[23]),J(h,"click",n[24]),J(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(le(),A(O[R],1,1,()=>{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function oI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[tI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[nI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[sI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function rI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Qh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function aI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[rI],default:[oI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-iXaWdysu.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),Co(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Xa extends ge{constructor(e){super(),_e(this,e,fI,aI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function e_(n,e,t){const i=n.slice();return i[21]=e[t],i}function t_(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=k0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function uI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[cI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function pI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function hI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mI],header:[pI],default:[dI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Rr="last_email_test",n_="email_test_request";function _I(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Rr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(n_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:n_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class gI extends ge{constructor(e){super(),_e(this,e,_I,hI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function bI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&i_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&l_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&s_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[wI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&o_(n);function L(N,P){return N[5]?LI:AI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=i_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=l_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=s_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=o_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function kI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function i_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function s_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[SI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$I,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[TI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[CI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?MI:OI}let O=C(n),D=O(n),I=n[4]&&r_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=r_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function SI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function TI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function OI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function MI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[EI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[II,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function DI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function EI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function II(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function AI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function NI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[kI,bI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function PI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}});let r={};return s=new gI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function FI(n,e,t){let i,l,s;We(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class RI extends ge{constructor(e){super(),_e(this,e,FI,PI,me,{},null,[-1,-1])}}const qI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),a_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function jI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function f_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[VI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[BI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[UI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[WI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function HI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function UI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function WI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function YI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[jI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],a_);let a=n[0].enabled&&f_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,qI):Tt(f[15]),a_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=f_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const qr="s3_test_request";function KI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(qr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:qr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class e0 extends ge{constructor(e){super(),_e(this,e,KI,YI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function JI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[GI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new e0({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&c_(n),O=n[6]&&d_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=c_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=d_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function ZI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function u_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),f=K(a),u=K(` to the @@ -149,4 +149,4 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t @weekly @daily @midnight -@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function N7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vg(n){let e;function t(s,o){return s[7]?R7:s[8]?F7:P7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function P7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function F7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function R7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function q7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new M7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new T7({props:N}),n[15](y);function P(G,U){return G[6]?E7:D7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&kg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=kg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function j7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function H7(n,e,t){let i,l;We(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class z7 extends ge{constructor(e){super(),_e(this,e,H7,j7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],V7={"/login":At({component:zE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-DnoMIZGu.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-C5ZKwumu.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:aE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:r$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:GE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:PE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:RI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:lA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:vA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:EA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:qA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:l7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:z7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-CP5c1DP1.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-CP5c1DP1.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CfCN5jko.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CfCN5jko.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-D9_-dnhk.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-D9_-dnhk.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-BBB69FeN.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-Da-UeZbe.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Lv,userData:{showAppSidebar:!1}})};function B7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Go}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function Sg(n,e,t){const i=n.slice();return i[2]=e[t],i}function U7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Y7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function K7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $g(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?K7:O[2].type==="success"?Y7:O[2].type==="warning"?W7:U7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){C0(t),h(),Ng(t,m)},a(){h(),h=T0(t,m,B7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Rg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ma(t,fs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function J7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J1(s)]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function X7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function Q7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function x7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[Q7],header:[X7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function eL(n,e,t){let i;We(n,Ua,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Ub()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class tL extends ge{constructor(e){super(),_e(this,e,eL,x7,me,{})}}function Tg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(ln.call(null,t)),Se(ln.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(ln.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(ln.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function nL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(ln.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function Cg(n){let e,t,i;return t=new Ja({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function iL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Tg(n);o=new H0({props:{routes:V7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new G7({}),u=new tL({});let _=n[1]&&!n[2]&&Cg(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Tg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=Cg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function lL(n,e,t){let i,l,s,o;We(n,Xi,_=>t(10,i=_)),We(n,Do,_=>t(3,l=_)),We(n,Oa,_=>t(0,s=_)),We(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),Ub())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Do,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class sL extends ge{constructor(e){super(),_e(this,e,lL,iL,me,{})}}new sL({target:document.getElementById("app")});export{$e as A,Lt as B,j as C,tl as D,ye as E,Q1 as F,Vo as G,oo as H,Ht as I,We as J,Rn as K,lt as L,ee as M,Hb as N,ue as O,at as P,Ai as Q,Et as R,ge as S,ot as T,v0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,ln as l,z as m,se as n,v as o,ae as p,ce as q,x as r,me as s,E as t,J as u,Be as v,K as w,oe as x,Q as y,re as z}; +@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function N7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vg(n){let e;function t(s,o){return s[7]?R7:s[8]?F7:P7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function P7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function F7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function R7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function q7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new M7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new T7({props:N}),n[15](y);function P(G,U){return G[6]?E7:D7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&kg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=kg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function j7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function H7(n,e,t){let i,l;We(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class z7 extends ge{constructor(e){super(),_e(this,e,H7,j7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],V7={"/login":At({component:zE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-CLtpG3X-.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-B5V9k9ND.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:aE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:r$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:GE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:PE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:RI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:lA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:vA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:EA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:qA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:l7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:z7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-B1PSZ-qj.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-B1PSZ-qj.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CQyCw5g4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CQyCw5g4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B4LDtp4c.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B4LDtp4c.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-DFTUTq4C.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-tMl3bsYz.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Lv,userData:{showAppSidebar:!1}})};function B7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Go}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function Sg(n,e,t){const i=n.slice();return i[2]=e[t],i}function U7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Y7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function K7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $g(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?K7:O[2].type==="success"?Y7:O[2].type==="warning"?W7:U7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){C0(t),h(),Ng(t,m)},a(){h(),h=T0(t,m,B7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Rg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ma(t,fs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function J7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J1(s)]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function X7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function Q7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function x7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[Q7],header:[X7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function eL(n,e,t){let i;We(n,Ua,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Ub()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class tL extends ge{constructor(e){super(),_e(this,e,eL,x7,me,{})}}function Tg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(ln.call(null,t)),Se(ln.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(ln.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(ln.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function nL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(ln.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function Cg(n){let e,t,i;return t=new Ja({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function iL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Tg(n);o=new H0({props:{routes:V7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new G7({}),u=new tL({});let _=n[1]&&!n[2]&&Cg(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Tg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=Cg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function lL(n,e,t){let i,l,s,o;We(n,Xi,_=>t(10,i=_)),We(n,Do,_=>t(3,l=_)),We(n,Oa,_=>t(0,s=_)),We(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),Ub())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Do,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class sL extends ge{constructor(e){super(),_e(this,e,lL,iL,me,{})}}new sL({target:document.getElementById("app")});export{$e as A,Lt as B,j as C,tl as D,ye as E,Q1 as F,Vo as G,oo as H,Ht as I,We as J,Rn as K,lt as L,ee as M,Hb as N,ue as O,at as P,Ai as Q,Et as R,ge as S,ot as T,v0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,ln as l,z as m,se as n,v as o,ae as p,ce as q,x as r,me as s,E as t,J as u,Be as v,K as w,oe as x,Q as y,re as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 4243b0d1d0..22db412ace 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -47,7 +47,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + From 0d34c00d2edbfc4ce548d4f357afdb3e446aadac Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Thu, 14 Nov 2024 14:31:17 +0200 Subject: [PATCH 20/44] added randomized trottle for failed list filter requests --- apis/record_crud.go | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/apis/record_crud.go b/apis/record_crud.go index 9fce86fc8a..48a1439978 100644 --- a/apis/record_crud.go +++ b/apis/record_crud.go @@ -1,9 +1,12 @@ package apis import ( + cryptoRand "crypto/rand" "fmt" "log/slog" + "math/big" "net/http" + "time" "github.com/labstack/echo/v5" "github.com/pocketbase/dbx" @@ -71,7 +74,13 @@ func (api *recordApi) list(c echo.Context) error { records := []*models.Record{} - result, err := searchProvider.ParseAndExec(c.QueryParams().Encode(), &records) + // note: in v0.23.0 this has been migrated as option check in the search.Provider + queryStr := c.QueryParams().Encode() + if len(queryStr) > 2048 { + return NewBadRequestError("query string is too large", nil) + } + + result, err := searchProvider.ParseAndExec(queryStr, &records) if err != nil { return NewBadRequestError("", err) } @@ -91,10 +100,43 @@ func (api *recordApi) list(c echo.Context) error { api.app.Logger().Debug("Failed to enrich list records", slog.String("error", err.Error())) } + // note: in v0.23.0 this is combined with extra check for repeated attempts + // + // Add a randomized throttle in case of empty search filter attempts. + // + // This is just for extra precaution since security researches raised concern regarding the possibity of eventual + // timing attacks because the List API rule acts also as filter and executes in a single run with the client-side filters. + // This is by design and it is an accepted tradeoff between performance, usability and correctness. + // + // While technically the below doesn't fully guarantee protection against filter timing attacks, in practice combined with the network latency it makes them even less feasible. + // A properly configured rate limiter or individual fields Hidden checks are better suited if you are really concerned about eventual information disclosure by side-channel attacks. + // + // In all cases it doesn't really matter that much because it doesn't affect the builtin PocketBase security sensitive fields (e.g. password and tokenKey) since they + // are not client-side filterable and in the few places where they need to be compared against an external value, a constant time check is used. + if requestInfo.Admin == nil && + (collection.ListRule != nil && *collection.ListRule != "") && + (requestInfo.Query["filter"] != "") && + len(e.Records) == 0 { + api.app.Logger().Debug("Randomized throttle because of failed filter search", "collectionId", collection.Id) + randomizedThrottle(100) + } + return e.HttpContext.JSON(http.StatusOK, e.Result) }) } +func randomizedThrottle(softMax int64) { + var timeout int64 + randRange, err := cryptoRand.Int(cryptoRand.Reader, big.NewInt(softMax)) + if err == nil { + timeout = randRange.Int64() + } else { + timeout = softMax + } + + time.Sleep(time.Duration(timeout) * time.Millisecond) +} + func (api *recordApi) view(c echo.Context) error { collection, _ := c.Get(ContextCollectionKey).(*models.Collection) if collection == nil { From dbb0b6b2d2b75ea76e430b64f625d180f8a2c163 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Thu, 14 Nov 2024 14:42:58 +0200 Subject: [PATCH 21/44] [#5861] refresh the old collections in the UI import page on successful import submission --- CHANGELOG.md | 7 ++ ui/.env | 2 +- ...7M5HLRz.js => AuthMethodsDocs-DUYNI6SK.js} | 2 +- ...ii5vPCm.js => AuthRefreshDocs-DZkxje-L.js} | 2 +- ...ZBFD.js => AuthWithOAuth2Docs-BfeByTL2.js} | 2 +- ...mY.js => AuthWithPasswordDocs-CPWaI1QS.js} | 2 +- ...tor-iXaWdysu.js => CodeEditor-CiCm0ZL1.js} | 2 +- ....js => ConfirmEmailChangeDocs-C4WZVRqf.js} | 2 +- ...s => ConfirmPasswordResetDocs-D60P5AZI.js} | 2 +- ...js => ConfirmVerificationDocs-C7bRCIQx.js} | 2 +- ...-DyFYshJx.js => CreateApiDocs-2bIkoopj.js} | 2 +- ...-BjlD4kbR.js => DeleteApiDocs-B7tWDNFi.js} | 2 +- ...CPhrsm.js => FieldsQueryParam-fa5aA_5L.js} | 2 +- ...js => FilterAutocompleteInput-CS7wYc6J.js} | 2 +- ...cs-D0RToTF6.js => ListApiDocs-WdA3p5Nq.js} | 2 +- ...A.js => ListExternalAuthsDocs-CD1lYZPX.js} | 2 +- ...PageAdminConfirmPasswordReset-DZiKZ2vT.js} | 2 +- ...PageAdminRequestPasswordReset-BF8cSSXp.js} | 2 +- ... => PageOAuth2RedirectFailure-DGb-fGnZ.js} | 2 +- ... => PageOAuth2RedirectSuccess-BZv-iZYo.js} | 2 +- ... PageRecordConfirmEmailChange-BzuoVpAs.js} | 2 +- ...ageRecordConfirmPasswordReset-DvKofdMx.js} | 2 +- ...PageRecordConfirmVerification-CjJgsihN.js} | 2 +- ..._90JfZR.js => RealtimeApiDocs-Dzg8Y9BD.js} | 2 +- ....js => RequestEmailChangeDocs-eykCUxs-.js} | 2 +- ...s => RequestPasswordResetDocs-DVvHVnNU.js} | 2 +- ...js => RequestVerificationDocs-DBEH9oXv.js} | 2 +- ...dkTabs-CofkKgiC.js => SdkTabs-BsOGCCZb.js} | 2 +- ....js => UnlinkExternalAuthDocs-Dusvq0CB.js} | 2 +- ...-DY8egWRV.js => UpdateApiDocs-B38WU-hm.js} | 2 +- ...cs-DaNIuuC4.js => ViewApiDocs-DvDqZGkM.js} | 2 +- .../{index-C3DCbsuy.js => index-BxkLVEIp.js} | 110 +++++++++--------- ui/dist/index.html | 2 +- .../settings/PageImportCollections.svelte | 8 +- 34 files changed, 100 insertions(+), 87 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-D7M5HLRz.js => AuthMethodsDocs-DUYNI6SK.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-Qii5vPCm.js => AuthRefreshDocs-DZkxje-L.js} (97%) rename ui/dist/assets/{AuthWithOAuth2Docs-fAroZBFD.js => AuthWithOAuth2Docs-BfeByTL2.js} (98%) rename ui/dist/assets/{AuthWithPasswordDocs-Day03rmY.js => AuthWithPasswordDocs-CPWaI1QS.js} (98%) rename ui/dist/assets/{CodeEditor-iXaWdysu.js => CodeEditor-CiCm0ZL1.js} (99%) rename ui/dist/assets/{ConfirmEmailChangeDocs-C8t_3a0s.js => ConfirmEmailChangeDocs-C4WZVRqf.js} (97%) rename ui/dist/assets/{ConfirmPasswordResetDocs-CqsVn5Wy.js => ConfirmPasswordResetDocs-D60P5AZI.js} (98%) rename ui/dist/assets/{ConfirmVerificationDocs-DXzEcR9y.js => ConfirmVerificationDocs-C7bRCIQx.js} (97%) rename ui/dist/assets/{CreateApiDocs-DyFYshJx.js => CreateApiDocs-2bIkoopj.js} (98%) rename ui/dist/assets/{DeleteApiDocs-BjlD4kbR.js => DeleteApiDocs-B7tWDNFi.js} (97%) rename ui/dist/assets/{FieldsQueryParam-DRCPhrsm.js => FieldsQueryParam-fa5aA_5L.js} (96%) rename ui/dist/assets/{FilterAutocompleteInput-DG6SVeUP.js => FilterAutocompleteInput-CS7wYc6J.js} (99%) rename ui/dist/assets/{ListApiDocs-D0RToTF6.js => ListApiDocs-WdA3p5Nq.js} (99%) rename ui/dist/assets/{ListExternalAuthsDocs-FIkHZF7A.js => ListExternalAuthsDocs-CD1lYZPX.js} (97%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-B5V9k9ND.js => PageAdminConfirmPasswordReset-DZiKZ2vT.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-CLtpG3X-.js => PageAdminRequestPasswordReset-BF8cSSXp.js} (98%) rename ui/dist/assets/{PageOAuth2RedirectFailure-tMl3bsYz.js => PageOAuth2RedirectFailure-DGb-fGnZ.js} (86%) rename ui/dist/assets/{PageOAuth2RedirectSuccess-DFTUTq4C.js => PageOAuth2RedirectSuccess-BZv-iZYo.js} (86%) rename ui/dist/assets/{PageRecordConfirmEmailChange-B4LDtp4c.js => PageRecordConfirmEmailChange-BzuoVpAs.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-B1PSZ-qj.js => PageRecordConfirmPasswordReset-DvKofdMx.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-CQyCw5g4.js => PageRecordConfirmVerification-CjJgsihN.js} (97%) rename ui/dist/assets/{RealtimeApiDocs-5_90JfZR.js => RealtimeApiDocs-Dzg8Y9BD.js} (98%) rename ui/dist/assets/{RequestEmailChangeDocs-W_T6yElq.js => RequestEmailChangeDocs-eykCUxs-.js} (98%) rename ui/dist/assets/{RequestPasswordResetDocs-Iw-ugIBq.js => RequestPasswordResetDocs-DVvHVnNU.js} (97%) rename ui/dist/assets/{RequestVerificationDocs-C_sAThHJ.js => RequestVerificationDocs-DBEH9oXv.js} (97%) rename ui/dist/assets/{SdkTabs-CofkKgiC.js => SdkTabs-BsOGCCZb.js} (96%) rename ui/dist/assets/{UnlinkExternalAuthDocs-BAfMmG5W.js => UnlinkExternalAuthDocs-Dusvq0CB.js} (98%) rename ui/dist/assets/{UpdateApiDocs-DY8egWRV.js => UpdateApiDocs-B38WU-hm.js} (98%) rename ui/dist/assets/{ViewApiDocs-DaNIuuC4.js => ViewApiDocs-DvDqZGkM.js} (97%) rename ui/dist/assets/{index-C3DCbsuy.js => index-BxkLVEIp.js} (84%) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc7ba11364..98d54c7353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.22.25 + +- Refresh the old collections state in the Import UI after successful import submission ([#5861](https://github.com/pocketbase/pocketbase/issues/5861)). + +- Added randomized throttle on failed filter list requests as a very rudimentary measure since some security researches raised concern regarding the possibity of eventual side-channel attacks. + + ## v0.22.24 - Delete new uploaded record files in case of record DB persist error ([#5845](https://github.com/pocketbase/pocketbase/issues/5845)). diff --git a/ui/.env b/ui/.env index 489150fd66..311ae44f46 100644 --- a/ui/.env +++ b/ui/.env @@ -9,4 +9,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/" PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk" PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk" PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases" -PB_VERSION = "v0.22.24" +PB_VERSION = "v0.22.25" diff --git a/ui/dist/assets/AuthMethodsDocs-D7M5HLRz.js b/ui/dist/assets/AuthMethodsDocs-DUYNI6SK.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-D7M5HLRz.js rename to ui/dist/assets/AuthMethodsDocs-DUYNI6SK.js index f7fb2ac074..79205558d0 100644 --- a/ui/dist/assets/AuthMethodsDocs-D7M5HLRz.js +++ b/ui/dist/assets/AuthMethodsDocs-DUYNI6SK.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-C3DCbsuy.js";import{S as Ke}from"./SdkTabs-CofkKgiC.js";import{F as qe}from"./FieldsQueryParam-DRCPhrsm.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` +import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-BxkLVEIp.js";import{S as Ke}from"./SdkTabs-BsOGCCZb.js";import{F as qe}from"./FieldsQueryParam-fa5aA_5L.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-Qii5vPCm.js b/ui/dist/assets/AuthRefreshDocs-DZkxje-L.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-Qii5vPCm.js rename to ui/dist/assets/AuthRefreshDocs-DZkxje-L.js index 70166987fe..284b7909ac 100644 --- a/ui/dist/assets/AuthRefreshDocs-Qii5vPCm.js +++ b/ui/dist/assets/AuthRefreshDocs-DZkxje-L.js @@ -1,4 +1,4 @@ -import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-C3DCbsuy.js";import{S as Ze}from"./SdkTabs-CofkKgiC.js";import{F as et}from"./FieldsQueryParam-DRCPhrsm.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function xe(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,Q=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` +import{S as Ue,i as je,s as Je,N as Qe,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-BxkLVEIp.js";import{S as Ze}from"./SdkTabs-BsOGCCZb.js";import{F as et}from"./FieldsQueryParam-fa5aA_5L.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function xe(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,x,ue,z,q,pe,Y,Q=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-fAroZBFD.js b/ui/dist/assets/AuthWithOAuth2Docs-BfeByTL2.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-fAroZBFD.js rename to ui/dist/assets/AuthWithOAuth2Docs-BfeByTL2.js index df2b3e27ec..c1c6c7f33e 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-fAroZBFD.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-BfeByTL2.js @@ -1,4 +1,4 @@ -import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Ne,k as Qe,R as ze,n as Ie,t as L,a as x,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-C3DCbsuy.js";import{S as Xe}from"./SdkTabs-CofkKgiC.js";import{F as Ye}from"./FieldsQueryParam-DRCPhrsm.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,E,be,J,R,me,Z,N=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as xe,i as Ee,s as Je,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Ne,k as Qe,R as ze,n as Ie,t as L,a as x,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-BxkLVEIp.js";import{S as Xe}from"./SdkTabs-BsOGCCZb.js";import{F as Ye}from"./FieldsQueryParam-fa5aA_5L.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){x(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,E,be,J,R,me,Z,N=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-Day03rmY.js b/ui/dist/assets/AuthWithPasswordDocs-CPWaI1QS.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-Day03rmY.js rename to ui/dist/assets/AuthWithPasswordDocs-CPWaI1QS.js index a8ce0191f9..744ad79384 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-Day03rmY.js +++ b/ui/dist/assets/AuthWithPasswordDocs-CPWaI1QS.js @@ -1,4 +1,4 @@ -import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as m,g as r,h as t,m as se,x as De,P as pt,Q as Pt,k as Rt,R as Ct,n as Ot,t as Z,a as x,o as c,d as ie,C as ft,p as At,r as re,u as Tt}from"./index-C3DCbsuy.js";import{S as Ut}from"./SdkTabs-CofkKgiC.js";import{F as Mt}from"./FieldsQueryParam-DRCPhrsm.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&De(g,i),C&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,Be,he,V,be,M,me,qe,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ce,Qe,k,je,q,Je,Ke,ze,Oe,Ge,Ae,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,A=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` +import{S as wt,i as yt,s as $t,N as vt,O as oe,e as n,w as p,b as d,c as ne,f as m,g as r,h as t,m as se,x as De,P as pt,Q as Pt,k as Rt,R as Ct,n as Ot,t as Z,a as x,o as c,d as ie,C as ft,p as At,r as re,u as Tt}from"./index-BxkLVEIp.js";import{S as Ut}from"./SdkTabs-BsOGCCZb.js";import{F as Mt}from"./FieldsQueryParam-fa5aA_5L.js";function ht(s,l,a){const i=s.slice();return i[8]=l[a],i}function bt(s,l,a){const i=s.slice();return i[8]=l[a],i}function Dt(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Et(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Wt(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function mt(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _t(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function kt(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function gt(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),t(a,g),t(a,b),f||(u=Tt(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&De(g,i),C&24&&re(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function St(s,l){let a,i,g,b;return i=new vt({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),ne(i.$$.fragment),g=d(),m(a,"class","tab-item"),re(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),se(i,a,null),t(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&re(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),ie(i)}}}function Lt(s){var rt,ct;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Ee,ce,T,de,N,ue,U,ee,We,te,I,Le,pe,le=s[0].name+"",fe,Be,he,V,be,M,me,qe,Q,D,_e,Fe,ke,He,$,Ye,ge,Se,ve,Ne,we,ye,j,$e,E,Pe,Ie,J,W,Re,Ve,Ce,Qe,k,je,q,Je,Ke,ze,Oe,Ge,Ae,Xe,Ze,xe,Te,et,tt,F,Ue,K,Me,L,z,A=[],lt=new Map,at,G,S=[],ot=new Map,H;function nt(e,o){if(e[1]&&e[2])return Wt;if(e[1])return Et;if(e[2])return Dt}let Y=nt(s),P=Y&&Y(s);T=new Ut({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); diff --git a/ui/dist/assets/CodeEditor-iXaWdysu.js b/ui/dist/assets/CodeEditor-CiCm0ZL1.js similarity index 99% rename from ui/dist/assets/CodeEditor-iXaWdysu.js rename to ui/dist/assets/CodeEditor-CiCm0ZL1.js index a3341f37da..3f17a60558 100644 --- a/ui/dist/assets/CodeEditor-iXaWdysu.js +++ b/ui/dist/assets/CodeEditor-CiCm0ZL1.js @@ -1,4 +1,4 @@ -import{S as wt,i as vt,s as qt,e as Yt,f as Tt,U as OO,g as Rt,y as IO,o as Vt,J as _t,K as jt,L as zt,I as Gt,C as Ut,M as Ct}from"./index-C3DCbsuy.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-BJXhcZ8-.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { +import{S as wt,i as vt,s as qt,e as Yt,f as Tt,U as OO,g as Rt,y as IO,o as Vt,J as _t,K as jt,L as zt,I as Gt,C as Ut,M as Ct}from"./index-BxkLVEIp.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-BJXhcZ8-.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-C8t_3a0s.js b/ui/dist/assets/ConfirmEmailChangeDocs-C4WZVRqf.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-C8t_3a0s.js rename to ui/dist/assets/ConfirmEmailChangeDocs-C4WZVRqf.js index b042779cab..bc9b1fe55e 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-C8t_3a0s.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-C4WZVRqf.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-C3DCbsuy.js";import{S as De}from"./SdkTabs-CofkKgiC.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` +import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-BxkLVEIp.js";import{S as De}from"./SdkTabs-BsOGCCZb.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),n(s,_),n(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),$e(a,s,null),n(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-CqsVn5Wy.js b/ui/dist/assets/ConfirmPasswordResetDocs-D60P5AZI.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-CqsVn5Wy.js rename to ui/dist/assets/ConfirmPasswordResetDocs-D60P5AZI.js index 5caa3bfaa6..3ee6d9a99e 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-CqsVn5Wy.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-D60P5AZI.js @@ -1,4 +1,4 @@ -import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-C3DCbsuy.js";import{S as Ie}from"./SdkTabs-CofkKgiC.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` +import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-BxkLVEIp.js";import{S as Ie}from"./SdkTabs-BsOGCCZb.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-DXzEcR9y.js b/ui/dist/assets/ConfirmVerificationDocs-C7bRCIQx.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-DXzEcR9y.js rename to ui/dist/assets/ConfirmVerificationDocs-C7bRCIQx.js index 810601f3ba..f74608855a 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-DXzEcR9y.js +++ b/ui/dist/assets/ConfirmVerificationDocs-C7bRCIQx.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-C3DCbsuy.js";import{S as Ae}from"./SdkTabs-CofkKgiC.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-BxkLVEIp.js";import{S as Ae}from"./SdkTabs-BsOGCCZb.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-DyFYshJx.js b/ui/dist/assets/CreateApiDocs-2bIkoopj.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-DyFYshJx.js rename to ui/dist/assets/CreateApiDocs-2bIkoopj.js index 083645974c..3410d95077 100644 --- a/ui/dist/assets/CreateApiDocs-DyFYshJx.js +++ b/ui/dist/assets/CreateApiDocs-2bIkoopj.js @@ -1,4 +1,4 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-C3DCbsuy.js";import{S as At}from"./SdkTabs-CofkKgiC.js";import{F as Bt}from"./FieldsQueryParam-DRCPhrsm.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
    Optional username
    String The username of the auth record. +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-BxkLVEIp.js";import{S as At}from"./SdkTabs-BsOGCCZb.js";import{F as Bt}from"./FieldsQueryParam-fa5aA_5L.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
    Optional username
    String The username of the auth record.
    If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
    Optional emailVisibility
    Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
    Required password
    String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
    Required passwordConfirm
    String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
    Optional verified
    Boolean Indicates whether the auth record is verified or not.
    diff --git a/ui/dist/assets/DeleteApiDocs-BjlD4kbR.js b/ui/dist/assets/DeleteApiDocs-B7tWDNFi.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-BjlD4kbR.js rename to ui/dist/assets/DeleteApiDocs-B7tWDNFi.js index afb8c0945f..3ea7bb5e11 100644 --- a/ui/dist/assets/DeleteApiDocs-BjlD4kbR.js +++ b/ui/dist/assets/DeleteApiDocs-B7tWDNFi.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-C3DCbsuy.js";import{S as He}from"./SdkTabs-CofkKgiC.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-BxkLVEIp.js";import{S as He}from"./SdkTabs-BsOGCCZb.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/FieldsQueryParam-DRCPhrsm.js b/ui/dist/assets/FieldsQueryParam-fa5aA_5L.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-DRCPhrsm.js rename to ui/dist/assets/FieldsQueryParam-fa5aA_5L.js index 8df673261a..5b319cc131 100644 --- a/ui/dist/assets/FieldsQueryParam-DRCPhrsm.js +++ b/ui/dist/assets/FieldsQueryParam-fa5aA_5L.js @@ -1,4 +1,4 @@ -import{S as J,i as O,s as P,N as Q,e as t,b as c,w as i,c as R,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-C3DCbsuy.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,k,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as O,s as P,N as Q,e as t,b as c,w as i,c as R,f as j,g as z,h as e,m as A,x as D,t as G,a as K,o as U,d as V}from"./index-BxkLVEIp.js";function W(f){let n,o,u,d,v,s,p,w,h,y,r,F,_,S,b,E,C,a,$,L,q,H,M,N,m,T,k,B,x;return r=new Q({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),h=t("em"),h.textContent="(by default returns all fields)",y=i(`. Ex.: `),R(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-DG6SVeUP.js b/ui/dist/assets/FilterAutocompleteInput-CS7wYc6J.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-DG6SVeUP.js rename to ui/dist/assets/FilterAutocompleteInput-CS7wYc6J.js index 8a872a1267..8f4cb78941 100644 --- a/ui/dist/assets/FilterAutocompleteInput-DG6SVeUP.js +++ b/ui/dist/assets/FilterAutocompleteInput-CS7wYc6J.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,e as ne,f as re,g as ae,y as D,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-C3DCbsuy.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as P,C as R,S as qe,t as ve,u as We,v as _e}from"./index-BJXhcZ8-.js";function Oe(e){return new Worker(""+new URL("autocomplete.worker-CGnTjHzG.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,v=new Oe,H=[],T=[],B=[],C="",W="";function _(){d==null||d.focus()}let O=null;v.onmessage=n=>{B=n.data.baseKeys||[],H=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function z(){clearTimeout(O),O=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function G(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(H||[])),c&&(l=l.concat(T||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};G();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(P(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(O),U(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!a&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),z()),e.$$.dirty[0]&4&&f&&G(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(P(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,C,W,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; +import{S as $,i as ee,s as te,e as ne,f as re,g as ae,y as D,o as ie,J as oe,K as le,L as se,I as de,C as u,M as ce}from"./index-BxkLVEIp.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,q as P,C as R,S as qe,t as ve,u as We,v as _e}from"./index-BJXhcZ8-.js";function Oe(e){return new Worker(""+new URL("autocomplete.worker-CGnTjHzG.js",import.meta.url).href,{name:e==null?void 0:e.name})}function De(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],i=e[h],a=0;a2&&i.token&&typeof i.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var i=0;it(21,g=n));const h=se();let{id:f=""}=r,{value:i=""}=r,{disabled:a=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=a,I=new R,J=new R,M=new R,A=new R,v=new Oe,H=[],T=[],B=[],C="",W="";function _(){d==null||d.focus()}let O=null;v.onmessage=n=>{B=n.data.baseKeys||[],H=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function z(){clearTimeout(O),O=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function F(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0}))}function U(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",_)}function G(){if(!f)return;U();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function Q(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(H||[])),c&&(l=l.concat(T||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=Q(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function N(){return qe.define(De({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",i)}};G();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:i,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),A.of(P(o)),J.of(E.editable.of(!a)),M.of(S.readOnly.of(a)),I.of(N()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||a||(t(1,i=l.state.doc.toString()),F())})]})})),()=>{clearTimeout(O),U(),d==null||d.destroy(),v.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,i=n.value),"disabled"in n&&t(3,a=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!a&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),z()),e.$$.dirty[0]&4&&f&&G(),e.$$.dirty[0]&2080&&d&&s!=null&&s.schema&&d.dispatch({effects:[I.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=a&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!a)),M.reconfigure(S.readOnly.of(a))]}),t(12,q=a),F()),e.$$.dirty[0]&2050&&d&&i!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:i}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[A.reconfigure(P(o))]})},[p,i,f,a,o,s,y,L,b,m,_,d,q,C,W,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Fe,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Ne as default}; diff --git a/ui/dist/assets/ListApiDocs-D0RToTF6.js b/ui/dist/assets/ListApiDocs-WdA3p5Nq.js similarity index 99% rename from ui/dist/assets/ListApiDocs-D0RToTF6.js rename to ui/dist/assets/ListApiDocs-WdA3p5Nq.js index 6db7b4d436..411a13b004 100644 --- a/ui/dist/assets/ListApiDocs-D0RToTF6.js +++ b/ui/dist/assets/ListApiDocs-WdA3p5Nq.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-C3DCbsuy.js";import{S as dl}from"./SdkTabs-CofkKgiC.js";import{F as pl}from"./FieldsQueryParam-DRCPhrsm.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-BxkLVEIp.js";import{S as dl}from"./SdkTabs-BsOGCCZb.js";import{F as pl}from"./FieldsQueryParam-fa5aA_5L.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-FIkHZF7A.js b/ui/dist/assets/ListExternalAuthsDocs-CD1lYZPX.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-FIkHZF7A.js rename to ui/dist/assets/ListExternalAuthsDocs-CD1lYZPX.js index a7b72baffe..fe24359a6e 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-FIkHZF7A.js +++ b/ui/dist/assets/ListExternalAuthsDocs-CD1lYZPX.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-C3DCbsuy.js";import{S as Ye}from"./SdkTabs-CofkKgiC.js";import{F as Ze}from"./FieldsQueryParam-DRCPhrsm.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-BxkLVEIp.js";import{S as Ye}from"./SdkTabs-BsOGCCZb.js";import{F as Ze}from"./FieldsQueryParam-fa5aA_5L.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-B5V9k9ND.js b/ui/dist/assets/PageAdminConfirmPasswordReset-DZiKZ2vT.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-B5V9k9ND.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-DZiKZ2vT.js index c049b20797..586aa4c94e 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-B5V9k9ND.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-DZiKZ2vT.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-C3DCbsuy.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-BxkLVEIp.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-CLtpG3X-.js b/ui/dist/assets/PageAdminRequestPasswordReset-BF8cSSXp.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-CLtpG3X-.js rename to ui/dist/assets/PageAdminRequestPasswordReset-BF8cSSXp.js index d942adeb20..d832797d95 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-CLtpG3X-.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-BF8cSSXp.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-C3DCbsuy.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

    Forgotten admin password

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

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

    Forgotten admin password

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

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

    Auth failed.

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

    Auth failed.

    You can close this window and go back to the app to try again.
    ',l(t,"class","content txt-hint txt-center p-base")},m(e,s){u(e,t,s)},p:a,i:a,o:a,d(e){e&&d(t)}}}function p(n){return h(()=>{window.close()}),[]}class g extends o{constructor(t){super(),i(this,t,p,f,c,{})}}export{g as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-DFTUTq4C.js b/ui/dist/assets/PageOAuth2RedirectSuccess-BZv-iZYo.js similarity index 86% rename from ui/dist/assets/PageOAuth2RedirectSuccess-DFTUTq4C.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-BZv-iZYo.js index cab3c62f4d..16090acc72 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-DFTUTq4C.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-BZv-iZYo.js @@ -1 +1 @@ -import{S as o,i as c,s as i,e as r,f as u,g as l,y as s,o as d,I as h}from"./index-C3DCbsuy.js";function p(n){let t;return{c(){t=r("div"),t.innerHTML='

    Auth completed.

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

    Auth completed.

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

    Successfully changed the user email address.

    You can now sign in with your new email address.

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

    Successfully changed the user password.

    You can now sign in with your new password.

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

    Invalid or expired verification token.

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

    Successfully verified email address.

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

    Invalid or expired verification token.

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

    Successfully verified email address.

    ',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
    Please wait...
    ',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-5_90JfZR.js b/ui/dist/assets/RealtimeApiDocs-Dzg8Y9BD.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-5_90JfZR.js rename to ui/dist/assets/RealtimeApiDocs-Dzg8Y9BD.js index 0120880825..9b9ef0591d 100644 --- a/ui/dist/assets/RealtimeApiDocs-5_90JfZR.js +++ b/ui/dist/assets/RealtimeApiDocs-Dzg8Y9BD.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-C3DCbsuy.js";import{S as de}from"./SdkTabs-CofkKgiC.js";function he(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,w,v,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-BxkLVEIp.js";import{S as de}from"./SdkTabs-BsOGCCZb.js";function he(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,w,v,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-W_T6yElq.js b/ui/dist/assets/RequestEmailChangeDocs-eykCUxs-.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-W_T6yElq.js rename to ui/dist/assets/RequestEmailChangeDocs-eykCUxs-.js index a4a7e7f44f..5d3c4cc62e 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-W_T6yElq.js +++ b/ui/dist/assets/RequestEmailChangeDocs-eykCUxs-.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-C3DCbsuy.js";import{S as je}from"./SdkTabs-CofkKgiC.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-BxkLVEIp.js";import{S as je}from"./SdkTabs-BsOGCCZb.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-Iw-ugIBq.js b/ui/dist/assets/RequestPasswordResetDocs-DVvHVnNU.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-Iw-ugIBq.js rename to ui/dist/assets/RequestPasswordResetDocs-DVvHVnNU.js index 366b072a2f..b8d5f27b9a 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-Iw-ugIBq.js +++ b/ui/dist/assets/RequestPasswordResetDocs-DVvHVnNU.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-C3DCbsuy.js";import{S as Ue}from"./SdkTabs-CofkKgiC.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-BxkLVEIp.js";import{S as Ue}from"./SdkTabs-BsOGCCZb.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-C_sAThHJ.js b/ui/dist/assets/RequestVerificationDocs-DBEH9oXv.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-C_sAThHJ.js rename to ui/dist/assets/RequestVerificationDocs-DBEH9oXv.js index 85ce111a87..b06dc9cb14 100644 --- a/ui/dist/assets/RequestVerificationDocs-C_sAThHJ.js +++ b/ui/dist/assets/RequestVerificationDocs-DBEH9oXv.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-C3DCbsuy.js";import{S as Ae}from"./SdkTabs-CofkKgiC.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` +import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-BxkLVEIp.js";import{S as Ae}from"./SdkTabs-BsOGCCZb.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/SdkTabs-CofkKgiC.js b/ui/dist/assets/SdkTabs-BsOGCCZb.js similarity index 96% rename from ui/dist/assets/SdkTabs-CofkKgiC.js rename to ui/dist/assets/SdkTabs-BsOGCCZb.js index 09a26ae8b6..c3cd6c2b06 100644 --- a/ui/dist/assets/SdkTabs-CofkKgiC.js +++ b/ui/dist/assets/SdkTabs-BsOGCCZb.js @@ -1 +1 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as P,a as T,o as C,w,r as E,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-C3DCbsuy.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function I(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function M(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(P(s.$$.fragment,b),d=!0)},o(b){T(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(N,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as y,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as P,a as T,o as C,w,r as E,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-BxkLVEIp.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function I(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=w(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&E(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function M(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=w(k),_=w(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),E(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&E(l,"active",e[1]===e[6].language)},i(b){d||(P(s.$$.fragment,b),d=!0)},o(b){T(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(N,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-BAfMmG5W.js b/ui/dist/assets/UnlinkExternalAuthDocs-Dusvq0CB.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-BAfMmG5W.js rename to ui/dist/assets/UnlinkExternalAuthDocs-Dusvq0CB.js index 0aa11b2624..1a611ce4ef 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-BAfMmG5W.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-Dusvq0CB.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-C3DCbsuy.js";import{S as Ke}from"./SdkTabs-CofkKgiC.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-BxkLVEIp.js";import{S as Ke}from"./SdkTabs-BsOGCCZb.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-DY8egWRV.js b/ui/dist/assets/UpdateApiDocs-B38WU-hm.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-DY8egWRV.js rename to ui/dist/assets/UpdateApiDocs-B38WU-hm.js index cb8e5a1202..28a75efbbe 100644 --- a/ui/dist/assets/UpdateApiDocs-DY8egWRV.js +++ b/ui/dist/assets/UpdateApiDocs-B38WU-hm.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-C3DCbsuy.js";import{S as Ft}from"./SdkTabs-CofkKgiC.js";import{F as Nt}from"./FieldsQueryParam-DRCPhrsm.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-BxkLVEIp.js";import{S as Ft}from"./SdkTabs-BsOGCCZb.js";import{F as Nt}from"./FieldsQueryParam-fa5aA_5L.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
    Optional username
    String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
    Optional email
    String The auth record email address.
    diff --git a/ui/dist/assets/ViewApiDocs-DaNIuuC4.js b/ui/dist/assets/ViewApiDocs-DvDqZGkM.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-DaNIuuC4.js rename to ui/dist/assets/ViewApiDocs-DvDqZGkM.js index b3c6dbe37c..57e1e7f6cb 100644 --- a/ui/dist/assets/ViewApiDocs-DaNIuuC4.js +++ b/ui/dist/assets/ViewApiDocs-DvDqZGkM.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-C3DCbsuy.js";import{S as pt}from"./SdkTabs-CofkKgiC.js";import{F as ut}from"./FieldsQueryParam-DRCPhrsm.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-BxkLVEIp.js";import{S as pt}from"./SdkTabs-BsOGCCZb.js";import{F as ut}from"./FieldsQueryParam-fa5aA_5L.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-C3DCbsuy.js b/ui/dist/assets/index-BxkLVEIp.js similarity index 84% rename from ui/dist/assets/index-C3DCbsuy.js rename to ui/dist/assets/index-BxkLVEIp.js index 17229f4373..0846103b41 100644 --- a/ui/dist/assets/index-C3DCbsuy.js +++ b/ui/dist/assets/index-BxkLVEIp.js @@ -1,18 +1,18 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-DG6SVeUP.js","./index-BJXhcZ8-.js","./CodeEditor-iXaWdysu.js","./ListApiDocs-D0RToTF6.js","./SdkTabs-CofkKgiC.js","./SdkTabs-CSWLpEgj.css","./FieldsQueryParam-DRCPhrsm.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DaNIuuC4.js","./CreateApiDocs-DyFYshJx.js","./UpdateApiDocs-DY8egWRV.js","./DeleteApiDocs-BjlD4kbR.js","./RealtimeApiDocs-5_90JfZR.js","./AuthWithPasswordDocs-Day03rmY.js","./AuthWithOAuth2Docs-fAroZBFD.js","./AuthRefreshDocs-Qii5vPCm.js","./RequestVerificationDocs-C_sAThHJ.js","./ConfirmVerificationDocs-DXzEcR9y.js","./RequestPasswordResetDocs-Iw-ugIBq.js","./ConfirmPasswordResetDocs-CqsVn5Wy.js","./RequestEmailChangeDocs-W_T6yElq.js","./ConfirmEmailChangeDocs-C8t_3a0s.js","./AuthMethodsDocs-D7M5HLRz.js","./ListExternalAuthsDocs-FIkHZF7A.js","./UnlinkExternalAuthDocs-BAfMmG5W.js"])))=>i.map(i=>d[i]); -var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>p0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const ks=n=>n;function Ie(n,e){for(const t in e)n[t]=e[t];return n}function m0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Og(n){return n()}function Qa(){return Object.create(null)}function $e(n){n.forEach(Og)}function Ct(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Is;function en(n,e){return n===e?!0:(Is||(Is=document.createElement("a")),Is.href=e,n===Is.href)}function h0(n){return Object.keys(n).length===0}function fa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Mg(n){let e;return fa(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(fa(e,t))}function wt(n,e,t,i){if(n){const l=Dg(n,e,t,i);return n[0](l)}}function Dg(n,e,t,i){return n[1]&&i?Ie(t.ctx.slice(),n[1](i(e))):t.ctx}function St(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ua=Eg?n=>requestAnimationFrame(n):Q;const yl=new Set;function Ig(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ua(Ig)}function jo(n){let e;return yl.size===0&&ua(Ig),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function k(n,e){n.appendChild(e)}function Ag(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function _0(n){const e=b("style");return e.textContent="/* empty */",g0(Ag(n),e),e.sheet}function g0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const b0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&b0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function k0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function y0(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function v0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Lg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const yo=new Map;let vo=0;function w0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function S0(n,e){const t={stylesheet:_0(e),rules:{}};return yo.set(n,t),t}function ss(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-CS7wYc6J.js","./index-BJXhcZ8-.js","./CodeEditor-CiCm0ZL1.js","./ListApiDocs-WdA3p5Nq.js","./SdkTabs-BsOGCCZb.js","./SdkTabs-CSWLpEgj.css","./FieldsQueryParam-fa5aA_5L.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DvDqZGkM.js","./CreateApiDocs-2bIkoopj.js","./UpdateApiDocs-B38WU-hm.js","./DeleteApiDocs-B7tWDNFi.js","./RealtimeApiDocs-Dzg8Y9BD.js","./AuthWithPasswordDocs-CPWaI1QS.js","./AuthWithOAuth2Docs-BfeByTL2.js","./AuthRefreshDocs-DZkxje-L.js","./RequestVerificationDocs-DBEH9oXv.js","./ConfirmVerificationDocs-C7bRCIQx.js","./RequestPasswordResetDocs-DVvHVnNU.js","./ConfirmPasswordResetDocs-D60P5AZI.js","./RequestEmailChangeDocs-eykCUxs-.js","./ConfirmEmailChangeDocs-C4WZVRqf.js","./AuthMethodsDocs-DUYNI6SK.js","./ListExternalAuthsDocs-CD1lYZPX.js","./UnlinkExternalAuthDocs-Dusvq0CB.js"])))=>i.map(i=>d[i]); +var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ge=(n,e,t)=>p0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const ks=n=>n;function Ae(n,e){for(const t in e)n[t]=e[t];return n}function m0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Og(n){return n()}function Qa(){return Object.create(null)}function $e(n){n.forEach(Og)}function Mt(n){return typeof n=="function"}function pe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Is;function en(n,e){return n===e?!0:(Is||(Is=document.createElement("a")),Is.href=e,n===Is.href)}function h0(n){return Object.keys(n).length===0}function fa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Mg(n){let e;return fa(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(fa(e,t))}function St(n,e,t,i){if(n){const l=Dg(n,e,t,i);return n[0](l)}}function Dg(n,e,t,i){return n[1]&&i?Ae(t.ctx.slice(),n[1](i(e))):t.ctx}function $t(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ua=Eg?n=>requestAnimationFrame(n):Q;const yl=new Set;function Ig(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ua(Ig)}function jo(n){let e;return yl.size===0&&ua(Ig),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function k(n,e){n.appendChild(e)}function Ag(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function _0(n){const e=b("style");return e.textContent="/* empty */",g0(Ag(n),e),e.sheet}function g0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Be(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const b0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&b0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function k0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function y0(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function oe(n,e){n.value=e??""}function v0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Lg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Et(n,e){return new n(e)}const yo=new Map;let vo=0;function w0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function S0(n,e){const t={stylesheet:_0(e),rules:{}};return yo.set(n,t),t}function ss(n,e,t,i,l,s,o,r=0){const a=16.666/i;let f=`{ `;for(let g=0;g<=1;g+=a){const y=e+(t-e)*s(g);f+=g*100+`%{${o(y,1-y)}} `}const u=f+`100% {${o(t,1-t)}} -}`,c=`__svelte_${w0(u)}_${r}`,d=Ag(n),{stylesheet:m,rules:h}=yo.get(d)||S0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,vo+=1,c}function os(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),vo-=l,vo||$0())}function $0(){ua(()=>{vo||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function T0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=ks,start:a=qo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=ss(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&os(n,h),d=!1}return jo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function C0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ng(n,l)}}function Ng(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let rs;function di(n){rs=n}function ys(){if(!rs)throw new Error("Function called outside component initialization");return rs}function Ht(n){ys().$$.on_mount.push(n)}function O0(n){ys().$$.after_update.push(n)}function vs(n){ys().$$.on_destroy.push(n)}function lt(){const n=ys();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Lg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gl=[],ee=[];let vl=[];const jr=[],Pg=Promise.resolve();let Hr=!1;function Fg(){Hr||(Hr=!0,Pg.then(ca))}function Qt(){return Fg(),Pg}function Ke(n){vl.push(n)}function ke(n){jr.push(n)}const ir=new Set;let cl=0;function ca(){if(cl!==0)return;const n=rs;do{try{for(;cln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vl=e}let jl;function da(){return jl||(jl=Promise.resolve(),jl.then(()=>{jl=null})),jl}function Ji(n,e,t){n.dispatchEvent(Lg(`${e?"intro":"outro"}${t}`))}const lo=new Set;let xn;function le(){xn={r:0,c:[],p:xn}}function se(){xn.r||$e(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(lo.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(lo.has(n))return;lo.add(n),xn.c.push(()=>{lo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Rg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&os(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=ks,tick:_=Q,css:g}=l||pa;g&&(o=ss(n,0,1,m,d,h,g,a++)),_(0,1);const y=qo()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Ji(n,!0,"start")),r=jo(T=>{if(s){if(T>=S)return _(1,0),Ji(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,os(n),Ct(l)?(l=l(i),da().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ma(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=ks,tick:m=Q,css:h}=l||pa;h&&(o=ss(n,1,0,c,u,d,h));const _=qo()+u,g=_+c;Ke(()=>Ji(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),jo(y=>{if(s){if(y>=g)return m(0,1),Ji(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Ct(l)?da().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&os(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&os(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=ks,tick:S=Q,css:T}=s||pa,$={start:qo()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=ss(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Ji(n,h,"start")),jo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ji(n,r.b,"start"),T&&(c(),f=ss(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ji(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Ct(s)?da().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function ef(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(le(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),se())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&ca()}if(m0(n)){const l=ys();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function E0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function ue(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ai(n,e){n.d(1),e.delete(n.key)}function Et(n,e){A(n,1,1,()=>{e.delete(n.key)})}function I0(n,e){n.f(),Et(n,e)}function at(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return $e(T),g}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ot(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Og).filter(Ct);n.$$.on_destroy?n.$$.on_destroy.push(...s):$e(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(D0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function A0(n,e){n.$$.dirty[0]===-1&&(gl.push(n),Fg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&A0(n,c)),d}):[],f.update(),u=!0,$e(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=y0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),z(n,e.target,e.anchor),ca()}di(a)}class ge{constructor(){Ze(this,"$$");Ze(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!Ct(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!h0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const L0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(L0);const dl=[];function qg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function jg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return qg(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Ct(h)?h:Q},m=l.map((h,_)=>fa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){$e(m),c(),a=!1}})}function Hg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function N0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&4?pt(l,[Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function P0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ot(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function F0(n){let e,t,i,l;const s=[P0,N0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function tf(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ho=qg(null,function(e){e(tf());const t=()=>{e(tf())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});jg(Ho,n=>n.location);const zo=jg(Ho,n=>n.querystring),nf=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function ln(n,e){if(e=sf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return lf(n,e),{update(t){t=sf(t),lf(n,t)}}}function R0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function lf(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||q0(i.currentTarget.getAttribute("href"))})}function sf(n){return n&&typeof n=="string"?{href:n}:n||{}}function q0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function j0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Hg(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),O0(()=>{R0(m)}));let _=null,g=null;const y=Ho.subscribe(async $=>{_=$;let C=0;for(;C{nf.set(f)});return}t(0,a=null),g=null,nf.set(void 0)});vs(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class H0 extends ge{constructor(e){super(),_e(this,e,j0,F0,me,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let zg;function Vg(n){const e=n.pattern.test(zg);of(n,n.className,e),of(n,n.inactiveClassName,!e)}function of(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ho.subscribe(n=>{zg=n.location+(n.querystring?"?"+n.querystring:""),so.map(Vg)});function Ln(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Hg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Vg(i),{destroy(){so.splice(so.indexOf(i),1)}}}const z0="modulepreload",V0=function(n,e){return new URL(n,e).href},rf={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(f=>{if(f=V0(f,i),f in rf)return;rf[f]=!0;const u=f.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===f&&(!u||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${c}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":z0,u||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),u)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function At(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}Bg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const ff="pb_auth";class Y0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ha(this.token)}get isAdmin(){return oo(this.token).type==="admin"}get isAuthRecord(){return oo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ff){const i=B0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=ff){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=oo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=af(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=af(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Ug extends Y0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class K0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class _a extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function lr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class J0 extends _a{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||lr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){lr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&lr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&ha(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&f.authStore.token){$[O]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Z0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Wg(n){if(n){n.query=n.query||{};for(let e in n)Z0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Yg extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Wg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class G0 extends _a{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Yg(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=uf(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new gn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=uf(h)})(d)}catch(c){r(),f(new gn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function uf(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class X0 extends _a{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class Q0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class x0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class ek extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class tk extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Vo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Ug,this.admins=new J0(this),this.collections=new X0(this),this.files=new ek(this),this.logs=new Q0(this),this.settings=new K0(this),this.realtime=new Yg(this),this.health=new x0(this),this.backups=new tk(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new G0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Wg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class nk extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ik extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class lk extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class kl extends il{}class Kg extends il{constructor(e){super(`Invalid unit ${e}`)}}class tn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const Me="numeric",Wn="short",$n="long",wo={year:Me,month:Me,day:Me},Jg={year:Me,month:Wn,day:Me},sk={year:Me,month:Wn,day:Me,weekday:Wn},Zg={year:Me,month:$n,day:Me},Gg={year:Me,month:$n,day:Me,weekday:$n},Xg={hour:Me,minute:Me},Qg={hour:Me,minute:Me,second:Me},xg={hour:Me,minute:Me,second:Me,timeZoneName:Wn},e1={hour:Me,minute:Me,second:Me,timeZoneName:$n},t1={hour:Me,minute:Me,hourCycle:"h23"},n1={hour:Me,minute:Me,second:Me,hourCycle:"h23"},i1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:Wn},l1={hour:Me,minute:Me,second:Me,hourCycle:"h23",timeZoneName:$n},s1={year:Me,month:Me,day:Me,hour:Me,minute:Me},o1={year:Me,month:Me,day:Me,hour:Me,minute:Me,second:Me},r1={year:Me,month:Wn,day:Me,hour:Me,minute:Me},a1={year:Me,month:Wn,day:Me,hour:Me,minute:Me,second:Me},ok={year:Me,month:Wn,day:Me,weekday:Wn,hour:Me,minute:Me},f1={year:Me,month:$n,day:Me,hour:Me,minute:Me,timeZoneName:Wn},u1={year:Me,month:$n,day:Me,hour:Me,minute:Me,second:Me,timeZoneName:Wn},c1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,timeZoneName:$n},d1={year:Me,month:$n,day:Me,weekday:$n,hour:Me,minute:Me,second:Me,timeZoneName:$n};class ws{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let sr=null;class Bo extends ws{static get instance(){return sr===null&&(sr=new Bo),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return v1(e,t,i)}formatOffset(e,t){return Xl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ro={};function rk(n){return ro[n]||(ro[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ro[n]}const ak={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function fk(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function uk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let cf={};function ck(n,e={}){const t=JSON.stringify([n,e]);let i=cf[t];return i||(i=new Intl.ListFormat(n,e),cf[t]=i),i}let zr={};function Vr(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Br={};function dk(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.NumberFormat(n,e),Br[t]=i),i}let Ur={};function pk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Ur[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Ur[l]=s),s}let Yl=null;function mk(){return Yl||(Yl=new Intl.DateTimeFormat().resolvedOptions().locale,Yl)}let df={};function hk(n){let e=df[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,df[n]=e}return e}function _k(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Vr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Vr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function gk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function bk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function kk(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function Ns(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function yk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class vk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=dk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):va(e,3);return Vt(t,this.padTo)}}}class wk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Vr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Sk{constructor(e,t,i){this.opts={style:"long",...i},!t&&k1()&&(this.rtf=pk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Yk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const $k={firstDay:1,minimalDays:4,weekend:[6,7]};class mt{static fromOpts(e){return mt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Rt.defaultLocale,r=o||(s?"en-US":mk()),a=t||Rt.defaultNumberingSystem,f=i||Rt.defaultOutputCalendar,u=Wr(l)||Rt.defaultWeekSettings;return new mt(r,a,f,u,o)}static resetCache(){Yl=null,zr={},Br={},Ur={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return mt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=_k(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=gk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=yk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:mt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Wr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ns(this,e,$1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=bk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Ns(this,e,O1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=kk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Ns(this,void 0,()=>M1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ns(this,e,D1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new vk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new wk(e,this.intl,t)}relFormatter(e={}){return new Sk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ck(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:y1()?hk(this.locale):$k}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let or=null;class cn extends ws{static get utcInstance(){return or===null&&(or=new cn(0)),or}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(Yo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Xl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Xl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Xl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Tk extends ws{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(Ue(n)||n===null)return e;if(n instanceof ws)return n;if(Ik(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Bo.instance:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||pi.create(n)}else return Oi(n)?cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Tk(n)}const ga={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},pf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ck=ga.hanidec.replace(/[\[|\]]/g,"").split("");function Ok(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let bl={};function Mk(){bl={}}function jn({numberingSystem:n},e=""){const t=n||"latn";return bl[t]||(bl[t]={}),bl[t][e]||(bl[t][e]=new RegExp(`${ga[t]}${e}`)),bl[t][e]}let mf=()=>Date.now(),hf="system",_f=null,gf=null,bf=null,kf=60,yf,vf=null;class Rt{static get now(){return mf}static set now(e){mf=e}static set defaultZone(e){hf=e}static get defaultZone(){return Si(hf,Bo.instance)}static get defaultLocale(){return _f}static set defaultLocale(e){_f=e}static get defaultNumberingSystem(){return gf}static set defaultNumberingSystem(e){gf=e}static get defaultOutputCalendar(){return bf}static set defaultOutputCalendar(e){bf=e}static get defaultWeekSettings(){return vf}static set defaultWeekSettings(e){vf=Wr(e)}static get twoDigitCutoffYear(){return kf}static set twoDigitCutoffYear(e){kf=e%100}static get throwOnInvalid(){return yf}static set throwOnInvalid(e){yf=e}static resetCaches(){mt.resetCache(),pi.resetCache(),je.resetCache(),Mk()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const p1=[0,31,59,90,120,151,181,212,243,273,304,334],m1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ba(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function h1(n,e,t){return t+(Ss(n)?m1:p1)[e-1]}function _1(n,e){const t=Ss(n)?m1:p1,i=t.findIndex(s=>sas(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Ko(n)}}function wf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ka(ba(i,1,e),t),r=wl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=wl(f)):a>r?(f=i+1,a-=wl(i)):f=i;const{month:u,day:c}=_1(f,a);return{year:f,month:u,day:c,...Ko(n)}}function rr(n){const{year:e,month:t,day:i}=n,l=h1(e,t,i);return{year:e,ordinal:l,...Ko(n)}}function Sf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=_1(e,t);return{year:e,month:i,day:l,...Ko(n)}}function $f(n,e){if(!Ue(n.localWeekday)||!Ue(n.localWeekNumber)||!Ue(n.localWeekYear)){if(!Ue(n.weekday)||!Ue(n.weekNumber)||!Ue(n.weekYear))throw new kl("Cannot mix locale-based week fields with ISO-based week fields");return Ue(n.localWeekday)||(n.weekday=n.localWeekday),Ue(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),Ue(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Dk(n,e=4,t=1){const i=Uo(n.weekYear),l=Pn(n.weekNumber,1,as(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function Ek(n){const e=Uo(n.year),t=Pn(n.ordinal,1,wl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function g1(n){const e=Uo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,$o(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function b1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function Ue(n){return typeof n>"u"}function Oi(n){return typeof n=="number"}function Uo(n){return typeof n=="number"&&n%1===0}function Ik(n){return typeof n=="string"}function Ak(n){return Object.prototype.toString.call(n)==="[object Date]"}function k1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function y1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Lk(n){return Array.isArray(n)?n:[n]}function Tf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Nk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ol(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Wr(n){if(n==null)return null;if(typeof n!="object")throw new tn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new tn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return Uo(n)&&n>=e&&n<=t}function Pk(n,e){return n-e*Math.floor(n/e)}function Vt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(Ue(n)||n===null||n===""))return parseInt(n,10)}function Pi(n){if(!(Ue(n)||n===null||n===""))return parseFloat(n)}function ya(n){if(!(Ue(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function va(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ss(n){return n%4===0&&(n%100!==0||n%400===0)}function wl(n){return Ss(n)?366:365}function $o(n,e){const t=Pk(e-1,12)+1,i=n+(e-t)/12;return t===2?Ss(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Wo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Cf(n,e,t){return-ka(ba(n,1,e),t)+e-1}function as(n,e=4,t=1){const i=Cf(n,e,t),l=Cf(n+1,e,t);return(wl(n)-i+l)/7}function Yr(n){return n>99?n:n>Rt.twoDigitCutoffYear?1900+n:2e3+n}function v1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Yo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function w1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new tn(`Invalid unit value ${n}`);return e}function To(n,e){const t={};for(const i in n)if(Ol(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=w1(l)}return t}function Xl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Vt(t,2)}:${Vt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Vt(t,2)}${Vt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ko(n){return Nk(n,["hour","minute","second","millisecond"])}const Fk=["January","February","March","April","May","June","July","August","September","October","November","December"],S1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Rk=["J","F","M","A","M","J","J","A","S","O","N","D"];function $1(n){switch(n){case"narrow":return[...Rk];case"short":return[...S1];case"long":return[...Fk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const T1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],C1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qk=["M","T","W","T","F","S","S"];function O1(n){switch(n){case"narrow":return[...qk];case"short":return[...C1];case"long":return[...T1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const M1=["AM","PM"],jk=["Before Christ","Anno Domini"],Hk=["BC","AD"],zk=["B","A"];function D1(n){switch(n){case"narrow":return[...zk];case"short":return[...Hk];case"long":return[...jk];default:return null}}function Vk(n){return M1[n.hour<12?0:1]}function Bk(n,e){return O1(e)[n.weekday-1]}function Uk(n,e){return $1(e)[n.month-1]}function Wk(n,e){return D1(e)[n.year<0?0:1]}function Yk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function Of(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Kk={D:wo,DD:Jg,DDD:Zg,DDDD:Gg,t:Xg,tt:Qg,ttt:xg,tttt:e1,T:t1,TT:n1,TTT:i1,TTTT:l1,f:s1,ff:r1,fff:f1,ffff:c1,F:o1,FF:a1,FFF:u1,FFFF:d1};class sn{static create(e,t={}){return new sn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Kk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Vt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Vk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Uk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Bk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=sn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Wk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Of(sn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=sn.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Of(s,l(r))}}const E1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Al(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ll(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Nl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function I1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Pi(t)),months:d(Pi(i)),weeks:d(Pi(l)),days:d(Pi(s)),hours:d(Pi(o)),minutes:d(Pi(r)),seconds:d(Pi(a),a==="-0"),milliseconds:d(ya(f),c)}]}const oy={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function $a(n,e,t,i,l,s,o){const r={year:e.length===2?Yr(vi(e)):vi(e),month:S1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?T1.indexOf(n)+1:C1.indexOf(n)+1),r}const ry=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ay(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=$a(e,l,i,t,s,o,r);let m;return a?m=oy[a]:f?m=0:m=Yo(u,c),[d,new cn(m)]}function fy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const uy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cy=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,dy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mf(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,l,i,t,s,o,r),cn.utcInstance]}function py(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,r,t,i,l,s,o),cn.utcInstance]}const my=Al(Zk,Sa),hy=Al(Gk,Sa),_y=Al(Xk,Sa),gy=Al(L1),P1=Ll(ny,Pl,$s,Ts),by=Ll(Qk,Pl,$s,Ts),ky=Ll(xk,Pl,$s,Ts),yy=Ll(Pl,$s,Ts);function vy(n){return Nl(n,[my,P1],[hy,by],[_y,ky],[gy,yy])}function wy(n){return Nl(fy(n),[ry,ay])}function Sy(n){return Nl(n,[uy,Mf],[cy,Mf],[dy,py])}function $y(n){return Nl(n,[ly,sy])}const Ty=Ll(Pl);function Cy(n){return Nl(n,[iy,Ty])}const Oy=Al(ey,ty),My=Al(N1),Dy=Ll(Pl,$s,Ts);function Ey(n){return Nl(n,[Oy,P1],[My,Dy])}const Df="Invalid Duration",F1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Iy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...F1},Dn=146097/400,pl=146097/4800,Ay={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...F1},Wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ly=Wi.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function R1(n,e){let t=e.milliseconds??0;for(const i of Ly.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Ef(n,e){const t=R1(n,e)<0?-1:1;Wi.reduceRight((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Wi.reduce((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function Ny(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Ay:Iy;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||mt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new tn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:To(e,st.normalizeUnit),loc:mt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Oi(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new tn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=$y(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Cy(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new lk(i);return new st({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Kg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?sn.create(this.loc,i).formatDurationFromString(this,e):Df}toHuman(e={}){if(!this.isValid)return Df;const t=Wi.map(i=>{const l=this.values[i];return Ue(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=va(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?R1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Wi)(Ol(t.values,l)||Ol(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=w1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...To(e,st.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ef(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Ny(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Wi)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Oi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Oi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Ef(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Wi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Py(n,e){return!n||!n.isValid?Ft.invalid("missing or invalid start"):!e||!e.isValid?Ft.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ft.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Ft.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Ft.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ft.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ft.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Ft.fromDateTimes(t,a.time)),t=null);return Ft.merge(l)}difference(...e){return Ft.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=wo,t={}){return this.isValid?sn.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return Ft.fromDateTimes(e(this.s),e(this.e))}}class Ps{static hasDST(e=Rt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,Rt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||mt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||mt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||mt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||mt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||mt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return mt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return mt.create(t,null,"gregory").eras(e)}static features(){return{relative:k1(),localeWeek:y1()}}}function If(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function Fy(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=If(a,f);return(u-u%7)/7}],["days",If]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Ry(n,e,t,i){let[l,s,o,r]=Fy(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?st.fromMillis(a,i).shiftTo(...f).plus(u):u}const qy="missing Intl.DateTimeFormat.formatToParts support";function ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Ok(t))}}const jy=" ",q1=`[ ${jy}]`,j1=new RegExp(q1,"g");function Hy(n){return n.replace(/\./g,"\\.?").replace(j1,q1)}function Af(n){return n.replace(/\./g,"").replace(j1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Hy).join("|")),deser:([t])=>n.findIndex(i=>Af(t)===Af(i))+e}}function Lf(n,e){return{regex:n,deser:([,t,i])=>Yo(t,i),groups:e}}function Fs(n){return{regex:n,deser:([e])=>e}}function zy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vy(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(zy(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ct(f);case"yy":return ct(c,Yr);case"yyyy":return ct(s);case"yyyyy":return ct(d);case"yyyyyy":return ct(o);case"M":return ct(r);case"MM":return ct(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ct(r);case"LL":return ct(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ct(r);case"dd":return ct(i);case"o":return ct(a);case"ooo":return ct(l);case"HH":return ct(i);case"H":return ct(r);case"hh":return ct(i);case"h":return ct(r);case"mm":return ct(i);case"m":return ct(r);case"q":return ct(r);case"qq":return ct(i);case"s":return ct(r);case"ss":return ct(i);case"S":return ct(a);case"SSS":return ct(l);case"u":return Fs(u);case"uu":return Fs(r);case"uuu":return ct(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ct(s);case"kk":return ct(c,Yr);case"W":return ct(r);case"WW":return ct(i);case"E":case"c":return ct(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Lf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Lf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Fs(/[a-z_+-/]{1,256}?/i);case" ":return Fs(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:qy};return _.token=n,_}const By={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Uy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=By[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Wy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Yy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Ol(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Ky(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return Ue(n.z)||(t=pi.create(n.z)),Ue(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),Ue(n.q)||(n.M=(n.q-1)*3+1),Ue(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),Ue(n.u)||(n.S=ya(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let ar=null;function Jy(){return ar||(ar=je.fromMillis(1555555555555)),ar}function Zy(n,e){if(n.literal)return n;const t=sn.macroTokenToFormatOpts(n.val),i=B1(t,e);return i==null||i.includes(void 0)?n:i}function H1(n,e){return Array.prototype.concat(...n.map(t=>Zy(t,e)))}class z1{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=H1(sn.parseFormat(t),e),this.units=this.tokens.map(i=>Vy(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=Wy(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=Yy(e,this.regex,this.handlers),[l,s,o]=i?Ky(i):[null,null,void 0];if(Ol(i,"a")&&Ol(i,"H"))throw new kl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function V1(n,e,t){return new z1(n,t).explainFromTokens(e)}function Gy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=V1(n,e,t);return[i,l,s,o]}function B1(n,e){if(!n)return null;const i=sn.create(e,n).dtFormatter(Jy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Uy(o,n,s))}const fr="Invalid DateTime",Nf=864e13;function Kl(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ur(n){return n.weekData===null&&(n.weekData=So(n.c)),n.weekData}function cr(n){return n.localWeekData===null&&(n.localWeekData=So(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Fi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function U1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Rs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ao(n,e,t){return U1(Wo(n),e,t)}function Pf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,$o(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Wo(s);let[a,f]=U1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function hl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function qs(n,e,t=!0){return n.isValid?sn.create(mt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function dr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Vt(n.c.year,t?6:4),e?(i+="-",i+=Vt(n.c.month),i+="-",i+=Vt(n.c.day)):(i+=Vt(n.c.month),i+=Vt(n.c.day)),i}function Ff(n,e,t,i,l,s){let o=Vt(n.c.hour);return e?(o+=":",o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Vt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Vt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Vt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Vt(Math.trunc(-n.o/60)),o+=":",o+=Vt(Math.trunc(-n.o%60))):(o+="+",o+=Vt(Math.trunc(n.o/60)),o+=":",o+=Vt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const W1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Xy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Y1=["year","month","day","hour","minute","second","millisecond"],xy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ev=["year","ordinal","hour","minute","second","millisecond"];function tv(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Kg(n);return e}function Rf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return tv(n)}}function nv(n){return uo[n]||(fo===void 0&&(fo=Rt.now()),uo[n]=n.offset(fo)),uo[n]}function qf(n,e){const t=Si(e.zone,Rt.defaultZone);if(!t.isValid)return je.invalid(Kl(t));const i=mt.fromObject(e);let l,s;if(Ue(n.year))l=Rt.now();else{for(const a of Y1)Ue(n[a])&&(n[a]=W1[a]);const o=g1(n)||b1(n);if(o)return je.invalid(o);const r=nv(t);[l,s]=ao(n,r,t)}return new je({ts:l,zone:t,loc:i,o:s})}function jf(n,e,t){const i=Ue(t.round)?!0:t.round,l=(o,r)=>(o=va(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Hf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let fo,uo={};class je{constructor(e){const t=e.zone||Rt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Kl(t));this.ts=Ue(e.ts)?Rt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=Oi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Rs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||mt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=cn.utcInstance,qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Ak(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,Rt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:mt.fromObject(t)}):je.invalid(Kl(l))}static fromMillis(e,t={}){if(Oi(e))return e<-Nf||e>Nf?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,Rt.defaultZone),loc:mt.fromObject(t)});throw new tn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Oi(e))return new je({ts:e*1e3,zone:Si(t.zone,Rt.defaultZone),loc:mt.fromObject(t)});throw new tn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,Rt.defaultZone);if(!i.isValid)return je.invalid(Kl(i));const l=mt.fromObject(t),s=To(e,Rf),{minDaysInFirstWeek:o,startOfWeek:r}=$f(s,l),a=Rt.now(),f=Ue(t.specificOffset)?i.offset(a):t.specificOffset,u=!Ue(s.ordinal),c=!Ue(s.year),d=!Ue(s.month)||!Ue(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new kl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Rs(a,f);_?(g=xy,y=Xy,S=So(S,o,r)):u?(g=ev,y=Qy,S=rr(S)):(g=Y1,y=W1);let T=!1;for(const R of g){const F=s[R];Ue(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Dk(s,o,r):u?Ek(s):g1(s),C=$||b1(s);if(C)return je.invalid(C);const O=_?wf(s,o,r):u?Sf(s):s,[D,I]=ao(O,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L.isValid?L:je.invalid(L.invalid)}static fromISO(e,t={}){const[i,l]=vy(e);return hl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=wy(e);return hl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=Sy(e);return hl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Gy(o,e,t);return u?je.invalid(u):hl(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=Ey(e);return hl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(Rt.throwOnInvalid)throw new nk(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=B1(e,mt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return H1(sn.parseFormat(e),mt.fromObject(t)).map(l=>l.val).join("")}static resetCache(){fo=void 0,uo={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ur(this).weekYear:NaN}get weekNumber(){return this.isValid?ur(this).weekNumber:NaN}get weekday(){return this.isValid?ur(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cr(this).weekday:NaN}get localWeekNumber(){return this.isValid?cr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cr(this).weekYear:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ps.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ps.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ps.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ps.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Wo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Rs(a,o),c=Rs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Fi(this,{ts:a}),Fi(this,{ts:f})]:[this]}get isInLeapYear(){return Ss(this.year)}get daysInMonth(){return $o(this.year,this.month)}get daysInYear(){return this.isValid?wl(this.year):NaN}get weeksInWeekYear(){return this.isValid?as(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?as(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=sn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(Rt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,Rt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ao(o,s,e)}return Fi(this,{ts:l,zone:e})}else return je.invalid(Kl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Fi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=To(e,Rf),{minDaysInFirstWeek:i,startOfWeek:l}=$f(t,this.loc),s=!Ue(t.weekYear)||!Ue(t.weekNumber)||!Ue(t.weekday),o=!Ue(t.ordinal),r=!Ue(t.year),a=!Ue(t.month)||!Ue(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new kl("Can't mix ordinal dates with month/day");let c;s?c=wf({...So(this.c,i,l),...t},i,l):Ue(t.ordinal)?(c={...this.toObject(),...t},Ue(t.day)&&(c.day=Math.min($o(c.year,c.month),c.day))):c=Sf({...rr(this.c),...t});const[d,m]=ao(c,this.o,this.zone);return Fi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Fi(this,Pf(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Fi(this,Pf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Ry(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Ft.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new tn("max requires all arguments be DateTimes");return Tf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return V1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=mt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new z1(s,e)}static fromFormatParser(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=mt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new tn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:f,invalidReason:u}=t.explainFromTokens(e);return u?je.invalid(u):hl(r,a,i,`format ${t.format}`,e,f)}static get DATE_SHORT(){return wo}static get DATE_MED(){return Jg}static get DATE_MED_WITH_WEEKDAY(){return sk}static get DATE_FULL(){return Zg}static get DATE_HUGE(){return Gg}static get TIME_SIMPLE(){return Xg}static get TIME_WITH_SECONDS(){return Qg}static get TIME_WITH_SHORT_OFFSET(){return xg}static get TIME_WITH_LONG_OFFSET(){return e1}static get TIME_24_SIMPLE(){return t1}static get TIME_24_WITH_SECONDS(){return n1}static get TIME_24_WITH_SHORT_OFFSET(){return i1}static get TIME_24_WITH_LONG_OFFSET(){return l1}static get DATETIME_SHORT(){return s1}static get DATETIME_SHORT_WITH_SECONDS(){return o1}static get DATETIME_MED(){return r1}static get DATETIME_MED_WITH_SECONDS(){return a1}static get DATETIME_MED_WITH_WEEKDAY(){return ok}static get DATETIME_FULL(){return f1}static get DATETIME_FULL_WITH_SECONDS(){return u1}static get DATETIME_HUGE(){return c1}static get DATETIME_HUGE_WITH_SECONDS(){return d1}}function Hl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Oi(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new tn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const iv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],lv=[".mp4",".avi",".mov",".3gp",".wmv"],sv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ov=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],K1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!iv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!ov.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,f;let s=e.find(u=>u.name==t||u.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const u of s.schema){const c=i+u.name;if(u.type=="relation"&&((r=u.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,u.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=u.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(u.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const u of e){u.schema=u.schema||[];for(const c of u.schema)if(c.type=="relation"&&((f=c.options)==null?void 0:f.collectionId)==s.id){const d=i+u.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,u.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` +}`,c=`__svelte_${w0(u)}_${r}`,d=Ag(n),{stylesheet:m,rules:h}=yo.get(d)||S0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,vo+=1,c}function os(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),vo-=l,vo||$0())}function $0(){ua(()=>{vo||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function T0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=ks,start:a=qo()+s,end:f=a+o,tick:u=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=ss(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&os(n,h),d=!1}return jo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=f&&(u(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);u(T,1-T)}return!0}),_(),u(0,1),g}function C0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ng(n,l)}}function Ng(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let rs;function di(n){rs=n}function ys(){if(!rs)throw new Error("Function called outside component initialization");return rs}function zt(n){ys().$$.on_mount.push(n)}function O0(n){ys().$$.after_update.push(n)}function vs(n){ys().$$.on_destroy.push(n)}function lt(){const n=ys();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Lg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gl=[],te=[];let vl=[];const jr=[],Pg=Promise.resolve();let Hr=!1;function Fg(){Hr||(Hr=!0,Pg.then(ca))}function Qt(){return Fg(),Pg}function Ke(n){vl.push(n)}function ke(n){jr.push(n)}const ir=new Set;let cl=0;function ca(){if(cl!==0)return;const n=rs;do{try{for(;cln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vl=e}let jl;function da(){return jl||(jl=Promise.resolve(),jl.then(()=>{jl=null})),jl}function Ji(n,e,t){n.dispatchEvent(Lg(`${e?"intro":"outro"}${t}`))}const lo=new Set;let xn;function ie(){xn={r:0,c:[],p:xn}}function le(){xn.r||$e(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(lo.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(lo.has(n))return;lo.add(n),xn.c.push(()=>{lo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Rg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&os(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=ks,tick:_=Q,css:g}=l||pa;g&&(o=ss(n,0,1,m,d,h,g,a++)),_(0,1);const y=qo()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Ji(n,!0,"start")),r=jo(T=>{if(s){if(T>=S)return _(1,0),Ji(n,!0,"end"),f(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,os(n),Mt(l)?(l=l(i),da().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function ma(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=ks,tick:m=Q,css:h}=l||pa;h&&(o=ss(n,1,0,c,u,d,h));const _=qo()+u,g=_+c;Ke(()=>Ji(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),jo(y=>{if(s){if(y>=g)return m(0,1),Ji(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Mt(l)?da().then(()=>{l=l(i),f()}):f(),{end(u){u&&"inert"in n&&(n.inert=a),u&&l.tick&&l.tick(1,0),s&&(o&&os(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,f=null,u;function c(){f&&os(n,f)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=ks,tick:S=Q,css:T}=s||pa,$={start:qo()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?u!==void 0&&(n.inert=u):(u=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),f=ss(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Ji(n,h,"start")),jo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Ji(n,r.b,"start"),T&&(c(),f=ss(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Ji(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Mt(s)?da().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function ef(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const f=l&&(e.current=l)(a);let u=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(ie(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),le())}):e.block.d(1),f.c(),E(f,1),f.m(e.mount(),e.anchor),u=!0),e.block=f,e.blocks&&(e.blocks[s]=f),u&&ca()}if(m0(n)){const l=ys();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function E0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function fe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ai(n,e){n.d(1),e.delete(n.key)}function It(n,e){A(n,1,1,()=>{e.delete(n.key)})}function I0(n,e){n.f(),It(n,e)}function at(n,e,t,i,l,s,o,r,a,f,u,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=f(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,u),o.set(D.key,D),u=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(u=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return $e(T),g}function dt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Dt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Og).filter(Mt);n.$$.on_destroy?n.$$.on_destroy.push(...s):$e(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(D0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function A0(n,e){n.$$.dirty[0]===-1&&(gl.push(n),Fg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return f.ctx&&l(f.ctx[c],f.ctx[c]=h)&&(!f.skip_bound&&f.bound[c]&&f.bound[c](h),u&&A0(n,c)),d}):[],f.update(),u=!0,$e(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const c=y0(e.target);f.fragment&&f.fragment.l(c),c.forEach(v)}else f.fragment&&f.fragment.c();e.intro&&E(n.$$.fragment),z(n,e.target,e.anchor),ca()}di(a)}class ge{constructor(){Ge(this,"$$");Ge(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!Mt(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!h0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const L0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(L0);const dl=[];function qg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(pe(n,r)&&(n=r,t)){const a=!dl.length;for(const f of i)f[1](),dl.push(f,n);if(a){for(let f=0;f{i.delete(f),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function jg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return qg(t,(o,r)=>{let a=!1;const f=[];let u=0,c=Q;const d=()=>{if(u)return;c();const h=e(i?f[0]:f,o,r);s?o(h):c=Mt(h)?h:Q},m=l.map((h,_)=>fa(h,g=>{f[_]=g,u&=~(1<<_),a&&d()},()=>{u|=1<<_}));return a=!0,d(),function(){$e(m),c(),a=!1}})}function Hg(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function N0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),le()}s?(e=Et(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&4?dt(l,[Dt(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function P0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let f={};for(let u=0;u{V(f,1)}),le()}s?(e=Et(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a&6?dt(l,[a&2&&{params:r[1]},a&4&&Dt(r[2])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function F0(n){let e,t,i,l;const s=[P0,N0],o=[];function r(a,f){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(ie(),A(o[u],1,1,()=>{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function tf(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ho=qg(null,function(e){e(tf());const t=()=>{e(tf())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});jg(Ho,n=>n.location);const zo=jg(Ho,n=>n.querystring),nf=Cn(void 0);async function tl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function ln(n,e){if(e=sf(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return lf(n,e),{update(t){t=sf(t),lf(n,t)}}}function R0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function lf(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||q0(i.currentTarget.getAttribute("href"))})}function sf(n){return n&&typeof n=="string"?{href:n}:n||{}}function q0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function j0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Hg(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,f=null,u={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),O0(()=>{R0(m)}));let _=null,g=null;const y=Ho.subscribe(async $=>{_=$;let C=0;for(;C{nf.set(f)});return}t(0,a=null),g=null,nf.set(void 0)});vs(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,f,u,i,l,s,S,T]}class H0 extends ge{constructor(e){super(),_e(this,e,j0,F0,pe,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let zg;function Vg(n){const e=n.pattern.test(zg);of(n,n.className,e),of(n,n.inactiveClassName,!e)}function of(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ho.subscribe(n=>{zg=n.location+(n.querystring?"?"+n.querystring:""),so.map(Vg)});function Ln(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Hg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Vg(i),{destroy(){so.splice(so.indexOf(i),1)}}}const z0="modulepreload",V0=function(n,e){return new URL(n,e).href},rf={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(f=>{if(f=V0(f,i),f in rf)return;rf[f]=!0;const u=f.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===f&&(!u||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${c}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":z0,u||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),u)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function Lt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t0&&(!t.exp||t.exp-e>Date.now()/1e3))}Bg=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const ff="pb_auth";class Y0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ha(this.token)}get isAdmin(){return oo(this.token).type==="admin"}get isAuthRecord(){return oo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ff){const i=B0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=ff){var a,f;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=oo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=af(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(f=s==null?void 0:s.model)==null?void 0:f.email};const u=["collectionId","username","verified"];for(const c in this.model)u.includes(c)&&(s.model[c]=this.model[c]);o=af(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Ug extends Y0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class nl{constructor(e){this.client=e}}class K0 extends nl{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class _a extends nl{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function lr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class J0 extends _a{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||lr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(f,u,c,d){lr(f);const m=f.beforeSend,h=f.authStore.model,_=f.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&lr(f)});f._resetAutoRefresh=function(){_(),f.beforeSend=m,delete f._resetAutoRefresh},f.beforeSend=async(g,y)=>{var C;const S=f.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=f.authStore.isValid;if(T&&ha(f.authStore.token,u))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&f.authStore.token){$[O]=f.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Z0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Wg(n){if(n){n.query=n.query||{};for(let e in n)Z0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Yg extends nl{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Wg(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let f;try{f=JSON.parse(a==null?void 0:a.data)}catch{}t(f||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class G0 extends _a{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(f=>this.authResponse(f))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Yg(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=uf(void 0)),new Promise(async(a,f)=>{var u;try{await s.subscribe("@oauth2",async h=>{const _=s.clientId;try{if(!h.state||_!==h.state)throw new Error("State parameters don't match.");const g=Object.assign({},t);delete g.provider,delete g.scopes,delete g.createData,delete g.urlCallback;const y=await this.authWithOAuth2Code(i.name,h.code,i.codeVerifier,l,t.createData,g);a(y)}catch(g){f(new gn(g))}r()});const c={state:s.clientId};(u=t.scopes)!=null&&u.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(h){o?o.location.href=h:o=uf(h)})(d)}catch(c){r(),f(new gn(c))}})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function uf(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class X0 extends _a{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class Q0 extends nl{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class x0 extends nl{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class ek extends nl{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class tk extends nl{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Vo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Ug,this.admins=new J0(this),this.collections=new X0(this),this.files=new ek(this),this.logs=new Q0(this),this.settings=new K0(this),this.realtime=new Yg(this),this.health=new x0(this),this.backups=new tk(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new G0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Wg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=this.normalizeFormDataValue(e[i]),s=Array.isArray(l)?l:[l];if(s.length)for(const o of s)t.append(i,o);else t.append(i,"")}return t}normalizeFormDataValue(e){return e===null||typeof e!="object"||e instanceof Date||this.hasBlobField({data:e})||Array.isArray(e)&&!e.filter(t=>typeof t!="string").length?e:JSON.stringify(e)}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class il extends Error{}class nk extends il{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ik extends il{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class lk extends il{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class kl extends il{}class Kg extends il{constructor(e){super(`Invalid unit ${e}`)}}class tn extends il{}class ki extends il{constructor(){super("Zone is an abstract class")}}const De="numeric",Wn="short",$n="long",wo={year:De,month:De,day:De},Jg={year:De,month:Wn,day:De},sk={year:De,month:Wn,day:De,weekday:Wn},Zg={year:De,month:$n,day:De},Gg={year:De,month:$n,day:De,weekday:$n},Xg={hour:De,minute:De},Qg={hour:De,minute:De,second:De},xg={hour:De,minute:De,second:De,timeZoneName:Wn},e1={hour:De,minute:De,second:De,timeZoneName:$n},t1={hour:De,minute:De,hourCycle:"h23"},n1={hour:De,minute:De,second:De,hourCycle:"h23"},i1={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Wn},l1={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:$n},s1={year:De,month:De,day:De,hour:De,minute:De},o1={year:De,month:De,day:De,hour:De,minute:De,second:De},r1={year:De,month:Wn,day:De,hour:De,minute:De},a1={year:De,month:Wn,day:De,hour:De,minute:De,second:De},ok={year:De,month:Wn,day:De,weekday:Wn,hour:De,minute:De},f1={year:De,month:$n,day:De,hour:De,minute:De,timeZoneName:Wn},u1={year:De,month:$n,day:De,hour:De,minute:De,second:De,timeZoneName:Wn},c1={year:De,month:$n,day:De,weekday:$n,hour:De,minute:De,timeZoneName:$n},d1={year:De,month:$n,day:De,weekday:$n,hour:De,minute:De,second:De,timeZoneName:$n};class ws{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let sr=null;class Bo extends ws{static get instance(){return sr===null&&(sr=new Bo),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return v1(e,t,i)}formatOffset(e,t){return Xl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ro={};function rk(n){return ro[n]||(ro[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ro[n]}const ak={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function fk(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,f,u]=i;return[o,l,s,r,a,f,u]}function uk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let cf={};function ck(n,e={}){const t=JSON.stringify([n,e]);let i=cf[t];return i||(i=new Intl.ListFormat(n,e),cf[t]=i),i}let zr={};function Vr(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Br={};function dk(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.NumberFormat(n,e),Br[t]=i),i}let Ur={};function pk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Ur[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Ur[l]=s),s}let Yl=null;function mk(){return Yl||(Yl=new Intl.DateTimeFormat().resolvedOptions().locale,Yl)}let df={};function hk(n){let e=df[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,df[n]=e}return e}function _k(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Vr(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Vr(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function gk(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function bk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function kk(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function Ns(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function yk(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class vk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=dk(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):va(e,3);return Bt(t,this.padTo)}}}class wk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&pi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Vr(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Sk{constructor(e,t,i){this.opts={style:"long",...i},!t&&k1()&&(this.rtf=pk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Yk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const $k={firstDay:1,minimalDays:4,weekend:[6,7]};class pt{static fromOpts(e){return pt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||qt.defaultLocale,r=o||(s?"en-US":mk()),a=t||qt.defaultNumberingSystem,f=i||qt.defaultOutputCalendar,u=Wr(l)||qt.defaultWeekSettings;return new pt(r,a,f,u,o)}static resetCache(){Yl=null,zr={},Br={},Ur={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return pt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=_k(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=gk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=yk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:pt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Wr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ns(this,e,$1,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=bk(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Ns(this,e,O1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=kk(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Ns(this,void 0,()=>M1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ns(this,e,D1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new vk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new wk(e,this.intl,t)}relFormatter(e={}){return new Sk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ck(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:y1()?hk(this.locale):$k}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let or=null;class cn extends ws{static get utcInstance(){return or===null&&(or=new cn(0)),or}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(Yo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Xl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Xl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Xl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Tk extends ws{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Si(n,e){if(Ue(n)||n===null)return e;if(n instanceof ws)return n;if(Ik(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Bo.instance:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||pi.create(n)}else return Oi(n)?cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Tk(n)}const ga={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},pf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ck=ga.hanidec.replace(/[\[|\]]/g,"").split("");function Ok(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let bl={};function Mk(){bl={}}function jn({numberingSystem:n},e=""){const t=n||"latn";return bl[t]||(bl[t]={}),bl[t][e]||(bl[t][e]=new RegExp(`${ga[t]}${e}`)),bl[t][e]}let mf=()=>Date.now(),hf="system",_f=null,gf=null,bf=null,kf=60,yf,vf=null;class qt{static get now(){return mf}static set now(e){mf=e}static set defaultZone(e){hf=e}static get defaultZone(){return Si(hf,Bo.instance)}static get defaultLocale(){return _f}static set defaultLocale(e){_f=e}static get defaultNumberingSystem(){return gf}static set defaultNumberingSystem(e){gf=e}static get defaultOutputCalendar(){return bf}static set defaultOutputCalendar(e){bf=e}static get defaultWeekSettings(){return vf}static set defaultWeekSettings(e){vf=Wr(e)}static get twoDigitCutoffYear(){return kf}static set twoDigitCutoffYear(e){kf=e%100}static get throwOnInvalid(){return yf}static set throwOnInvalid(e){yf=e}static resetCaches(){pt.resetCache(),pi.resetCache(),je.resetCache(),Mk()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const p1=[0,31,59,90,120,151,181,212,243,273,304,334],m1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ba(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function h1(n,e,t){return t+(Ss(n)?m1:p1)[e-1]}function _1(n,e){const t=Ss(n)?m1:p1,i=t.findIndex(s=>sas(i,e,t)?(f=i+1,a=1):f=i,{weekYear:f,weekNumber:a,weekday:r,...Ko(n)}}function wf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ka(ba(i,1,e),t),r=wl(i);let a=l*7+s-o-7+e,f;a<1?(f=i-1,a+=wl(f)):a>r?(f=i+1,a-=wl(i)):f=i;const{month:u,day:c}=_1(f,a);return{year:f,month:u,day:c,...Ko(n)}}function rr(n){const{year:e,month:t,day:i}=n,l=h1(e,t,i);return{year:e,ordinal:l,...Ko(n)}}function Sf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=_1(e,t);return{year:e,month:i,day:l,...Ko(n)}}function $f(n,e){if(!Ue(n.localWeekday)||!Ue(n.localWeekNumber)||!Ue(n.localWeekYear)){if(!Ue(n.weekday)||!Ue(n.weekNumber)||!Ue(n.weekYear))throw new kl("Cannot mix locale-based week fields with ISO-based week fields");return Ue(n.localWeekday)||(n.weekday=n.localWeekday),Ue(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),Ue(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Dk(n,e=4,t=1){const i=Uo(n.weekYear),l=Pn(n.weekNumber,1,as(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function Ek(n){const e=Uo(n.year),t=Pn(n.ordinal,1,wl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function g1(n){const e=Uo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,$o(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function b1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function Ue(n){return typeof n>"u"}function Oi(n){return typeof n=="number"}function Uo(n){return typeof n=="number"&&n%1===0}function Ik(n){return typeof n=="string"}function Ak(n){return Object.prototype.toString.call(n)==="[object Date]"}function k1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function y1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Lk(n){return Array.isArray(n)?n:[n]}function Tf(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Nk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ol(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Wr(n){if(n==null)return null;if(typeof n!="object")throw new tn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new tn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return Uo(n)&&n>=e&&n<=t}function Pk(n,e){return n-e*Math.floor(n/e)}function Bt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(Ue(n)||n===null||n===""))return parseInt(n,10)}function Pi(n){if(!(Ue(n)||n===null||n===""))return parseFloat(n)}function ya(n){if(!(Ue(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function va(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ss(n){return n%4===0&&(n%100!==0||n%400===0)}function wl(n){return Ss(n)?366:365}function $o(n,e){const t=Pk(e-1,12)+1,i=n+(e-t)/12;return t===2?Ss(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Wo(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Cf(n,e,t){return-ka(ba(n,1,e),t)+e-1}function as(n,e=4,t=1){const i=Cf(n,e,t),l=Cf(n+1,e,t);return(wl(n)-i+l)/7}function Yr(n){return n>99?n:n>qt.twoDigitCutoffYear?1900+n:2e3+n}function v1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Yo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function w1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new tn(`Invalid unit value ${n}`);return e}function To(n,e){const t={};for(const i in n)if(Ol(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=w1(l)}return t}function Xl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Bt(t,2)}:${Bt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Bt(t,2)}${Bt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ko(n){return Nk(n,["hour","minute","second","millisecond"])}const Fk=["January","February","March","April","May","June","July","August","September","October","November","December"],S1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Rk=["J","F","M","A","M","J","J","A","S","O","N","D"];function $1(n){switch(n){case"narrow":return[...Rk];case"short":return[...S1];case"long":return[...Fk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const T1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],C1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qk=["M","T","W","T","F","S","S"];function O1(n){switch(n){case"narrow":return[...qk];case"short":return[...C1];case"long":return[...T1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const M1=["AM","PM"],jk=["Before Christ","Anno Domini"],Hk=["BC","AD"],zk=["B","A"];function D1(n){switch(n){case"narrow":return[...zk];case"short":return[...Hk];case"long":return[...jk];default:return null}}function Vk(n){return M1[n.hour<12?0:1]}function Bk(n,e){return O1(e)[n.weekday-1]}function Uk(n,e){return $1(e)[n.month-1]}function Wk(n,e){return D1(e)[n.year<0?0:1]}function Yk(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,f=l[n],u=i?a?f[1]:f[2]||f[1]:a?l[n][0]:n;return o?`${r} ${u} ago`:`in ${r} ${u}`}function Of(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Kk={D:wo,DD:Jg,DDD:Zg,DDDD:Gg,t:Xg,tt:Qg,ttt:xg,tttt:e1,T:t1,TT:n1,TTT:i1,TTTT:l1,f:s1,ff:r1,fff:f1,ffff:c1,F:o1,FF:a1,FFF:u1,FFFF:d1};class sn{static create(e,t={}){return new sn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Kk[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Bt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Vk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Uk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),f=(m,h)=>i?Bk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const h=sn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Wk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Of(sn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>f=>{const u=i(f);return u?this.num(a.get(u),f.length):f},s=sn.parseFormat(t),o=s.reduce((a,{literal:f,val:u})=>f?a:a.concat(u),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Of(s,l(r))}}const E1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Al(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ll(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Nl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function I1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&u)?-m:m;return[{years:d(Pi(t)),months:d(Pi(i)),weeks:d(Pi(l)),days:d(Pi(s)),hours:d(Pi(o)),minutes:d(Pi(r)),seconds:d(Pi(a),a==="-0"),milliseconds:d(ya(f),c)}]}const oy={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function $a(n,e,t,i,l,s,o){const r={year:e.length===2?Yr(vi(e)):vi(e),month:S1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?T1.indexOf(n)+1:C1.indexOf(n)+1),r}const ry=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ay(n){const[,e,t,i,l,s,o,r,a,f,u,c]=n,d=$a(e,l,i,t,s,o,r);let m;return a?m=oy[a]:f?m=0:m=Yo(u,c),[d,new cn(m)]}function fy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const uy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cy=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,dy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mf(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,l,i,t,s,o,r),cn.utcInstance]}function py(n){const[,e,t,i,l,s,o,r]=n;return[$a(e,r,t,i,l,s,o),cn.utcInstance]}const my=Al(Zk,Sa),hy=Al(Gk,Sa),_y=Al(Xk,Sa),gy=Al(L1),P1=Ll(ny,Pl,$s,Ts),by=Ll(Qk,Pl,$s,Ts),ky=Ll(xk,Pl,$s,Ts),yy=Ll(Pl,$s,Ts);function vy(n){return Nl(n,[my,P1],[hy,by],[_y,ky],[gy,yy])}function wy(n){return Nl(fy(n),[ry,ay])}function Sy(n){return Nl(n,[uy,Mf],[cy,Mf],[dy,py])}function $y(n){return Nl(n,[ly,sy])}const Ty=Ll(Pl);function Cy(n){return Nl(n,[iy,Ty])}const Oy=Al(ey,ty),My=Al(N1),Dy=Ll(Pl,$s,Ts);function Ey(n){return Nl(n,[Oy,P1],[My,Dy])}const Df="Invalid Duration",F1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Iy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...F1},Dn=146097/400,pl=146097/4800,Ay={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:pl/7,days:pl,hours:pl*24,minutes:pl*24*60,seconds:pl*24*60*60,milliseconds:pl*24*60*60*1e3},...F1},Wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ly=Wi.slice(0).reverse();function yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function R1(n,e){let t=e.milliseconds??0;for(const i of Ly.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Ef(n,e){const t=R1(n,e)<0?-1:1;Wi.reduceRight((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Wi.reduce((i,l)=>{if(Ue(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function Ny(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Ay:Iy;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||pt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new tn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:To(e,st.normalizeUnit),loc:pt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Oi(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new tn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=$y(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Cy(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(qt.throwOnInvalid)throw new lk(i);return new st({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Kg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?sn.create(this.loc,i).formatDurationFromString(this,e):Df}toHuman(e={}){if(!this.isValid)return Df;const t=Wi.map(i=>{const l=this.values[i];return Ue(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=va(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?R1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Wi)(Ol(t.values,l)||Ol(this.values,l))&&(i[l]=t.get(l)+this.get(l));return yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=w1(e(this.values[i],i));return yi(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...To(e,st.normalizeUnit)};return yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ef(this.matrix,e),yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Ny(this.normalize().shiftToAll().toObject());return yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Wi)if(e.indexOf(o)>=0){s=o;let r=0;for(const f in i)r+=this.matrix[f][o]*i[f],i[f]=0;Oi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Oi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Ef(this.matrix,t),yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Wi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const ml="Invalid Interval";function Py(n,e){return!n||!n.isValid?Rt.invalid("missing or invalid start"):!e||!e.isValid?Rt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Rt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Rt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Rt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Rt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Rt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,f)=>a.time-f.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Rt.fromDateTimes(t,a.time)),t=null);return Rt.merge(l)}difference(...e){return Rt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ml}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=wo,t={}){return this.isValid?sn.create(this.s.loc.clone(t),e).formatInterval(this):ml}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ml}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ml}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ml}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ml}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return Rt.fromDateTimes(e(this.s),e(this.e))}}class Ps{static hasDST(e=qt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,qt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||pt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||pt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||pt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||pt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||pt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||pt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||pt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return pt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return pt.create(t,null,"gregory").eras(e)}static features(){return{relative:k1(),localeWeek:y1()}}}function If(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function Fy(n,e,t){const i=[["years",(a,f)=>f.year-a.year],["quarters",(a,f)=>f.quarter-a.quarter+(f.year-a.year)*4],["months",(a,f)=>f.month-a.month+(f.year-a.year)*12],["weeks",(a,f)=>{const u=If(a,f);return(u-u%7)/7}],["days",If]],l={},s=n;let o,r;for(const[a,f]of i)t.indexOf(a)>=0&&(o=a,l[a]=f(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Ry(n,e,t,i){let[l,s,o,r]=Fy(n,e,t);const a=e-l,f=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);f.length===0&&(o0?st.fromMillis(a,i).shiftTo(...f).plus(u):u}const qy="missing Intl.DateTimeFormat.formatToParts support";function ut(n,e=t=>t){return{regex:n,deser:([t])=>e(Ok(t))}}const jy=" ",q1=`[ ${jy}]`,j1=new RegExp(q1,"g");function Hy(n){return n.replace(/\./g,"\\.?").replace(j1,q1)}function Af(n){return n.replace(/\./g,"").replace(j1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Hy).join("|")),deser:([t])=>n.findIndex(i=>Af(t)===Af(i))+e}}function Lf(n,e){return{regex:n,deser:([,t,i])=>Yo(t,i),groups:e}}function Fs(n){return{regex:n,deser:([e])=>e}}function zy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vy(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),f=jn(e,"{1,6}"),u=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(zy(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ut(f);case"yy":return ut(c,Yr);case"yyyy":return ut(s);case"yyyyy":return ut(d);case"yyyyyy":return ut(o);case"M":return ut(r);case"MM":return ut(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ut(r);case"LL":return ut(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ut(r);case"dd":return ut(i);case"o":return ut(a);case"ooo":return ut(l);case"HH":return ut(i);case"H":return ut(r);case"hh":return ut(i);case"h":return ut(r);case"mm":return ut(i);case"m":return ut(r);case"q":return ut(r);case"qq":return ut(i);case"s":return ut(r);case"ss":return ut(i);case"S":return ut(a);case"SSS":return ut(l);case"u":return Fs(u);case"uu":return Fs(r);case"uuu":return ut(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ut(s);case"kk":return ut(c,Yr);case"W":return ut(r);case"WW":return ut(i);case"E":case"c":return ut(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Lf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Lf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Fs(/[a-z_+-/]{1,256}?/i);case" ":return Fs(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:qy};return _.token=n,_}const By={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Uy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=By[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Wy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Yy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Ol(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Ky(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return Ue(n.z)||(t=pi.create(n.z)),Ue(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),Ue(n.q)||(n.M=(n.q-1)*3+1),Ue(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),Ue(n.u)||(n.S=ya(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let ar=null;function Jy(){return ar||(ar=je.fromMillis(1555555555555)),ar}function Zy(n,e){if(n.literal)return n;const t=sn.macroTokenToFormatOpts(n.val),i=B1(t,e);return i==null||i.includes(void 0)?n:i}function H1(n,e){return Array.prototype.concat(...n.map(t=>Zy(t,e)))}class z1{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=H1(sn.parseFormat(t),e),this.units=this.tokens.map(i=>Vy(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=Wy(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=Yy(e,this.regex,this.handlers),[l,s,o]=i?Ky(i):[null,null,void 0];if(Ol(i,"a")&&Ol(i,"H"))throw new kl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function V1(n,e,t){return new z1(n,t).explainFromTokens(e)}function Gy(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=V1(n,e,t);return[i,l,s,o]}function B1(n,e){if(!n)return null;const i=sn.create(e,n).dtFormatter(Jy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Uy(o,n,s))}const fr="Invalid DateTime",Nf=864e13;function Kl(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ur(n){return n.weekData===null&&(n.weekData=So(n.c)),n.weekData}function cr(n){return n.localWeekData===null&&(n.localWeekData=So(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Fi(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function U1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Rs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ao(n,e,t){return U1(Wo(n),e,t)}function Pf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,$o(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Wo(s);let[a,f]=U1(r,t,n.zone);return o!==0&&(a+=o,f=n.zone.offset(a)),{ts:a,o:f}}function hl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,f=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?f:f.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function qs(n,e,t=!0){return n.isValid?sn.create(pt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function dr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Bt(n.c.year,t?6:4),e?(i+="-",i+=Bt(n.c.month),i+="-",i+=Bt(n.c.day)):(i+=Bt(n.c.month),i+=Bt(n.c.day)),i}function Ff(n,e,t,i,l,s){let o=Bt(n.c.hour);return e?(o+=":",o+=Bt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=Bt(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=Bt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Bt(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Bt(Math.trunc(-n.o/60)),o+=":",o+=Bt(Math.trunc(-n.o%60))):(o+="+",o+=Bt(Math.trunc(n.o/60)),o+=":",o+=Bt(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const W1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Xy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Y1=["year","month","day","hour","minute","second","millisecond"],xy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ev=["year","ordinal","hour","minute","second","millisecond"];function tv(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Kg(n);return e}function Rf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return tv(n)}}function nv(n){return uo[n]||(fo===void 0&&(fo=qt.now()),uo[n]=n.offset(fo)),uo[n]}function qf(n,e){const t=Si(e.zone,qt.defaultZone);if(!t.isValid)return je.invalid(Kl(t));const i=pt.fromObject(e);let l,s;if(Ue(n.year))l=qt.now();else{for(const a of Y1)Ue(n[a])&&(n[a]=W1[a]);const o=g1(n)||b1(n);if(o)return je.invalid(o);const r=nv(t);[l,s]=ao(n,r,t)}return new je({ts:l,zone:t,loc:i,o:s})}function jf(n,e,t){const i=Ue(t.round)?!0:t.round,l=(o,r)=>(o=va(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Hf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let fo,uo={};class je{constructor(e){const t=e.zone||qt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Kl(t));this.ts=Ue(e.ts)?qt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=Oi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Rs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||pt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static utc(){const[e,t]=Hf(arguments),[i,l,s,o,r,a,f]=t;return e.zone=cn.utcInstance,qf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Ak(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,qt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:pt.fromObject(t)}):je.invalid(Kl(l))}static fromMillis(e,t={}){if(Oi(e))return e<-Nf||e>Nf?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,qt.defaultZone),loc:pt.fromObject(t)});throw new tn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Oi(e))return new je({ts:e*1e3,zone:Si(t.zone,qt.defaultZone),loc:pt.fromObject(t)});throw new tn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,qt.defaultZone);if(!i.isValid)return je.invalid(Kl(i));const l=pt.fromObject(t),s=To(e,Rf),{minDaysInFirstWeek:o,startOfWeek:r}=$f(s,l),a=qt.now(),f=Ue(t.specificOffset)?i.offset(a):t.specificOffset,u=!Ue(s.ordinal),c=!Ue(s.year),d=!Ue(s.month)||!Ue(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||u)&&h)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new kl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Rs(a,f);_?(g=xy,y=Xy,S=So(S,o,r)):u?(g=ev,y=Qy,S=rr(S)):(g=Y1,y=W1);let T=!1;for(const R of g){const F=s[R];Ue(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Dk(s,o,r):u?Ek(s):g1(s),C=$||b1(s);if(C)return je.invalid(C);const O=_?wf(s,o,r):u?Sf(s):s,[D,I]=ao(O,f,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L.isValid?L:je.invalid(L.invalid)}static fromISO(e,t={}){const[i,l]=vy(e);return hl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=wy(e);return hl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=Sy(e);return hl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=pt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,f,u]=Gy(o,e,t);return u?je.invalid(u):hl(r,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=Ey(e);return hl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(qt.throwOnInvalid)throw new nk(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=B1(e,pt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return H1(sn.parseFormat(e),pt.fromObject(t)).map(l=>l.val).join("")}static resetCache(){fo=void 0,uo={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ur(this).weekYear:NaN}get weekNumber(){return this.isValid?ur(this).weekNumber:NaN}get weekday(){return this.isValid?ur(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cr(this).weekday:NaN}get localWeekNumber(){return this.isValid?cr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cr(this).weekYear:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ps.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ps.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ps.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ps.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Wo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,f=i-r*t,u=Rs(a,o),c=Rs(f,r);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[Fi(this,{ts:a}),Fi(this,{ts:f})]:[this]}get isInLeapYear(){return Ss(this.year)}get daysInMonth(){return $o(this.year,this.month)}get daysInYear(){return this.isValid?wl(this.year):NaN}get weeksInWeekYear(){return this.isValid?as(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?as(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=sn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(qt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,qt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=ao(o,s,e)}return Fi(this,{ts:l,zone:e})}else return je.invalid(Kl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Fi(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=To(e,Rf),{minDaysInFirstWeek:i,startOfWeek:l}=$f(t,this.loc),s=!Ue(t.weekYear)||!Ue(t.weekNumber)||!Ue(t.weekday),o=!Ue(t.ordinal),r=!Ue(t.year),a=!Ue(t.month)||!Ue(t.day),f=r||a,u=t.weekYear||t.weekNumber;if((f||o)&&u)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new kl("Can't mix ordinal dates with month/day");let c;s?c=wf({...So(this.c,i,l),...t},i,l):Ue(t.ordinal)?(c={...this.toObject(),...t},Ue(t.day)&&(c.day=Math.min($o(c.year,c.month),c.day))):c=Sf({...rr(this.c),...t});const[d,m]=ao(c,this.o,this.zone);return Fi(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Fi(this,Pf(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Fi(this,Pf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,f=Ry(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Rt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new tn("max requires all arguments be DateTimes");return Tf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=pt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return V1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=pt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new z1(s,e)}static fromFormatParser(e,t,i={}){if(Ue(e)||Ue(t))throw new tn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=pt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new tn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:f,invalidReason:u}=t.explainFromTokens(e);return u?je.invalid(u):hl(r,a,i,`format ${t.format}`,e,f)}static get DATE_SHORT(){return wo}static get DATE_MED(){return Jg}static get DATE_MED_WITH_WEEKDAY(){return sk}static get DATE_FULL(){return Zg}static get DATE_HUGE(){return Gg}static get TIME_SIMPLE(){return Xg}static get TIME_WITH_SECONDS(){return Qg}static get TIME_WITH_SHORT_OFFSET(){return xg}static get TIME_WITH_LONG_OFFSET(){return e1}static get TIME_24_SIMPLE(){return t1}static get TIME_24_WITH_SECONDS(){return n1}static get TIME_24_WITH_SHORT_OFFSET(){return i1}static get TIME_24_WITH_LONG_OFFSET(){return l1}static get DATETIME_SHORT(){return s1}static get DATETIME_SHORT_WITH_SECONDS(){return o1}static get DATETIME_MED(){return r1}static get DATETIME_MED_WITH_SECONDS(){return a1}static get DATETIME_MED_WITH_WEEKDAY(){return ok}static get DATETIME_FULL(){return f1}static get DATETIME_FULL_WITH_SECONDS(){return u1}static get DATETIME_HUGE(){return c1}static get DATETIME_HUGE_WITH_SECONDS(){return d1}}function Hl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Oi(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new tn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const iv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],lv=[".mp4",".avi",".mov",".3gp",".wmv"],sv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ov=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],K1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!iv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!ov.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),u=r.width,c=r.height;return a.width=t,a.height=i,f.drawImage(r,u>c?(u-c)/2:0,0,u>c?c:u,u>c?c:u,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,f,u,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((f=e==null?void 0:e.options)==null?void 0:f.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((u=_.options)==null?void 0:u.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let f=null;if(a.type==="number")f=123;else if(a.type==="date")f="2022-01-01 10:00:00.123Z";else if(a.type==="bool")f=!0;else if(a.type==="email")f="test@example.com";else if(a.type==="url")f="https://example.com";else if(a.type==="json")f="JSON";else{if(a.type==="file")continue;a.type==="select"?(f=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(f=[f])):a.type==="relation"?(f="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):f="test"}i[a.name]=f}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let f in e)if(f!=="schema"&&JSON.stringify(e[f])!==JSON.stringify(t[f]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(s,"id",f.id)),r=s.filter(f=>(f==null?void 0:f.id)&&!j.findByKey(l,"id",f.id)),a=s.filter(f=>{const u=j.isObject(f)&&j.findByKey(l,"id",f.id);if(!u)return!1;for(let c in u)if(JSON.stringify(f[c])!=JSON.stringify(u[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const f=a.target.files[0],u=new FileReader;u.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=u.result.split(",")[1],h=d.create(c,f,m);d.add(h),l(h.blobUri(),{title:f.name})}),u.readAsDataURL(f)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,f;let s=e.find(u=>u.name==t||u.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const u of s.schema){const c=i+u.name;if(u.type=="relation"&&((r=u.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,u.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=u.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(u.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const u of e){u.schema=u.schema||[];for(const c of u.schema)if(c.type=="relation"&&((f=c.options)==null?void 0:f.collectionId)==s.id){const d=i+u.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,u.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,f,u,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((f=l[2])==null?void 0:f.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(u=_[1])==null?void 0:u.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Cn([]);function Co(n,e=4e3){return Zo(n,"info",e)}function Lt(n,e=3e3){return Zo(n,"success",e)}function ii(n,e=4500){return Zo(n,"error",e)}function rv(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ca(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ca(e,n),e))}function Ta(){Jo.update(n=>{for(let e of n)Ca(n,e);return[]})}function Ca(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Jt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const Oa=Cn({});function Kr(n){Oa.set(n||{})}const Rn=Cn([]),Yn=Cn({}),Oo=Cn(!1),Z1=Cn({});let Ql;typeof BroadcastChannel<"u"&&(Ql=new BroadcastChannel("collections"),Ql.onmessage=()=>{var n;X1((n=Mg(Yn))==null?void 0:n.id)});function G1(){Ql==null||Ql.postMessage("reload")}function av(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function fv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ma(),G1(),j.sortCollections(e)))}function uv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ma(),G1(),e))}async function X1(n=null){Oo.set(!0);try{let e=await ae.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ma()}catch(e){ae.error(e)}Oo.set(!1)}function Ma(){Z1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const pr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Jt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Mg(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ha(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class cv extends Ug{save(e,t){super.save(e,t),t&&!t.collectionId&&Kr(t)}clear(){super.clear(),Kr(null)}}const ae=new Vo("../",new cv("pb_admin_auth"));ae.authStore.model&&!ae.authStore.model.collectionId&&Kr(ae.authStore.model);const dv=n=>({}),zf=n=>({});function pv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=wt(h,n,n[2],null),g=n[3].footer,y=wt(g,n,n[2],zf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.24",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&$t(_,h,S,S[2],m?St(h,S[2],T,null):Tt(S[2]),null),y&&y.p&&(!m||T&4)&&$t(y,g,S,S[2],m?St(g,S[2],T,dv):Tt(S[2]),zf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function mv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,mv,pv,me,{center:0,class:1})}}function Vf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function hv(n){let e,t,i,l=!n[0]&&Vf();const s=n[1].default,o=wt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Vf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,s,r,r[2],i?St(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[hv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,gv,_v,me,{nobranding:0})}}function Go(n){const e=n-1;return e*e*e+1}function fs(n,{delay:e=0,duration:t=400,easing:i=ks}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Go,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=xa(l),[m,h]=xa(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const f=e[a];f===null?s.delete(a):s.set(a,f)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Cn([]);function Co(n,e=4e3){return Zo(n,"info",e)}function Nt(n,e=3e3){return Zo(n,"success",e)}function ii(n,e=4500){return Zo(n,"error",e)}function rv(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ca(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ca(e,n),e))}function Ta(){Jo.update(n=>{for(let e of n)Ca(n,e);return[]})}function Ca(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const mi=Cn({});function Zt(n){mi.set(n||{})}function li(n){mi.update(e=>(j.deleteByPath(e,n),e))}const Oa=Cn({});function Kr(n){Oa.set(n||{})}const Rn=Cn([]),Yn=Cn({}),Oo=Cn(!1),Z1=Cn({});let Ql;typeof BroadcastChannel<"u"&&(Ql=new BroadcastChannel("collections"),Ql.onmessage=()=>{var n;X1((n=Mg(Yn))==null?void 0:n.id)});function G1(){Ql==null||Ql.postMessage("reload")}function av(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function fv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Ma(),G1(),j.sortCollections(e)))}function uv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),Ma(),G1(),e))}async function X1(n=null){Oo.set(!0);try{let e=await re.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),Ma()}catch(e){re.error(e)}Oo.set(!1)}function Ma(){Z1.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const pr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&tl("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Zt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),tl("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Mg(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ha(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class cv extends Ug{save(e,t){super.save(e,t),t&&!t.collectionId&&Kr(t)}clear(){super.clear(),Kr(null)}}const re=new Vo("../",new cv("pb_admin_auth"));re.authStore.model&&!re.authStore.model.collectionId&&Kr(re.authStore.model);const dv=n=>({}),zf=n=>({});function pv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;const h=n[3].default,_=St(h,n,n[2],null),g=n[3].footer,y=St(g,n,n[2],zf);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",f=M(),u=b("a"),c=b("span"),c.textContent="PocketBase v0.22.25",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(l,u),k(u,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&Tt(_,h,S,S[2],m?$t(h,S[2],T,null):Ct(S[2]),null),y&&y.p&&(!m||T&4)&&Tt(y,g,S,S[2],m?$t(g,S[2],T,dv):Ct(S[2]),zf),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function mv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,mv,pv,pe,{center:0,class:1})}}function Vf(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function hv(n){let e,t,i,l=!n[0]&&Vf();const s=n[1].default,o=St(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Vf(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&Tt(o,s,r,r[2],i?$t(s,r[2],a,null):Ct(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[hv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Q1 extends ge{constructor(e){super(),_e(this,e,gv,_v,pe,{nobranding:0})}}function Go(n){const e=n-1;return e*e*e+1}function fs(n,{delay:e=0,duration:t=400,easing:i=ks}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Go,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,f=r.transform==="none"?"":r.transform,u=a*(1-o),[c,d]=xa(l),[m,h]=xa(s);return{delay:e,duration:t,easing:i,css:(_,g)=>` transform: ${f} translate(${(1-_)*c}${d}, ${(1-_)*m}${h}); - opacity: ${a-u*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Go,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Wt(n,{delay:e=0,duration:t=400,easing:i=Go,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` + opacity: ${a-u*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Go,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${f[0]}: ${y*c}px;padding-${f[1]}: ${y*d}px;margin-${f[0]}: ${y*m}px;margin-${f[1]}: ${y*h}px;border-${f[0]}-width: ${y*_}px;border-${f[1]}-width: ${y*g}px;`}}function Yt(n,{delay:e=0,duration:t=400,easing:i=Go,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-f*d}); opacity: ${r-u*d} - `}}let Jr,Ri;const Zr="app-tooltip";function Bf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Mi(){return Ri=Ri||document.querySelector("."+Zr),Ri||(Ri=document.createElement("div"),Ri.classList.add(Zr),document.body.appendChild(Ri)),Ri}function x1(n,e){let t=Mi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Gr();return}t.textContent=e.text,t.className=Zr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Gr(){clearTimeout(Jr),Mi().classList.remove("active"),Mi().activeNode=void 0}function bv(n,e){Mi().activeNode=n,clearTimeout(Jr),Jr=setTimeout(()=>{Mi().classList.add("active"),x1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Bf(e);function i(){bv(n,t)}function l(){Gr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Mi(),{update(s){var o,r;t=Bf(s),(r=(o=Mi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&x1(n,t)},destroy(){var s,o;(o=(s=Mi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Gr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Uf(n,e,t){const i=n.slice();return i[12]=e[t],i}const kv=n=>({}),Wf=n=>({uniqueId:n[4]});function yv(n){let e,t,i=ue(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Yf(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Mo(a[12])+"")&&oe(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function wv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=wt(a,n,n[8],Wf),u=[vv,yv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&$t(f,a,m,m[8],s?St(a,m[8],h,kv):Tt(m[8]),Wf);let _=i;i=d(m),i===_?c[i].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Kf="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Kf:n||Kf}function Sv(n,e,t){let i;We(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}Ht(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){ee[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,Sv,wv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Tv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&re(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[Tv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Cv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Mv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ae.admins.create({email:l,password:s,passwordConfirm:o}),await ae.admins.authWithPassword(l,s),i("submit")}catch(d){ae.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class Dv extends ge{constructor(e){super(),_e(this,e,Mv,Ov,me,{})}}function Jf(n){let e,t;return e=new Q1({props:{$$slots:{default:[Ev]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ev(n){let e,t;return e=new Dv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Jf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Jf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(le(),A(i,1,1,()=>{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Av(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ae.logout(!1),t(0,i=!0);return}ae.authStore.isValid?tl("/collections"):ae.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Lv extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{})}}const It=Cn(""),Do=Cn(""),Xi=Cn(!1);function Nv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),re(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&re(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Pv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Zf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Gf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Fv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Pv,Nv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zf(),g=(n[0].length||n[7].length)&&Gf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(le(),A(m[T],1,1,()=>{m[T]=null}),se(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Zf(),_.c(),E(_,1),_.m(e,a)):_&&(le(),A(_,1,1,()=>{_=null}),se()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Gf(y),g.c(),E(g,1),g.m(e,null)):g&&(le(),A(g,1,1,()=>{g=null}),se())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Rv(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-DG6SVeUP.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}Ht(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class Cs extends ge{constructor(e){super(),_e(this,e,Rv,Fv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function qv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Ct(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function jv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Ht(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Xo extends ge{constructor(e){super(),_e(this,e,jv,qv,me,{tooltip:0,class:1})}}function Hv(n){let e,t,i,l,s;const o=n[6].default,r=wt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&$t(r,o,a,a[5],i?St(o,a[5],f,null):Tt(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function zv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,zv,Hv,me,{class:1,name:2,sort:0,disable:3})}}const Vv=n=>({}),Xf=n=>({}),Bv=n=>({}),Qf=n=>({});function Uv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=wt(f,n,n[10],Qf),c=n[11].default,d=wt(c,n,n[10],null),m=n[11].after,h=wt(m,n,n[10],Xf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&$t(u,f,_,_[10],o?St(f,_[10],g,Bv):Tt(_[10]),Qf),d&&d.p&&(!o||g&1024)&&$t(d,c,_,_[10],o?St(c,_[10],g,null):Tt(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&$t(h,m,_,_[10],o?St(m,_[10],g,Vv):Tt(_[10]),Xf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Wv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Ht(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Qo extends ge{constructor(e){super(),_e(this,e,Wv,Uv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Yv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&oe(l,i),u&1&&oe(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Kv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=K1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class eb extends ge{constructor(e){super(),_e(this,e,Kv,Yv,me,{level:0})}}function Jv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Zv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class tb extends ge{constructor(e){super(),_e(this,e,Zv,Jv,me,{date:0})}}function xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=r2(i[31]);return i[33]=s,i}function eu(n,e,t){const i=n.slice();return i[36]=e[t],i}function Gv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Xv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tu(n){let e;function t(s,o){return s[7]?n2:t2}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function t2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&nu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function n2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function iu(n){let e,t=ue(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const ie={};Y[0]&8&&(ie.level=e[31].level),m.$set(ie),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&oe(T,S),e[33].length?H?H.p(e,Y):(H=iu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const te={};Y[0]&8&&(te.date=e[31].created),D.$set(te)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function s2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Xv:Gv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Qv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));let q=ue(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const ie={};U[1]&256&&(ie.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,ie.sort=G[1],ke(()=>u=!1)),f.$set(ie);const te={};U[1]&256&&(te.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,te.sort=G[1],ke(()=>m=!1)),d.$set(te),U[0]&9369&&(q=ue(G[3]),le(),S=at(S,U,H,1,G,q,T,y,Et,su,null,xf),se(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=tu(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function ru(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&oe(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&oe(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function o2(n){let e,t,i,l,s;e=new Qo({props:{class:"table-wrapper",$$slots:{default:[s2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ou(n),r=n[5]&&ru(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=ou(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=ru(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const au=50,mr=/[-:\. ]/gi;function r2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function a2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const ie=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return ae.logs.getList(U,au,{sort:f,skipTotal:1,filter:ie}).then(async te=>{var Ne;U<=1&&y();const pe=j.toArray(te.items);if(t(7,m=!1),t(6,c=te.page),t(16,d=((Ne=te.items)==null?void 0:Ne.length)||0),o("load",u.concat(pe)),Y){const He=++h;for(;pe.length&&h==He;){const Xe=pe.splice(0,10);for(let xe of Xe)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of pe)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(te=>{te!=null&&te.isAbort||(t(7,m=!1),console.warn(te),y(),ae.error(te,!ie||(te==null?void 0:te.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((te,pe)=>te.createdpe.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(mr,"")+".json");const Y=U[0].created.replaceAll(mr,""),ie=U[U.length-1].created.replaceAll(mr,"");return j.downloadJson(U,`${U.length}_logs_${ie}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=au),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class f2 extends ge{constructor(e){super(),_e(this,e,a2,o2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! + `}}let Jr,Ri;const Zr="app-tooltip";function Bf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Mi(){return Ri=Ri||document.querySelector("."+Zr),Ri||(Ri=document.createElement("div"),Ri.classList.add(Zr),document.body.appendChild(Ri)),Ri}function x1(n,e){let t=Mi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Gr();return}t.textContent=e.text,t.className=Zr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Gr(){clearTimeout(Jr),Mi().classList.remove("active"),Mi().activeNode=void 0}function bv(n,e){Mi().activeNode=n,clearTimeout(Jr),Jr=setTimeout(()=>{Mi().classList.add("active"),x1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Bf(e);function i(){bv(n,t)}function l(){Gr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Mi(),{update(s){var o,r;t=Bf(s),(r=(o=Mi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&x1(n,t)},destroy(){var s,o;(o=(s=Mi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Gr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Uf(n,e,t){const i=n.slice();return i[12]=e[t],i}const kv=n=>({}),Wf=n=>({uniqueId:n[4]});function yv(n){let e,t,i=fe(n[3]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Fe(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Yt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Yf(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=K(i),s=M(),p(e,"class","help-block help-block-error")},m(a,f){w(a,e,f),k(e,t),k(t,l),k(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Mo(a[12])+"")&&se(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function wv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=St(a,n,n[8],Wf),u=[vv,yv],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),f&&f.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&Tt(f,a,m,m[8],s?$t(a,m[8],h,kv):Ct(m[8]),Wf);let _=i;i=d(m),i===_?c[i].p(m,h):(ie(),A(c[_],1,1,()=>{c[_]=null}),le(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(f,m),E(l),s=!0)},o(m){A(f,m),A(l),s=!1},d(m){m&&v(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Kf="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Kf:n||Kf}function Sv(n,e,t){let i;We(n,mi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){li(r)}zt(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){te[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class ue extends ge{constructor(e){super(),_e(this,e,Sv,wv,pe,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0]),s.focus(),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&oe(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Tv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[1]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[6]),f=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&oe(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[2]),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&oe(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new ue({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field required",name:"password",$$slots:{default:[Tv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ue({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Cv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=J(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Mv(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await re.admins.create({email:l,password:s,passwordConfirm:o}),await re.admins.authWithPassword(l,s),i("submit")}catch(d){re.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class Dv extends ge{constructor(e){super(),_e(this,e,Mv,Ov,pe,{})}}function Jf(n){let e,t;return e=new Q1({props:{$$slots:{default:[Ev]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ev(n){let e,t;return e=new Dv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Jf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Jf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ie(),A(i,1,1,()=>{i=null}),le())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Av(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){re.logout(!1),t(0,i=!0);return}re.authStore.isValid?tl("/collections"):re.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Lv extends ge{constructor(e){super(),_e(this,e,Av,Iv,pe,{})}}const At=Cn(""),Do=Cn(""),Xi=Cn(!1);function Nv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),oe(e,n[7]),i||(l=J(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&oe(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Pv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!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=Et(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),le()}o?(e=Et(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Zf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Gf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Fv(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Pv,Nv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zf(),g=(n[0].length||n[7].length)&&Gf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[J(e,"click",Tn(n[11])),J(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(ie(),A(m[T],1,1,()=>{m[T]=null}),le(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Zf(),_.c(),E(_,1),_.m(e,a)):_&&(ie(),A(_,1,1,()=>{_=null}),le()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Gf(y),g.c(),E(g,1),g.m(e,null)):g&&(ie(),A(g,1,1,()=>{g=null}),le())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,$e(c)}}}function Rv(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CS7wYc6J.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}zt(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){te[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class Cs extends ge{constructor(e){super(),_e(this,e,Rv,Fv,pe,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function qv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[Se(l=Pe.call(null,e,n[0])),J(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Mt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,$e(o)}}}function jv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return zt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Xo extends ge{constructor(e){super(),_e(this,e,jv,qv,pe,{tooltip:0,class:1})}}function Hv(n){let e,t,i,l,s;const o=n[6].default,r=St(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"click",n[7]),J(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&Tt(r,o,a,a[5],i?$t(o,a[5],f,null):Ct(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function zv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class Sn extends ge{constructor(e){super(),_e(this,e,zv,Hv,pe,{class:1,name:2,sort:0,disable:3})}}const Vv=n=>({}),Xf=n=>({}),Bv=n=>({}),Qf=n=>({});function Uv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=St(f,n,n[10],Qf),c=n[11].default,d=St(c,n,n[10],null),m=n[11].after,h=St(m,n,n[10],Xf);return{c(){e=b("div"),u&&u.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&Tt(u,f,_,_[10],o?$t(f,_[10],g,Bv):Ct(_[10]),Qf),d&&d.p&&(!o||g&1024)&&Tt(d,c,_,_[10],o?$t(c,_[10],g,null):Ct(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&Tt(h,m,_,_[10],o?$t(m,_[10],g,Vv):Ct(_[10]),Xf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,$e(a)}}}function Wv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}zt(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){te[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,O]}class Qo extends ge{constructor(e){super(),_e(this,e,Wv,Uv,pe,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Yv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=K(i),s=K(" ("),o=K(n[0]),r=K(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&se(l,i),u&1&&se(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function Kv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=K1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class eb extends ge{constructor(e){super(),_e(this,e,Kv,Yv,pe,{level:0})}}function Jv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=K(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=Se(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Zv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class tb extends ge{constructor(e){super(),_e(this,e,Zv,Jv,pe,{date:0})}}function xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=r2(i[31]);return i[33]=s,i}function eu(n,e,t){const i=n.slice();return i[36]=e[t],i}function Gv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Xv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tu(n){let e;function t(s,o){return s[7]?n2:t2}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function t2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&nu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function n2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function iu(n){let e,t=fe(n[33]),i=[];for(let l=0;l',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(f,"for",u="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(U,Y){w(U,t,Y),k(t,i),k(i,l),k(l,s),k(l,a),k(l,f),k(t,c),k(t,d),z(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),H&&H.m(_,null),k(t,C),k(t,O),z(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[J(s,"change",q),J(l,"click",Tn(e[17])),J(t,"click",W),J(t,"keydown",G)],N=!0)},p(U,Y){e=U,(!F||Y[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||Y[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||Y[0]&8&&u!==(u="checkbox_"+e[31].id))&&p(f,"for",u);const me={};Y[0]&8&&(me.level=e[31].level),m.$set(me),(!F||Y[0]&8)&&S!==(S=e[31].message+"")&&se(T,S),e[33].length?H?H.p(e,Y):(H=iu(e),H.c(),H.m(_,null)):H&&(H.d(1),H=null);const ee={};Y[0]&8&&(ee.date=e[31].created),D.$set(ee)},i(U){F||(E(m.$$.fragment,U),E(D.$$.fragment,U),F=!0)},o(U){A(m.$$.fragment,U),A(D.$$.fragment,U),F=!1},d(U){U&&v(t),V(m),H&&H.d(),V(D),N=!1,$e(P)}}}function s2(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(G,U){return G[7]?Xv:Gv}let O=C(n),D=O(n);function I(G){n[19](G)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[Qv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),te.push(()=>be(o,"sort",I));function R(G){n[20](G)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),f=new Sn({props:F}),te.push(()=>be(f,"sort",R));function N(G){n[21](G)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),te.push(()=>be(d,"sort",N));let q=fe(n[3]);const H=G=>G[31].id;for(let G=0;Gr=!1)),o.$set(Y);const me={};U[1]&256&&(me.$$scope={dirty:U,ctx:G}),!u&&U[0]&2&&(u=!0,me.sort=G[1],ke(()=>u=!1)),f.$set(me);const ee={};U[1]&256&&(ee.$$scope={dirty:U,ctx:G}),!m&&U[0]&2&&(m=!0,ee.sort=G[1],ke(()=>m=!1)),d.$set(ee),U[0]&9369&&(q=fe(G[3]),ie(),S=at(S,U,H,1,G,q,T,y,It,su,null,xf),le(),!q.length&&W?W.p(G,U):q.length?W&&(W.d(1),W=null):(W=tu(G),W.c(),W.m(y,null))),(!$||U[0]&128)&&x(e,"table-loading",G[7])},i(G){if(!$){E(o.$$.fragment,G),E(f.$$.fragment,G),E(d.$$.fragment,G);for(let U=0;ULoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function ru(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[5]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[27]),J(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&se(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&se(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function o2(n){let e,t,i,l,s;e=new Qo({props:{class:"table-wrapper",$$slots:{default:[s2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ou(n),r=n[5]&&ru(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,f){z(e,a,f),w(a,t,f),o&&o.m(a,f),w(a,i,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){const u={};f[0]&411|f[1]&256&&(u.$$scope={dirty:f,ctx:a}),e.$set(u),a[3].length&&a[9]?o?o.p(a,f):(o=ou(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=ru(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const au=50,mr=/[-:\. ]/gi;function r2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function a2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:f="-rowid"}=e,u=[],c=1,d=0,m=!1,h=0,_={};async function g(U=1,Y=!0){t(7,m=!0);const me=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return re.logs.getList(U,au,{sort:f,skipTotal:1,filter:me}).then(async ee=>{var Oe;U<=1&&y();const ce=j.toArray(ee.items);if(t(7,m=!1),t(6,c=ee.page),t(16,d=((Oe=ee.items)==null?void 0:Oe.length)||0),o("load",u.concat(ce)),Y){const He=++h;for(;ce.length&&h==He;){const Je=ce.splice(0,10);for(let xe of Je)j.pushOrReplaceByKey(u,xe);t(3,u),await j.yieldToMain()}}else{for(let He of ce)j.pushOrReplaceByKey(u,He);t(3,u)}}).catch(ee=>{ee!=null&&ee.isAbort||(t(7,m=!1),console.warn(ee),y(),re.error(ee,!me||(ee==null?void 0:ee.status)!=400))})}function y(){t(3,u=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const U of u)t(4,_[U.id]=U,_);t(4,_)}function C(U){_[U.id]?delete _[U.id]:t(4,_[U.id]=U,_),t(4,_)}function O(){const U=Object.values(_).sort((ee,ce)=>ee.createdce.created?-1:0);if(!U.length)return;if(U.length==1)return j.downloadJson(U[0],"log_"+U[0].created.replaceAll(mr,"")+".json");const Y=U[0].created.replaceAll(mr,""),me=U[U.length-1].created.replaceAll(mr,"");return j.downloadJson(U,`${U.length}_logs_${me}_to_${Y}.json`)}function D(U){Ce.call(this,n,U)}const I=()=>S();function L(U){f=U,t(1,f)}function R(U){f=U,t(1,f)}function F(U){f=U,t(1,f)}const N=U=>C(U),P=U=>o("select",U),q=(U,Y)=>{Y.code==="Enter"&&(Y.preventDefault(),o("select",U))},H=()=>t(0,r=""),W=()=>g(c+1),G=()=>T();return n.$$set=U=>{"filter"in U&&t(0,r=U.filter),"presets"in U&&t(15,a=U.presets),"sort"in U&&t(1,f=U.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof f<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=au),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=u.length&&l===u.length)},[r,f,g,u,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,H,W,G]}class f2 extends ge{constructor(e){super(),_e(this,e,a2,o2,pe,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela @@ -22,71 +22,71 @@ var d0=Object.defineProperty;var p0=(n,e,t)=>e in n?d0(n,e,{enumerable:!0,config * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function ri(){}const A2=(()=>{let n=0;return()=>n++})();function jt(n){return n===null||typeof n>"u"}function Xt(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 nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function rn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Zn(n,e){return rn(n)?n:e}function vt(n,e){return typeof n>"u"?e:n}const L2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let l,s,o;if(Xt(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function F2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function R2(n){const e=F2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ao(n,e){return(pu[e]||(pu[e]=R2(e)))(n)}function Aa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Lo=n=>typeof n<"u",Ei=n=>typeof n=="function",mu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function q2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const on=Math.PI,ti=2*on,j2=ti+on,No=Number.POSITIVE_INFINITY,H2=on/180,Vn=on/2,qi=on/4,hu=on*2/3,Qr=Math.log10,Ml=Math.sign;function es(n,e,t){return Math.abs(n-e)l-s).pop(),e}function ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function V2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function B2(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Ki=(n,e,t,i)=>La(n,t,i?l=>{const s=n[l][e];return sn[l][e]La(n,t,i=>n[i][e]>=t);function Z2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Aa(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function bu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(ab.forEach(s=>{delete n[s]}),delete n._chartjs)}function X2(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const fb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ub(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,fb.call(window,()=>{i=!1,n.apply(e,t)}))}}function Q2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const x2=n=>n==="start"?"left":n==="end"?"right":"center",ku=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ew(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=Bn(Math.min(Ki(r,a,f).lo,t?i:Ki(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?s=Bn(Math.max(Ki(r,o.axis,u,!0).hi+1,t?0:Ki(e,a,o.getPixelForValue(u),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function tw(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Vs=n=>n===0||n===1,yu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ti/t)),vu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ti/t)+1,ts={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*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(on*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Vs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Vs(n)?n:yu(n,.075,.3),easeOutElastic:n=>Vs(n)?n:vu(n,.075,.3),easeInOutElastic(n){return Vs(n)?n:n<.5?.5*yu(n*2,.1125,.45):.5+.5*vu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-ts.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ts.easeInBounce(n*2)*.5:ts.easeOutBounce(n*2-1)*.5+.5};function Na(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wu(n){return Na(n)?n:new us(n)}function _r(n){return Na(n)?n:new us(n).saturate(.5).darken(.1).hexString()}const nw=["x","y","borderWidth","radius","tension"],iw=["color","borderColor","backgroundColor"];function lw(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:iw},numbers:{type:"number",properties:nw}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function sw(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Su=new Map;function ow(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Su.get(t);return i||(i=new Intl.NumberFormat(n,e),Su.set(t,i)),i}function cb(n,e,t){return ow(e,t).format(n)}const db={values(n){return Xt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(l="scientific"),s=rw(n,t)}const o=Qr(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),cb(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Qr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?db.numeric.call(this,n,e,t):""}};function rw(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var pb={formatters:db};function aw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:pb.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Qi=Object.create(null),ea=Object.create(null);function ns(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>_r(l.backgroundColor),this.hoverBorderColor=(i,l)=>_r(l.borderColor),this.hoverColor=(i,l)=>_r(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return gr(this,e,t)}get(e){return ns(this,e)}describe(e,t){return gr(ea,e,t)}override(e,t){return gr(Qi,e,t)}route(e,t,i,l){const s=ns(this,e),o=ns(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[l];return nt(a)?Object.assign({},f,a):vt(a,f)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Ut=new fw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lw,sw,aw]);function uw(n){return!n||jt(n.size)||jt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function $u(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function ji(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Tu(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function ta(n,e,t,i){cw(n,e,t,i)}function cw(n,e,t,i,l){let s,o,r,a,f,u,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*H2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,ti),n.closePath();break;case"triangle":u=_,n.moveTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=hu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=hu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":f=_*.516,a=_-f,o=Math.cos(g+qi)*a,c=Math.cos(g+qi)*a,r=Math.sin(g+qi)*a,d=Math.sin(g+qi)*a,n.arc(t-c,i-r,f,g-on,g-Vn),n.arc(t+d,i-o,f,g-Vn,g),n.arc(t+c,i+r,f,g,g+Vn),n.arc(t-d,i+o,f,g+Vn,g+on),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,u=a,n.rect(t-u,i-a,2*u,2*a);break}g+=qi;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=qi;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=qi,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ps(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,f;for(n.save(),n.font=l.string,mw(n,s),a=0;a+n||0;function mb(n,e){const t={},i=nt(e),l=i?Object.keys(e):e,s=nt(n)?i?o=>vt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=yw(s(o));return t}function vw(n){return mb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function co(n){return mb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ii(n){const e=vw(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ei(n,e){n=n||{},e=e||Ut.font;let t=vt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=vt(n.style,e.style);i&&!(""+i).match(bw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:vt(n.family,e.family),lineHeight:kw(vt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:vt(n.weight,e.weight),string:""};return l.string=uw(l),l}function Bs(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function ll(n,e){return Object.assign(Object.create(n),e)}function Ra(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=bb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Ra([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return _b(r,a,()=>Ew(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Du(r).includes(a)},ownKeys(r){return Du(r)},set(r,a,f){const u=r._storage||(r._storage=l());return r[a]=u[a]=f,delete r._keys,!0}})}function Dl(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:hb(n,i),setContext:s=>Dl(n,s,t,i),override:s=>Dl(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return _b(s,o,()=>$w(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function hb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Ei(t)?t:()=>t,isIndexable:Ei(i)?i:()=>i}}const Sw=(n,e)=>n?n+Aa(e):e,qa=(n,e)=>nt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _b(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function $w(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Ei(r)&&o.isScriptable(e)&&(r=Tw(e,r,n,t)),Xt(r)&&r.length&&(r=Cw(e,r,n,o.isIndexable)),qa(e,r)&&(r=Dl(r,l,s&&s[e],o)),r}function Tw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),qa(n,a)&&(a=ja(l._scopes,l,n,a)),a}function Cw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(nt(e[0])){const a=e,f=l._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=ja(f,l,n,u);e.push(Dl(c,s,o&&o[n],r))}}return e}function gb(n,e,t){return Ei(n)?n(e,t):n}const Ow=(n,e)=>n===!0?e:typeof n=="string"?Ao(e,n):void 0;function Mw(n,e,t,i,l){for(const s of e){const o=Ow(t,s);if(o){n.add(o);const r=gb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function ja(n,e,t,i){const l=e._rootScopes,s=gb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Mu(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Mu(r,o,s,a,i),a===null)?!1:Ra(Array.from(r),[""],l,s,()=>Dw(e,t,i))}function Mu(n,e,t,i,l){for(;t;)t=Mw(n,e,t,i,l);return t}function Dw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Xt(l)&&nt(t)?t:l||{}}function Ew(n,e,t,i){let l;for(const s of e)if(l=bb(Sw(s,n),t),typeof l<"u")return qa(n,l)?ja(t,i,n,l):l}function bb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Du(n){let e=n._keys;return e||(e=n._keys=Iw(n._scopes)),e}function Iw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const Aw=Number.EPSILON||1e-14,El=(n,e)=>en==="x"?"y":"x";function Lw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=xr(s,l),a=xr(o,s);let f=r/(r+a),u=a/(r+a);f=isNaN(f)?0:f,u=isNaN(u)?0:u;const c=i*f,d=i*u;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Nw(n,e,t){const i=n.length;let l,s,o,r,a,f=El(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")Fw(n,l);else{let f=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function jw(n,e){return xo(n).getPropertyValue(e)}const Hw=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Hw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Vw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(zw(l,s,n.target))r=l,a=s;else{const f=e.getBoundingClientRect();r=i.clientX-f.left,a=i.clientY-f.top,o=!0}return{x:r,y:a,box:o}}function Vi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=xo(t),s=l.boxSizing==="border-box",o=Zi(l,"padding"),r=Zi(l,"border","width"),{x:a,y:f,box:u}=Vw(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/h*t.height/i)}}function Bw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&za(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=xo(s),a=Zi(r,"border","width"),f=Zi(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Po(r.maxWidth,s,"clientWidth"),l=Po(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||No,maxHeight:l||No}}const Ws=n=>Math.round(n*10)/10;function Uw(n,e,t,i){const l=xo(n),s=Zi(l,"margin"),o=Po(l.maxWidth,n,"clientWidth")||No,r=Po(l.maxHeight,n,"clientHeight")||No,a=Bw(n,e,t);let{width:f,height:u}=a;if(l.boxSizing==="content-box"){const d=Zi(l,"border","width"),m=Zi(l,"padding");f-=m.width+d.width,u-=m.height+d.height}return f=Math.max(0,f-s.width),u=Math.max(0,i?f/i:u-s.height),f=Ws(Math.min(f,o,a.maxWidth)),u=Ws(Math.min(u,r,a.maxHeight)),f&&!u&&(u=Ws(f/2)),(e!==void 0||t!==void 0)&&i&&a.height&&u>a.height&&(u=a.height,f=Ws(Math.floor(u*i))),{width:f,height:u}}function Eu(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ww=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ha()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Iu(n,e){const t=jw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Yw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Kw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Bi(n,l,t),r=Bi(l,s,t),a=Bi(s,e,t),f=Bi(o,r,t),u=Bi(r,a,t);return Bi(f,u,t)}const Jw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Zw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function br(n,e,t){return n?Jw(e,t):Zw()}function Gw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Xw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function yb(n){return n==="angle"?{between:ob,compare:Y2,normalize:Qn}:{between:rb,compare:(e,t)=>e-t,normalize:e=>e}}function Au({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Qw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=yb(i),a=e.length;let{start:f,end:u,loop:c}=n,d,m;if(c){for(f+=a,u+=a,d=0,m=a;da(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),O=()=>_||$(),D=()=>!_||C();for(let I=u,L=u;I<=c;++I)S=e[I%o],!S.skip&&(y=f(S[i]),y!==T&&(_=a(y,l,s),g===null&&O()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Au({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Au({start:g,end:c,loop:d,count:o,style:m})),h}function wb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function e3(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%l];f.skip||f.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function t3(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=xw(t,l,s,i);if(i===!0)return Lu(n,[{start:o,end:r,loop:s}],t,e);const a=r{let n=0;return()=>n++})();function Ht(n){return n===null||typeof n>"u"}function Xt(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 nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function rn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Zn(n,e){return rn(n)?n:e}function wt(n,e){return typeof n>"u"?e:n}const L2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function jt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ht(n,e,t,i){let l,s,o;if(Xt(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function F2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function R2(n){const e=F2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ao(n,e){return(pu[e]||(pu[e]=R2(e)))(n)}function Aa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Lo=n=>typeof n<"u",Ei=n=>typeof n=="function",mu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function q2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const on=Math.PI,ti=2*on,j2=ti+on,No=Number.POSITIVE_INFINITY,H2=on/180,Vn=on/2,qi=on/4,hu=on*2/3,Qr=Math.log10,Ml=Math.sign;function es(n,e,t){return Math.abs(n-e)l-s).pop(),e}function ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function V2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function B2(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&f=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Ki=(n,e,t,i)=>La(n,t,i?l=>{const s=n[l][e];return sn[l][e]La(n,t,i=>n[i][e]>=t);function Z2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Aa(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function bu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(ab.forEach(s=>{delete n[s]}),delete n._chartjs)}function X2(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const fb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ub(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,fb.call(window,()=>{i=!1,n.apply(e,t)}))}}function Q2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const x2=n=>n==="start"?"left":n==="end"?"right":"center",ku=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ew(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:f,max:u,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=Bn(Math.min(Ki(r,a,f).lo,t?i:Ki(e,a,o.getPixelForValue(f)).lo),0,i-1)),d?s=Bn(Math.max(Ki(r,o.axis,u,!0).hi+1,t?0:Ki(e,a,o.getPixelForValue(u),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function tw(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Vs=n=>n===0||n===1,yu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ti/t)),vu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ti/t)+1,ts={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*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(on*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Vs(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Vs(n)?n:yu(n,.075,.3),easeOutElastic:n=>Vs(n)?n:vu(n,.075,.3),easeInOutElastic(n){return Vs(n)?n:n<.5?.5*yu(n*2,.1125,.45):.5+.5*vu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-ts.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ts.easeInBounce(n*2)*.5:ts.easeOutBounce(n*2-1)*.5+.5};function Na(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wu(n){return Na(n)?n:new us(n)}function _r(n){return Na(n)?n:new us(n).saturate(.5).darken(.1).hexString()}const nw=["x","y","borderWidth","radius","tension"],iw=["color","borderColor","backgroundColor"];function lw(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:iw},numbers:{type:"number",properties:nw}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function sw(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Su=new Map;function ow(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Su.get(t);return i||(i=new Intl.NumberFormat(n,e),Su.set(t,i)),i}function cb(n,e,t){return ow(e,t).format(n)}const db={values(n){return Xt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(l="scientific"),s=rw(n,t)}const o=Qr(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),cb(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Qr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?db.numeric.call(this,n,e,t):""}};function rw(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var pb={formatters:db};function aw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:pb.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Qi=Object.create(null),ea=Object.create(null);function ns(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>_r(l.backgroundColor),this.hoverBorderColor=(i,l)=>_r(l.borderColor),this.hoverColor=(i,l)=>_r(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return gr(this,e,t)}get(e){return ns(this,e)}describe(e,t){return gr(ea,e,t)}override(e,t){return gr(Qi,e,t)}route(e,t,i,l){const s=ns(this,e),o=ns(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],f=o[l];return nt(a)?Object.assign({},f,a):wt(a,f)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Wt=new fw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lw,sw,aw]);function uw(n){return!n||Ht(n.size)||Ht(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function $u(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function ji(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Tu(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function ta(n,e,t,i){cw(n,e,t,i)}function cw(n,e,t,i,l){let s,o,r,a,f,u,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*H2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,ti),n.closePath();break;case"triangle":u=_,n.moveTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=hu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),g+=hu,n.lineTo(t+Math.sin(g)*u,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":f=_*.516,a=_-f,o=Math.cos(g+qi)*a,c=Math.cos(g+qi)*a,r=Math.sin(g+qi)*a,d=Math.sin(g+qi)*a,n.arc(t-c,i-r,f,g-on,g-Vn),n.arc(t+d,i-o,f,g-Vn,g),n.arc(t+c,i+r,f,g,g+Vn),n.arc(t-d,i+o,f,g+Vn,g+on),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,u=a,n.rect(t-u,i-a,2*u,2*a);break}g+=qi;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=qi;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=qi,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ps(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,f;for(n.save(),n.font=l.string,mw(n,s),a=0;a+n||0;function mb(n,e){const t={},i=nt(e),l=i?Object.keys(e):e,s=nt(n)?i?o=>wt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=yw(s(o));return t}function vw(n){return mb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function co(n){return mb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ii(n){const e=vw(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ei(n,e){n=n||{},e=e||Wt.font;let t=wt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=wt(n.style,e.style);i&&!(""+i).match(bw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:wt(n.family,e.family),lineHeight:kw(wt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:wt(n.weight,e.weight),string:""};return l.string=uw(l),l}function Bs(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function ll(n,e){return Object.assign(Object.create(n),e)}function Ra(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=bb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Ra([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return _b(r,a,()=>Ew(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Du(r).includes(a)},ownKeys(r){return Du(r)},set(r,a,f){const u=r._storage||(r._storage=l());return r[a]=u[a]=f,delete r._keys,!0}})}function Dl(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:hb(n,i),setContext:s=>Dl(n,s,t,i),override:s=>Dl(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return _b(s,o,()=>$w(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function hb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Ei(t)?t:()=>t,isIndexable:Ei(i)?i:()=>i}}const Sw=(n,e)=>n?n+Aa(e):e,qa=(n,e)=>nt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _b(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function $w(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Ei(r)&&o.isScriptable(e)&&(r=Tw(e,r,n,t)),Xt(r)&&r.length&&(r=Cw(e,r,n,o.isIndexable)),qa(e,r)&&(r=Dl(r,l,s&&s[e],o)),r}function Tw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),qa(n,a)&&(a=ja(l._scopes,l,n,a)),a}function Cw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(nt(e[0])){const a=e,f=l._scopes.filter(u=>u!==a);e=[];for(const u of a){const c=ja(f,l,n,u);e.push(Dl(c,s,o&&o[n],r))}}return e}function gb(n,e,t){return Ei(n)?n(e,t):n}const Ow=(n,e)=>n===!0?e:typeof n=="string"?Ao(e,n):void 0;function Mw(n,e,t,i,l){for(const s of e){const o=Ow(t,s);if(o){n.add(o);const r=gb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function ja(n,e,t,i){const l=e._rootScopes,s=gb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Mu(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Mu(r,o,s,a,i),a===null)?!1:Ra(Array.from(r),[""],l,s,()=>Dw(e,t,i))}function Mu(n,e,t,i,l){for(;t;)t=Mw(n,e,t,i,l);return t}function Dw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Xt(l)&&nt(t)?t:l||{}}function Ew(n,e,t,i){let l;for(const s of e)if(l=bb(Sw(s,n),t),typeof l<"u")return qa(n,l)?ja(t,i,n,l):l}function bb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Du(n){let e=n._keys;return e||(e=n._keys=Iw(n._scopes)),e}function Iw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const Aw=Number.EPSILON||1e-14,El=(n,e)=>en==="x"?"y":"x";function Lw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=xr(s,l),a=xr(o,s);let f=r/(r+a),u=a/(r+a);f=isNaN(f)?0:f,u=isNaN(u)?0:u;const c=i*f,d=i*u;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Nw(n,e,t){const i=n.length;let l,s,o,r,a,f=El(n,0);for(let u=0;u!f.skip)),e.cubicInterpolationMode==="monotone")Fw(n,l);else{let f=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function jw(n,e){return xo(n).getPropertyValue(e)}const Hw=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Hw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Vw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(zw(l,s,n.target))r=l,a=s;else{const f=e.getBoundingClientRect();r=i.clientX-f.left,a=i.clientY-f.top,o=!0}return{x:r,y:a,box:o}}function Vi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=xo(t),s=l.boxSizing==="border-box",o=Zi(l,"padding"),r=Zi(l,"border","width"),{x:a,y:f,box:u}=Vw(n,t),c=o.left+(u&&r.left),d=o.top+(u&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((f-d)/h*t.height/i)}}function Bw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&za(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=xo(s),a=Zi(r,"border","width"),f=Zi(r,"padding");e=o.width-f.width-a.width,t=o.height-f.height-a.height,i=Po(r.maxWidth,s,"clientWidth"),l=Po(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||No,maxHeight:l||No}}const Ws=n=>Math.round(n*10)/10;function Uw(n,e,t,i){const l=xo(n),s=Zi(l,"margin"),o=Po(l.maxWidth,n,"clientWidth")||No,r=Po(l.maxHeight,n,"clientHeight")||No,a=Bw(n,e,t);let{width:f,height:u}=a;if(l.boxSizing==="content-box"){const d=Zi(l,"border","width"),m=Zi(l,"padding");f-=m.width+d.width,u-=m.height+d.height}return f=Math.max(0,f-s.width),u=Math.max(0,i?f/i:u-s.height),f=Ws(Math.min(f,o,a.maxWidth)),u=Ws(Math.min(u,r,a.maxHeight)),f&&!u&&(u=Ws(f/2)),(e!==void 0||t!==void 0)&&i&&a.height&&u>a.height&&(u=a.height,f=Ws(Math.floor(u*i))),{width:f,height:u}}function Eu(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ww=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ha()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Iu(n,e){const t=jw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Yw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Kw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Bi(n,l,t),r=Bi(l,s,t),a=Bi(s,e,t),f=Bi(o,r,t),u=Bi(r,a,t);return Bi(f,u,t)}const Jw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Zw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function br(n,e,t){return n?Jw(e,t):Zw()}function Gw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Xw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function yb(n){return n==="angle"?{between:ob,compare:Y2,normalize:Qn}:{between:rb,compare:(e,t)=>e-t,normalize:e=>e}}function Au({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Qw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=yb(i),a=e.length;let{start:f,end:u,loop:c}=n,d,m;if(c){for(f+=a,u+=a,d=0,m=a;da(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),O=()=>_||$(),D=()=>!_||C();for(let I=u,L=u;I<=c;++I)S=e[I%o],!S.skip&&(y=f(S[i]),y!==T&&(_=a(y,l,s),g===null&&O()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Au({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Au({start:g,end:c,loop:d,count:o,style:m})),h}function wb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function e3(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%l];f.skip||f.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=f.stop?a:null):(o=a,r.skip&&(e=a)),r=f}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function t3(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=xw(t,l,s,i);if(i===!0)return Lu(n,[{start:o,end:r,loop:s}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=fb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new l3;const Pu="transparent",s3={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=wu(n||Pu),l=i.valid&&wu(e||Pu);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class o3{constructor(e,t,i,l){const s=t[i];l=Bs([e.to,l,s,e.from]);const o=Bs([e.from,s,l]);this._active=!0,this._fn=e.fn||s3[e.type||typeof o],this._easing=ts[e.easing]||ts.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Bs([e.to,t,l,e.from]),this._from=Bs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!nt(s))return;const o={};for(const r of t)o[r]=s[r];(Xt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=a3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&r3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new o3(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function r3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function ju(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,f=o.axis,u=d3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function h3(n,e){return ll(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function _3(n,e,t){return ll(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function zl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const vr=n=>n==="reset"||n==="none",Hu=(n,e)=>e?n:Object.assign({},n),g3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:$b(t,!0),values:null};class is{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=kr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&zl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=vt(i.xAxisID,yr(e,"x")),o=t.yAxisID=vt(i.yAxisID,yr(e,"y")),r=t.rAxisID=vt(i.rAxisID,yr(e,"r")),a=t.indexAxis,f=t.iAxisID=l(a,s,o,r),u=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&bu(this._data,this),e._stacked&&zl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(nt(t)){const l=this._cachedMeta;this._data=c3(t,l)}else if(i!==t){if(i){bu(i,this);const l=this._cachedMeta;zl(l),l._parsed=[]}t&&Object.isExtensible(t)&&G2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=kr(t.vScale,t),t.stack!==i.stack&&(l=!0,zl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(ju(this,t._parsed),t._stacked=kr(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Xt(l[e])?d=this.parseArrayData(i,l,e,t):nt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||f&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=f.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(Hu(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const u=this.chart.config,c=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),c);a=u.createResolver(d,this.getContext(e,i,t))}const f=new Sb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){vr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,f]of this._syncList)this[r](a,f);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let C=0;C=S){D.skip=!0;continue}const I=this.getParsed(C),L=jt(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=f.data[C]),c&&(D.options=u||this.resolveDataElementOptions(C,O.active?"active":l)),y||this.updateElement(O,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ze(po,"id","line"),Ze(po,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ze(po,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Va{constructor(e){Ze(this,"options");this.options=e||{}}static override(e){Object.assign(Va.prototype,e)}init(){}formats(){return Hi()}parse(){return Hi()}format(){return Hi()}add(){return Hi()}diff(){return Hi()}startOf(){return Hi()}endOf(){return Hi()}}var Tb={_date:Va};function b3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?J2:Ki;if(i){if(l._sharedOptions){const f=s[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(s,e,t-u),d=a(s,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function Ms(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var w3={evaluateInteractionItems:Ms,modes:{index(n,e,t,i){const l=Vi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const u=r[0].index,c=f.data[u];c&&!c.skip&&a.push({element:c,datasetIndex:f.index,index:u})}),a):[]},dataset(n,e,t,i){const l=Vi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,f=n.getDatasetMeta(a).data;r=[];for(let u=0;ut.pos===e)}function Vu(n,e){return n.filter(t=>Cb.indexOf(t.pos)===-1&&t.box.axis===e)}function Bl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function S3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Bl(Vl(e,"left"),!0),l=Bl(Vl(e,"right")),s=Bl(Vl(e,"top"),!0),o=Bl(Vl(e,"bottom")),r=Vu(e,"x"),a=Vu(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Vl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Bu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Ob(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function O3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!nt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Ob(o,s.getPadding());const r=Math.max(0,e.outerWidth-Bu(o,n,"left","right")),a=Math.max(0,e.outerHeight-Bu(o,n,"top","bottom")),f=r!==n.w,u=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:f,other:u}:{same:u,other:f}}function M3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function D3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Zl(n,e,t,i){const l=[];let s,o,r,a,f,u;for(s=0,o=n.length,f=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},l);Ob(d,Ii(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=T3(a.concat(f),c);Zl(r.fullSize,m,c,h),Zl(a,m,c,h),Zl(f,m,c,h)&&Zl(a,m,c,h),M3(m),Uu(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Uu(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Mb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class E3 extends Mb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const mo="$chartjs",I3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Wu=n=>n===null||n==="";function A3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[mo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Wu(l)){const s=Iu(n,"width");s!==void 0&&(n.width=s)}if(Wu(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Iu(n,"height");s!==void 0&&(n.height=s)}return n}const Db=Ww?{passive:!0}:!1;function L3(n,e,t){n&&n.addEventListener(e,t,Db)}function N3(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Db)}function P3(n,e){const t=I3[n.type]||n.type,{x:i,y:l}=Vi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Fo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function F3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Fo(r.addedNodes,i),o=o&&!Fo(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function R3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Fo(r.removedNodes,i),o=o&&!Fo(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const ms=new Map;let Yu=0;function Eb(){const n=window.devicePixelRatio;n!==Yu&&(Yu=n,ms.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function q3(n,e){ms.size||window.addEventListener("resize",Eb),ms.set(n,e)}function j3(n){ms.delete(n),ms.size||window.removeEventListener("resize",Eb)}function H3(n,e,t){const i=n.canvas,l=i&&za(i);if(!l)return;const s=ub((r,a)=>{const f=l.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||s(f,u)});return o.observe(l),q3(n,s),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&j3(n)}function z3(n,e,t){const i=n.canvas,l=ub(s=>{n.ctx!==null&&t(P3(s,n))},n);return L3(i,e,l),l}class V3 extends Mb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(A3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[mo])return!1;const i=t[mo].initial;["height","width"].forEach(s=>{const o=i[s];jt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[mo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:F3,detach:R3,resize:H3}[t]||z3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:$r,detach:$r,resize:$r}[t]||N3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Uw(e,t,i,l)}isAttached(e){const t=e&&za(e);return!!(t&&t.isConnected)}}function B3(n){return!Ha()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?E3:V3}class xi{constructor(){Ze(this,"x");Ze(this,"y");Ze(this,"active",!1);Ze(this,"options");Ze(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return ds(this.x)&&ds(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ze(xi,"defaults",{}),Ze(xi,"defaultRoutes");function U3(n,e){const t=n.options.ticks,i=W3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?K3(e):[],o=s.length,r=s[0],a=s[o-1],f=[];if(o>l)return J3(e,f,s,o/l),f;const u=Y3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Js(e,f,u,jt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function K3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Ku=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Ju=(n,e)=>Math.min(e||n,n);function Zu(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function Q3(n,e){gt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:Zn(t,Zn(i,t)),max:Zn(i,Zn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){qt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ww(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ul(e.grid)-t.padding-Gu(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=U2(Math.min(Math.asin(Bn((u.highest.height+6)/r,-1,1)),Math.asin(Bn(a/f,-1,1))-Math.asin(Bn(d/f,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Gu(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ul(s)+a):(e.height=this.maxHeight,e.width=Ul(s)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Yi(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,f=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?f?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let u=t.height/2,c=e.height/2;s==="start"?(u=0,c=e.height):s==="end"&&(u=t.height,c=0),this.paddingTop=u+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){qt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(O),highest:I(D),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return K2(this._alignToPixels?ji(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,f=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ul(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(W){return ji(i,W,_)};let S,T,$,C,O,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),O=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,O=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}O=S-g,I=O-d,R=e.left,N=e.right}const q=vt(l.ticks.maxTicksLimit,c),H=Math.max(1,Math.ceil(c/q));for(T=0;T0&&(xe-=He/2);break}te={left:xe,top:Xe,width:He+pe.width,height:Ne+pe.height,color:H.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:G,strokeColor:U,strokeWidth:Y,textAlign:ie,textBaseline:P,translation:[C,O],backdrop:te}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Yi(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let f,u;return t==="left"?l?(u=this.right+s,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u+=a)):(u=this.right-r,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u=this.left)):t==="right"?l?(u=this.left+s,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u-=a)):(u=this.left+r,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u=this.right)):f="right",{textAlign:f,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,f,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Ut.route(s,l,a,r)})}function s4(n){return"id"in n&&"defaults"in n}class o4{constructor(){this.controllers=new Zs(is,"datasets",!0),this.elements=new Zs(xi,"elements"),this.plugins=new Zs(Object,"plugins"),this.scales=new Zs(Ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):gt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Aa(e);qt(i["before"+l],[],i),t[e](i),qt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function a4(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let s=0;s1&&Xu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Qu(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function h4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Qu(n,"x",t[0])||Qu(n,"y",t[0])}return{}}function _4(n,e){const t=Qi[n.type]||{scales:{}},i=e.scales||{},l=na(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!nt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ia(o,r,h4(o,n),Ut.scales[r.type]),f=p4(a,l),u=t.scales||{};s[o]=xl(Object.create(null),[{axis:a},r,u[a],u[f]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||na(r,e),u=(Qi[r]||{}).scales||{};Object.keys(u).forEach(c=>{const d=d4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),xl(s[m],[{axis:d},i[m],u[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];xl(r,[Ut.scales[r.type],Ut.scale])}),s}function Ib(n){const e=n.options||(n.options={});e.plugins=vt(e.plugins,{}),e.scales=_4(n,e)}function Ab(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function g4(n){return n=n||{},n.data=Ab(n.data),Ib(n),n}const xu=new Map,Lb=new Set;function Gs(n,e){let t=xu.get(n);return t||(t=e(),xu.set(n,t),Lb.add(t)),t}const Wl=(n,e,t)=>{const i=Ao(e,t);i!==void 0&&n.add(i)};class b4{constructor(e){this._config=g4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ab(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Ib(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(u=>{e&&(a.add(e),u.forEach(c=>Wl(a,e,c))),u.forEach(c=>Wl(a,l,c)),u.forEach(c=>Wl(a,Qi[s]||{},c)),u.forEach(c=>Wl(a,Ut,c)),u.forEach(c=>Wl(a,ea,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Lb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,Qi[t]||{},Ut.datasets[t]||{},{type:t},Ut,ea]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=ec(this._resolverCache,e,l);let a=o;if(y4(o,t)){s.$shared=!1,i=Ei(i)?i():i;const f=this.createResolver(e,i,r);a=Dl(o,i,f)}for(const f of t)s[f]=a[f];return s}createResolver(e,t,i=[""],l){const{resolver:s}=ec(this._resolverCache,e,i);return nt(t)?Dl(s,t,void 0,l):s}}function ec(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Ra(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const k4=n=>nt(n)&&Object.getOwnPropertyNames(n).some(e=>Ei(n[e]));function y4(n,e){const{isScriptable:t,isIndexable:i}=hb(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Ei(r)||k4(r))||o&&Xt(r))return!0}return!1}var v4="4.4.6";const w4=["top","bottom","left","right","chartArea"];function tc(n,e){return n==="top"||n==="bottom"||w4.indexOf(n)===-1&&e==="x"}function nc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function ic(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),qt(t&&t.onComplete,[n],e)}function S4(n){const e=n.chart,t=e.options.animation;qt(t&&t.onProgress,[n],e)}function Nb(n){return Ha()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ho={},lc=n=>{const e=Nb(n);return Object.values(ho).filter(t=>t.canvas===e).pop()};function $4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function T4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Xs(n,e,t){return n.options.clip?n[t]:e[t]}function C4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Xs(t,e,"left"),right:Xs(t,e,"right"),top:Xs(i,e,"top"),bottom:Xs(i,e,"bottom")}:e}class ci{static register(...e){Xn.add(...e),sc()}static unregister(...e){Xn.remove(...e),sc()}constructor(e,t){const i=this.config=new b4(t),l=Nb(e),s=lc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||B3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=A2(),this.ctx=r,this.canvas=a,this.width=u,this.height=f,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new r4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Q2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ho[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",ic),ai.listen(this,"progress",S4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return jt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Eu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Tu(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Eu(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),qt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=ia(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),gt(s,o=>{const r=o.options,a=r.id,f=ia(a,r),u=vt(r.type,o.dtype);(r.position===void 0||tc(r.position,f)!==tc(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=Xn.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(l,(o,r)=>{o||delete i[r]}),gt(i,o=>{Ks.configure(this,o,o.options),Ks.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let f=0,u=this.data.datasets.length;f{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(nc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{Ks.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!mu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;$4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ks.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=C4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Pa(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Fa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ps(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=w3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=ll(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Lo(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};gt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},l=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},s=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Eo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=q2(e),f=T4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,qt(s.onHover,[e,r,this],this),a&&qt(s.onClick,[e,r,this],this));const u=!Eo(r,l);return(u||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ze(ci,"defaults",Ut),Ze(ci,"instances",ho),Ze(ci,"overrides",Qi),Ze(ci,"registry",Xn),Ze(ci,"version",v4),Ze(ci,"getChart",lc);function sc(){return gt(ci.instances,n=>n._plugins.invalidate())}function Pb(n,e,t=e){n.lineCap=vt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(vt(t.borderDash,e.borderDash)),n.lineDashOffset=vt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=vt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=vt(t.borderWidth,e.borderWidth),n.strokeStyle=vt(t.borderColor,e.borderColor)}function O4(n,e,t){n.lineTo(t.x,t.y)}function M4(n){return n.stepped?dw:n.tension||n.cubicInterpolationMode==="monotone"?pw:O4}function Fb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),f=Math.min(s,r),u=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(u,g),n.lineTo(u,_),n.lineTo(u,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,O=$|0;O===h?(C<_?_=C:C>g&&(g=C),u=(c*u+$)/++c):(T(),n.lineTo($,C),h=O,c=0,_=g=C),y=C}T()}function la(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?E4:D4}function I4(n){return n.stepped?Yw:n.tension||n.cubicInterpolationMode==="monotone"?Kw:Bi}function A4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Pb(n,e.options),n.stroke(l)}function L4(n,e,t,i){const{segments:l,options:s}=e,o=la(e);for(const r of l)Pb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const N4=typeof Path2D=="function";function P4(n,e,t,i){N4&&!e.options.segment?A4(n,e,t,i):L4(n,e,t,i)}class Ti extends xi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;qw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=t3(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=wb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=I4(i);let f,u;for(f=0,u=o.length;fe!=="borderDash"&&e!=="fill"});function oc(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Ba(o,r,l);const a=l[o],f=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:f.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:f.y}))}),s}function Ba(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function rc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Rb(n,e){let t=[],i=!1;return Xt(n)?(i=!0,t=n):t=R4(n,e),t.length?new Ti({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ac(n){return n&&n.fill!==!1}function q4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!rn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function j4(n,e,t){const i=B4(n);if(nt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return rn(l)&&Math.floor(l)===l?H4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function H4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function z4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:nt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function V4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:nt(n)?i=n.value:i=e.getBaseValue(),i}function B4(n){const e=n.options,t=e.fill;let i=vt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function U4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=W4(e,t);r.push(Rb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Tr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;ac(s)&&Tr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ac(i)||t.drawTime!=="beforeDatasetDraw"||Tr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gl={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;sr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=fb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new l3;const Pu="transparent",s3={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=wu(n||Pu),l=i.valid&&wu(e||Pu);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class o3{constructor(e,t,i,l){const s=t[i];l=Bs([e.to,l,s,e.from]);const o=Bs([e.from,s,l]);this._active=!0,this._fn=e.fn||s3[e.type||typeof o],this._easing=ts[e.easing]||ts.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Bs([e.to,t,l,e.from]),this._from=Bs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!nt(s))return;const o={};for(const r of t)o[r]=s[r];(Xt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=a3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&r3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new o3(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function r3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function ju(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,f=o.axis,u=d3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function h3(n,e){return ll(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function _3(n,e,t){return ll(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function zl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const vr=n=>n==="reset"||n==="none",Hu=(n,e)=>e?n:Object.assign({},n),g3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:$b(t,!0),values:null};class is{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=kr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&zl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=wt(i.xAxisID,yr(e,"x")),o=t.yAxisID=wt(i.yAxisID,yr(e,"y")),r=t.rAxisID=wt(i.rAxisID,yr(e,"r")),a=t.indexAxis,f=t.iAxisID=l(a,s,o,r),u=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&bu(this._data,this),e._stacked&&zl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(nt(t)){const l=this._cachedMeta;this._data=c3(t,l)}else if(i!==t){if(i){bu(i,this);const l=this._cachedMeta;zl(l),l._parsed=[]}t&&Object.isExtensible(t)&&G2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=kr(t.vScale,t),t.stack!==i.stack&&(l=!0,zl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(ju(this,t._parsed),t._stacked=kr(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,f=e>0&&i._parsed[e-1],u,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Xt(l[e])?d=this.parseArrayData(i,l,e,t):nt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||f&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(f,e,m,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),_=f.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(Hu(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const u=this.chart.config,c=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),c);a=u.createResolver(d,this.getContext(e,i,t))}const f=new Sb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){vr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,f]of this._syncList)this[r](a,f);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(f.length+=t,r=f.length-1;r>=o;r--)f[r]=f[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let C=0;C=S){D.skip=!0;continue}const I=this.getParsed(C),L=Ht(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=f.data[C]),c&&(D.options=u||this.resolveDataElementOptions(C,O.active?"active":l)),y||this.updateElement(O,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ge(po,"id","line"),Ge(po,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ge(po,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Va{constructor(e){Ge(this,"options");this.options=e||{}}static override(e){Object.assign(Va.prototype,e)}init(){}formats(){return Hi()}parse(){return Hi()}format(){return Hi()}add(){return Hi()}diff(){return Hi()}startOf(){return Hi()}endOf(){return Hi()}}var Tb={_date:Va};function b3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?J2:Ki;if(i){if(l._sharedOptions){const f=s[0],u=typeof f.getRange=="function"&&f.getRange(e);if(u){const c=a(s,e,t-u),d=a(s,e,t+u);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function Ms(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:f,index:u}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var w3={evaluateInteractionItems:Ms,modes:{index(n,e,t,i){const l=Vi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const u=r[0].index,c=f.data[u];c&&!c.skip&&a.push({element:c,datasetIndex:f.index,index:u})}),a):[]},dataset(n,e,t,i){const l=Vi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,f=n.getDatasetMeta(a).data;r=[];for(let u=0;ut.pos===e)}function Vu(n,e){return n.filter(t=>Cb.indexOf(t.pos)===-1&&t.box.axis===e)}function Bl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function S3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tf.box.fullSize),!0),i=Bl(Vl(e,"left"),!0),l=Bl(Vl(e,"right")),s=Bl(Vl(e,"top"),!0),o=Bl(Vl(e,"bottom")),r=Vu(e,"x"),a=Vu(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Vl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Bu(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Ob(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function O3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!nt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Ob(o,s.getPadding());const r=Math.max(0,e.outerWidth-Bu(o,n,"left","right")),a=Math.max(0,e.outerHeight-Bu(o,n,"top","bottom")),f=r!==n.w,u=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:f,other:u}:{same:u,other:f}}function M3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function D3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Zl(n,e,t,i){const l=[];let s,o,r,a,f,u;for(s=0,o=n.length,f=0;s{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},l);Ob(d,Ii(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=T3(a.concat(f),c);Zl(r.fullSize,m,c,h),Zl(a,m,c,h),Zl(f,m,c,h)&&Zl(a,m,c,h),M3(m),Uu(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Uu(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},ht(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Mb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class E3 extends Mb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const mo="$chartjs",I3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Wu=n=>n===null||n==="";function A3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[mo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Wu(l)){const s=Iu(n,"width");s!==void 0&&(n.width=s)}if(Wu(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Iu(n,"height");s!==void 0&&(n.height=s)}return n}const Db=Ww?{passive:!0}:!1;function L3(n,e,t){n&&n.addEventListener(e,t,Db)}function N3(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Db)}function P3(n,e){const t=I3[n.type]||n.type,{x:i,y:l}=Vi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Fo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function F3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Fo(r.addedNodes,i),o=o&&!Fo(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function R3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Fo(r.removedNodes,i),o=o&&!Fo(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const ms=new Map;let Yu=0;function Eb(){const n=window.devicePixelRatio;n!==Yu&&(Yu=n,ms.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function q3(n,e){ms.size||window.addEventListener("resize",Eb),ms.set(n,e)}function j3(n){ms.delete(n),ms.size||window.removeEventListener("resize",Eb)}function H3(n,e,t){const i=n.canvas,l=i&&za(i);if(!l)return;const s=ub((r,a)=>{const f=l.clientWidth;t(r,a),f{const a=r[0],f=a.contentRect.width,u=a.contentRect.height;f===0&&u===0||s(f,u)});return o.observe(l),q3(n,s),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&j3(n)}function z3(n,e,t){const i=n.canvas,l=ub(s=>{n.ctx!==null&&t(P3(s,n))},n);return L3(i,e,l),l}class V3 extends Mb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(A3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[mo])return!1;const i=t[mo].initial;["height","width"].forEach(s=>{const o=i[s];Ht(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[mo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:F3,detach:R3,resize:H3}[t]||z3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:$r,detach:$r,resize:$r}[t]||N3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Uw(e,t,i,l)}isAttached(e){const t=e&&za(e);return!!(t&&t.isConnected)}}function B3(n){return!Ha()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?E3:V3}class xi{constructor(){Ge(this,"x");Ge(this,"y");Ge(this,"active",!1);Ge(this,"options");Ge(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return ds(this.x)&&ds(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ge(xi,"defaults",{}),Ge(xi,"defaultRoutes");function U3(n,e){const t=n.options.ticks,i=W3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?K3(e):[],o=s.length,r=s[0],a=s[o-1],f=[];if(o>l)return J3(e,f,s,o/l),f;const u=Y3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Js(e,f,u,Ht(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function K3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Ku=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Ju=(n,e)=>Math.min(e||n,n);function Zu(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function Q3(n,e){ht(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:Zn(t,Zn(i,t)),max:Zn(i,Zn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){jt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ww(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ul(e.grid)-t.padding-Gu(e.title,this.chart.options.font),f=Math.sqrt(c*c+d*d),o=U2(Math.min(Math.asin(Bn((u.highest.height+6)/r,-1,1)),Math.asin(Bn(a/f,-1,1))-Math.asin(Bn(d/f,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){jt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Gu(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ul(s)+a):(e.height=this.maxHeight,e.width=Ul(s)+a),i.display&&this.ticks.length){const{first:f,last:u,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Yi(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(f,u,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,f=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?f?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let u=t.height/2,c=e.height/2;s==="start"?(u=0,c=e.height):s==="end"&&(u=t.height,c=0),this.paddingTop=u+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){jt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(O),highest:I(D),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return K2(this._alignToPixels?ji(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,f=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ul(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(W){return ji(i,W,_)};let S,T,$,C,O,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),O=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,O=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(nt(o)){const W=Object.keys(o)[0],G=o[W];S=y(this.chart.scales[W].getPixelForValue(G))}O=S-g,I=O-d,R=e.left,N=e.right}const q=wt(l.ticks.maxTicksLimit,c),H=Math.max(1,Math.ceil(c/q));for(T=0;T0&&(xe-=He/2);break}ee={left:xe,top:Je,width:He+ce.width,height:Oe+ce.height,color:H.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:G,strokeColor:U,strokeWidth:Y,textAlign:me,textBaseline:P,translation:[C,O],backdrop:ee}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Yi(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let f,u;return t==="left"?l?(u=this.right+s,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u+=a)):(u=this.right-r,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u=this.left)):t==="right"?l?(u=this.left+s,i==="near"?f="right":i==="center"?(f="center",u-=a/2):(f="left",u-=a)):(u=this.left+r,i==="near"?f="left":i==="center"?(f="center",u+=a/2):(f="right",u=this.right)):f="right",{textAlign:f,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,f,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Wt.route(s,l,a,r)})}function s4(n){return"id"in n&&"defaults"in n}class o4{constructor(){this.controllers=new Zs(is,"datasets",!0),this.elements=new Zs(xi,"elements"),this.plugins=new Zs(Object,"plugins"),this.scales=new Zs(Ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):ht(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Aa(e);jt(i["before"+l],[],i),t[e](i),jt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function a4(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let s=0;s1&&Xu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Qu(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function h4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return Qu(n,"x",t[0])||Qu(n,"y",t[0])}return{}}function _4(n,e){const t=Qi[n.type]||{scales:{}},i=e.scales||{},l=na(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!nt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ia(o,r,h4(o,n),Wt.scales[r.type]),f=p4(a,l),u=t.scales||{};s[o]=xl(Object.create(null),[{axis:a},r,u[a],u[f]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||na(r,e),u=(Qi[r]||{}).scales||{};Object.keys(u).forEach(c=>{const d=d4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),xl(s[m],[{axis:d},i[m],u[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];xl(r,[Wt.scales[r.type],Wt.scale])}),s}function Ib(n){const e=n.options||(n.options={});e.plugins=wt(e.plugins,{}),e.scales=_4(n,e)}function Ab(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function g4(n){return n=n||{},n.data=Ab(n.data),Ib(n),n}const xu=new Map,Lb=new Set;function Gs(n,e){let t=xu.get(n);return t||(t=e(),xu.set(n,t),Lb.add(t)),t}const Wl=(n,e,t)=>{const i=Ao(e,t);i!==void 0&&n.add(i)};class b4{constructor(e){this._config=g4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ab(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Ib(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(u=>{e&&(a.add(e),u.forEach(c=>Wl(a,e,c))),u.forEach(c=>Wl(a,l,c)),u.forEach(c=>Wl(a,Qi[s]||{},c)),u.forEach(c=>Wl(a,Wt,c)),u.forEach(c=>Wl(a,ea,c))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),Lb.has(t)&&o.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,Qi[t]||{},Wt.datasets[t]||{},{type:t},Wt,ea]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=ec(this._resolverCache,e,l);let a=o;if(y4(o,t)){s.$shared=!1,i=Ei(i)?i():i;const f=this.createResolver(e,i,r);a=Dl(o,i,f)}for(const f of t)s[f]=a[f];return s}createResolver(e,t,i=[""],l){const{resolver:s}=ec(this._resolverCache,e,i);return nt(t)?Dl(s,t,void 0,l):s}}function ec(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Ra(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const k4=n=>nt(n)&&Object.getOwnPropertyNames(n).some(e=>Ei(n[e]));function y4(n,e){const{isScriptable:t,isIndexable:i}=hb(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Ei(r)||k4(r))||o&&Xt(r))return!0}return!1}var v4="4.4.6";const w4=["top","bottom","left","right","chartArea"];function tc(n,e){return n==="top"||n==="bottom"||w4.indexOf(n)===-1&&e==="x"}function nc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function ic(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),jt(t&&t.onComplete,[n],e)}function S4(n){const e=n.chart,t=e.options.animation;jt(t&&t.onProgress,[n],e)}function Nb(n){return Ha()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ho={},lc=n=>{const e=Nb(n);return Object.values(ho).filter(t=>t.canvas===e).pop()};function $4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function T4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Xs(n,e,t){return n.options.clip?n[t]:e[t]}function C4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Xs(t,e,"left"),right:Xs(t,e,"right"),top:Xs(i,e,"top"),bottom:Xs(i,e,"bottom")}:e}class ci{static register(...e){Xn.add(...e),sc()}static unregister(...e){Xn.remove(...e),sc()}constructor(e,t){const i=this.config=new b4(t),l=Nb(e),s=lc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||B3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,f=a&&a.height,u=a&&a.width;if(this.id=A2(),this.ctx=r,this.canvas=a,this.width=u,this.height=f,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new r4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Q2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ho[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",ic),ai.listen(this,"progress",S4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Ht(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Eu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Tu(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Eu(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),jt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ht(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=ia(o,r),f=a==="r",u=a==="x";return{options:r,dposition:f?"chartArea":u?"bottom":"left",dtype:f?"radialLinear":u?"category":"linear"}}))),ht(s,o=>{const r=o.options,a=r.id,f=ia(a,r),u=wt(r.type,o.dtype);(r.position===void 0||tc(r.position,f)!==tc(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===u)c=i[a];else{const d=Xn.getScale(u);c=new d({id:a,type:u,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ht(l,(o,r)=>{o||delete i[r]}),ht(i,o=>{Ks.configure(this,o,o.options),Ks.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let f=0,u=this.data.datasets.length;f{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(nc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){ht(this.scales,e=>{Ks.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!mu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;$4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ks.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ht(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=C4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Pa(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Fa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ps(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=w3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=ll(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Lo(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};ht(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},l=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},s=(a,f)=>{this.canvas&&this.resize(a,f)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){ht(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ht(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Eo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,f)=>a.filter(u=>!f.some(c=>u.datasetIndex===c.datasetIndex&&u.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=q2(e),f=T4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,jt(s.onHover,[e,r,this],this),a&&jt(s.onClick,[e,r,this],this));const u=!Eo(r,l);return(u||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=f,u}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ge(ci,"defaults",Wt),Ge(ci,"instances",ho),Ge(ci,"overrides",Qi),Ge(ci,"registry",Xn),Ge(ci,"version",v4),Ge(ci,"getChart",lc);function sc(){return ht(ci.instances,n=>n._plugins.invalidate())}function Pb(n,e,t=e){n.lineCap=wt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(wt(t.borderDash,e.borderDash)),n.lineDashOffset=wt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=wt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=wt(t.borderWidth,e.borderWidth),n.strokeStyle=wt(t.borderColor,e.borderColor)}function O4(n,e,t){n.lineTo(t.x,t.y)}function M4(n){return n.stepped?dw:n.tension||n.cubicInterpolationMode==="monotone"?pw:O4}function Fb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),f=Math.min(s,r),u=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:f(o+(f?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(u,g),n.lineTo(u,_),n.lineTo(u,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,O=$|0;O===h?(C<_?_=C:C>g&&(g=C),u=(c*u+$)/++c):(T(),n.lineTo($,C),h=O,c=0,_=g=C),y=C}T()}function la(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?E4:D4}function I4(n){return n.stepped?Yw:n.tension||n.cubicInterpolationMode==="monotone"?Kw:Bi}function A4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Pb(n,e.options),n.stroke(l)}function L4(n,e,t,i){const{segments:l,options:s}=e,o=la(e);for(const r of l)Pb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const N4=typeof Path2D=="function";function P4(n,e,t,i){N4&&!e.options.segment?A4(n,e,t,i):L4(n,e,t,i)}class Ti extends xi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;qw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=t3(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=wb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=I4(i);let f,u;for(f=0,u=o.length;fe!=="borderDash"&&e!=="fill"});function oc(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Ba(o,r,l);const a=l[o],f=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:f.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:f.y}))}),s}function Ba(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function rc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Rb(n,e){let t=[],i=!1;return Xt(n)?(i=!0,t=n):t=R4(n,e),t.length?new Ti({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ac(n){return n&&n.fill!==!1}function q4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!rn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function j4(n,e,t){const i=B4(n);if(nt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return rn(l)&&Math.floor(l)===l?H4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function H4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function z4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:nt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function V4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:nt(n)?i=n.value:i=e.getBaseValue(),i}function B4(n){const e=n.options,t=e.fill;let i=wt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function U4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=W4(e,t);r.push(Rb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Tr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;ac(s)&&Tr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ac(i)||t.drawTime!=="beforeDatasetDraw"||Tr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gl={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;s-1?n.split(` -`):n}function nS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function dc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ei(e.bodyFont),f=ei(e.titleFont),u=ei(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ii(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=f.string,gt(n.title,T),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,gt(i,$=>{gt($.before,T),gt($.lines,T),gt($.after,T)}),S=0,t.font=u.string,gt(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function iS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function lS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function sS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),lS(f,n,e,t)&&(f="center"),f}function pc(n,e,t){const i=t.yAlign||e.yAlign||iS(n,t);return{xAlign:t.xAlign||e.xAlign||sS(n,e,t,i),yAlign:i}}function oS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function rS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function mc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=co(o);let h=oS(e,r);const _=rS(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Qs(n,e,t){const i=Ii(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function hc(n){return Gn([],fi(n))}function aS(n,e,t){return ll(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function _c(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const jb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?jb[e].call(t,i):l}class oa extends xi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Sb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=aS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),o=pn(i,"afterTitle",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}getBeforeBody(e,t){return hc(pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return gt(e,s=>{const o={before:[],lines:[],after:[]},r=_c(i,s);Gn(o.before,fi(pn(r,"beforeLabel",this,s))),Gn(o.lines,pn(r,"label",this,s)),Gn(o.after,fi(pn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return hc(pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),o=pn(i,"afterFooter",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,f;for(a=0,f=t.length;ae.filter(u,c,d,i))),e.itemSort&&(r=r.sort((u,c)=>e.itemSort(u,c,i))),gt(r,u=>{const c=_c(e.callbacks,u);l.push(pn(c,"labelColor",this,u)),s.push(pn(c,"labelPointStyle",this,u)),o.push(pn(c,"labelTextColor",this,u))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Gl[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=dc(this,i),f=Object.assign({},r,a),u=pc(this.chart,i,f),c=mc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=co(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,u)+o:l==="right"?y=d+h-Math.max(f,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const f=br(i.rtl,this.x,this.width);for(e.x=Qs(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=ei(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Ou(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Ou(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ei(i.bodyFont);let d=c.lineHeight,m=0;const h=br(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,O,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Qs(this,g,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,O=l.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Gl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=dc(this,e),a=Object.assign({},o,this._size),f=pc(t,e,a),u=mc(e,a,f,t);(l._to!==u.x||s._to!==u.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ii(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),Gw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Xw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const f=this.chart.getDatasetMeta(r);if(!f)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:f.data[a],index:a}}),s=!Eo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Eo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Gl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ze(oa,"positioners",Gl);var fS={id:"tooltip",_element:oa,positioners:Gl,afterInit(n,e,t){t&&(n.tooltip=new oa({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function uS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=s||1,h=u-1,{min:_,max:g}=e,y=!jt(o),S=!jt(r),T=!jt(f),$=(g-_)/(c+1);let C=_u((g-_)/h/m)*m,O,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=_u(L*C/h/m)*m),jt(a)||(O=Math.pow(10,a),C=Math.ceil(C*O)/O),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&V2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,u)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=f-1,C=(I-D)/L):(L=(I-D)/C,es(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(gu(C),gu(D));O=Math.pow(10,jt(a)?R:a),D=Math.round(D*O)/O,I=Math.round(I*O)/O;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),Dr)break;t.push({value:N})}return S&&d&&I!==r?t.length&&es(t[t.length-1].value,r,gc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function gc(n,e,{horizontal:t,minRotation:i}){const l=Yi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class cS extends Ds{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return jt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Ml(l),f=Ml(s);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=uS(l,s);return e.bounds==="ticks"&&B2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return cb(e,this.chart.options.locale,this.options.ticks.format)}}class ra extends cS{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=rn(e)?e:0,this.max=rn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Yi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ze(ra,"id","linear"),Ze(ra,"defaults",{ticks:{callback:pb.formatters.numeric}});const er={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_n=Object.keys(er);function bc(n,e){return n-e}function kc(n,e){if(jt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),rn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(ds(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function yc(n,e,t,i){const l=_n.length;for(let s=_n.indexOf(n);s=_n.indexOf(t);s--){const o=_n[s];if(er[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return _n[t?_n.indexOf(t):0]}function pS(n){for(let e=_n.indexOf(n)+1,t=_n.length;e=e?t[i]:t[l];n[s]=!0}}function mS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function wc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||yc(s.minUnit,t,i,this._getLabelCapacity(t)),r=vt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=ds(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return qt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Ki(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Ki(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class Sc extends hs{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=xs(t,this.min),this._tableRange=xs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&l.push(f);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(xs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return xs(this._table,i*this._tableRange+this._minPos,!0)}}Ze(Sc,"id","timeseries"),Ze(Sc,"defaults",hs.defaults);/*! +`):n}function nS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function dc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ei(e.bodyFont),f=ei(e.titleFont),u=ei(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ii(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=f.string,ht(n.title,T),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,ht(i,$=>{ht($.before,T),ht($.lines,T),ht($.after,T)}),S=0,t.font=u.string,ht(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function iS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function lS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function sS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),lS(f,n,e,t)&&(f="center"),f}function pc(n,e,t){const i=t.yAlign||e.yAlign||iS(n,t);return{xAlign:t.xAlign||e.xAlign||sS(n,e,t,i),yAlign:i}}function oS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function rS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function mc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=co(o);let h=oS(e,r);const _=rS(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Qs(n,e,t){const i=Ii(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function hc(n){return Gn([],fi(n))}function aS(n,e,t){return ll(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function _c(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const jb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?jb[e].call(t,i):l}class oa extends xi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Sb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=aS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),o=pn(i,"afterTitle",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}getBeforeBody(e,t){return hc(pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return ht(e,s=>{const o={before:[],lines:[],after:[]},r=_c(i,s);Gn(o.before,fi(pn(r,"beforeLabel",this,s))),Gn(o.lines,pn(r,"label",this,s)),Gn(o.after,fi(pn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return hc(pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),o=pn(i,"afterFooter",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,f;for(a=0,f=t.length;ae.filter(u,c,d,i))),e.itemSort&&(r=r.sort((u,c)=>e.itemSort(u,c,i))),ht(r,u=>{const c=_c(e.callbacks,u);l.push(pn(c,"labelColor",this,u)),s.push(pn(c,"labelPointStyle",this,u)),o.push(pn(c,"labelTextColor",this,u))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Gl[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=dc(this,i),f=Object.assign({},r,a),u=pc(this.chart,i,f),c=mc(i,f,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:f,bottomLeft:u,bottomRight:c}=co(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,u)+o:l==="right"?y=d+h-Math.max(f,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const f=br(i.rtl,this.x,this.width);for(e.x=Qs(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",o=ei(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Ou(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Ou(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ei(i.bodyFont);let d=c.lineHeight,m=0;const h=br(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,O,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Qs(this,g,i),t.fillStyle=i.bodyColor,ht(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,O=l.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Gl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=dc(this,e),a=Object.assign({},o,this._size),f=pc(t,e,a),u=mc(e,a,f,t);(l._to!==u.x||s._to!==u.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ii(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),Gw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Xw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const f=this.chart.getDatasetMeta(r);if(!f)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:f.data[a],index:a}}),s=!Eo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Eo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Gl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ge(oa,"positioners",Gl);var fS={id:"tooltip",_element:oa,positioners:Gl,afterInit(n,e,t){t&&(n.tooltip=new oa({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function uS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:f,maxTicks:u,maxDigits:c,includeBounds:d}=n,m=s||1,h=u-1,{min:_,max:g}=e,y=!Ht(o),S=!Ht(r),T=!Ht(f),$=(g-_)/(c+1);let C=_u((g-_)/h/m)*m,O,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=_u(L*C/h/m)*m),Ht(a)||(O=Math.pow(10,a),C=Math.ceil(C*O)/O),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&V2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,u)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=f-1,C=(I-D)/L):(L=(I-D)/C,es(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(gu(C),gu(D));O=Math.pow(10,Ht(a)?R:a),D=Math.round(D*O)/O,I=Math.round(I*O)/O;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),Dr)break;t.push({value:N})}return S&&d&&I!==r?t.length&&es(t[t.length-1].value,r,gc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function gc(n,e,{horizontal:t,minRotation:i}){const l=Yi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class cS extends Ds{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Ht(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Ml(l),f=Ml(s);a<0&&f<0?r(0):a>0&&f>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=uS(l,s);return e.bounds==="ticks"&&B2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return cb(e,this.chart.options.locale,this.options.ticks.format)}}class ra extends cS{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=rn(e)?e:0,this.max=rn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Yi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ge(ra,"id","linear"),Ge(ra,"defaults",{ticks:{callback:pb.formatters.numeric}});const er={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_n=Object.keys(er);function bc(n,e){return n-e}function kc(n,e){if(Ht(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),rn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(ds(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function yc(n,e,t,i){const l=_n.length;for(let s=_n.indexOf(n);s=_n.indexOf(t);s--){const o=_n[s];if(er[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return _n[t?_n.indexOf(t):0]}function pS(n){for(let e=_n.indexOf(n)+1,t=_n.length;e=e?t[i]:t[l];n[s]=!0}}function mS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function wc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||yc(s.minUnit,t,i,this._getLabelCapacity(t)),r=wt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=ds(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return jt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Ki(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Ki(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class Sc extends hs{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=xs(t,this.min),this._tableRange=xs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o=t&&f<=i&&l.push(f);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(xs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return xs(this._table,i*this._tableRange+this._minPos,!0)}}Ge(Sc,"id","timeseries"),Ge(Sc,"defaults",hs.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license - */const hS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Tb._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return hS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function $c(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function _S(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&$c();return{c(){e=b("div"),t=b("div"),i=K("Found "),l=K(n[1]),s=M(),r=K(o),a=M(),c&&c.c(),f=M(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&oe(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&oe(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=$c(),c.c(),E(c,1),c.m(e,f)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function gS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return ae.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ae.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}Ht(()=>(ci.register(Ti,_o,po,ra,hs,tS,fS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ee[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class bS extends ge{constructor(e){super(),_e(this,e,gS,_S,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function kS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function yS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Hb extends ge{constructor(e){super(),_e(this,e,yS,kS,me,{content:2,language:3,class:0})}}const vS=n=>({}),Tc=n=>({}),wS=n=>({}),Cc=n=>({});function Oc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Mc(n);const $=n[19].header,C=wt($,n,n[18],Cc);let O=n[4]&&n[2]&&Dc(n);const D=n[19].default,I=wt(D,n,n[18],null),L=n[19].footer,R=wt(L,n,n[18],Tc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),f=M(),u=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[J(t,"click",Be(n[20])),J(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Mc(n),T.c(),E(T,1),T.m(o,r)):T&&(le(),A(T,1,1,()=>{T=null}),se()),C&&C.p&&(!g||N[0]&262144)&&$t(C,$,n,n[18],g?St($,n[18],N,wS):Tt(n[18]),Cc),n[4]&&n[2]?O?O.p(n,N):(O=Dc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&$t(I,D,n,n[18],g?St(D,n[18],N,null):Tt(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&$t(R,L,n,n[18],g?St(L,n[18],N,vS):Tt(n[18]),Tc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=Rg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ma(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,$e(S)}}}function Mc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,fs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,fs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Dc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function SS(n){let e,t,i,l,s=n[0]&&Oc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Oc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,$e(l)}}}let zi,Cr=[];function zb(){return zi=zi||document.querySelector(".overlays"),zi||(zi=document.createElement("div"),zi.classList.add("overlays"),document.body.appendChild(zi)),zi}let wi=150;function Ec(){return 1e3+zb().querySelectorAll(".overlay-panel-container.active").length}function $S(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Ec(),_):t(6,_.style="",_))}function R(){j.pushUnique(Cr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Cr,h),Cr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Ec()&&(Y.preventDefault(),O())}function P(Y){o&&q(g)}function q(Y,ie){ie&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Ht(()=>(zb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const H=()=>a?O():!0;function W(Y){ee[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function U(Y){ee[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,O,_,g,T,N,P,q,u,c,d,C,D,$,l,i,H,W,G,U]}class Zt extends ge{constructor(e){super(),_e(this,e,$S,SS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function TS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[Se(i=Pe.call(null,e,n[3]?void 0:n[0])),J(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Ct(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function CS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function f(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Ht(()=>()=>{a&&clearTimeout(a)}),n.$$set=u=>{"value"in u&&t(5,i=u.value),"tooltip"in u&&t(0,l=u.tooltip),"idleClasses"in u&&t(1,s=u.idleClasses),"successClasses"in u&&t(2,o=u.successClasses),"successDuration"in u&&t(6,r=u.successDuration)},[l,s,o,a,f,i,r]}class sl extends ge{constructor(e){super(),_e(this,e,CS,TS,me,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Ic(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function OS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new eb({props:{level:n[1].level}}),I=new tb({props:{date:n[1].created}});let N=!n[4]&&Ac(n),P=ue(n[5](n[1].data)),q=[];for(let W=0;WA(q[W],1,1,()=>{q[W]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("div"),d=K(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),B(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),B(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let W=0;W',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ac(n){let e,t,i,l;function s(a,f){return a[1].message?ES:DS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function DS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ES(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&oe(i,t)},d(l){l&&v(e)}}}function IS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=K(t),s=K(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function AS(n){let e,t;return e=new Hb({props:{content:n[17],language:"html"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function LS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function NS(n){let e,t;return e=new Hb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Lc(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[PS,NS,LS,AS,IS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=K("data."),s=K(l),o=M(),r=b("td"),u.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&oe(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function FS(n){let e,t,i,l;const s=[MS,OS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(le(),A(o[u],1,1,()=>{o[u]=null}),se()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function RS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[J(e,"click",n[9]),J(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,$e(a)}}}function jS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[qS],header:[RS],default:[FS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}const Nc="log_view";function HS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return ae.cancelRequest(Nc),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await ae.logs.getOne(T,{requestKey:Nc})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){ee[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class zS extends ge{constructor(e){super(),_e(this,e,HS,jS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function VS(n,e,t){const i=n.slice();return i[1]=e[t],i}function BS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function US(n){let e,t,i,l=ue(K1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Vb extends ge{constructor(e){super(),_e(this,e,WS,US,me,{class:0})}}function YS(n){let e,t,i,l,s,o,r,a,f;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[JS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[ZS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[GS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function KS(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&re(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function ZS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Vb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),re(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&re(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function GS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function XS(n){let e,t,i,l;const s=[KS,YS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function e$(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[xS],header:[QS],default:[XS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function t$(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await ae.settings.getAll()||{};y(L)}catch(L){ae.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await ae.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Lt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ae.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Pc(n){let e,t;return e=new bS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Fc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new f2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Xo({}),f.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[i$,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Cs({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Vb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Pc(n),N=Fc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&oe(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&me($,$=P[4])?(le(),A(F,1,1,Q),se(),F=Pc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(le(),A(N,1,1,Q),se(),N=Fc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function s$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[l$]},$$scope:{ctx:n}}});let r={};i=new zS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new n$({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const eo="logId",Rc="adminRequests",qc="adminLogRequests";function o$(n,e,t){var L;let i,l,s;We(n,zo,R=>t(19,l=R)),We(n,It,R=>t(6,s=R)),xt(It,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Rc)||((L=window.localStorage)==null?void 0:L.getItem(qc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Rc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[eo]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[eo]=null,j.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(eo)&&r&&r.show(o.get(eo)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(qc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class r$ extends ge{constructor(e){super(),_e(this,e,o$,s$,me,{})}}function a$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function f$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class u$ extends ge{constructor(e){super(),_e(this,e,f$,a$,me,{tolerance:3})}}function c$(n){let e,t,i,l,s;const o=n[5].default,r=wt(o,n,n[4],null);return l=new u$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&$t(r,o,a,a[4],s?St(o,a[4],f,null):Tt(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const jc="@adminSidebarWidth";function d$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(jc)||null;function f(m){ee[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(jc,a))},[s,o,a,r,l,i,f,u,c,d]}class Bb extends ge{constructor(e){super(),_e(this,e,d$,c$,me,{class:0})}}const Ua=Cn({});function un(n,e,t){Ua.set({text:n,yesCallback:e,noCallback:t})}function Ub(){Ua.set({})}function Hc(n){let e,t,i;const l=n[18].default,s=wt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&$t(s,l,o,o[17],i?St(l,o[17],r,null):Tt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function p$(n){let e,t,i,l,s=n[0]&&Hc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Hc(o),s.c(),E(s,1),s.m(e,null)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function m$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var ie;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((ie=Y.target)!=null&&ie.closest(".flatpickr-calendar"))&&T()}Ht(()=>(D(),()=>I()));function G(Y){ee[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){ee[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,ie;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((ie=m==null?void 0:m.classList)==null||ie.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,m$,p$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function zc(n,e,t){const i=n.slice();return i[27]=e[t],i}function h$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function _$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){le();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function g$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function b$(n){let e,t,i,l;const s=[g$,_$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Vc(n){let e,t,i,l=ue(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[b$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Vc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Vc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function y$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&v(e)}}}function Uc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function v$(n){let e,t,i,l,s,o,r=n[5]!=""&&Uc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Uc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function w$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[v$],header:[y$],default:[k$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}Ht(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-iXaWdysu.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){ee[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ie(Ie({},e),Yt(H)),t(14,r=Ge(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class $$ extends ge{constructor(e){super(),_e(this,e,S$,w$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Wc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Yc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Jc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Yc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Yc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Jc).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Ct(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function T$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=ue(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Jc=n=>n.name;function C$(n,e,t){let i;We(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){ee[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class O$ extends ge{constructor(e){super(),_e(this,e,C$,T$,me,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function M$(n){let e,t=ue(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class I$ extends ge{constructor(e){super(),_e(this,e,E$,D$,me,{class:0})}}const A$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]}),L$=n=>({interactive:n&64,hasErrors:n&32}),Qc=n=>({interactive:n[6],hasErrors:n[5]}),N$=n=>({interactive:n&64,hasErrors:n&32}),xc=n=>({interactive:n[6],hasErrors:n[5]});function ed(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function td(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&oe(i,l[4])},d(l){l&&v(e)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&td(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=td(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function F$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function R$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function q$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function nd(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=wt(d,n,n[19],Qc);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[j$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[H$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=wt(h,n,n[19],Xc);let g=!n[0].toDelete&&id(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&$t(m,d,y,y[19],c?St(d,y[19],S,L$):Tt(y[19]),Qc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&$t(_,h,y,y[19],c?St(h,y[19],S,A$):Tt(y[19]),Xc),y[0].toDelete?g&&(le(),A(g,1,1,()=>{g=null}),se()):g?(g.p(y,S),S&1&&E(g,1)):(g=id(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function j$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&oe(o,m[4]),f&&Ct(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function H$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function id(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function z$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function V$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&ed();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[P$]},$$scope:{ctx:n}}});const c=n[14].default,d=wt(c,n,n[19],xc),m=d||F$();function h(S,T){if(S[0].toDelete)return q$;if(S[6])return R$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&nd(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=ed(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&$t(d,c,S,S[19],f?St(c,S[19],T,N$):Tt(S[19]),xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=nd(S),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function B$(n,e,t){let i,l,s,o;We(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Jt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of Or)N.id!=f&&N.collapse()}Ht(()=>(Or.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(Or,"id",f)}));function I(N){ee[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,B$,V$,me,{key:1,field:0})}}function U$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function W$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&re(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[U$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[W$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[Y$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function J$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[K$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Z$(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class G$ extends ge{constructor(e){super(),_e(this,e,Z$,J$,me,{field:0,key:1})}}function X$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&re(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Q$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&re(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x$(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[X$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Q$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function eT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function tT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[eT,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[tT],options:[x$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function iT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ie(Ie({},e),Yt(h)),t(2,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class lT extends ge{constructor(e){super(),_e(this,e,iT,nT,me,{field:0,key:1})}}function sT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class rT extends ge{constructor(e){super(),_e(this,e,oT,sT,me,{field:0,key:1})}}function aT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(5,s=Ge(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Fl extends ge{constructor(e){super(),_e(this,e,fT,aT,me,{value:0,separator:1,readonly:2,disabled:3})}}function uT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function cT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function dT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[uT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[cT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function pT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[dT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Wb extends ge{constructor(e){super(),_e(this,e,mT,pT,me,{field:0,key:1})}}function hT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function _T(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ie(Ie({},e),Yt(c)),t(2,l=Ge(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class gT extends ge{constructor(e){super(),_e(this,e,_T,hT,me,{field:0,key:1})}}function bT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function kT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[bT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[kT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ot(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function vT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(2,l=Ge(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class wT extends ge{constructor(e){super(),_e(this,e,vT,yT,me,{field:0,key:1})}}var Mr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$l={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},_s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function ld(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function fn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function dt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Yb(n,e){if(e(n))return n;if(n.parentNode)return Yb(n.parentNode,e)}function no(n,e){var t=dt("div","numInputWrapper"),i=dt("input","numInput "+n),l=dt("span","arrowUp"),s=dt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Ro=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},ST={D:Er,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Er,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Ui={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ls={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ls.w(n,e,t)]},F:function(n,e,t){return Ro(ls.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ls.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Ro(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Kb=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ls[c]&&m[d-1]!=="\\"?ls[c](r,u,t):c!=="\\"?c:""}).join("")}},aa=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||$l).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ar(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var fe=t._input.value;c(),Kt(),t._input.value!==fe&&t._debouncedChange()}function f(Z,X){return Z%12+12*In(X===t.l10n.amPM[1])}function u(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=f(Z,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Ir(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Ir(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Ir(Z,X,ne);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(Z){var X=yn(Z),ne=parseInt(X.value)+(Z.delta||0);(ne/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&Mt(ne)}function _(Z,X,ne,fe){if(X instanceof Array)return X.forEach(function(Te){return _(Z,Te,ne,fe)});if(Z instanceof Array)return Z.forEach(function(Te){return _(Te,X,ne,fe)});Z.addEventListener(X,ne,fe),t._handlers.push({remove:function(){return Z.removeEventListener(X,ne,fe)}})}function g(){kt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(fe){return _(fe,"click",t[ne])})}),t.isMobile){al();return}var Z=ld(ze,50);if(t._debouncedChange=ld(g,OT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Ae(yn(ne))}),_(t._input,"keydown",De),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",De),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ut),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Gt)}function S(Z,X){var ne=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=dt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Z,X,ne,fe){var Te=ft(X,!0),Le=dt("span",Z,X.getDate().toString());return Le.dateObj=X,Le.$i=fe,Le.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Te?(Le.tabIndex=-1,Mn(X)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(fn(Le,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),fn(Le,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),kt("onDayCreate",Le),Le}function D(Z){Z.focus(),t.config.mode==="range"&&Ae(Z)}function I(Z){for(var X=Z>0?0:t.config.showMonths-1,ne=Z>0?t.config.showMonths:-1,fe=X;fe!=ne;fe+=Z)for(var Te=t.daysContainer.children[fe],Le=Z>0?0:Te.children.length-1,Je=Z>0?Te.children.length:-1,qe=Le;qe!=Je;qe+=Z){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&ft(Qe.dateObj))return Qe}}function L(Z,X){for(var ne=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,fe=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Le=ne-t.currentMonth;Le!=fe;Le+=Te)for(var Je=t.daysContainer.children[Le],qe=ne-t.currentMonth===Le?Z.$i+X:X<0?Je.children.length-1:0,Qe=Je.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=Te){var Ve=Je.children[Re];if(Ve.className.indexOf("hidden")===-1&&ft(Ve.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(Z,X){var ne=s(),fe=ht(ne||document.body),Te=Z!==void 0?Z:fe?ne:t.selectedDateElem!==void 0&&ht(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&ht(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():fe?L(Te,X):D(Te)}function F(Z,X){for(var ne=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((X-1+12)%12,Z),Te=t.utils.getDaysInMonth(X,Z),Le=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",Qe=Je?"nextMonthDay hidden":"nextMonthDay",Re=fe+1-ne,Ve=0;Re<=fe;Re++,Ve++)Le.appendChild(O("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Le.appendChild(O("flatpickr-day",new Date(Z,X,Re),Re,Ve));for(var yt=Te+1;yt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);yt++,Ve++)Le.appendChild(O("flatpickr-day "+Qe,new Date(Z,X+1,yt%Te),yt,Ve));var Jn=dt("div","dayContainer");return Jn.appendChild(Le),Jn}function N(){if(t.daysContainer!==void 0){to(t.daysContainer),t.weekNumbers&&to(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ne=dt("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Ro(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Z=dt("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=dt("span","cur-month"):(t.monthsDropdownContainer=dt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),kt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var fe=no("cur-year",{tabindex:"-1"}),Te=fe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=dt("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(fe),X.appendChild(Le),Z.appendChild(X),{container:Z,yearElement:Te,monthElement:ne}}function H(){to(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){return t.monthNav=dt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(fn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(fn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Oe(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Ar(t.config);t.timeContainer=dt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=dt("span","flatpickr-time-separator",":"),ne=no("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var fe=no("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:u(Z.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=no("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(dt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=dt("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function U(){t.weekdayContainer?to(t.weekdayContainer):t.weekdayContainer=dt("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=dt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=sd(t.l10n.weekdays.shorthand);Z>0&&Z{i&&(t||(t=Fe(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function _S(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&$c();return{c(){e=b("div"),t=b("div"),i=K("Found "),l=K(n[1]),s=M(),r=K(o),a=M(),c&&c.c(),f=M(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,f),k(e,u),n[8](u)},p(d,[m]){m&2&&se(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&se(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=$c(),c.c(),E(c,1),c.m(e,f)):c&&(ie(),A(c,1,1,()=>{c=null}),le()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function gS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return re.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),re.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}zt(()=>(ci.register(Ti,_o,po,ra,hs,tS,fS),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class bS extends ge{constructor(e){super(),_e(this,e,gS,_S,pe,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function kS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function yS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Hb extends ge{constructor(e){super(),_e(this,e,yS,kS,pe,{content:2,language:3,class:0})}}const vS=n=>({}),Tc=n=>({}),wS=n=>({}),Cc=n=>({});function Oc(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Mc(n);const $=n[19].header,C=St($,n,n[18],Cc);let O=n[4]&&n[2]&&Dc(n);const D=n[19].default,I=St(D,n,n[18],null),L=n[19].footer,R=St(L,n,n[18],Tc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),f=M(),u=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(u,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,f),k(s,u),I&&I.m(u,null),n[21](u),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[J(t,"click",Be(n[20])),J(u,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Mc(n),T.c(),E(T,1),T.m(o,r)):T&&(ie(),A(T,1,1,()=>{T=null}),le()),C&&C.p&&(!g||N[0]&262144)&&Tt(C,$,n,n[18],g?$t($,n[18],N,wS):Ct(n[18]),Cc),n[4]&&n[2]?O?O.p(n,N):(O=Dc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&Tt(I,D,n,n[18],g?$t(D,n[18],N,null):Ct(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&Tt(R,L,n,n[18],g?$t(L,n[18],N,vS):Ct(n[18]),Tc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=Rg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,fs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ma(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,$e(S)}}}function Mc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",Be(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,fs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,fs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Dc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function SS(n){let e,t,i,l,s=n[0]&&Oc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Oc(o),s.c(),E(s,1),s.m(e,null)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,$e(l)}}}let zi,Cr=[];function zb(){return zi=zi||document.querySelector(".overlays"),zi||(zi=document.createElement("div"),zi.classList.add("overlays"),document.body.appendChild(zi)),zi}let wi=150;function Ec(){return 1e3+zb().querySelectorAll(".overlay-panel-container.active").length}function $S(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:u=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(Y){t(17,$=Y),Y?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Ec(),_):t(6,_.style="",_))}function R(){j.pushUnique(Cr,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Cr,h),Cr.length||document.body.classList.remove("overlay-active")}function N(Y){o&&u&&Y.code=="Escape"&&!j.isInput(Y.target)&&_&&_.style.zIndex==Ec()&&(Y.preventDefault(),O())}function P(Y){o&&q(g)}function q(Y,me){me&&t(8,T=""),!(!Y||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!Y)return;if(Y.scrollHeight-Y.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}Y.scrollTop==0?t(8,T+=" scroll-top-reached"):Y.scrollTop+Y.offsetHeight==Y.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}zt(()=>(zb().appendChild(_),()=>{var Y;clearTimeout(S),F(),(Y=_==null?void 0:_.classList)==null||Y.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const H=()=>a?O():!0;function W(Y){te[Y?"unshift":"push"](()=>{g=Y,t(7,g)})}const G=Y=>q(Y.target);function U(Y){te[Y?"unshift":"push"](()=>{_=Y,t(6,_)})}return n.$$set=Y=>{"class"in Y&&t(1,s=Y.class),"active"in Y&&t(0,o=Y.active),"popup"in Y&&t(2,r=Y.popup),"overlayClose"in Y&&t(3,a=Y.overlayClose),"btnClose"in Y&&t(4,f=Y.btnClose),"escClose"in Y&&t(12,u=Y.escClose),"beforeOpen"in Y&&t(13,c=Y.beforeOpen),"beforeHide"in Y&&t(14,d=Y.beforeHide),"$$scope"in Y&&t(18,l=Y.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,f,O,_,g,T,N,P,q,u,c,d,C,D,$,l,i,H,W,G,U]}class Gt extends ge{constructor(e){super(),_e(this,e,$S,SS,pe,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function TS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[Se(i=Pe.call(null,e,n[3]?void 0:n[0])),J(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Mt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function CS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function f(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return zt(()=>()=>{a&&clearTimeout(a)}),n.$$set=u=>{"value"in u&&t(5,i=u.value),"tooltip"in u&&t(0,l=u.tooltip),"idleClasses"in u&&t(1,s=u.idleClasses),"successClasses"in u&&t(2,o=u.successClasses),"successDuration"in u&&t(6,r=u.successDuration)},[l,s,o,a,f,i,r]}class sl extends ge{constructor(e){super(),_e(this,e,CS,TS,pe,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Ic(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function OS(n){let e,t,i,l,s,o,r,a,f,u,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new sl({props:{value:n[1].id}}),S=new eb({props:{level:n[1].level}}),I=new tb({props:{date:n[1].created}});let N=!n[4]&&Ac(n),P=fe(n[5](n[1].data)),q=[];for(let W=0;WA(q[W],1,1,()=>{q[W]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("div"),d=K(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),B(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),B(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let W=0;W',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Ac(n){let e,t,i,l;function s(a,f){return a[1].message?ES:DS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function DS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ES(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&se(i,t)},d(l){l&&v(e)}}}function IS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=K(t),s=K(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&se(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&se(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function AS(n){let e,t;return e=new Hb({props:{content:n[17],language:"html"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function LS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function NS(n){let e,t;return e=new Hb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Lc(n){let e,t,i,l=n[16]+"",s,o,r,a,f,u,c,d;const m=[PS,NS,LS,AS,IS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return f=_(n,-1),u=h[f]=m[f](n),{c(){e=b("tr"),t=b("td"),i=K("data."),s=K(l),o=M(),r=b("td"),u.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[f].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&se(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=f;f=_(g,y),f===S?h[f].p(g,y):(ie(),A(h[S],1,1,()=>{h[S]=null}),le(),u=h[f],u?u.p(g,y):(u=h[f]=m[f](g),u.c()),E(u,1),u.m(r,null))},i(g){d||(E(u),d=!0)},o(g){A(u),d=!1},d(g){g&&v(e),h[f].d()}}}function FS(n){let e,t,i,l;const s=[MS,OS],o=[];function r(a,f){var u;return a[3]?0:(u=a[1])!=null&&u.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,f){~e&&o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(ie(),A(o[u],1,1,()=>{o[u]=null}),le()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function RS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),k(i,l),k(i,s),k(i,o),r||(a=[J(e,"click",n[9]),J(i,"click",n[10])],r=!0)},p(f,u){u&8&&(i.disabled=f[3])},d(f){f&&(v(e),v(t),v(i)),r=!1,$e(a)}}}function jS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[qS],header:[RS],default:[FS]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}const Nc="log_view";function HS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return u(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function f(){return re.cancelRequest(Nc),s==null?void 0:s.hide()}async function u(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await re.logs.getOne(T,{requestKey:Nc})}catch(C){C.isAbort||(f(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>f(),y=()=>m();function S(T){te[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[f,o,s,r,i,d,m,_,a,g,y,S]}class zS extends ge{constructor(e){super(),_e(this,e,HS,jS,pe,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function VS(n,e,t){const i=n.slice();return i[1]=e[t],i}function BS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function US(n){let e,t,i,l=fe(K1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Vb extends ge{constructor(e){super(),_e(this,e,WS,US,pe,{class:0})}}function YS(n){let e,t,i,l,s,o,r,a,f;return t=new ue({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[JS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new ue({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[ZS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[GS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){w(u,e,c),z(t,e,null),k(e,i),z(l,e,null),k(e,s),z(o,e,null),r=!0,a||(f=J(e,"submit",Be(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(E(t.$$.fragment,u),E(l.$$.fragment,u),E(o.$$.fragment,u),r=!0)},o(u){A(t.$$.fragment,u),A(l.$$.fragment,u),A(o.$$.fragment,u),r=!1},d(u){u&&v(e),V(t),V(l),V(o),a=!1,f()}}}function KS(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JS(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&oe(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function ZS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Vb({}),{c(){e=b("label"),t=K("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=M(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),oe(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=J(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&oe(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function GS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function XS(n){let e,t,i,l;const s=[KS,YS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(ie(),A(o[u],1,1,()=>{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function e$(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[xS],header:[QS],default:[XS]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function t$(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Zt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await re.settings.getAll()||{};y(L)}catch(L){re.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await re.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Nt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),re.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){te[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,O,D,I]}class n$ extends ge{constructor(e){super(),_e(this,e,t$,e$,pe,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Pc(n){let e,t;return e=new bS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Fc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new f2({props:s}),te.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;f=new Xo({}),f.$on("refresh",n[10]),h=new ue({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[i$,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Cs({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Vb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Pc(n),N=Fc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=K(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(f.$$.fragment),u=M(),c=b("div"),d=M(),m=b("div"),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[Se(Pe.call(null,r,{text:"Logs settings",position:"right"})),J(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&se(s,P[6]);const H={};q&12582916&&(H.$$scope={dirty:q,ctx:P}),h.$set(H);const W={};q&2&&(W.value=P[1]),g.$set(W),q&16&&pe($,$=P[4])?(ie(),A(F,1,1,Q),le(),F=Pc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&pe(O,O=P[4])?(ie(),A(N,1,1,Q),le(),N=Fc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,$e(R)}}}function s$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[l$]},$$scope:{ctx:n}}});let r={};i=new zS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new n$({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const eo="logId",Rc="adminRequests",qc="adminLogRequests";function o$(n,e,t){var L;let i,l,s;We(n,zo,R=>t(19,l=R)),We(n,At,R=>t(6,s=R)),xt(At,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Rc)||((L=window.localStorage)==null?void 0:L.getItem(qc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Rc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){te[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[eo]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[eo]=null,j.replaceHashQueryParams(R)};function I(R){te[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(eo)&&r&&r.show(o.get(eo)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(qc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class r$ extends ge{constructor(e){super(),_e(this,e,o$,s$,pe,{})}}function a$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[J(e,"mousedown",n[5]),J(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,$e(i)}}}function f$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft){s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,u,c,l,h,_]}class u$ extends ge{constructor(e){super(),_e(this,e,f$,a$,pe,{tolerance:3})}}function c$(n){let e,t,i,l,s;const o=n[5].default,r=St(o,n,n[4],null);return l=new u$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,f){w(a,e,f),r&&r.m(e,null),n[6](e),w(a,i,f),z(l,a,f),s=!0},p(a,[f]){r&&r.p&&(!s||f&16)&&Tt(r,o,a,a[4],s?$t(o,a[4],f,null):Ct(a[4]),null),(!s||f&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const jc="@adminSidebarWidth";function d$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(jc)||null;function f(m){te[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const u=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(jc,a))},[s,o,a,r,l,i,f,u,c,d]}class Bb extends ge{constructor(e){super(),_e(this,e,d$,c$,pe,{class:0})}}const Ua=Cn({});function un(n,e,t){Ua.set({text:n,yesCallback:e,noCallback:t})}function Ub(){Ua.set({})}function Hc(n){let e,t,i;const l=n[18].default,s=St(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Tt(s,l,o,o[17],i?$t(l,o[17],r,null):Ct(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function p$(n){let e,t,i,l,s=n[0]&&Hc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[J(window,"click",n[7]),J(window,"mousedown",n[6]),J(window,"keydown",n[5]),J(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Hc(o),s.c(),E(s,1),s.m(e,null)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,$e(l)}}}function m$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:f="closable"}=e,{class:u=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(Y=0){o&&(clearTimeout(_),_=setTimeout(T,Y))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(Y){return!c||Y.classList.contains(f)||c.contains(Y)&&Y.closest&&Y.closest("."+f)}function D(Y){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=Y||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(Y){Y.stopPropagation(),O(Y.target)&&T()}function R(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.stopPropagation(),O(Y.target)&&S(150))}function F(Y){Y.preventDefault(),Y.stopPropagation(),C()}function N(Y){(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),Y.stopPropagation(),C())}function P(Y){o&&!(m!=null&&m.contains(Y.target))&&!(c!=null&&c.contains(Y.target))&&C()}function q(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),T())}function H(Y){o&&(g=!(c!=null&&c.contains(Y.target)))}function W(Y){var me;o&&g&&!(c!=null&&c.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((me=Y.target)!=null&&me.closest(".flatpickr-calendar"))&&T()}zt(()=>(D(),()=>I()));function G(Y){te[Y?"unshift":"push"](()=>{d=Y,t(3,d)})}function U(Y){te[Y?"unshift":"push"](()=>{c=Y,t(2,c)})}return n.$$set=Y=>{"trigger"in Y&&t(8,s=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,f=Y.closableClass),"class"in Y&&t(1,u=Y.class),"$$scope"in Y&&t(17,l=Y.$$scope)},n.$$.update=()=>{var Y,me;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((me=m==null?void 0:m.classList)==null||me.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,u,c,d,P,q,H,W,s,r,a,f,S,T,$,C,m,l,i,G,U]}class On extends ge{constructor(e){super(),_e(this,e,m$,p$,pe,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function zc(n,e,t){const i=n.slice();return i[27]=e[t],i}function h$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(u,c){w(u,e,c),w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[19]),a=!0)},p(u,c){c[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),c[0]&8&&i!==(i=u[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function _$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,f){var c;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Et(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){var u;if(f[0]&128&&o!==(o=a[7])){if(e){ie();const c=e;A(c.$$.fragment,1,0,()=>{V(c,1)}),le()}o?(e=Et(o,r(a)),te.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};f[0]&1073741824&&(c.id=a[30]),f[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(u=a[0])==null?void 0:u.name} (created)`),!t&&f[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function g$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function b$(n){let e,t,i,l;const s=[g$,_$],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(ie(),A(o[u],1,1,()=>{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Vc(n){let e,t,i,l=fe(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ue({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[b$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Vc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){const u={};f[0]&1073741837|f[1]&1&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&64&&(c.name=`indexes.${a[6]||""}`),f[0]&1073742213|f[1]&1&&(c.$$scope={dirty:f,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,f):(r=Vc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function y$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=K(t),l=K(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&se(i,t)},d(s){s&&v(e)}}}function Uc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function v$(n){let e,t,i,l,s,o,r=n[5]!=""&&Uc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,f){r&&r.m(a,f),w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),s||(o=[J(t,"click",n[17]),J(l,"click",n[18])],s=!0)},p(a,f){a[5]!=""?r?r.p(a,f):(r=Uc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),f[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,$e(o)}}}function w$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[v$],header:[y$],default:[k$]},$$scope:{ctx:n}};for(let s=0;sU.name==H);G?j.removeByValue(W.columns,G):j.pushUnique(W.columns,{name:H}),t(2,d=j.buildIndex(W))}zt(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:H}=await import("./CodeEditor-CiCm0ZL1.js");return{default:H}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(H){console.warn(H)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=H=>{t(3,l.unique=H.target.checked,l),t(3,l.tableName=l.tableName||(f==null?void 0:f.name),l),t(2,d=j.buildIndex(l))};function R(H){d=H,t(2,d)}const F=H=>C(H);function N(H){te[H?"unshift":"push"](()=>{u=H,t(4,u)})}function P(H){Ce.call(this,n,H)}function q(H){Ce.call(this,n,H)}return n.$$set=H=>{e=Ae(Ae({},e),Kt(H)),t(14,r=Xe(e,o)),"collection"in H&&t(0,f=H.collection)},n.$$.update=()=>{var H,W,G;n.$$.dirty[0]&1&&t(10,i=(((W=(H=f==null?void 0:f.schema)==null?void 0:H.filter(U=>!U.toDelete))==null?void 0:W.map(U=>U.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((G=l.columns)==null?void 0:G.map(U=>U.name))||[])},[f,y,d,l,u,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class $$ extends ge{constructor(e){super(),_e(this,e,S$,w$,pe,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Wc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Yc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Kc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Jc).join(", "))+"",s,o,r,a,f,u=n[11].unique&&Yc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),u&&u.c(),t=M(),i=b("span"),s=K(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),u&&u.m(e,null),k(e,t),k(e,i),k(i,s),a||(f=[Se(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),J(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?u||(u=Yc(),u.c(),u.m(e,t)):u&&(u.d(1),u=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Jc).join(", "))+"")&&se(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Mt(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),u&&u.d(),a=!1,$e(f)}}}function T$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,f,u,c,d,m,h,_,g=fe(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;Dbe(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=K("Unique constraints and indexes ("),l=K(i),s=K(")"),o=M(),r=b("div");for(let D=0;D+ New index',u=M(),B(c.$$.fragment),p(e,"class","section-title"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;Ld=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(u)),ot(y,D),n[6](null),V(c,D),h=!1,_()}}}const Jc=n=>n.name;function C$(n,e,t){let i;We(n,mi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function f(m){te[m?"unshift":"push"](()=>{s=m,t(1,s)})}function u(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,f,u,c,d]}class O$ extends ge{constructor(e){super(),_e(this,e,C$,T$,pe,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gc(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f},d(f){f&&v(e),o=!1,r()}}}function M$(n){let e,t=fe(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class I$ extends ge{constructor(e){super(),_e(this,e,E$,D$,pe,{class:0})}}const A$=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]}),L$=n=>({interactive:n&64,hasErrors:n&32}),Qc=n=>({interactive:n[6],hasErrors:n[5]}),N$=n=>({interactive:n&64,hasErrors:n&32}),xc=n=>({interactive:n[6],hasErrors:n[5]});function ed(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function td(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=K(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&se(i,l[4])},d(l){l&&v(e)}}}function P$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=n[0].required&&td(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=f=!n[0].id,p(o,"placeholder","Field name"),o.value=u=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=J(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=td(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&f!==(f=!h[0].id)&&(o.autofocus=f),_&1&&u!==(u=h[0].name)&&o.value!==u&&(o.value=u)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function F$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function R$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function q$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,"Restore")),J(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function nd(n){let e,t,i,l,s,o,r,a,f,u,c;const d=n[14].options,m=St(d,n,n[19],Qc);s=new ue({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[j$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[H$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=St(h,n,n[19],Xc);let g=!n[0].toDelete&&id(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),_&&_.c(),f=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),z(s,l,null),k(l,o),z(r,l,null),k(l,a),_&&_.m(l,null),k(l,f),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&Tt(m,d,y,y[19],c?$t(d,y[19],S,L$):Ct(y[19]),Qc);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&Tt(_,h,y,y[19],c?$t(h,y[19],S,A$):Ct(y[19]),Xc),y[0].toDelete?g&&(ie(),A(g,1,1,()=>{g=null}),le()):g?(g.p(y,S),S&1&&E(g,1)):(g=id(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(u||(u=Fe(e,et,{duration:150},!0)),u.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(u||(u=Fe(e,et,{duration:150},!1)),u.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),V(s),V(r),_&&_.d(y),g&&g.d(),y&&u&&u.end()}}}function j$(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=K(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",u=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[J(e,"change",n[17]),Se(f=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&se(o,m[4]),f&&Mt(f.update)&&h&1&&f.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&u!==(u=m[25])&&p(l,"for",u)},d(m){m&&(v(e),v(i),v(l)),c=!1,$e(d)}}}function H$(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],f=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function id(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f&524288&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(o)}}}function z$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Duplicate',t=M(),i=b("button"),i.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",Be(n[10])),J(i,"click",Be(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function V$(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&ed();l=new ue({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[P$]},$$scope:{ctx:n}}});const c=n[14].default,d=St(c,n,n[19],xc),m=d||F$();function h(S,T){if(S[0].toDelete)return q$;if(S[6])return R$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&nd(n);return{c(){e=b("div"),t=b("div"),u&&u.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),u&&u.m(t,null),k(t,i),z(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),f=!0},p(S,[T]){S[6]?u||(u=ed(),u.c(),u.m(t,i)):u&&(u.d(1),u=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!f||T&524384)&&Tt(d,c,S,S[19],f?$t(c,S[19],T,N$):Ct(S[19]),xc),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=nd(S),y.c(),E(y,1),y.m(e,null)):y&&(ie(),A(y,1,1,()=>{y=null}),le()),(!f||T&1)&&x(e,"required",S[0].required),(!f||T&72)&&x(e,"expanded",S[6]&&S[3]),(!f||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){f||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(S){S&&v(e),u&&u.d(),V(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function B$(n,e,t){let i,l,s,o;We(n,mi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const f="f_"+j.randomString(8),u=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),u("remove"))}function y(){t(0,m.toDelete=!1,m),Zt({})}function S(){m.toDelete||(C(),u("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of Or)N.id!=f&&N.collapse()}zt(()=>(Or.push({id:f,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(Or,"id",f)}));function I(N){te[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,u("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,u,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,B$,V$,pe,{key:1,field:0})}}function U$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.min),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&oe(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function W$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),oe(s,n[0].options.max),a||(f=J(s,"input",n[4]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&oe(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function Y$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.pattern),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&s.value!==f[0].options.pattern&&oe(s,f[0].options.pattern)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function K$(n){let e,t,i,l,s,o,r,a,f,u;return i=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[U$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[W$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),f=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[Y$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),u=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),f.$set(_)},i(c){u||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(f.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(f.$$.fragment,c),u=!1},d(c){c&&v(e),V(i),V(o),V(f)}}}function J$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[K$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function Z$(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function f(){s.options.pattern=this.value,t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ae(Ae({},e),Kt(h)),t(2,l=Xe(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class G$ extends ge{constructor(e){super(),_e(this,e,Z$,J$,pe,{field:0,key:1})}}function X$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.min),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&1024&&i!==(i=f[10])&&p(e,"for",i),u&1024&&o!==(o=f[10])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.min&&oe(s,f[0].options.min)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function Q$(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),oe(s,n[0].options.max),a||(f=J(s,"input",n[5]),a=!0)},p(u,c){c&1024&&i!==(i=u[10])&&p(e,"for",i),c&1024&&o!==(o=u[10])&&p(s,"id",o),c&1&&r!==(r=u[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.max&&oe(s,u[0].options.max)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x$(n){let e,t,i,l,s,o,r;return i=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[X$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Q$,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&3073&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&3073&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function eT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],f=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function tT(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[eT,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[tT],options:[x$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&2051&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function iT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function f(){s.options.max=it(this.value),t(0,s)}function u(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ae(Ae({},e),Kt(h)),t(2,l=Xe(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,f,u,c,d,m]}class lT extends ge{constructor(e){super(),_e(this,e,iT,nT,pe,{field:0,key:1})}}function sT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ae(Ae({},e),Kt(c)),t(2,l=Xe(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class rT extends ge{constructor(e){super(),_e(this,e,oT,sT,pe,{field:0,key:1})}}function aT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ae(Ae({},e),Kt(c)),t(5,s=Xe(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,f=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,f,i,s,u]}class Fl extends ge{constructor(e){super(),_e(this,e,fT,aT,pe,{value:0,separator:1,readonly:2,disabled:3})}}function uT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Fl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function cT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Fl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function dT(n){let e,t,i,l,s,o,r;return i=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[uT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[cT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function pT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[dT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ae(Ae({},e),Kt(m)),t(2,l=Xe(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Wb extends ge{constructor(e){super(),_e(this,e,mT,pT,pe,{field:0,key:1})}}function hT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function _T(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ae(Ae({},e),Kt(c)),t(2,l=Xe(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class gT extends ge{constructor(e){super(),_e(this,e,_T,hT,pe,{field:0,key:1})}}function bT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[3]),Se(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function kT(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[bT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[kT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function vT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function f(m){s=m,t(0,s)}function u(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ae(Ae({},e),Kt(m)),t(2,l=Xe(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,f,u,c,d]}class wT extends ge{constructor(e){super(),_e(this,e,vT,yT,pe,{field:0,key:1})}}var Mr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$l={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},_s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function ld(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function fn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ct(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Yb(n,e){if(e(n))return n;if(n.parentNode)return Yb(n.parentNode,e)}function no(n,e){var t=ct("div","numInputWrapper"),i=ct("input","numInput "+n),l=ct("span","arrowUp"),s=ct("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Ro=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},ST={D:Er,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Er,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Ui={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ls={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ls.w(n,e,t)]},F:function(n,e,t){return Ro(ls.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ls.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Ro(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Kb=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,f){var u=f||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,u):a.split("").map(function(c,d,m){return ls[c]&&m[d-1]!=="\\"?ls[c](r,u,t):c!=="\\"?c:""}).join("")}},aa=function(n){var e=n.config,t=e===void 0?$l:e,i=n.l10n,l=i===void 0?_s:i;return function(s,o,r,a){if(!(s!==0&&!s)){var f=a||l,u,c=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var d=o||(t||$l).dateFormat,m=String(s).trim();if(m==="today")u=new Date,r=!0;else if(t&&t.parseDate)u=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))u=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";gMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ar(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var ae=t._input.value;c(),Jt(),t._input.value!==ae&&t._debouncedChange()}function f(Z,X){return Z%12+12*In(X===t.l10n.amPM[1])}function u(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=f(Z,t.amPM.textContent));var ae=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ne=Ir(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ze=Ir(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Ir(Z,X,ne);if(qe>Ze&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(Z){var X=yn(Z),ne=parseInt(X.value)+(Z.delta||0);(ne/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&bt(ne)}function _(Z,X,ne,ae){if(X instanceof Array)return X.forEach(function(Te){return _(Z,Te,ne,ae)});if(Z instanceof Array)return Z.forEach(function(Te){return _(Te,X,ne,ae)});Z.addEventListener(X,ne,ae),t._handlers.push({remove:function(){return Z.removeEventListener(X,ne,ae)}})}function g(){gt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(ae){return _(ae,"click",t[ne])})}),t.isMobile){al();return}var Z=ld(ze,50);if(t._debouncedChange=ld(g,OT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Le(yn(ne))}),_(t._input,"keydown",Ee),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Ee),!t.config.inline&&!t.config.static&&_(window,"resize",Z),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ft),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",ol)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Ot)}function S(Z,X){var ne=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ne=ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ne,t.element),Ne.appendChild(t.element),t.altInput&&Ne.appendChild(t.altInput),Ne.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Z,X,ne,ae){var Te=kt(X,!0),Ne=ct("span",Z,X.getDate().toString());return Ne.dateObj=X,Ne.$i=ae,Ne.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Ne,Ne.classList.add("today"),Ne.setAttribute("aria-current","date")),Te?(Ne.tabIndex=-1,Mn(X)&&(Ne.classList.add("selected"),t.selectedDateElem=Ne,t.config.mode==="range"&&(fn(Ne,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),fn(Ne,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Ne.classList.add("inRange")))):Ne.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Ne.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&ae%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),gt("onDayCreate",Ne),Ne}function D(Z){Z.focus(),t.config.mode==="range"&&Le(Z)}function I(Z){for(var X=Z>0?0:t.config.showMonths-1,ne=Z>0?t.config.showMonths:-1,ae=X;ae!=ne;ae+=Z)for(var Te=t.daysContainer.children[ae],Ne=Z>0?0:Te.children.length-1,Ze=Z>0?Te.children.length:-1,qe=Ne;qe!=Ze;qe+=Z){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&kt(Qe.dateObj))return Qe}}function L(Z,X){for(var ne=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,ae=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Ne=ne-t.currentMonth;Ne!=ae;Ne+=Te)for(var Ze=t.daysContainer.children[Ne],qe=ne-t.currentMonth===Ne?Z.$i+X:X<0?Ze.children.length-1:0,Qe=Ze.children.length,Re=qe;Re>=0&&Re0?Qe:-1);Re+=Te){var Ve=Ze.children[Re];if(Ve.className.indexOf("hidden")===-1&&kt(Ve.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(Z,X){var ne=s(),ae=yt(ne||document.body),Te=Z!==void 0?Z:ae?ne:t.selectedDateElem!==void 0&&yt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&yt(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():ae?L(Te,X):D(Te)}function F(Z,X){for(var ne=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ae=t.utils.getDaysInMonth((X-1+12)%12,Z),Te=t.utils.getDaysInMonth(X,Z),Ne=window.document.createDocumentFragment(),Ze=t.config.showMonths>1,qe=Ze?"prevMonthDay hidden":"prevMonthDay",Qe=Ze?"nextMonthDay hidden":"nextMonthDay",Re=ae+1-ne,Ve=0;Re<=ae;Re++,Ve++)Ne.appendChild(O("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Ne.appendChild(O("flatpickr-day",new Date(Z,X,Re),Re,Ve));for(var vt=Te+1;vt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);vt++,Ve++)Ne.appendChild(O("flatpickr-day "+Qe,new Date(Z,X+1,vt%Te),vt,Ve));var Jn=ct("div","dayContainer");return Jn.appendChild(Ne),Jn}function N(){if(t.daysContainer!==void 0){to(t.daysContainer),t.weekNumbers&&to(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(ae){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&aet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ne=ct("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=Ro(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Z=ct("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ct("span","cur-month"):(t.monthsDropdownContainer=ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Ze){var qe=yn(Ze),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),gt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var ae=no("cur-year",{tabindex:"-1"}),Te=ae.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ne=ct("div","flatpickr-current-month");return Ne.appendChild(ne),Ne.appendChild(ae),X.appendChild(Ne),Z.appendChild(X),{container:Z,yearElement:Te,monthElement:ne}}function H(){to(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){return t.monthNav=ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(fn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(fn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Me(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Ar(t.config);t.timeContainer=ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ct("span","flatpickr-time-separator",":"),ne=no("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var ae=no("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ae.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:u(Z.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(X),t.timeContainer.appendChild(ae),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=no("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ct("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function U(){t.weekdayContainer?to(t.weekdayContainer):t.weekdayContainer=ct("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Y(),t.weekdayContainer}function Y(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=sd(t.l10n.weekdays.shorthand);Z>0&&Z `+X.join("")+` - `}}function ie(){t.calendarContainer.classList.add("hasWeeks");var Z=dt("div","flatpickr-weekwrapper");Z.appendChild(dt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=dt("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function te(Z,X){X===void 0&&(X=!0);var ne=X?Z:Z-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,kt("onYearChange"),P()),N(),kt("onMonthChange"),Oe())}function pe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ar(t.config),fe=ne.hours,Te=ne.minutes,Le=ne.seconds;m(fe,Te,Le)}t.redraw(),Z&&kt("onChange")}function Ne(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),kt("onClose")}function He(){t.config!==void 0&&kt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Xe(Z){return t.calendarContainer.contains(Z)}function xe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ne=Xe(X),fe=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),Te=!fe&&!ne&&!Xe(Z.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});Te&&Le&&(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 Mt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ne=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),kt("onYearChange"),P())}}function ft(Z,X){var ne;X===void 0&&(X=!0);var fe=t.parseDate(Z,void 0,X);if(t.config.minDate&&fe&&vn(fe,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&fe&&vn(fe,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(fe===void 0)return!1;for(var Te=!!t.config.enable,Le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Je=0,qe=void 0;Je=qe.from.getTime()&&fe.getTime()<=qe.to.getTime())return Te}return!Te}function ht(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Gt(Z){var X=Z.target===t._input,ne=t._input.value.trimEnd()!==_t();X&&ne&&!(Z.relatedTarget&&Xe(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function De(Z){var X=yn(Z),ne=t.config.wrap?n.contains(X):X===t._input,fe=t.config.allowInput,Te=t.isOpen&&(!fe||!ne),Le=t.config.inline&&ne&&!fe;if(Z.keyCode===13&&ne){if(fe)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Xe(X)||Te||Le){var Je=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Je?(Z.preventDefault(),a(),Li()):ol(Z);break;case 27:Z.preventDefault(),Li();break;case 8:case 46:ne&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Je&&!ne){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(fe===!1||qe&&ht(qe))){var Qe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),te(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),Mt(t.currentYear-Re),R(I(1),0)):Je||R(void 0,Re*7):X===t.currentYearElement?Mt(t.currentYear-Re):t.config.enableTime&&(!Je&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Je){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(kn){return kn}),yt=Ve.indexOf(X);if(yt!==-1){var Jn=Ve[yt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Kt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Kt();break}(ne||Xe(X))&&kt("onKeyDown",Z)}function Ae(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ne=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),fe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Le=Math.max(ne,t.selectedDates[0].getTime()),Je=!1,qe=0,Qe=0,Re=Te;ReTe&&Reqe)?qe=Re:Re>fe&&(!Qe||Re ."+X));Ve.forEach(function(yt){var Jn=yt.dateObj,kn=Jn.getTime(),ql=qe>0&&kn0&&kn>Qe;if(ql){yt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ul){yt.classList.remove(ul)});return}else if(Je&&!ql)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ul){yt.classList.remove(ul)}),Z!==void 0&&(Z.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),fene&&kn===fe&&yt.classList.add("endRange"),kn>=qe&&(Qe===0||kn<=Qe)&&$T(kn,fe,ne)&&yt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function bt(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ne=yn(Z);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),kt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var fe=t.isOpen;t.isOpen=!0,fe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),kt("onOpen"),zt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function de(Z){return function(X){var ne=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),fe=t.config["_"+(Z==="min"?"max":"min")+"Date"];ne!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return ft(Te)}),!t.selectedDates.length&&Z==="min"&&d(ne),Kt()),t.daysContainer&&(qn(),ne!==void 0?t.currentYearElement[Z]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!fe&&ne!==void 0&&fe.getFullYear()===ne.getFullYear())}}function ve(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=nn(nn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Kn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Kn(Ve)}});var fe=X.mode==="time";if(!X.dateFormat&&(X.enableTime||fe)){var Te=Bt.defaultConfig.dateFormat||$l.dateFormat;ne.dateFormat=X.noCalendar||fe?"H:i"+(X.enableSeconds?":S":""):Te+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||fe)&&!X.altFormat){var Le=Bt.defaultConfig.altFormat||$l.altFormat;ne.altFormat=X.noCalendar||fe?"h:i"+(X.enableSeconds?":S K":" K"):Le+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:de("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:de("max")});var Je=function(Ve){return function(yt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(yt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Je("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Je("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe-1?t.config[Re]=Dr(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=we().className+" "+t.config.altInputClass),kt("onParseConfig")}function we(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ye(){typeof t.config.locale!="object"&&typeof Bt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=nn(nn({},Bt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Bt.l10ns[t.config.locale]:void 0),Ui.D="("+t.l10n.weekdays.shorthand.join("|")+")",Ui.l="("+t.l10n.weekdays.longhand.join("|")+")",Ui.M="("+t.l10n.months.shorthand.join("|")+")",Ui.F="("+t.l10n.months.longhand.join("|")+")",Ui.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=nn(nn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Bt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Kb(t),t.parseDate=aa({config:t.config,l10n:t.l10n})}function zt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){kt("onPreCalendarPosition");var X=Z||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(u0,c0){return u0+c0.offsetHeight},0),fe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Le=Te[0],Je=Te.length>1?Te[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Le==="above"||Le!=="below"&&Qene,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(fn(t.calendarContainer,"arrowTop",!Re),fn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var yt=window.pageXOffset+qe.left,Jn=!1,kn=!1;Je==="center"?(yt-=(fe-qe.width)/2,Jn=!0):Je==="right"&&(yt-=fe-qe.width,kn=!0),fn(t.calendarContainer,"arrowLeft",!Jn&&!kn),fn(t.calendarContainer,"arrowCenter",Jn),fn(t.calendarContainer,"arrowRight",kn);var ql=window.document.body.offsetWidth-(window.pageXOffset+qe.right),ul=yt+fe>window.document.body.offsetWidth,i0=ql+fe>window.document.body.offsetWidth;if(fn(t.calendarContainer,"rightMost",ul),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!ul)t.calendarContainer.style.left=yt+"px",t.calendarContainer.style.right="auto";else if(!i0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=ql+"px";else{var nr=dn();if(nr===void 0)return;var l0=window.document.body.offsetWidth,s0=Math.max(0,l0/2-fe/2),o0=".flatpickr-calendar.centerMost:before",r0=".flatpickr-calendar.centerMost:after",a0=nr.cssRules.length,f0="{left:"+qe.left+"px;right:auto;}";fn(t.calendarContainer,"rightMost",!1),fn(t.calendarContainer,"centerMost",!0),nr.insertRule(o0+","+r0+f0,a0),t.calendarContainer.style.left=s0+"px",t.calendarContainer.style.right="auto"}}}}function dn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=fe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Je=Mn(Te);Je?t.selectedDates.splice(parseInt(Je),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),vn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,yt){return Ve.getTime()-yt.getTime()}));if(c(),Le){var qe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),qe&&(kt("onYearChange"),P()),kt("onMonthChange")}if(Oe(),N(),Kt(),!Le&&t.config.mode!=="range"&&t.config.showMonths===1?D(fe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Li()}g()}}var gi={locale:[Ye,Y],showMonths:[H,r,U],minDate:[S],maxDate:[S],positionElement:[bi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ee(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ne in Z)gi[ne]!==void 0&&gi[ne].forEach(function(fe){return fe()})}else t.config[Z]=X,gi[Z]!==void 0?gi[Z].forEach(function(fe){return fe()}):Mr.indexOf(Z)>-1&&(t.config[Z]=Dr(X));t.redraw(),Kt(!0)}function Nt(Z,X){var ne=[];if(Z instanceof Array)ne=Z.map(function(fe){return t.parseDate(fe,X)});else if(Z instanceof Date||typeof Z=="number")ne=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(Z,X)];break;case"multiple":ne=Z.split(t.config.conjunction).map(function(fe){return t.parseDate(fe,X)});break;case"range":ne=Z.split(t.l10n.rangeSeparator).map(function(fe){return t.parseDate(fe,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(fe){return fe instanceof Date&&ft(fe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(fe,Te){return fe.getTime()-Te.getTime()})}function Ni(Z,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Nt(Z,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Kt(X),X&&kt("onChange")}function Kn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function rl(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Nt(Z,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Rl(){if(t.input=we(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=dt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bi()}function bi(){t._positionElement=t.config.positionElement||t._input}function al(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=dt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),kt("onChange"),kt("onClose")})}function fl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function kt(Z,X){if(t.config!==void 0){var ne=t.config[Z];if(ne!==void 0&&ne.length>0)for(var fe=0;ne[fe]&&fe=0&&vn(Z,t.selectedDates[1])<=0}function Oe(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Ro(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),Z.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function _t(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,fe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===fe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Kt(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=_t(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=_t(t.config.altFormat)),Z!==!1&&kt("onValueUpdate")}function ut(Z){var X=yn(Z),ne=t.prevMonthNav.contains(X),fe=t.nextMonthNav.contains(X);ne||fe?te(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ne=yn(Z),fe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(fe.getAttribute("min")),Le=parseFloat(fe.getAttribute("max")),Je=parseFloat(fe.getAttribute("step")),qe=parseInt(fe.value,10),Qe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Je*Qe;if(typeof fe.value<"u"&&fe.value.length===2){var Ve=fe===t.hourElement,yt=fe===t.minuteElement;ReLe&&(Re=fe===t.hourElement?Re-Le-In(!t.amPM):Te,yt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Je===1?Re+qe===23:Math.abs(Re-qe)>Je)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),fe.value=mn(Re)}}return l(),t}function Tl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function AT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:f="",element:u=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Ht(()=>{const $=u??h,C=y(d);return C.onReady.push((O,D,I)=>{a===void 0&&S(O,D,I),Qt().then(()=>{t(8,m=!0)})}),t(3,_=Bt($,Object.assign(C,u?{wrap:!0}:{}))),()=>{_.destroy()}});const g=lt();function y($={}){$=Object.assign({},$);for(const C of r){const O=(D,I,L)=>{g(IT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(O)):$[C]=[O]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,O){const D=od(O,$);!rd(a,D)&&(a||D)&&t(2,a=D),t(4,f=C)}function T($){ee[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Ie(Ie({},e),Yt($)),t(1,l=Ge(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,f=$.formattedValue),"element"in $&&t(5,u=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(rd(a,od(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,f,u,c,d,m,o,s,T]}class Wa extends ge{constructor(e){super(),_e(this,e,AT,ET,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function LT(n){let e,t,i,l,s,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Wa({props:c}),ee.push(()=>be(s,"value",f)),ee.push(()=>be(s,"formattedValue",u)),s.$on("close",n[8]),{c(){e=b("label"),t=K("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function NT(n){let e,t,i,l,s,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Wa({props:c}),ee.push(()=>be(s,"value",f)),ee.push(()=>be(s,"formattedValue",u)),s.$on("close",n[11]),{c(){e=b("label"),t=K("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function PT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[LT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[NT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&196613&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&196617&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function FT(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[PT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ot(r[5])]):{};a&131087&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function RT(n,e,t){var $,C;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function f(O,D){O.detail&&O.detail.length==3&&t(0,s.options[D]=O.detail[1],s)}function u(O){r=O,t(2,r),t(0,s)}function c(O){n.$$.not_equal(s.options.min,O)&&(s.options.min=O,t(0,s))}const d=O=>f(O,"min");function m(O){a=O,t(3,a),t(0,s)}function h(O){n.$$.not_equal(s.options.max,O)&&(s.options.max=O,t(0,s))}const _=O=>f(O,"max");function g(O){s=O,t(0,s)}function y(O){Ce.call(this,n,O)}function S(O){Ce.call(this,n,O)}function T(O){Ce.call(this,n,O)}return n.$$set=O=>{e=Ie(Ie({},e),Yt(O)),t(5,l=Ge(e,i)),"field"in O&&t(0,s=O.field),"key"in O&&t(1,o=O.key)},n.$$.update=()=>{var O,D,I,L;n.$$.dirty&5&&r!=((O=s==null?void 0:s.options)==null?void 0:O.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,f,l,u,c,d,m,h,_,g,y,S,T]}class qT extends ge{constructor(e){super(),_e(this,e,RT,FT,me,{field:0,key:1})}}const jT=n=>({}),ad=n=>({});function fd(n,e,t){const i=n.slice();return i[48]=e[t],i}const HT=n=>({}),ud=n=>({});function cd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function dd(n){let e,t,i;return{c(){e=b("div"),t=K(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function zT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function VT(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&2049?pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ot(r[11])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function pd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Clear")),J(e,"click",Tn(Be(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function md(n){let e,t,i,l,s,o;const r=[VT,zT],a=[];function f(c,d){return c[10]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[8])&&pd(n);return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),u&&u.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(le(),A(a[m],1,1,()=>{a[m]=null}),se(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?u?u.p(c,d):(u=pd(c),u.c(),u.m(e,s)):u&&(u.d(1),u=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),u&&u.d()}}}function hd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[WT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function _d(n){let e,t,i,l,s,o,r,a,f=n[17].length&&gd(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),f&&f.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(t,l),k(t,s),re(s,n[17]),k(t,o),f&&f.m(t,null),s.focus(),r||(a=J(s,"input",n[38]),r=!0)},p(u,c){c[0]&8&&p(s,"placeholder",u[3]),c[0]&131072&&s.value!==u[17]&&re(s,u[17]),u[17].length?f?f.p(u,c):(f=gd(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&v(e),f&&f.d(),r=!1,a()}}}function gd(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",Tn(Be(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function bd(n){let e,t=n[1]&&kd(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=kd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function kd(n){let e,t;return{c(){e=b("div"),t=K(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&v(e)}}}function BT(n){let e=n[48]+"",t;return{c(){t=K(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&oe(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function UT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let f={};for(let u=0;u{V(f,1)}),se()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&4202496?pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ot(r[13])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function yd(n){let e,t,i,l,s,o,r;const a=[UT,BT],f=[];function u(m,h){return m[12]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),f[t].m(e,null),k(e,l),s=!0,o||(r=[J(e,"click",c),J(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=u(n),t===_?f[t].p(n,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),i=f[t],i?i.p(n,h):(i=f[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),f[t].d(),o=!1,$e(r)}}}function WT(n){let e,t,i,l,s,o=n[14]&&_d(n);const r=n[35].beforeOptions,a=wt(r,n,n[44],ud);let f=ue(n[22]),u=[];for(let _=0;_A(u[_],1,1,()=>{u[_]=null});let d=null;f.length||(d=bd(n));const m=n[35].afterOptions,h=wt(m,n,n[44],ad);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let _=0;_A(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=dd(n));let c=!n[5]&&!n[6]&&hd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),se()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mwe(Ye,ve))||[]}function Ne(de,ve){de.preventDefault(),y&&d?W(ve):H(ve)}function He(de,ve){(de.code==="Enter"||de.code==="Space")&&(Ne(de,ve),S&&Y())}function Xe(){te(),setTimeout(()=>{const de=N==null?void 0:N.querySelector(".dropdown-item.option.selected");de&&(de.focus(),de.scrollIntoView({block:"nearest"}))},0)}function xe(de){de.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Ht(()=>{const de=document.querySelectorAll(`label[for="${r}"]`);for(const ve of de)ve.addEventListener("click",xe);return()=>{for(const ve of de)ve.removeEventListener("click",xe)}});const Mt=de=>q(de);function ft(de){ee[de?"unshift":"push"](()=>{P=de,t(20,P)})}function ht(){F=this.value,t(17,F)}const Gt=(de,ve)=>Ne(ve,de),De=(de,ve)=>He(ve,de);function Ae(de){ee[de?"unshift":"push"](()=>{R=de,t(18,R)})}function ze(de){Ce.call(this,n,de)}function bt(de){ee[de?"unshift":"push"](()=>{N=de,t(19,N)})}return n.$$set=de=>{"id"in de&&t(27,r=de.id),"noOptionsText"in de&&t(1,a=de.noOptionsText),"selectPlaceholder"in de&&t(2,f=de.selectPlaceholder),"searchPlaceholder"in de&&t(3,u=de.searchPlaceholder),"items"in de&&t(28,c=de.items),"multiple"in de&&t(4,d=de.multiple),"disabled"in de&&t(5,m=de.disabled),"readonly"in de&&t(6,h=de.readonly),"upside"in de&&t(7,_=de.upside),"selected"in de&&t(0,g=de.selected),"toggle"in de&&t(8,y=de.toggle),"closable"in de&&t(9,S=de.closable),"labelComponent"in de&&t(10,T=de.labelComponent),"labelComponentProps"in de&&t(11,$=de.labelComponentProps),"optionComponent"in de&&t(12,C=de.optionComponent),"optionComponentProps"in de&&t(13,O=de.optionComponentProps),"searchable"in de&&t(14,D=de.searchable),"searchFunc"in de&&t(29,I=de.searchFunc),"class"in de&&t(15,L=de.class),"$$scope"in de&&t(44,o=de.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ie(),te()),n.$$.dirty[0]&268566528&&t(22,i=pe(c,F)),n.$$.dirty[0]&1&&t(21,l=function(de){const ve=j.toArray(g);return j.inArray(ve,de)})},[g,a,f,u,d,m,h,_,y,S,T,$,C,O,D,L,q,F,R,N,P,l,i,te,Ne,He,Xe,r,c,I,H,W,G,U,Y,s,Mt,ft,ht,Gt,De,Ae,ze,bt,o]}class Jb extends ge{constructor(e){super(),_e(this,e,JT,YT,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function vd(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function ZT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&vd(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=K(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=vd(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function GT(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class wd extends ge{constructor(e){super(),_e(this,e,GT,ZT,me,{item:0})}}const XT=n=>({}),Sd=n=>({});function QT(n){let e;const t=n[8].afterOptions,i=wt(t,n,n[12],Sd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&$t(i,t,l,l[12],e?St(t,l[12],s,XT):Tt(l[12]),Sd)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function xT(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[QT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&62?pt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ot(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function eC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ge(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=wd}=e,{optionComponent:c=wd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const O=j.findByKey(r,d,C);O&&$.push(O)}T.length&&!$.length||t(0,f=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){f=T,t(0,f)}function y(T){Ce.call(this,n,T)}function S(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ie(Ie({},e),Yt(T)),t(5,l=Ge(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,f=T.selected),"labelComponent"in T&&t(3,u=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(f)},[f,r,a,u,c,l,m,d,s,g,y,S,o]}class hi extends ge{constructor(e){super(),_e(this,e,eC,xT,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function tC(n){let e,t,i,l,s,o;function r(f){n[7](f)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Fl({props:a}),ee.push(()=>be(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(f,u){w(f,e,u),z(t,e,null),l=!0,s||(o=Se(Pe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(f,u){const c={};u&16384&&(c.id=f[14]),u&32768&&(c.readonly=!f[15]),!i&&u&1&&(i=!0,c.value=f[0].options.values,ke(()=>i=!1)),t.$set(c)},i(f){l||(E(t.$$.fragment,f),l=!0)},o(f){A(t.$$.fragment,f),l=!1},d(f){f&&v(e),V(t),s=!1,o()}}}function nC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function iC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[tC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[nC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function $d(n){let e,t;return e=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[lC,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function sC(n){let e,t,i=!n[2]&&$d(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(le(),A(i,1,1,()=>{i=null}),se()):i?(i.p(l,s),s&4&&E(i,1)):(i=$d(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function oC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[sC],default:[iC,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&18?pt(l,[a&2&&{key:r[1]},a&16&&Ot(r[4])]):{};a&98311&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function rC(n,e,t){var S;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,f=a;function u(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,f=a)}function c(){s.options.maxSelect=it(this.value),t(0,s),t(5,f),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,f),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,f),t(2,a)}function _(T){Ce.call(this,n,T)}function g(T){Ce.call(this,n,T)}function y(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ie(Ie({},e),Yt(T)),t(4,l=Ge(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&u()},[s,o,a,r,l,f,c,d,m,h,_,g,y]}class aC extends ge{constructor(e){super(),_e(this,e,rC,oC,me,{field:0,key:1})}}function fC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max size "),i=b("small"),i.textContent="(bytes)",s=M(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(u,c){w(u,e,c),k(e,t),k(e,i),w(u,s,c),w(u,o,c),re(o,n[0].options.maxSize),a||(f=J(o,"input",n[4]),a=!0)},p(u,c){c&2048&&l!==(l=u[11])&&p(e,"for",l),c&2048&&r!==(r=u[11])&&p(o,"id",r),c&1&&it(o.value)!==u[0].options.maxSize&&re(o,u[0].options.maxSize)},d(u){u&&(v(e),v(s),v(o)),a=!1,f()}}}function uC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Td(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,H,W,G,U,Y,ie;return{c(){e=b("div"),t=b("div"),i=b("div"),l=K("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=K(` and + `}}function me(){t.calendarContainer.classList.add("hasWeeks");var Z=ct("div","flatpickr-weekwrapper");Z.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function ee(Z,X){X===void 0&&(X=!0);var ne=X?Z:Z-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,gt("onYearChange"),P()),N(),gt("onMonthChange"),Me())}function ce(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ar(t.config),ae=ne.hours,Te=ne.minutes,Ne=ne.seconds;m(ae,Te,Ne)}t.redraw(),Z&>("onChange")}function Oe(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),gt("onClose")}function He(){t.config!==void 0&>("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Je(Z){return t.calendarContainer.contains(Z)}function xe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ne=Je(X),ae=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),Te=!ae&&!ne&&!Je(Z.relatedTarget),Ne=!t.config.ignoredFocusElements.some(function(Ze){return Ze.contains(X)});Te&&Ne&&(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 bt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ne=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),gt("onYearChange"),P())}}function kt(Z,X){var ne;X===void 0&&(X=!0);var ae=t.parseDate(Z,void 0,X);if(t.config.minDate&&ae&&vn(ae,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&ae&&vn(ae,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ae===void 0)return!1;for(var Te=!!t.config.enable,Ne=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Ze=0,qe=void 0;Ze=qe.from.getTime()&&ae.getTime()<=qe.to.getTime())return Te}return!Te}function yt(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Ot(Z){var X=Z.target===t._input,ne=t._input.value.trimEnd()!==mt();X&&ne&&!(Z.relatedTarget&&Je(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ee(Z){var X=yn(Z),ne=t.config.wrap?n.contains(X):X===t._input,ae=t.config.allowInput,Te=t.isOpen&&(!ae||!ne),Ne=t.config.inline&&ne&&!ae;if(Z.keyCode===13&&ne){if(ae)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Je(X)||Te||Ne){var Ze=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Ze?(Z.preventDefault(),a(),Li()):ol(Z);break;case 27:Z.preventDefault(),Li();break;case 8:case 46:ne&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Ze&&!ne){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(ae===!1||qe&&yt(qe))){var Qe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),ee(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),bt(t.currentYear-Re),R(I(1),0)):Ze||R(void 0,Re*7):X===t.currentYearElement?bt(t.currentYear-Re):t.config.enableTime&&(!Ze&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Ze){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(kn){return kn}),vt=Ve.indexOf(X);if(vt!==-1){var Jn=Ve[vt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Jt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Jt();break}(ne||Je(X))&>("onKeyDown",Z)}function Le(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ne=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ae=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Ne=Math.max(ne,t.selectedDates[0].getTime()),Ze=!1,qe=0,Qe=0,Re=Te;ReTe&&Reqe)?qe=Re:Re>ae&&(!Qe||Re ."+X));Ve.forEach(function(vt){var Jn=vt.dateObj,kn=Jn.getTime(),ql=qe>0&&kn0&&kn>Qe;if(ql){vt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ul){vt.classList.remove(ul)});return}else if(Ze&&!ql)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ul){vt.classList.remove(ul)}),Z!==void 0&&(Z.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),aene&&kn===ae&&vt.classList.add("endRange"),kn>=qe&&(Qe===0||kn<=Qe)&&$T(kn,ae,ne)&&vt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&Vt()}function _t(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ne=yn(Z);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),gt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ae=t.isOpen;t.isOpen=!0,ae||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),gt("onOpen"),Vt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function de(Z){return function(X){var ne=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),ae=t.config["_"+(Z==="min"?"max":"min")+"Date"];ne!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return kt(Te)}),!t.selectedDates.length&&Z==="min"&&d(ne),Jt()),t.daysContainer&&(qn(),ne!==void 0?t.currentYearElement[Z]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!ae&&ne!==void 0&&ae.getFullYear()===ne.getFullYear())}}function ve(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=nn(nn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Kn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Kn(Ve)}});var ae=X.mode==="time";if(!X.dateFormat&&(X.enableTime||ae)){var Te=Ut.defaultConfig.dateFormat||$l.dateFormat;ne.dateFormat=X.noCalendar||ae?"H:i"+(X.enableSeconds?":S":""):Te+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||ae)&&!X.altFormat){var Ne=Ut.defaultConfig.altFormat||$l.altFormat;ne.altFormat=X.noCalendar||ae?"h:i"+(X.enableSeconds?":S K":" K"):Ne+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:de("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:de("max")});var Ze=function(Ve){return function(vt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(vt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ze("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ze("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe-1?t.config[Re]=Dr(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=we().className+" "+t.config.altInputClass),gt("onParseConfig")}function we(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ye(){typeof t.config.locale!="object"&&typeof Ut.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=nn(nn({},Ut.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Ut.l10ns[t.config.locale]:void 0),Ui.D="("+t.l10n.weekdays.shorthand.join("|")+")",Ui.l="("+t.l10n.weekdays.longhand.join("|")+")",Ui.M="("+t.l10n.months.shorthand.join("|")+")",Ui.F="("+t.l10n.months.longhand.join("|")+")",Ui.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=nn(nn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Ut.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Kb(t),t.parseDate=aa({config:t.config,l10n:t.l10n})}function Vt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){gt("onPreCalendarPosition");var X=Z||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(u0,c0){return u0+c0.offsetHeight},0),ae=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ne=Te[0],Ze=Te.length>1?Te[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Ne==="above"||Ne!=="below"&&Qene,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(fn(t.calendarContainer,"arrowTop",!Re),fn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var vt=window.pageXOffset+qe.left,Jn=!1,kn=!1;Ze==="center"?(vt-=(ae-qe.width)/2,Jn=!0):Ze==="right"&&(vt-=ae-qe.width,kn=!0),fn(t.calendarContainer,"arrowLeft",!Jn&&!kn),fn(t.calendarContainer,"arrowCenter",Jn),fn(t.calendarContainer,"arrowRight",kn);var ql=window.document.body.offsetWidth-(window.pageXOffset+qe.right),ul=vt+ae>window.document.body.offsetWidth,i0=ql+ae>window.document.body.offsetWidth;if(fn(t.calendarContainer,"rightMost",ul),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!ul)t.calendarContainer.style.left=vt+"px",t.calendarContainer.style.right="auto";else if(!i0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=ql+"px";else{var nr=dn();if(nr===void 0)return;var l0=window.document.body.offsetWidth,s0=Math.max(0,l0/2-ae/2),o0=".flatpickr-calendar.centerMost:before",r0=".flatpickr-calendar.centerMost:after",a0=nr.cssRules.length,f0="{left:"+qe.left+"px;right:auto;}";fn(t.calendarContainer,"rightMost",!1),fn(t.calendarContainer,"centerMost",!0),nr.insertRule(o0+","+r0+f0,a0),t.calendarContainer.style.left=s0+"px",t.calendarContainer.style.right="auto"}}}}function dn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ae,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Ze=Mn(Te);Ze?t.selectedDates.splice(parseInt(Ze),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),vn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,vt){return Ve.getTime()-vt.getTime()}));if(c(),Ne){var qe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),qe&&(gt("onYearChange"),P()),gt("onMonthChange")}if(Me(),N(),Jt(),!Ne&&t.config.mode!=="range"&&t.config.showMonths===1?D(ae):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Li()}g()}}var gi={locale:[Ye,Y],showMonths:[H,r,U],minDate:[S],maxDate:[S],positionElement:[bi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ie(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ne in Z)gi[ne]!==void 0&&gi[ne].forEach(function(ae){return ae()})}else t.config[Z]=X,gi[Z]!==void 0?gi[Z].forEach(function(ae){return ae()}):Mr.indexOf(Z)>-1&&(t.config[Z]=Dr(X));t.redraw(),Jt(!0)}function Pt(Z,X){var ne=[];if(Z instanceof Array)ne=Z.map(function(ae){return t.parseDate(ae,X)});else if(Z instanceof Date||typeof Z=="number")ne=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(Z,X)];break;case"multiple":ne=Z.split(t.config.conjunction).map(function(ae){return t.parseDate(ae,X)});break;case"range":ne=Z.split(t.l10n.rangeSeparator).map(function(ae){return t.parseDate(ae,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(ae){return ae instanceof Date&&kt(ae,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ae,Te){return ae.getTime()-Te.getTime()})}function Ni(Z,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Pt(Z,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Jt(X),X&>("onChange")}function Kn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function rl(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Pt(Z,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Rl(){if(t.input=we(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ct(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bi()}function bi(){t._positionElement=t.config.positionElement||t._input}function al(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),gt("onChange"),gt("onClose")})}function fl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function gt(Z,X){if(t.config!==void 0){var ne=t.config[Z];if(ne!==void 0&&ne.length>0)for(var ae=0;ne[ae]&&ae=0&&vn(Z,t.selectedDates[1])<=0}function Me(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Ro(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),Z.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function mt(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,ae,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===ae}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Jt(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=mt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=mt(t.config.altFormat)),Z!==!1&>("onValueUpdate")}function ft(Z){var X=yn(Z),ne=t.prevMonthNav.contains(X),ae=t.nextMonthNav.contains(X);ne||ae?ee(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ne=yn(Z),ae=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(ae.getAttribute("min")),Ne=parseFloat(ae.getAttribute("max")),Ze=parseFloat(ae.getAttribute("step")),qe=parseInt(ae.value,10),Qe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Ze*Qe;if(typeof ae.value<"u"&&ae.value.length===2){var Ve=ae===t.hourElement,vt=ae===t.minuteElement;ReNe&&(Re=ae===t.hourElement?Re-Ne-In(!t.amPM):Te,vt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Ze===1?Re+qe===23:Math.abs(Re-qe)>Ze)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),ae.value=mn(Re)}}return l(),t}function Tl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function AT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Xe(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:f="",element:u=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;zt(()=>{const $=u??h,C=y(d);return C.onReady.push((O,D,I)=>{a===void 0&&S(O,D,I),Qt().then(()=>{t(8,m=!0)})}),t(3,_=Ut($,Object.assign(C,u?{wrap:!0}:{}))),()=>{_.destroy()}});const g=lt();function y($={}){$=Object.assign({},$);for(const C of r){const O=(D,I,L)=>{g(IT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(O)):$[C]=[O]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,O){const D=od(O,$);!rd(a,D)&&(a||D)&&t(2,a=D),t(4,f=C)}function T($){te[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Ae(Ae({},e),Kt($)),t(1,l=Xe(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,f=$.formattedValue),"element"in $&&t(5,u=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(rd(a,od(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,f,u,c,d,m,o,s,T]}class Wa extends ge{constructor(e){super(),_e(this,e,AT,ET,pe,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function LT(n){let e,t,i,l,s,o,r,a;function f(d){n[6](d)}function u(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Wa({props:c}),te.push(()=>be(s,"value",f)),te.push(()=>be(s,"formattedValue",u)),s.$on("close",n[8]),{c(){e=b("label"),t=K("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function NT(n){let e,t,i,l,s,o,r,a;function f(d){n[9](d)}function u(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Wa({props:c}),te.push(()=>be(s,"value",f)),te.push(()=>be(s,"formattedValue",u)),s.$on("close",n[11]),{c(){e=b("label"),t=K("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function PT(n){let e,t,i,l,s,o,r;return i=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[LT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[NT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){w(a,e,f),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.min"),f&196613&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.max"),f&196617&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function FT(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[PT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&131087&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function RT(n,e,t){var $,C;const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function f(O,D){O.detail&&O.detail.length==3&&t(0,s.options[D]=O.detail[1],s)}function u(O){r=O,t(2,r),t(0,s)}function c(O){n.$$.not_equal(s.options.min,O)&&(s.options.min=O,t(0,s))}const d=O=>f(O,"min");function m(O){a=O,t(3,a),t(0,s)}function h(O){n.$$.not_equal(s.options.max,O)&&(s.options.max=O,t(0,s))}const _=O=>f(O,"max");function g(O){s=O,t(0,s)}function y(O){Ce.call(this,n,O)}function S(O){Ce.call(this,n,O)}function T(O){Ce.call(this,n,O)}return n.$$set=O=>{e=Ae(Ae({},e),Kt(O)),t(5,l=Xe(e,i)),"field"in O&&t(0,s=O.field),"key"in O&&t(1,o=O.key)},n.$$.update=()=>{var O,D,I,L;n.$$.dirty&5&&r!=((O=s==null?void 0:s.options)==null?void 0:O.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,f,l,u,c,d,m,h,_,g,y,S,T]}class qT extends ge{constructor(e){super(),_e(this,e,RT,FT,pe,{field:0,key:1})}}const jT=n=>({}),ad=n=>({});function fd(n,e,t){const i=n.slice();return i[48]=e[t],i}const HT=n=>({}),ud=n=>({});function cd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function dd(n){let e,t,i;return{c(){e=b("div"),t=K(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&se(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function zT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function VT(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let f={};for(let u=0;u{V(f,1)}),le()}s?(e=Et(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&2049?dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function pd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Clear")),J(e,"click",Tn(Be(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function md(n){let e,t,i,l,s,o;const r=[VT,zT],a=[];function f(c,d){return c[10]?0:1}t=f(n),i=a[t]=r[t](n);let u=(n[4]||n[8])&&pd(n);return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),u&&u.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=f(c),t===m?a[t].p(c,d):(ie(),A(a[m],1,1,()=>{a[m]=null}),le(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?u?u.p(c,d):(u=pd(c),u.c(),u.m(e,s)):u&&(u.d(1),u=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),u&&u.d()}}}function hd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[WT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function _d(n){let e,t,i,l,s,o,r,a,f=n[17].length&&gd(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),f&&f.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(t,l),k(t,s),oe(s,n[17]),k(t,o),f&&f.m(t,null),s.focus(),r||(a=J(s,"input",n[38]),r=!0)},p(u,c){c[0]&8&&p(s,"placeholder",u[3]),c[0]&131072&&s.value!==u[17]&&oe(s,u[17]),u[17].length?f?f.p(u,c):(f=gd(u),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(u){u&&v(e),f&&f.d(),r=!1,a()}}}function gd(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",Tn(Be(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function bd(n){let e,t=n[1]&&kd(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=kd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function kd(n){let e,t;return{c(){e=b("div"),t=K(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&se(t,i[1])},d(i){i&&v(e)}}}function BT(n){let e=n[48]+"",t;return{c(){t=K(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&se(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function UT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let f={};for(let u=0;u{V(f,1)}),le()}s?(e=Et(s,o(r,a)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const f=a[0]&4202496?dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]):{};e.$set(f)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function yd(n){let e,t,i,l,s,o,r;const a=[UT,BT],f=[];function u(m,h){return m[12]?0:1}t=u(n),i=f[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),f[t].m(e,null),k(e,l),s=!0,o||(r=[J(e,"click",c),J(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=u(n),t===_?f[t].p(n,h):(ie(),A(f[_],1,1,()=>{f[_]=null}),le(),i=f[t],i?i.p(n,h):(i=f[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),f[t].d(),o=!1,$e(r)}}}function WT(n){let e,t,i,l,s,o=n[14]&&_d(n);const r=n[35].beforeOptions,a=St(r,n,n[44],ud);let f=fe(n[22]),u=[];for(let _=0;_A(u[_],1,1,()=>{u[_]=null});let d=null;f.length||(d=bd(n));const m=n[35].afterOptions,h=St(m,n,n[44],ad);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let _=0;_A(a[d],1,1,()=>{a[d]=null});let u=null;r.length||(u=dd(n));let c=!n[5]&&!n[6]&&hd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),le()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mwe(Ye,ve))||[]}function Oe(de,ve){de.preventDefault(),y&&d?W(ve):H(ve)}function He(de,ve){(de.code==="Enter"||de.code==="Space")&&(Oe(de,ve),S&&Y())}function Je(){ee(),setTimeout(()=>{const de=N==null?void 0:N.querySelector(".dropdown-item.option.selected");de&&(de.focus(),de.scrollIntoView({block:"nearest"}))},0)}function xe(de){de.stopPropagation(),!h&&!m&&(R==null||R.toggle())}zt(()=>{const de=document.querySelectorAll(`label[for="${r}"]`);for(const ve of de)ve.addEventListener("click",xe);return()=>{for(const ve of de)ve.removeEventListener("click",xe)}});const bt=de=>q(de);function kt(de){te[de?"unshift":"push"](()=>{P=de,t(20,P)})}function yt(){F=this.value,t(17,F)}const Ot=(de,ve)=>Oe(ve,de),Ee=(de,ve)=>He(ve,de);function Le(de){te[de?"unshift":"push"](()=>{R=de,t(18,R)})}function ze(de){Ce.call(this,n,de)}function _t(de){te[de?"unshift":"push"](()=>{N=de,t(19,N)})}return n.$$set=de=>{"id"in de&&t(27,r=de.id),"noOptionsText"in de&&t(1,a=de.noOptionsText),"selectPlaceholder"in de&&t(2,f=de.selectPlaceholder),"searchPlaceholder"in de&&t(3,u=de.searchPlaceholder),"items"in de&&t(28,c=de.items),"multiple"in de&&t(4,d=de.multiple),"disabled"in de&&t(5,m=de.disabled),"readonly"in de&&t(6,h=de.readonly),"upside"in de&&t(7,_=de.upside),"selected"in de&&t(0,g=de.selected),"toggle"in de&&t(8,y=de.toggle),"closable"in de&&t(9,S=de.closable),"labelComponent"in de&&t(10,T=de.labelComponent),"labelComponentProps"in de&&t(11,$=de.labelComponentProps),"optionComponent"in de&&t(12,C=de.optionComponent),"optionComponentProps"in de&&t(13,O=de.optionComponentProps),"searchable"in de&&t(14,D=de.searchable),"searchFunc"in de&&t(29,I=de.searchFunc),"class"in de&&t(15,L=de.class),"$$scope"in de&&t(44,o=de.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(me(),ee()),n.$$.dirty[0]&268566528&&t(22,i=ce(c,F)),n.$$.dirty[0]&1&&t(21,l=function(de){const ve=j.toArray(g);return j.inArray(ve,de)})},[g,a,f,u,d,m,h,_,y,S,T,$,C,O,D,L,q,F,R,N,P,l,i,ee,Oe,He,Je,r,c,I,H,W,G,U,Y,s,bt,kt,yt,Ot,Ee,Le,ze,_t,o]}class Jb extends ge{constructor(e){super(),_e(this,e,JT,YT,pe,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function vd(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function ZT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&vd(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=K(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=vd(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function GT(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class wd extends ge{constructor(e){super(),_e(this,e,GT,ZT,pe,{item:0})}}const XT=n=>({}),Sd=n=>({});function QT(n){let e;const t=n[8].afterOptions,i=St(t,n,n[12],Sd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&Tt(i,t,l,l[12],e?$t(t,l[12],s,XT):Ct(l[12]),Sd)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function xT(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[QT]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&62?dt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Dt(r[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.selected=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function eC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Xe(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:u=wd}=e,{optionComponent:c=wd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const O=j.findByKey(r,d,C);O&&$.push(O)}T.length&&!$.length||t(0,f=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){f=T,t(0,f)}function y(T){Ce.call(this,n,T)}function S(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ae(Ae({},e),Kt(T)),t(5,l=Xe(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,f=T.selected),"labelComponent"in T&&t(3,u=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(f)},[f,r,a,u,c,l,m,d,s,g,y,S,o]}class hi extends ge{constructor(e){super(),_e(this,e,eC,xT,pe,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function tC(n){let e,t,i,l,s,o;function r(f){n[7](f)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Fl({props:a}),te.push(()=>be(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(f,u){w(f,e,u),z(t,e,null),l=!0,s||(o=Se(Pe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(f,u){const c={};u&16384&&(c.id=f[14]),u&32768&&(c.readonly=!f[15]),!i&&u&1&&(i=!0,c.value=f[0].options.values,ke(()=>i=!1)),t.$set(c)},i(f){l||(E(t.$$.fragment,f),l=!0)},o(f){A(t.$$.fragment,f),l=!1},d(f){f&&v(e),V(t),s=!1,o()}}}function nC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function iC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ue({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[tC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[nC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function $d(n){let e,t;return e=new ue({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[lC,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.maxSelect),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&16384&&i!==(i=f[14])&&p(e,"for",i),u&16384&&o!==(o=f[14])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&oe(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function sC(n){let e,t,i=!n[2]&&$d(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(ie(),A(i,1,1,()=>{i=null}),le()):i?(i.p(l,s),s&4&&E(i,1)):(i=$d(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function oC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[sC],default:[iC,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&18?dt(l,[a&2&&{key:r[1]},a&16&&Dt(r[4])]):{};a&98311&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function rC(n,e,t){var S;const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,f=a;function u(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,f=a)}function c(){s.options.maxSelect=it(this.value),t(0,s),t(5,f),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,f),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,f),t(2,a)}function _(T){Ce.call(this,n,T)}function g(T){Ce.call(this,n,T)}function y(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ae(Ae({},e),Kt(T)),t(4,l=Xe(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&f!=a&&(t(5,f=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&u()},[s,o,a,r,l,f,c,d,m,h,_,g,y]}class aC extends ge{constructor(e){super(),_e(this,e,rC,oC,pe,{field:0,key:1})}}function fC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max size "),i=b("small"),i.textContent="(bytes)",s=M(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(u,c){w(u,e,c),k(e,t),k(e,i),w(u,s,c),w(u,o,c),oe(o,n[0].options.maxSize),a||(f=J(o,"input",n[4]),a=!0)},p(u,c){c&2048&&l!==(l=u[11])&&p(e,"for",l),c&2048&&r!==(r=u[11])&&p(o,"id",r),c&1&&it(o.value)!==u[0].options.maxSize&&oe(o,u[0].options.maxSize)},d(u){u&&(v(e),v(s),v(o)),a=!1,f()}}}function uC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Td(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,H,W,G,U,Y,me;return{c(){e=b("div"),t=b("div"),i=b("div"),l=K("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=K(` and `),r=b("code"),r.textContent="multipart/form-data",a=K(` requests, the following normalization rules are applied if the `),f=b("code"),f.textContent="json",u=K(` field is a `),c=b("strong"),c.textContent="plain string",d=K(`: `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",_=M(),g=b("li"),g.innerHTML=""false" is converted to the json false",y=M(),S=b("li"),S.innerHTML=""null" is converted to the json null",T=M(),$=b("li"),$.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",C=M(),O=b("li"),I=K(D),L=K(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',F=M(),N=b("li"),N.textContent="numeric strings are converted to json number",P=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",H=M(),W=b("li"),W.textContent="any other string (empty string too) is double quoted",G=K(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),U=b("code"),U.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(te,pe){w(te,e,pe),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,O),k(O,I),k(O,L),k(O,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,H),k(m,W),k(i,G),k(i,U),ie=!0},i(te){ie||(te&&Ke(()=>{ie&&(Y||(Y=Fe(e,et,{duration:150},!0)),Y.run(1))}),ie=!0)},o(te){te&&(Y||(Y=Fe(e,et,{duration:150},!1)),Y.run(0)),ie=!1},d(te){te&&v(e),te&&Y&&Y.end()}}}function dC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new ce({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[fC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?cC:uC}let m=d(n),h=m(n),_=n[2]&&Td();return{c(){B(e.$$.fragment),t=M(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=M(),h.c(),r=M(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){z(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=J(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=Td(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function pC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[dC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ot(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mC(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=it(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Ce.call(this,n,_)}function m(_){Ce.call(this,n,_)}function h(_){Ce.call(this,n,_)}return n.$$set=_=>{e=Ie(Ie({},e),Yt(_)),t(3,l=Ge(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class hC extends ge{constructor(e){super(),_e(this,e,mC,pC,me,{field:0,key:1})}}function _C(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=K(t),l=M(),s=b("small"),r=K(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),w(a,s,f),k(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),f&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function gC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Cd extends ge{constructor(e){super(),_e(this,e,gC,_C,me,{item:0})}}const bC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function kC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function yC(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[kC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const f={};a&16777216&&(f.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function vC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[9]),J(i,"click",n[10]),J(s,"click",n[11]),J(r,"click",n[12])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function wC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;function $(O){n[8](O)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Cd,optionComponent:Cd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new hi({props:C}),ee.push(()=>be(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[vC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=M(),h=b("i"),_=M(),B(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(O,D){w(O,e,D),k(e,t),k(e,i),k(e,l),w(O,o,D),z(r,O,D),w(O,f,D),w(O,u,D),k(u,c),k(c,d),k(c,m),k(c,h),k(c,_),z(g,c,null),y=!0,S||(T=Se(Pe.call(null,l,{text:`Allow files ONLY with the listed mime types. + data inside an object, eg.`),U=b("code"),U.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,ce){w(ee,e,ce),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,O),k(O,I),k(O,L),k(O,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,H),k(m,W),k(i,G),k(i,U),me=!0},i(ee){me||(ee&&Ke(()=>{me&&(Y||(Y=Fe(e,et,{duration:150},!0)),Y.run(1))}),me=!0)},o(ee){ee&&(Y||(Y=Fe(e,et,{duration:150},!1)),Y.run(0)),me=!1},d(ee){ee&&v(e),ee&&Y&&Y.end()}}}function dC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new ue({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[fC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?cC:uC}let m=d(n),h=m(n),_=n[2]&&Td();return{c(){B(e.$$.fragment),t=M(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=M(),h.c(),r=M(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){z(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=J(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=Td(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(ie(),A(_,1,1,()=>{_=null}),le())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function pC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[dC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&10?dt(l,[a&2&&{key:r[1]},a&8&&Dt(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mC(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=it(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Ce.call(this,n,_)}function m(_){Ce.call(this,n,_)}function h(_){Ce.call(this,n,_)}return n.$$set=_=>{e=Ae(Ae({},e),Kt(_)),t(3,l=Xe(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class hC extends ge{constructor(e){super(),_e(this,e,mC,pC,pe,{field:0,key:1})}}function _C(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=K(t),l=M(),s=b("small"),r=K(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),w(a,s,f),k(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),f&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function gC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Cd extends ge{constructor(e){super(),_e(this,e,gC,_C,pe,{item:0})}}const bC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function kC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function yC(n){let e,t,i,l,s,o;return i=new ue({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[kC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const f={};a&16777216&&(f.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(f.$$scope={dirty:a,ctx:r}),i.$set(f)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function vC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[9]),J(i,"click",n[10]),J(s,"click",n[11]),J(r,"click",n[12])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function wC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;function $(O){n[8](O)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Cd,optionComponent:Cd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new hi({props:C}),te.push(()=>be(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[vC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=M(),h=b("i"),_=M(),B(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(O,D){w(O,e,D),k(e,t),k(e,i),k(e,l),w(O,o,D),z(r,O,D),w(O,f,D),w(O,u,D),k(u,c),k(c,d),k(c,m),k(c,h),k(c,_),z(g,c,null),y=!0,S||(T=Se(Pe.call(null,l,{text:`Allow files ONLY with the listed mime types. Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,D){(!y||D&8388608&&s!==(s=O[23]))&&p(e,"for",s);const I={};D&8388608&&(I.id=O[23]),D&8&&(I.items=O[3]),!a&&D&1&&(a=!0,I.keyOfSelected=O[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};D&33554433&&(L.$$scope={dirty:D,ctx:O}),g.$set(L)},i(O){y||(E(r.$$.fragment,O),E(g.$$.fragment,O),y=!0)},o(O){A(r.$$.fragment,O),A(g.$$.fragment,O),y=!1},d(O){O&&(v(e),v(o),v(f),v(u)),V(r,O),V(g),S=!1,T()}}}function SC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $C(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C;function O(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Fl({props:D}),ee.push(()=>be(r,"value",O)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[SC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=M(),g=b("i"),y=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),z(r,I,L),w(I,f,L),w(I,u,L),k(u,c),k(u,d),k(u,m),k(m,h),k(m,_),k(m,g),k(m,y),z(S,m,null),T=!0,$||(C=Se(Pe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(f),v(u)),V(r,I),V(S),$=!1,C()}}}function TC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[14]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&&it(s.value)!==c[0].options.maxSize&&re(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Od(n){let e,t,i;return t=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[CC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function CC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.maxSelect),r||(a=J(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&re(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function OC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[wC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[$C,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[TC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Od(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),d=M(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(f,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,a),k(e,f),z(u,f,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),_[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(_,g),g&4&&E(h,1)):(h=Od(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(u.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(u.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),V(i),V(o),V(u),h&&h.d()}}}function MC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),f||(u=J(e,"change",n[7]),f=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),f=!1,u()}}}function DC(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[MC,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[DC],options:[OC],default:[yC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ot(r[5])]):{};a&50331663&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function IC(n,e,t){var F;const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=bC.slice(),f=((F=s.options)==null?void 0:F.maxSelect)<=1,u=f;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,f=!0),t(6,u=f)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,u),t(2,f)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,u),t(2,f))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,u),t(2,f))}function $(){s.options.maxSize=it(this.value),t(0,s),t(6,u),t(2,f)}function C(){s.options.maxSelect=it(this.value),t(0,s),t(6,u),t(2,f)}function O(N){f=N,t(2,f)}function D(N){s=N,t(0,s),t(6,u),t(2,f)}function I(N){Ce.call(this,n,N)}function L(N){Ce.call(this,n,N)}function R(N){Ce.call(this,n,N)}return n.$$set=N=>{e=Ie(Ie({},e),Yt(N)),t(5,l=Ge(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,f,a,r,l,u,m,h,_,g,y,S,T,$,C,O,D,I,L,R]}class AC extends ge{constructor(e){super(),_e(this,e,IC,EC,me,{field:0,key:1})}}function LC(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function NC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[LC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function PC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ce({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[NC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[PC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function Md(n){let e,t,i,l,s,o;return t=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[RC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[qC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,null),o=!0},p(r,a){const f={};a&2&&(f.name="schema."+r[1]+".options.minSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a&2&&(u.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function RC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minSelect),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&16777216&&i!==(i=f[24])&&p(e,"for",i),u&16777216&&o!==(o=f[24])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minSelect&&re(s,f[0].options.minSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[0].options.maxSelect),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&16777216&&i!==(i=u[24])&&p(e,"for",i),c&16777216&&o!==(o=u[24])&&p(s,"id",o),c&1&&r!==(r=u[0].options.minSelect||2)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.maxSelect&&re(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function jC(n){let e,t,i,l,s,o,r,a,f,u,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new hi({props:h}),ee.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),z(a,_,g),u=!0,c||(d=Se(s=Pe.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + (eg. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $C(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C;function O(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Fl({props:D}),te.push(()=>be(r,"value",O)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[SC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=M(),g=b("i"),y=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),z(r,I,L),w(I,f,L),w(I,u,L),k(u,c),k(u,d),k(u,m),k(m,h),k(m,_),k(m,g),k(m,y),z(S,m,null),T=!0,$||(C=Se(Pe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(f),v(u)),V(r,I),V(S),$=!1,C()}}}function TC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[14]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&&it(s.value)!==c[0].options.maxSize&&oe(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function Od(n){let e,t,i;return t=new ue({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[CC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function CC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.maxSelect),r||(a=J(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.maxSelect&&oe(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function OC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[wC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[$C,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new ue({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[TC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Od(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),d=M(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(f,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,a),k(e,f),z(u,f,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(f,"class",c),_[2]?h&&(ie(),A(h,1,1,()=>{h=null}),le()):h?(h.p(_,g),g&4&&E(h,1)):(h=Od(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(u.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(u.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),V(i),V(o),V(u),h&&h.d()}}}function MC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),f||(u=J(e,"change",n[7]),f=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),f=!1,u()}}}function DC(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[MC,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[DC],options:[OC],default:[yC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&50331663&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ke(()=>t=!1)),e.$set(f)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function IC(n,e,t){var F;const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=bC.slice(),f=((F=s.options)==null?void 0:F.maxSelect)<=1,u=f;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,f=!0),t(6,u=f)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,u),t(2,f)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,u),t(2,f))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,u),t(2,f))}function $(){s.options.maxSize=it(this.value),t(0,s),t(6,u),t(2,f)}function C(){s.options.maxSelect=it(this.value),t(0,s),t(6,u),t(2,f)}function O(N){f=N,t(2,f)}function D(N){s=N,t(0,s),t(6,u),t(2,f)}function I(N){Ce.call(this,n,N)}function L(N){Ce.call(this,n,N)}function R(N){Ce.call(this,n,N)}return n.$$set=N=>{e=Ae(Ae({},e),Kt(N)),t(5,l=Xe(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&u!=f&&(t(6,u=f),f?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,f,a,r,l,u,m,h,_,g,y,S,T,$,C,O,D,I,L,R]}class AC extends ge{constructor(e){super(),_e(this,e,IC,EC,pe,{field:0,key:1})}}function LC(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function NC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[LC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new hi({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function PC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new hi({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FC(n){let e,t,i,l,s,o,r,a,f,u;return i=new ue({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[NC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[PC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),f=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(f,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,f,d),u=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){u||(E(i.$$.fragment,c),E(r.$$.fragment,c),u=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),u=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(f)),V(i,c),V(r,c)}}}function Md(n){let e,t,i,l,s,o;return t=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[RC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[qC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,null),o=!0},p(r,a){const f={};a&2&&(f.name="schema."+r[1]+".options.minSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),t.$set(f);const u={};a&2&&(u.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function RC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Min select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.minSelect),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&16777216&&i!==(i=f[24])&&p(e,"for",i),u&16777216&&o!==(o=f[24])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minSelect&&oe(s,f[0].options.minSelect)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function qC(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Max select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),oe(s,n[0].options.maxSelect),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&16777216&&i!==(i=u[24])&&p(e,"for",i),c&16777216&&o!==(o=u[24])&&p(s,"id",o),c&1&&r!==(r=u[0].options.minSelect||2)&&p(s,"min",r),c&1&&it(s.value)!==u[0].options.maxSelect&&oe(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function jC(n){let e,t,i,l,s,o,r,a,f,u,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new hi({props:h}),te.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),z(a,_,g),u=!0,c||(d=Se(s=Pe.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"})),c=!0)},p(_,g){var S,T;s&&Ct(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=_[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` +`),position:"top"})),c=!0)},p(_,g){var S,T;s&&Mt(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=_[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!f&&g&1&&(f=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>f=!1)),a.$set(y)},i(_){u||(E(a.$$.fragment,_),u=!0)},o(_){A(a.$$.fragment,_),u=!1},d(_){_&&(v(e),v(r)),V(a,_),c=!1,d()}}}function HC(n){let e,t,i,l,s,o=!n[2]&&Md(n);return l=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[jC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(le(),A(o,1,1,()=>{o=null}),se()):o?(o.p(r,a),a&4&&E(o,1)):(o=Md(r),o.c(),E(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function zC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[HC],default:[FC,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;ube(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Ya({props:f}),n[21](l),l.$on("save",n[22]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(u,c){z(e,u,c),w(u,i,c),z(l,u,c),s=!0},p(u,[c]){const d=c&258?pt(o,[c&2&&{key:u[1]},c&256&&Ot(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(E(e.$$.fragment,u),E(l.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),A(l.$$.fragment,u),s=!1},d(u){u&&v(i),V(e,u),n[21](null),V(l,u)}}}function VC(n,e,t){var N;let i,l;const s=["field","key"];let o=Ge(e,s),r;We(n,Rn,P=>t(10,r=P));let{field:a}=e,{key:f=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function O(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Ce.call(this,n,P)}function I(P){Ce.call(this,n,P)}function L(P){Ce.call(this,n,P)}function R(P){ee[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,H;(H=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&H.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Ie(Ie({},e),Yt(P)),t(8,o=Ge(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,f=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,y,S,T,$,C,O,D,I,L,R,F]}class BC extends ge{constructor(e){super(),_e(this,e,VC,zC,me,{field:0,key:1})}}const UC=n=>({dragging:n&4,dragover:n&8}),Dd=n=>({dragging:n[2],dragover:n[3]});function WC(n){let e,t,i,l,s;const o=n[10].default,r=wt(o,n,n[9],Dd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"dragover",Be(n[11])),J(e,"dragleave",Be(n[12])),J(e,"dragend",n[13]),J(e,"dragstart",n[14]),J(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&$t(r,o,a,a[9],i?St(o,a[9],f,UC):Tt(a[9]),Dd),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&x(e,"dragging",a[2]),(!i||f&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function YC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:f=!1}=e,{dragHandleClass:u=""}=e,c=!1,d=!1;function m($,C){if(!(!$||f)){if(u&&!$.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||f)return;$.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const D=O.index<<0;D{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,f=$.disabled),"dragHandleClass"in $&&t(8,u=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,f,c,d,m,h,r,a,u,l,i,_,g,y,S,T]}class Es extends ge{constructor(e){super(),_e(this,e,YC,WC,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Ed(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Id(n){let e,t,i,l,s,o,r,a;return{c(){e=K(`, +`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!f&&g&1&&(f=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>f=!1)),a.$set(y)},i(_){u||(E(a.$$.fragment,_),u=!0)},o(_){A(a.$$.fragment,_),u=!1},d(_){_&&(v(e),v(r)),V(a,_),c=!1,d()}}}function HC(n){let e,t,i,l,s,o=!n[2]&&Md(n);return l=new ue({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[jC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(ie(),A(o,1,1,()=>{o=null}),le()):o?(o.p(r,a),a&4&&E(o,1)):(o=Md(r),o.c(),E(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function zC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[HC],default:[FC,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;ube(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Ya({props:f}),n[21](l),l.$on("save",n[22]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(u,c){z(e,u,c),w(u,i,c),z(l,u,c),s=!0},p(u,[c]){const d=c&258?dt(o,[c&2&&{key:u[1]},c&256&&Dt(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(E(e.$$.fragment,u),E(l.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),A(l.$$.fragment,u),s=!1},d(u){u&&v(i),V(e,u),n[21](null),V(l,u)}}}function VC(n,e,t){var N;let i,l;const s=["field","key"];let o=Xe(e,s),r;We(n,Rn,P=>t(10,r=P));let{field:a}=e,{key:f=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function O(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Ce.call(this,n,P)}function I(P){Ce.call(this,n,P)}function L(P){Ce.call(this,n,P)}function R(P){te[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,H;(H=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&H.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Ae(Ae({},e),Kt(P)),t(8,o=Xe(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,f=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,y,S,T,$,C,O,D,I,L,R,F]}class BC extends ge{constructor(e){super(),_e(this,e,VC,zC,pe,{field:0,key:1})}}const UC=n=>({dragging:n&4,dragover:n&8}),Dd=n=>({dragging:n[2],dragover:n[3]});function WC(n){let e,t,i,l,s;const o=n[10].default,r=St(o,n,n[9],Dd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[J(e,"dragover",Be(n[11])),J(e,"dragleave",Be(n[12])),J(e,"dragend",n[13]),J(e,"dragstart",n[14]),J(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&Tt(r,o,a,a[9],i?$t(o,a[9],f,UC):Ct(a[9]),Dd),(!i||f&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||f&4)&&x(e,"dragging",a[2]),(!i||f&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,$e(s)}}}function YC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:f=!1}=e,{dragHandleClass:u=""}=e,c=!1,d=!1;function m($,C){if(!(!$||f)){if(u&&!$.target.classList.contains(u)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||f)return;$.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const D=O.index<<0;D{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,f=$.disabled),"dragHandleClass"in $&&t(8,u=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,f,c,d,m,h,r,a,u,l,i,_,g,y,S,T]}class Es extends ge{constructor(e){super(),_e(this,e,YC,WC,pe,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Ed(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Id(n){let e,t,i,l,s,o,r,a;return{c(){e=K(`, `),t=b("code"),t.textContent="username",i=K(` , `),l=b("code"),l.textContent="email",s=K(` , `),o=b("code"),o.textContent="emailVisibility",r=K(` , - `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),w(f,l,u),w(f,s,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function KC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Dt(a,f(n)),ee.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&B(e.$$.fragment),i=M()},m(u,c){e&&z(e,u,c),w(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){le();const d=e;A(d.$$.fragment,1,0,()=>{V(d,1)}),se()}a?(e=Dt(a,f(n)),ee.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(u){l||(e&&E(e.$$.fragment,u),l=!0)},o(u){e&&A(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Ad(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[KC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function JC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C,O,D=n[0].type==="auth"&&Id(),I=ue(n[0].schema);const L=N=>N[19];for(let N=0;Nbe($,"collection",R)),{c(){e=b("div"),t=b("p"),i=K(`System fields: + `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),w(f,l,u),w(f,s,u),w(f,o,u),w(f,r,u),w(f,a,u)},d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function KC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Et(a,f(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&B(e.$$.fragment),i=M()},m(u,c){e&&z(e,u,c),w(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){ie();const d=e;A(d.$$.fragment,1,0,()=>{V(d,1)}),le()}a?(e=Et(a,f(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(u){l||(e&&E(e.$$.fragment,u),l=!0)},o(u){e&&A(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Ad(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[KC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Es({props:r}),te.push(()=>be(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function JC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C,O,D=n[0].type==="auth"&&Id(),I=fe(n[0].schema);const L=N=>N[19];for(let N=0;Nbe($,"collection",R)),{c(){e=b("div"),t=b("p"),i=K(`System fields: `),l=b("code"),l.textContent="id",s=K(` , `),o=b("code"),o.textContent="created",r=K(` , `),a=b("code"),a.textContent="updated",f=M(),D&&D.c(),u=K(` - .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Jt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class GC extends ge{constructor(e){super(),_e(this,e,ZC,JC,me,{collection:0})}}const XC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),QC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]}),xC=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function e5(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[n5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function t5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Rd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=wt(T,n,n[15],Pd),C=n[12].afterLabel,O=wt(C,n,n[15],Nd);let D=!n[9]&&Fd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Dt(L,R(n)),n[13](m),ee.push(()=>be(m,"value",I)));let F=n[9]&&Rd(n);const N=n[12].default,P=wt(N,n,n[15],Ld);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&$t($,T,q,q[15],S?St(T,q[15],H,xC):Tt(q[15]),Pd),(!S||H&4)&&oe(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&oe(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&$t(O,C,q,q[15],S?St(C,q[15],H,QC):Tt(q[15]),Nd),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Fd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){le();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),se()}L?(m=Dt(L,R(q)),q[13](m),ee.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Rd(q),F.c(),E(F,1),F.m(e,null)):F&&(le(),A(F,1,1,()=>{F=null}),se()),P&&P.p&&(!S||H&33280)&&$t(P,N,q,q[15],S?St(N,q[15],H,XC):Tt(q[15]),Ld)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function i5(n){let e,t,i,l;const s=[t5,e5],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let qd;function l5(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=qd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-DG6SVeUP.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),qd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){ee[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class Cl extends ge{constructor(e){super(),_e(this,e,l5,i5,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=ue(n[2]),R=[];for(let F=0;F@request
    filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function zd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&oe(i,t)},d(l){l&&v(e)}}}function Vd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[s5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cl({props:c}),ee.push(()=>be(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Cl({props:m}),ee.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Cl({props:_}),ee.push(()=>be(r,"rule",h)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(g,y){z(e,g,y),w(g,i,y),z(l,g,y),w(g,o,y),z(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),V(e,g),V(l,g),V(r,g)}}}function Bd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function s5(n){let e,t=!n[10]&&Bd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Bd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Ud(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[o5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Cl({props:s}),ee.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function o5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. + .`),c=M(),d=b("div");for(let N=0;NC=!1)),$.$set(q)},i(N){if(!O){for(let P=0;PI.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Zt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class GC extends ge{constructor(e){super(),_e(this,e,ZC,JC,pe,{collection:0})}}const XC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),QC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]}),xC=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function e5(n){let e,t;return e=new ue({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[n5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function t5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Rd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=J(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,f,u,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=St(T,n,n[15],Pd),C=n[12].afterLabel,O=St(C,n,n[15],Nd);let D=!n[9]&&Fd(n);function I(q){n[14](q)}var L=n[7];function R(q,H){let W={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(W.value=q[0]),{props:W}}L&&(m=Et(L,R(n)),n[13](m),te.push(()=>be(m,"value",I)));let F=n[9]&&Rd(n);const N=n[12].default,P=St(N,n,n[15],Ld);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=K(n[2]),o=M(),a=K(r),f=M(),O&&O.c(),u=M(),D&&D.c(),d=M(),m&&B(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,f),O&&O.m(t,null),k(t,u),D&&D.m(t,null),k(e,d),m&&z(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,H),w(q,y,H),P&&P.m(y,null),S=!0},p(q,H){if($&&$.p&&(!S||H&33280)&&Tt($,T,q,q[15],S?$t(T,q[15],H,xC):Ct(q[15]),Pd),(!S||H&4)&&se(s,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||H&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||H&33280)&&Tt(O,C,q,q[15],S?$t(C,q[15],H,QC):Ct(q[15]),Nd),q[9]?D&&(D.d(1),D=null):D?D.p(q,H):(D=Fd(q),D.c(),D.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c),H&128&&L!==(L=q[7])){if(m){ie();const W=m;A(W.$$.fragment,1,0,()=>{V(W,1)}),le()}L?(m=Et(L,R(q)),q[13](m),te.push(()=>be(m,"value",I)),B(m.$$.fragment),E(m.$$.fragment,1),z(m,e,_)):m=null}else if(L){const W={};H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!h&&H&1&&(h=!0,W.value=q[0],ke(()=>h=!1)),m.$set(W)}q[9]?F?(F.p(q,H),H&512&&E(F,1)):(F=Rd(q),F.c(),E(F,1),F.m(e,null)):F&&(ie(),A(F,1,1,()=>{F=null}),le()),P&&P.p&&(!S||H&33280)&&Tt(P,N,q,q[15],S?$t(N,q[15],H,XC):Ct(q[15]),Ld)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&V(m),F&&F.d(),P&&P.d(q)}}}function i5(n){let e,t,i,l;const s=[t5,e5],o=[];function r(a,f){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,[f]){let u=e;e=r(a),e===u?o[e].p(a,f):(ie(),A(o[u],1,1,()=>{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let qd;function l5(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:f="rule"}=e,{required:u=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=qd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CS7wYc6J.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),qd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){te[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,f=C.formKey),"required"in C&&t(4,u=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,f,u,c,d,h,_,i,y,S,l,T,$,s]}class Cl extends ge{constructor(e){super(),_e(this,e,l5,i5,pe,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=fe(n[2]),R=[];for(let F=0;F@request filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function zd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&se(i,t)},d(l){l&&v(e)}}}function Vd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[s5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cl({props:c}),te.push(()=>be(e,"rule",u));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Cl({props:m}),te.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Cl({props:_}),te.push(()=>be(r,"rule",h)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(g,y){z(e,g,y),w(g,i,y),z(l,g,y),w(g,o,y),z(r,g,y),f=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){f||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),f=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),f=!1},d(g){g&&(v(i),v(o)),V(e,g),V(l,g),V(r,g)}}}function Bd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function s5(n){let e,t=!n[10]&&Bd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Bd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Ud(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[o5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Cl({props:s}),te.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function o5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified - state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function r5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&Hd(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new Cl({props:D}),ee.push(()=>be(u,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Cl({props:L}),ee.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Vd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Ud(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function r5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&Hd(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new Cl({props:D}),te.push(()=>be(u,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Cl({props:L}),te.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Vd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Ud(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,l=M(),s=b("button"),r=K(o),a=M(),C&&C.c(),f=M(),B(u.$$.fragment),d=M(),B(m.$$.fragment),_=M(),R&&R.c(),g=M(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,H){w(q,e,H),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,f,H),z(u,q,H),w(q,d,H),z(m,q,H),w(q,_,H),R&&R.m(q,H),w(q,g,H),F&&F.m(q,H),w(q,y,H),S=!0,T||($=J(s,"click",n[3]),T=!0)},p(q,[H]){var U,Y;(!S||H&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&oe(r,o),q[1]?C?(C.p(q,H),H&2&&E(C,1)):(C=Hd(q),C.c(),E(C,1),C.m(e,null)):C&&(le(),A(C,1,1,()=>{C=null}),se());const W={};H&1&&(W.collection=q[0]),!c&&H&1&&(c=!0,W.rule=q[0].listRule,ke(()=>c=!1)),u.$set(W);const G={};H&1&&(G.collection=q[0]),!h&&H&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((U=q[0])==null?void 0:U.type)!=="view"?R?(R.p(q,H),H&1&&E(R,1)):(R=Vd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(le(),A(R,1,1,()=>{R=null}),se()),((Y=q[0])==null?void 0:Y.type)==="auth"?F?(F.p(q,H),H&1&&E(F,1)):(F=Ud(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(le(),A(F,1,1,()=>{F=null}),se())},i(q){S||(E(C),E(u.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(u.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),V(u,q),V(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function a5(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class f5 extends ge{constructor(e){super(),_e(this,e,a5,r5,me,{collection:0})}}function Wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function u5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function c5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Yd(n){let e,t,i=ue(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. + .`,l=M(),s=b("button"),r=K(o),a=M(),C&&C.c(),f=M(),B(u.$$.fragment),d=M(),B(m.$$.fragment),_=M(),R&&R.c(),g=M(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,H){w(q,e,H),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,f,H),z(u,q,H),w(q,d,H),z(m,q,H),w(q,_,H),R&&R.m(q,H),w(q,g,H),F&&F.m(q,H),w(q,y,H),S=!0,T||($=J(s,"click",n[3]),T=!0)},p(q,[H]){var U,Y;(!S||H&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,H),H&2&&E(C,1)):(C=Hd(q),C.c(),E(C,1),C.m(e,null)):C&&(ie(),A(C,1,1,()=>{C=null}),le());const W={};H&1&&(W.collection=q[0]),!c&&H&1&&(c=!0,W.rule=q[0].listRule,ke(()=>c=!1)),u.$set(W);const G={};H&1&&(G.collection=q[0]),!h&&H&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((U=q[0])==null?void 0:U.type)!=="view"?R?(R.p(q,H),H&1&&E(R,1)):(R=Vd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(ie(),A(R,1,1,()=>{R=null}),le()),((Y=q[0])==null?void 0:Y.type)==="auth"?F?(F.p(q,H),H&1&&E(F,1)):(F=Ud(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(ie(),A(F,1,1,()=>{F=null}),le())},i(q){S||(E(C),E(u.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(u.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),V(u,q),V(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function a5(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class f5 extends ge{constructor(e){super(),_e(this,e,a5,r5,pe,{collection:0})}}function Wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function u5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Et(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),le()}o?(e=Et(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function c5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Yd(n){let e,t,i=fe(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(le(),A(m[S],1,1,()=>{m[S]=null}),se(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Yd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function p5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[d5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function m5(n,e,t){let i;We(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Ht(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-iXaWdysu.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class h5 extends ge{constructor(e){super(),_e(this,e,m5,p5,me,{collection:0})}}const _5=n=>({active:n&1}),Jd=n=>({active:n[0]});function Zd(n){let e,t,i;const l=n[15].default,s=wt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&$t(s,l,o,o[14],i?St(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function g5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=wt(a,n,n[14],Jd);let u=n[0]&&Zd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&$t(f,a,c,c[14],s?St(a,c[14],d,_5):Tt(c[14]),Jd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Zd(c),u.c(),E(u,1),u.m(e,null)):u&&(le(),A(u,1,1,()=>{u=null}),se()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function b5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Ht(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){ee[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class go extends ge{constructor(e){super(),_e(this,e,b5,g5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function y5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[k5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function v5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?w5:v5}let a=r(n),f=a(n),u=n[3]&&Gd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function $5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[T5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[C5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function T5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function C5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fl({props:_}),ee.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function O5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[$5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Xd(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Xd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function E5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?D5:M5}let a=r(n),f=a(n),u=n[2]&&Qd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Qd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function xd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function A5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[I5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&xd();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=xd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function L5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function N5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ep(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function P5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?N5:L5}let a=r(n),f=a(n),u=n[1]&&ep();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=ep(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].options.minPasswordLength),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minPasswordLength&&re(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function R5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[11]),Se(Pe.call(null,r,{text:`The constraint is applied only for new records. + MAX(balance) as maxBalance).`,f=M(),_&&_.c(),u=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,f,y),_&&_.m(g,y),w(g,u,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(ie(),A(m[S],1,1,()=>{m[S]=null}),le(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Yd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(f),v(u)),m[s].d(g),_&&_.d(g)}}}function p5(n){let e,t;return e=new ue({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[d5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function m5(n,e,t){let i;We(n,mi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}zt(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-CiCm0ZL1.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,f,u]}class h5 extends ge{constructor(e){super(),_e(this,e,m5,p5,pe,{collection:0})}}const _5=n=>({active:n&1}),Jd=n=>({active:n[0]});function Zd(n){let e,t,i;const l=n[15].default,s=St(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Tt(s,l,o,o[14],i?$t(l,o[14],r,null):Ct(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function g5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=St(a,n,n[14],Jd);let u=n[0]&&Zd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=M(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),f&&f.m(t,null),k(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[J(t,"click",Be(n[17])),J(t,"drop",Be(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",Be(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&Tt(f,a,c,c[14],s?$t(a,c[14],d,_5):Ct(c[14]),Jd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&E(u,1)):(u=Zd(c),u.c(),E(u,1),u.m(e,null)):u&&(ie(),A(u,1,1,()=>{u=null}),le()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(f,c),E(u),s=!0)},o(c){A(f,c),A(u),s=!1},d(c){c&&v(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,$e(r)}}}function b5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){S(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),u?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}zt(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{f&&(t(7,m=!1),S(),s("drop",R))},O=R=>f&&s("dragstart",R),D=R=>{f&&(t(7,m=!0),s("dragenter",R))},I=R=>{f&&(t(7,m=!1),s("dragleave",R))};function L(R){te[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,f=R.draggable),"active"in R&&t(0,u=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&u&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[u,a,f,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class go extends ge{constructor(e){super(),_e(this,e,b5,g5,pe,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function k5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowUsernameAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[5]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowUsernameAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function y5(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[k5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function v5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?w5:v5}let a=r(n),f=a(n),u=n[3]&&Gd();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[3]?u?d&8&&E(u,1):(u=Gd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(ie(),A(u,1,1,()=>{u=null}),le())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function $5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowEmailAuth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[6]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowEmailAuth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Xd(n){let e,t,i,l,s,o,r,a;return i=new ue({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[T5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[C5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(f,u){w(f,e,u),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),a=!0},p(f,u){const c={};u&1&&(c.class="form-field "+(j.isEmpty(f[0].options.onlyEmailDomains)?"":"disabled")),u&24577&&(c.$$scope={dirty:u,ctx:f}),i.$set(c);const d={};u&1&&(d.class="form-field "+(j.isEmpty(f[0].options.exceptEmailDomains)?"":"disabled")),u&24577&&(d.$$scope={dirty:u,ctx:f}),o.$set(d)},i(f){a||(E(i.$$.fragment,f),E(o.$$.fragment,f),f&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(f){A(i.$$.fragment,f),A(o.$$.fragment,f),f&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(f){f&&v(e),V(i),V(o),f&&r&&r.end()}}}function T5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function C5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),f=M(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),z(r,g,y),w(g,f,y),w(g,u,y),c=!0,d||(m=Se(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(f),v(u)),V(r,g),d=!1,m()}}}function O5(n){let e,t,i,l;e=new ue({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[$5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Xd(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=Xd(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Qd(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function E5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?D5:M5}let a=r(n),f=a(n),u=n[2]&&Qd();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&E(u,1):(u=Qd(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(ie(),A(u,1,1,()=>{u=null}),le())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].options.allowOAuth2Auth,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function xd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function A5(n){let e,t,i,l;e=new ue({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[I5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&xd();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=xd(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function L5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function N5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ep(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function P5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?N5:L5}let a=r(n),f=a(n),u=n[1]&&ep();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),f.c(),s=M(),u&&u.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),f.m(c,d),w(c,s,d),u&&u.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[1]?u?d&2&&E(u,1):(u=ep(),u.c(),E(u,1),u.m(o.parentNode,o)):u&&(ie(),A(u,1,1,()=>{u=null}),le())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),f.d(c),u&&u.d(c)}}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].options.minPasswordLength),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&8192&&i!==(i=f[13])&&p(e,"for",i),u&8192&&o!==(o=f[13])&&p(s,"id",o),u&1&&it(s.value)!==f[0].options.minPasswordLength&&oe(s,f[0].options.minPasswordLength)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function R5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[11]),Se(Pe.call(null,r,{text:`The constraint is applied only for new records. Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function q5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[12]),Se(Pe.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(` -`),position:"right"}))],f=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function j5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;return l=new go({props:{single:!0,$$slots:{header:[S5],default:[y5]},$$scope:{ctx:n}}}),o=new go({props:{single:!0,$$slots:{header:[E5],default:[O5]},$$scope:{ctx:n}}}),a=new go({props:{single:!0,$$slots:{header:[P5],default:[A5]},$$scope:{ctx:n}}}),h=new ce({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[F5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[R5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[q5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),z(l,i,null),k(i,s),z(o,i,null),k(i,r),z(a,i,null),w($,f,C),w($,u,C),w($,c,C),w($,d,C),w($,m,C),z(h,$,C),w($,_,C),z(g,$,C),w($,y,C),z(S,$,C),T=!0},p($,[C]){const O={};C&16393&&(O.$$scope={dirty:C,ctx:$}),l.$set(O);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(f),v(u),v(c),v(d),v(m),v(_),v(y)),V(l),V(o),V(a),V(h,$),V(g,$),V(S,$)}}}function H5(n,e,t){let i,l,s,o;We(n,mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=it(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class z5 extends ge{constructor(e){super(),_e(this,e,H5,j5,me,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n,e,t){const i=n.slice();return i[18]=e[t],i}function ip(n,e,t){const i=n.slice();return i[18]=e[t],i}function lp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sp(n){let e,t,i,l,s=n[3]&&op(n),o=!n[4]&&rp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=op(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=rp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function op(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=K(`Renamed collection - `),l=b("strong"),o=K(s),r=M(),a=b("i"),f=M(),u=b("strong"),d=K(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&oe(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&oe(d,c)},d(_){_&&v(e)}}}function rp(n){let e,t,i,l=ue(n[6]),s=[];for(let u=0;u
    ',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=lp(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=sp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function B5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function W5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[U5],header:[B5],default:[V5]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function Y5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){ee[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class K5 extends ge{constructor(e){super(),_e(this,e,Y5,W5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function J5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new GC({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Z5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new h5({props:s}),ee.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function pp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new z5({props:o}),ee.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Il)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function G5(n){let e,t,i,l,s,o,r;const a=[Z5,J5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===gs&&dp(n),d=n[15]&&pp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(le(),A(f[_],1,1,()=>{f[_]=null}),se(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===gs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=dp(m),c.c(),E(c,1),c.m(e,o)):c&&(le(),A(c,1,1,()=>{c=null}),se()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=pp(m),d.c(),E(d,1),d.m(e,null)):d&&(le(),A(d,1,1,()=>{d=null}),se())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function mp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[X5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function X5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function hp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[Q5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function _p(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&oe(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function Q5(n){let e,t=ue(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),se()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=hp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=gp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function bp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Ct(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function yp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&vp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=vp(),r.c(),E(r,1),r.m(e,null)):r&&(le(),A(r,1,1,()=>{r=null}),se()),d[0]&8&&x(e,"active",c[3]===Il)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function vp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e6(n){var H,W,G,U,Y,ie,te;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((te=(ie=n[5])==null?void 0:ie.options)==null?void 0:te.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&mp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[x5,({uniqueId:pe})=>({49:pe}),({uniqueId:pe})=>[0,pe?262144:0]]},$$scope:{ctx:n}}});let N=y&&bp(n),P=O&&kp(),q=n[15]&&yp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===gs),p(c,"class","tabs-header stretched")},m(pe,Ne){w(pe,e,Ne),k(e,i),w(pe,l,Ne),F&&F.m(pe,Ne),w(pe,s,Ne),w(pe,o,Ne),z(r,o,null),k(o,a),k(o,f),w(pe,u,Ne),w(pe,c,Ne),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(pe,Ne){var Xe,xe,Mt,ft,ht,Gt,De;(!I||Ne[0]&4)&&t!==(t=pe[2].id?"Edit collection":"New collection")&&oe(i,t),pe[2].id&&!pe[2].system?F?(F.p(pe,Ne),Ne[0]&4&&E(F,1)):(F=mp(pe),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(le(),A(F,1,1,()=>{F=null}),se());const He={};Ne[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(pe[13]?"disabled":"")),Ne[0]&41028|Ne[1]&8650752&&(He.$$scope={dirty:Ne,ctx:pe}),r.$set(He),(!I||Ne[0]&16384)&&h!==(h=pe[14]?"Query":"Fields")&&oe(_,h),Ne[0]&2048&&(y=!j.isEmpty(pe[11])),y?N?(N.p(pe,Ne),Ne[0]&2048&&E(N,1)):(N=bp(pe),N.c(),E(N,1),N.m(d,null)):N&&(le(),A(N,1,1,()=>{N=null}),se()),(!I||Ne[0]&8)&&x(d,"active",pe[3]===Ci),Ne[0]&32&&(O=!j.isEmpty((Xe=pe[5])==null?void 0:Xe.listRule)||!j.isEmpty((xe=pe[5])==null?void 0:xe.viewRule)||!j.isEmpty((Mt=pe[5])==null?void 0:Mt.createRule)||!j.isEmpty((ft=pe[5])==null?void 0:ft.updateRule)||!j.isEmpty((ht=pe[5])==null?void 0:ht.deleteRule)||!j.isEmpty((De=(Gt=pe[5])==null?void 0:Gt.options)==null?void 0:De.manageRule)),O?P?Ne[0]&32&&E(P,1):(P=kp(),P.c(),E(P,1),P.m(T,null)):P&&(le(),A(P,1,1,()=>{P=null}),se()),(!I||Ne[0]&8)&&x(T,"active",pe[3]===gs),pe[15]?q?q.p(pe,Ne):(q=yp(pe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(pe){I||(E(F),E(r.$$.fragment,pe),E(N),E(P),I=!0)},o(pe){A(F),A(r.$$.fragment,pe),A(N),A(P),I=!1},d(pe){pe&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(pe),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function t6(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&oe(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function n6(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[t6],header:[e6],default:[G5]},$$scope:{ctx:n}};e=new Zt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new K5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",gs="api_rules",Il="options",i6="base",wp="auth",Sp="view";function Lr(n){return JSON.stringify(n)}function l6(n,e,t){let i,l,s,o,r,a;We(n,mi,ve=>t(5,a=ve));const f={};f[i6]="Base",f[Sp]="View",f[wp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Lr(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Jt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Lr(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=ae.collections.update(h.id,ve):we=ae.collections.create(ve),we.then(Ye=>{Ta(),fv(Ye),t(10,g=!1),O(),Lt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{ae.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&un(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ae.collections.delete(m.id).then(()=>{O(),Lt(`Successfully deleted collection "${m.name}".`),u("delete",m),uv(m)}).catch(ve=>{ae.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),ie=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},te=ve=>P(ve),pe=()=>{r&&L()},Ne=()=>$(Ci),He=()=>$(gs),Xe=()=>$(Il);function xe(ve){h=ve,t(2,h),t(23,m)}function Mt(ve){h=ve,t(2,h),t(23,m)}function ft(ve){h=ve,t(2,h),t(23,m)}function ht(ve){h=ve,t(2,h),t(23,m)}const Gt=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function De(ve){ee[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Ae(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function bt(ve){ee[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===wp),n.$$.dirty[0]&4&&t(14,l=h.type===Sp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Lr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Il&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De,Ae,ze,bt,de]}class Ya extends ge{constructor(e){super(),_e(this,e,l6,n6,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function s6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function o6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function r6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?o6:s6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(ln.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&oe(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Ct(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function a6(n,e,t){let i,l;We(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Zb extends ge{constructor(e){super(),_e(this,e,a6,r6,me,{collection:0,pinnedIds:4})}}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cp(n){let e,t,i=[],l=new Map,s,o,r=ue(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Mp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Dp(),r=ue(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Ip(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ap(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function f6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Cp(n),T=n[5].length&&Mp(n),$=n[3].length&&!n[2].length&&Ip(),C=!n[9]&&Ap(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),re(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&re(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=Cp(O),S.c(),E(S,1),S.m(u,c)):S&&(le(),A(S,1,1,()=>{S=null}),se()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Mp(O),T.c(),E(T,1),T.m(u,d)):T&&(le(),A(T,1,1,()=>{T=null}),se()),O[3].length&&!O[2].length?$||($=Ip(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ap(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function u6(n){let e,t,i,l;e=new Bb({props:{class:"collection-sidebar",$$slots:{default:[f6]},$$scope:{ctx:n}}});let s={};return i=new Ya({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Lp="@pinnedCollections";function c6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function d6(n,e,t){let i,l,s,o,r,a,f,u,c;We(n,Rn,L=>t(11,a=L)),We(n,Yn,L=>t(19,f=L)),We(n,Oo,L=>t(8,u=L)),We(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Lp);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){ee[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),c6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Lp,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class p6 extends ge{constructor(e){super(),_e(this,e,d6,u6,me,{})}}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Pp(n){n[18]=n[19].default}function Fp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Rp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Rp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Rp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&oe(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function jp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:_6,then:h6,catch:m6,value:19,blocks:[,,,]};return ef(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&ef(t,l)||E0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function m6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function h6(n){Pp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Pp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function _6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Hp(n,e){let t,i,l,s=e[5]===e[14]&&jp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=jp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(le(),A(s,1,1,()=>{s=null}),se())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function g6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=ue(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function k6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[b6],default:[g6]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function y6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-D0RToTF6.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-DaNIuuC4.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-DyFYshJx.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-DY8egWRV.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-BjlD4kbR.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-5_90JfZR.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-Day03rmY.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-fAroZBFD.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-Qii5vPCm.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-C_sAThHJ.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-DXzEcR9y.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-Iw-ugIBq.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-CqsVn5Wy.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-W_T6yElq.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-C8t_3a0s.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-D7M5HLRz.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-FIkHZF7A.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-BAfMmG5W.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){ee[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class v6 extends ge{constructor(e){super(),_e(this,e,y6,k6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function w6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` -`),position:"left"})),i=!0)},p(s,[o]){t&&Ct(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const zp="yyyy-MM-dd HH:mm:ss.SSS";function S6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,zp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,zp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Gb extends ge{constructor(e){super(),_e(this,e,S6,w6,me,{model:1})}}function $6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function T6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[$6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),ee.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ct(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function C6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){ee[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Xb extends ge{constructor(e){super(),_e(this,e,C6,T6,me,{class:0,length:5})}}function O6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),re(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function M6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),re(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&oe(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&re(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Vp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[D6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bp(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[E6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[I6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function E6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),re(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&re(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function I6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function A6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function L6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[M6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Vp(n),_=(n[2]||n[3])&&Bp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[A6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(y,S),S&4&&E(h,1)):(h=Vp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Bp(y),_.c(),E(_,1),_.m(a,null)):_&&(le(),A(_,1,1,()=>{_=null}),se());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function N6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||un("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class P6 extends ge{constructor(e){super(),_e(this,e,N6,L6,me,{record:0,collection:1,isNew:2})}}function F6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Ht(()=>(f(),()=>clearTimeout(a)));function c(m){ee[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(3,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class q6 extends ge{constructor(e){super(),_e(this,e,R6,F6,me,{value:0,maxHeight:4})}}function j6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new q6({props:h}),ee.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&oe(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function H6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class V6 extends ge{constructor(e){super(),_e(this,e,z6,H6,me,{field:1,value:0})}}function B6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),re(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&oe(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&re(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function U6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Y6 extends ge{constructor(e){super(),_e(this,e,W6,U6,me,{field:1,value:0})}}function K6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&oe(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function J6(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class G6 extends ge{constructor(e){super(),_e(this,e,Z6,J6,me,{field:1,value:0})}}function X6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function Q6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class eO extends ge{constructor(e){super(),_e(this,e,x6,Q6,me,{field:1,value:0})}}function tO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),re(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&oe(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&re(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function nO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function iO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class lO extends ge{constructor(e){super(),_e(this,e,iO,nO,me,{field:1,value:0})}}function Up(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function sO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Up(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Wa({props:T}),ee.push(()=>be(d,"value",y)),ee.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&oe(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Up($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function oO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class aO extends ge{constructor(e){super(),_e(this,e,rO,oO,me,{field:1,value:0})}}function Wp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&oe(l,i)},d(o){o&&v(e)}}}function fO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Jb({props:g}),ee.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Wp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&oe(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Wp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function uO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class dO extends ge{constructor(e){super(),_e(this,e,cO,uO,me,{field:1,value:0})}}function pO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function _O(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){le();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),se()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function gO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?mO:pO}let $=T(n),C=$(n);const O=[_O,hO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&oe(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Ct(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(le(),A(D[F],1,1,()=>{D[F]=null}),se(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function bO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yp(n){return typeof n=="string"&&Qb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Qb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function kO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Yp(s);Ht(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-iXaWdysu.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Yp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Qb(r))},[s,l,r,o,i,a]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,me,{field:1,value:0})}}function vO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){let e;function t(s,o){return s[2]?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function $O(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class TO extends ge{constructor(e){super(),_e(this,e,$O,SO,me,{file:0,size:1})}}function Kp(n){let e;function t(s,o){return s[4]==="image"?OO:CO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function CO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function OO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function MO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Kp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Kp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function DO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function EO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function IO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[EO],header:[DO],default:[MO]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function AO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){ee[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class LO extends ge{constructor(e){super(),_e(this,e,AO,IO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function NO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?qO:f[3]==="video"||f[3]==="audio"?RO:FO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function PO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function FO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function RO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Jp(n){let e,t,i={};return e=new LO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function jO(n){let e,t,i;function l(a,f){return a[2]?PO:NO}let s=l(n),o=s(n),r=n[7]&&Jp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Jp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function HO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ae.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){ee[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":ae.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":ae.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ka extends ge{constructor(e){super(),_e(this,e,HO,jO,me,{record:9,filename:0,size:1})}}function Zp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Gp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function zO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function VO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function BO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ka({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?VO:zO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=ae.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&oe(a,r),(!m||S[0]&1064&&f!==(f=ae.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Xp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[BO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function UO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new TO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&oe(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Qp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[UO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function WO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=ue(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new ue({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[R5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new ue({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[q5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(h.$$.fragment),_=M(),B(g.$$.fragment),y=M(),B(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),z(l,i,null),k(i,s),z(o,i,null),k(i,r),z(a,i,null),w($,f,C),w($,u,C),w($,c,C),w($,d,C),w($,m,C),z(h,$,C),w($,_,C),z(g,$,C),w($,y,C),z(S,$,C),T=!0},p($,[C]){const O={};C&16393&&(O.$$scope={dirty:C,ctx:$}),l.$set(O);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(f),v(u),v(c),v(d),v(m),v(_),v(y)),V(l),V(o),V(a),V(h,$),V(g,$),V(S,$)}}}function H5(n,e,t){let i,l,s,o;We(n,mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=it(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class z5 extends ge{constructor(e){super(),_e(this,e,H5,j5,pe,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n,e,t){const i=n.slice();return i[18]=e[t],i}function ip(n,e,t){const i=n.slice();return i[18]=e[t],i}function lp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sp(n){let e,t,i,l,s=n[3]&&op(n),o=!n[4]&&rp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=op(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=rp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function op(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,f,u,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=K(`Renamed collection + `),l=b("strong"),o=K(s),r=M(),a=b("i"),f=M(),u=b("strong"),d=K(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,f),k(t,u),k(u,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&se(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&se(d,c)},d(_){_&&v(e)}}}function rp(n){let e,t,i,l=fe(n[6]),s=[];for(let u=0;u
    ',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=M(),f&&f.c(),r=M(),u&&u.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),f&&f.m(l,null),w(c,r,d),u&&u.m(c,d),w(c,a,d)},p(c,d){c[7].length?f||(f=lp(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=sp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(v(e),v(r),v(a)),f&&f.d(),u&&u.d(c)}}}function B5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[J(e,"click",n[12]),J(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function W5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[U5],header:[B5],default:[V5]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function Y5(n,e,t){let i,l,s,o,r,a;const f=lt();let u,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),y=()=>_();function S(C){te[C?"unshift":"push"](()=>{u=C,t(5,u)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,y,S,T,$]}class K5 extends ge{constructor(e){super(),_e(this,e,Y5,W5,pe,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function J5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new GC({props:s}),te.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Z5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new h5({props:s}),te.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function pp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new z5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ke(()=>i=!1)),t.$set(f),(!l||a[0]&8)&&x(e,"active",r[3]===Il)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function G5(n){let e,t,i,l,s,o,r;const a=[Z5,J5],f=[];function u(m,h){return m[14]?0:1}i=u(n),l=f[i]=a[i](n);let c=n[3]===gs&&dp(n),d=n[15]&&pp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ci),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),f[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=u(m),i===_?f[i].p(m,h):(ie(),A(f[_],1,1,()=>{f[_]=null}),le(),l=f[i],l?l.p(m,h):(l=f[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Ci),m[3]===gs?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=dp(m),c.c(),E(c,1),c.m(e,o)):c&&(ie(),A(c,1,1,()=>{c=null}),le()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=pp(m),d.c(),E(d,1),d.m(e,null)):d&&(ie(),A(d,1,1,()=>{d=null}),le())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),f[i].d(),c&&c.d(),d&&d.d()}}}function mp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[X5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function X5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[27]),J(i,"click",Tn(Be(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function hp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[Q5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function _p(n){let e,t,i,l,s,o=n[51]+"",r,a,f,u,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" collection"),f=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,f),u||(c=J(e,"click",d),u=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&se(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),u=!1,c()}}}function Q5(n){let e,t=fe(Object.entries(n[6])),i=[];for(let l=0;l{N=null}),le()):N?(N.p(q,H),H[0]&4&&E(N,1)):(N=hp(q),N.c(),E(N,1),N.m(d,null)),(!L||H[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||H[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||H[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||H[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=gp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(u),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function bp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=Se(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Mt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Yt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Yt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function kp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function yp(n){var a,f,u;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((u=(f=n[5])==null?void 0:f.options)!=null&&u.manageRule),s,o,r=l&&vp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Il)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=J(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=vp(),r.c(),E(r,1),r.m(e,null)):r&&(ie(),A(r,1,1,()=>{r=null}),le()),d[0]&8&&x(e,"active",c[3]===Il)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function vp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e6(n){var H,W,G,U,Y,me,ee;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,f,u,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((H=n[5])==null?void 0:H.listRule)||!j.isEmpty((W=n[5])==null?void 0:W.viewRule)||!j.isEmpty((G=n[5])==null?void 0:G.createRule)||!j.isEmpty((U=n[5])==null?void 0:U.updateRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.deleteRule)||!j.isEmpty((ee=(me=n[5])==null?void 0:me.options)==null?void 0:ee.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&mp(n);r=new ue({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[x5,({uniqueId:ce})=>({49:ce}),({uniqueId:ce})=>[0,ce?262144:0]]},$$scope:{ctx:n}}});let N=y&&bp(n),P=O&&kp(),q=n[15]&&yp(n);return{c(){e=b("h4"),i=K(t),l=M(),F&&F.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),f=b("input"),u=M(),c=b("div"),d=b("button"),m=b("span"),_=K(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ci),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===gs),p(c,"class","tabs-header stretched")},m(ce,Oe){w(ce,e,Oe),k(e,i),w(ce,l,Oe),F&&F.m(ce,Oe),w(ce,s,Oe),w(ce,o,Oe),z(r,o,null),k(o,a),k(o,f),w(ce,u,Oe),w(ce,c,Oe),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[J(o,"submit",Be(n[31])),J(d,"click",n[32]),J(T,"click",n[33])],L=!0)},p(ce,Oe){var Je,xe,bt,kt,yt,Ot,Ee;(!I||Oe[0]&4)&&t!==(t=ce[2].id?"Edit collection":"New collection")&&se(i,t),ce[2].id&&!ce[2].system?F?(F.p(ce,Oe),Oe[0]&4&&E(F,1)):(F=mp(ce),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(ie(),A(F,1,1,()=>{F=null}),le());const He={};Oe[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(ce[13]?"disabled":"")),Oe[0]&41028|Oe[1]&8650752&&(He.$$scope={dirty:Oe,ctx:ce}),r.$set(He),(!I||Oe[0]&16384)&&h!==(h=ce[14]?"Query":"Fields")&&se(_,h),Oe[0]&2048&&(y=!j.isEmpty(ce[11])),y?N?(N.p(ce,Oe),Oe[0]&2048&&E(N,1)):(N=bp(ce),N.c(),E(N,1),N.m(d,null)):N&&(ie(),A(N,1,1,()=>{N=null}),le()),(!I||Oe[0]&8)&&x(d,"active",ce[3]===Ci),Oe[0]&32&&(O=!j.isEmpty((Je=ce[5])==null?void 0:Je.listRule)||!j.isEmpty((xe=ce[5])==null?void 0:xe.viewRule)||!j.isEmpty((bt=ce[5])==null?void 0:bt.createRule)||!j.isEmpty((kt=ce[5])==null?void 0:kt.updateRule)||!j.isEmpty((yt=ce[5])==null?void 0:yt.deleteRule)||!j.isEmpty((Ee=(Ot=ce[5])==null?void 0:Ot.options)==null?void 0:Ee.manageRule)),O?P?Oe[0]&32&&E(P,1):(P=kp(),P.c(),E(P,1),P.m(T,null)):P&&(ie(),A(P,1,1,()=>{P=null}),le()),(!I||Oe[0]&8)&&x(T,"active",ce[3]===gs),ce[15]?q?q.p(ce,Oe):(q=yp(ce),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(ce){I||(E(F),E(r.$$.fragment,ce),E(N),E(P),I=!0)},o(ce){A(F),A(r.$$.fragment,ce),A(N),A(P),I=!1},d(ce){ce&&(v(e),v(l),v(s),v(o),v(u),v(c)),F&&F.d(ce),V(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,$e(R)}}}function t6(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,f,u;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=K(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),f||(u=[J(e,"click",n[25]),J(l,"click",n[26])],f=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function n6(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[t6],header:[e6],default:[G5]},$$scope:{ctx:n}};e=new Gt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new K5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const f={};a[0]&512&&(f.overlayClose=!r[9]),a[0]&1040&&(f.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),V(e,r),n[43](null),V(i,r)}}}const Ci="schema",gs="api_rules",Il="options",i6="base",wp="auth",Sp="view";function Lr(n){return JSON.stringify(n)}function l6(n,e,t){let i,l,s,o,r,a;We(n,mi,ve=>t(5,a=ve));const f={};f[i6]="Base",f[Sp]="View",f[wp]="Auth";const u=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Ci,S=Lr(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Ci),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Zt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Lr(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let we;h.id?we=re.collections.update(h.id,ve):we=re.collections.create(ve),we.then(Ye=>{Ta(),fv(Ye),t(10,g=!1),O(),Nt(h.id?"Successfully updated collection.":"Successfully created collection."),u("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{re.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let we=ve.schema.length-1;we>=0;we--)ve.schema[we].toDelete&&ve.schema.splice(we,1);return ve}function N(){m!=null&&m.id&&un(`Do you really want to delete collection "${m.name}" and all its records?`,()=>re.collections.delete(m.id).then(()=>{O(),Nt(`Successfully deleted collection "${m.name}".`),u("delete",m),uv(m)}).catch(ve=>{re.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{H()}):H()}async function H(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const we of ve.schema)we.id="";if(!j.isEmpty(ve.indexes))for(let we=0;weO(),G=()=>L(),U=()=>q(),Y=()=>N(),me=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},ee=ve=>P(ve),ce=()=>{r&&L()},Oe=()=>$(Ci),He=()=>$(gs),Je=()=>$(Il);function xe(ve){h=ve,t(2,h),t(23,m)}function bt(ve){h=ve,t(2,h),t(23,m)}function kt(ve){h=ve,t(2,h),t(23,m)}function yt(ve){h=ve,t(2,h),t(23,m)}const Ot=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function Ee(ve){te[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Le(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function _t(ve){te[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,we;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===wp),n.$$.dirty[0]&4&&t(14,l=h.type===Sp),n.$$.dirty[0]&32&&(a.schema||(we=a.options)!=null&&we.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Lr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Il&&h.type!=="auth"&&$(Ci)},[$,O,h,y,o,a,f,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,W,G,U,Y,me,ee,ce,Oe,He,Je,xe,bt,kt,yt,Ot,Ee,Le,ze,_t,de]}class Ya extends ge{constructor(e){super(),_e(this,e,l6,n6,pe,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function s6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function o6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function r6(n){let e,t,i,l,s,o=n[0].name+"",r,a,f,u,c,d,m,h;function _(S,T){return S[1]?o6:s6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),y.m(f,null),m||(h=[Se(u=Pe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),J(f,"click",Tn(Be(n[5]))),Se(ln.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&se(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(f,null))),u&&Mt(u.update)&&T&2&&u.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,$e(h)}}}function a6(n,e,t){let i,l;We(n,Yn,f=>t(2,l=f));let{collection:s}=e,{pinnedIds:o}=e;function r(f){o.includes(f.id)?j.removeByValue(o,f.id):o.push(f.id),t(4,o)}const a=()=>r(s);return n.$$set=f=>{"collection"in f&&t(0,s=f.collection),"pinnedIds"in f&&t(4,o=f.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Zb extends ge{constructor(e){super(),_e(this,e,a6,r6,pe,{collection:0,pinnedIds:4})}}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cp(n){let e,t,i=[],l=new Map,s,o,r=fe(n[6]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&64&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Mp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Dp(),r=fe(n[5]);const a=f=>f[22].id;for(let f=0;fbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&32&&(u.collection=e[22]),!l&&f&2&&(l=!0,u.pinnedIds=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Ip(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Ap(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=J(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function f6(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S=n[6].length&&Cp(n),T=n[5].length&&Mp(n),$=n[3].length&&!n[2].length&&Ip(),C=!n[9]&&Ap(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),f=M(),u=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),x(u,"fade",n[8]),x(u,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),oe(o,n[0]),w(O,r,D),w(O,a,D),w(O,f,D),w(O,u,D),S&&S.m(u,null),k(u,c),T&&T.m(u,null),k(u,d),$&&$.m(u,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[J(l,"click",n[12]),J(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&oe(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=Cp(O),S.c(),E(S,1),S.m(u,c)):S&&(ie(),A(S,1,1,()=>{S=null}),le()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Mp(O),T.c(),E(T,1),T.m(u,d)):T&&(ie(),A(T,1,1,()=>{T=null}),le()),O[3].length&&!O[2].length?$||($=Ip(),$.c(),$.m(u,null)):$&&($.d(1),$=null),(!_||D&256)&&x(u,"fade",O[8]),(!_||D&4)&&x(u,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Ap(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(f),v(u),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,$e(y)}}}function u6(n){let e,t,i,l;e=new Bb({props:{class:"collection-sidebar",$$slots:{default:[f6]},$$scope:{ctx:n}}});let s={};return i=new Ya({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Lp="@pinnedCollections";function c6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function d6(n,e,t){let i,l,s,o,r,a,f,u,c;We(n,Rn,L=>t(11,a=L)),We(n,Yn,L=>t(19,f=L)),We(n,Oo,L=>t(8,u=L)),We(n,Xi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,f=L,f)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Lp);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){te[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),c6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Lp,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,u,c,_,a,S,T,$,C,O,D,I]}class p6 extends ge{constructor(e){super(),_e(this,e,d6,u6,pe,{})}}function Np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Pp(n){n[18]=n[19].default}function Fp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Rp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,f,u,c=i&&Rp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=K(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),f||(u=J(s,"click",d),f=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Rp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&se(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),f=!1,u()}}}function jp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:_6,then:h6,catch:m6,value:19,blocks:[,,,]};return ef(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&ef(t,l)||E0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function m6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function h6(n){Pp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Pp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function _6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Hp(n,e){let t,i,l,s=e[5]===e[14]&&jp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=jp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function g6(n){let e,t,i,l=[],s=new Map,o,r,a=[],f=new Map,u,c=fe(Object.entries(n[3]));const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function k6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[b6],default:[g6]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function y6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-WdA3p5Nq.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-DvDqZGkM.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-2bIkoopj.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-B38WU-hm.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-B7tWDNFi.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-Dzg8Y9BD.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-CPWaI1QS.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-BfeByTL2.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-DZkxje-L.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-DBEH9oXv.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-C7bRCIQx.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-DVvHVnNU.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-D60P5AZI.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-eykCUxs-.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-C4WZVRqf.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-DUYNI6SK.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-CD1lYZPX.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-Dusvq0CB.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function f(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function u(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>u(),m=y=>c(y);function h(y){te[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[u,c,o,a,s,r,i,f,d,m,h,_,g]}class v6 extends ge{constructor(e){super(),_e(this,e,y6,k6,pe,{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 w6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{text:n[0].join(` +`),position:"left"})),i=!0)},p(s,[o]){t&&Mt(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` +`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const zp="yyyy-MM-dd HH:mm:ss.SSS";function S6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,zp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,zp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Gb extends ge{constructor(e){super(),_e(this,e,S6,w6,pe,{model:1})}}function $6(n){let e,t,i,l,s,o,r,a,f,u;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=K(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),z(s,e,null),k(e,o),k(e,r),a=!0,f||(u=[Se(Pe.call(null,r,"Refresh")),J(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),f=!1,$e(u)}}}function T6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[$6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),te.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),z(l,e,null),a=!0,f||(u=Se(r=Pe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Mt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),f=!1,u()}}}function C6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,f,s,u,c]}class Xb extends ge{constructor(e){super(),_e(this,e,C6,T6,pe,{class:0,length:5})}}function O6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),oe(r,n[0].username),c||(d=J(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&oe(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function M6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),f=b("span"),u=K("Public: "),d=K(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,f),k(f,u),k(f,d),w($,h,C),w($,_,C),oe(_,n[0].email),n[2]&&_.focus(),S||(T=[Se(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",Be(n[6])),J(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&se(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&oe(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,$e(T)}}}function Vp(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[D6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[3],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&8&&(e.checked=f[3]),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bp(n){let e,t,i,l,s,o,r,a,f;return l=new ue({props:{class:"form-field required",name:"password",$$slots:{default:[E6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[I6,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:u}),r.$set(m),(!f||c&8)&&x(t,"p-t-xs",u[3])},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function E6(n){var _,g;let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(u,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),oe(r,n[0].password),w(y,f,S),w(y,u,S),z(c,u,null),d=!0,m||(h=J(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&oe(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function I6(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[0].passwordConfirm),f||(u=J(r,"input",n[10]),f=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&oe(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function A6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){w(f,e,u),e.checked=n[0].verified,w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"change",n[11]),J(e,"change",Be(n[12]))],r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].verified),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function L6(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ue({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[O6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[M6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Vp(n),_=(n[2]||n[3])&&Bp(n);return d=new ue({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[A6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),f=M(),_&&_.c(),u=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,f),_&&_.m(a,null),k(e,u),k(e,c),z(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(ie(),A(h,1,1,()=>{h=null}),le()):h?(h.p(y,S),S&4&&E(h,1)):(h=Vp(y),h.c(),E(h,1),h.m(a,f)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Bp(y),_.c(),E(_,1),_.m(a,null)):_&&(ie(),A(_,1,1,()=>{_=null}),le());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),V(o),h&&h.d(),_&&_.d(),V(d)}}}function N6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const f=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function u(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||un("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,f,u,c,d,m,h,_]}class P6 extends ge{constructor(e){super(),_e(this,e,N6,L6,pe,{record:0,collection:1,isNew:2})}}function F6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function u(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}zt(()=>(f(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ae(Ae({},e),Kt(m)),t(3,l=Xe(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&f()},[s,r,u,l,o,c,d]}class q6 extends ge{constructor(e){super(),_e(this,e,R6,F6,pe,{value:0,maxHeight:4})}}function j6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),u=new q6({props:h}),te.push(()=>be(u,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),z(u,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&se(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),u.$set(y)},i(_){d||(E(u.$$.fragment,_),d=!0)},o(_){A(u.$$.fragment,_),d=!1},d(_){_&&(v(e),v(f)),V(u,_)}}}function H6(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class V6 extends ge{constructor(e){super(),_e(this,e,z6,H6,pe,{field:1,value:0})}}function B6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","number"),p(u,"id",c=n[3]),u.required=d=n[1].required,p(u,"min",m=(y=n[1].options)==null?void 0:y.min),p(u,"max",h=(S=n[1].options)==null?void 0:S.max),p(u,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),w(y,u,S),oe(u,n[0]),_||(g=J(u,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&se(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(u,"id",c),S&2&&d!==(d=y[1].required)&&(u.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(u,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(u,"max",h),S&1&&it(u.value)!==y[0]&&oe(u,y[0])},d(y){y&&(v(e),v(f),v(u)),_=!1,g()}}}function U6(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Y6 extends ge{constructor(e){super(),_e(this,e,W6,U6,pe,{field:1,value:0})}}function K6(n){let e,t,i,l,s=n[1].name+"",o,r,a,f;return{c(){e=b("input"),i=M(),l=b("label"),o=K(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(u,c){w(u,e,c),e.checked=n[0],w(u,i,c),w(u,l,c),k(l,o),a||(f=J(e,"change",n[2]),a=!0)},p(u,c){c&8&&t!==(t=u[3])&&p(e,"id",t),c&1&&(e.checked=u[0]),c&2&&s!==(s=u[1].name+"")&&se(o,s),c&8&&r!==(r=u[3])&&p(l,"for",r)},d(u){u&&(v(e),v(i),v(l)),a=!1,f()}}}function J6(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class G6 extends ge{constructor(e){super(),_e(this,e,Z6,J6,pe,{field:1,value:0})}}function X6(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","email"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),oe(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&se(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&oe(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function Q6(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class eO extends ge{constructor(e){super(),_e(this,e,x6,Q6,pe,{field:1,value:0})}}function tO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),u=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(u,"type","url"),p(u,"id",c=n[3]),u.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,f,g),w(_,u,g),oe(u,n[0]),m||(h=J(u,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&se(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(u,"id",c),g&2&&d!==(d=_[1].required)&&(u.required=d),g&1&&u.value!==_[0]&&oe(u,_[0])},d(_){_&&(v(e),v(f),v(u)),m=!1,h()}}}function nO(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function iO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class lO extends ge{constructor(e){super(),_e(this,e,iO,nO,pe,{field:1,value:0})}}function Up(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[Se(Pe.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,$e(l)}}}function sO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g=n[0]&&!n[1].required&&Up(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Wa({props:T}),te.push(()=>be(d,"value",y)),te.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=K(" (UTC)"),u=M(),g&&g.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",f=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,u,C),g&&g.m($,C),w($,c,C),z(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&se(r,o),(!_||C&256&&f!==(f=$[8]))&&p(e,"for",f),$[0]&&!$[1].required?g?g.p($,C):(g=Up($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(u),v(c)),g&&g.d($),V(d,$)}}}function oO(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function f(c){s=c,t(2,s),t(0,l)}function u(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,f,u]}class aO extends ge{constructor(e){super(),_e(this,e,rO,oO,pe,{field:1,value:0})}}function Wp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=K("Select up to "),l=K(i),s=K(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(l,i)},d(o){o&&v(e)}}}function fO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),u=new Jb({props:g}),te.push(()=>be(u,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Wp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),B(u.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,f,L),z(u,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,H,W;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&se(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((H=(q=I[1].options)==null?void 0:q.values)==null?void 0:H.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),u.$set(R),((W=I[1].options)==null?void 0:W.maxSelect)>1?y?y.p(I,L):(y=Wp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(u.$$.fragment,I),h=!0)},o(I){A(u.$$.fragment,I),h=!1},d(I){I&&(v(e),v(f),v(d),v(m)),V(u,I),y&&y.d(I)}}}function uO(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class dO extends ge{constructor(e){super(),_e(this,e,cO,uO,pe,{field:1,value:0})}}function pO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function _O(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Et(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ye()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){ie();const a=e;A(a.$$.fragment,1,0,()=>{V(a,1)}),le()}l?(e=Et(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function gO(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?mO:pO}let $=T(n),C=$(n);const O=[_O,hO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),a=M(),f=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(f,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,f),C.m(f,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=Se(u=Pe.call(null,f,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&se(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(f,null))),u&&Mt(u.update)&&R&16&&u.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(ie(),A(D[F],1,1,()=>{D[F]=null}),le(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function bO(n){let e,t;return e=new ue({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[gO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yp(n){return typeof n=="string"&&Qb(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Qb(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function kO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Yp(s);zt(async()=>{try{t(3,o=(await tt(async()=>{const{default:f}=await import("./CodeEditor-CiCm0ZL1.js");return{default:f}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(f){console.warn(f)}});const a=f=>{t(2,r=f.detail),t(0,s=r.trim())};return n.$$set=f=>{"field"in f&&t(1,l=f.field),"value"in f&&t(0,s=f.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Yp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Qb(r))},[s,l,r,o,i,a]}class yO extends ge{constructor(e){super(),_e(this,e,kO,bO,pe,{field:1,value:0})}}function vO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function wO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function SO(n){let e;function t(s,o){return s[2]?wO:vO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function $O(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class TO extends ge{constructor(e){super(),_e(this,e,$O,SO,pe,{file:0,size:1})}}function Kp(n){let e;function t(s,o){return s[4]==="image"?OO:CO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function CO(n){let e,t;return{c(){e=b("object"),t=K("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function OO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function MO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Kp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Kp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function DO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function EO(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("a"),t=K(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),f||(u=J(a,"click",n[0]),f=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),f=!1,u()}}}function IO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[EO],header:[DO],default:[MO]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function AO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function f(){return o==null?void 0:o.hide()}function u(m){te[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,a,i,u,c,d]}class LO extends ge{constructor(e){super(),_e(this,e,AO,IO,pe,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function NO(n){let e,t,i,l,s;function o(f,u){return f[3]==="image"?qO:f[3]==="video"||f[3]==="audio"?RO:FO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(f,u){w(f,e,u),a.m(e,null),l||(s=J(e,"click",Tn(n[11])),l=!0)},p(f,u){r===(r=o(f))&&a?a.p(f,u):(a.d(1),a=r(f),a&&(a.c(),a.m(e,null))),u&2&&t!==(t="thumb "+(f[1]?`thumb-${f[1]}`:""))&&p(e,"class",t),u&64&&p(e,"href",f[6]),u&129&&i!==(i=(f[7]?"Preview":"Download")+" "+f[0])&&p(e,"title",i)},d(f){f&&v(e),a.d(),l=!1,s()}}}function PO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function FO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function RO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){w(o,e,r),l||(s=J(e,"error",n[8]),l=!0)},p(o,r){r&32&&!en(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Jp(n){let e,t,i={};return e=new LO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function jO(n){let e,t,i;function l(a,f){return a[2]?PO:NO}let s=l(n),o=s(n),r=n[7]&&Jp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,f){o.m(a,f),w(a,e,f),r&&r.m(a,f),w(a,t,f),i=!0},p(a,[f]){s===(s=l(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,f),f&128&&E(r,1)):(r=Jp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function HO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,f="",u="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await re.getAdminFileToken(s.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function h(){t(5,f="")}const _=y=>{l&&(y.preventDefault(),a==null||a.show(u))};function g(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,s=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,u=d?"":re.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,f=d?"":re.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,f,u,l,h,s,c,_,g]}class Ka extends ge{constructor(e){super(),_e(this,e,HO,jO,pe,{record:9,filename:0,size:1})}}function Zp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Gp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function zO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[Se(Pe.call(null,e,"Remove file")),J(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,$e(i)}}}function VO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=J(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function BO(n){let e,t,i,l,s,o,r=n[34]+"",a,f,u,c,d,m;i=new Ka({props:{record:n[3],filename:n[34]}});function h(y,S){return y[35]?VO:zO}let _=h(n),g=_(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=K(r),c=M(),d=b("div"),g.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",f=re.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",u="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(y,S){w(y,e,S),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,c),k(e,d),g.m(d,null),m=!0},p(y,S){const T={};S[0]&8&&(T.record=y[3]),S[0]&32&&(T.filename=y[34]),i.$set(T),(!m||S[0]&36)&&x(t,"fade",y[35]),(!m||S[0]&32)&&r!==(r=y[34]+"")&&se(a,r),(!m||S[0]&1064&&f!==(f=re.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",f),(!m||S[0]&36&&u!==(u="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",u),_===(_=h(y))&&g?g.p(y,S):(g.d(1),g=_(y),g&&(g.c(),g.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",y[32]),(!m||S[1]&4)&&x(e,"dragover",y[33])},i(y){m||(E(i.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),m=!1},d(y){y&&v(e),V(i),g.d()}}}function Xp(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[BO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Es({props:r}),te.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_uploaded"),f[0]&32&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&1068|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.list=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function UO(n){let e,t,i,l,s,o,r,a,f=n[29].name+"",u,c,d,m,h,_,g;i=new TO({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),u=K(f),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,T){w(S,e,T),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,u),k(e,d),k(e,m),h=!0,_||(g=[Se(Pe.call(null,m,"Remove file")),J(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[29]),i.$set($),(!h||T[0]&2)&&f!==(f=n[29].name+"")&&se(u,f),(!h||T[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||T[1]&2)&&x(e,"dragging",n[32]),(!h||T[1]&4)&&x(e,"dragover",n[33])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),V(i),_=!1,$e(g)}}}function Qp(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[UO,({dragging:a,dragover:f})=>({32:a,33:f}),({dragging:a,dragover:f})=>[0,(a?2:0)|(f?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Es({props:r}),te.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&16&&(u.group=e[4].name+"_new"),f[0]&2&&(u.index=e[31]),f[0]&64&&(u.disabled=!e[6]),f[0]&2|f[1]&70&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&2&&(l=!0,u.list=e[1],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function WO(n){let e,t,i,l,s,o=n[4].name+"",r,a,f,u,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=fe(n[5]);const P=W=>W[34]+W[3].id;for(let W=0;WW[29].name+W[31];for(let W=0;W{t(10,h=await ae.getAdminFileToken(o.collectionId))});const $=H=>_(H),C=H=>g(H);function O(H){a=H,t(0,a),t(6,i),t(4,r)}const D=H=>y(H);function I(H){f=H,t(1,f)}function L(H){ee[H?"unshift":"push"](()=>{c=H,t(7,c)})}const R=()=>{for(let H of c.files)f.push(H);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(H){ee[H?"unshift":"push"](()=>{d=H,t(8,d)})}const P=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=H=>{"record"in H&&t(3,o=H.record),"field"in H&&t(4,r=H.field),"value"in H&&t(0,a=H.value),"uploadedFiles"in H&&t(1,f=H.uploadedFiles),"deletedFileNames"in H&&t(2,u=H.deletedFileNames)},n.$$.update=()=>{var H,W;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=j.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=j.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((H=r.options)==null?void 0:H.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((W=r.options)==null?void 0:W.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,y,T,$,C,O,D,I,L,R,F,N,P,q]}class JO extends ge{constructor(e){super(),_e(this,e,KO,YO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function xp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function ZO(n,e){e=xp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=xp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function em(n,e,t){const i=n.slice();i[6]=e[t];const l=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=l,i}function tm(n,e,t){const i=n.slice();return i[10]=e[t],i}function nm(n){let e,t;return e=new Ka({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[10]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function im(n){let e=!j.isEmpty(n[10]),t,i,l=e&&nm(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&3&&(e=!j.isEmpty(s[10])),e?l?(l.p(s,o),o&3&&E(l,1)):(l=nm(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(le(),A(l,1,1,()=>{l=null}),se())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function lm(n){let e,t,i=ue(n[7]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oA(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let _=0;_t(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.schema)||[];if(t(1,o=f.filter(u=>u.presentable&&u.type=="file").map(u=>u.name)),t(2,r=f.filter(u=>u.presentable&&u.type!="file").map(u=>u.name)),!o.length&&!r.length){const u=f.find(c=>{var d,m,h;return c.type=="file"&&((d=c.options)==null?void 0:d.maxSelect)==1&&((h=(m=c.options)==null?void 0:m.mimeTypes)==null?void 0:h.find(_=>_.startsWith("image/")))});u&&o.push(u.name)}}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l]}class tr extends ge{constructor(e){super(),_e(this,e,XO,GO,me,{record:0})}}function sm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function om(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function rm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function am(n){let e,t=!n[13]&&fm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=fm(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function fm(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&um(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=um(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function QO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[Se(Pe.call(null,t,"Edit")),J(t,"keydown",Tn(n[27])),J(t,"click",Tn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,$e(l)}}}function dm(n,e){let t,i,l,s,o,r,a,f;function u(g,y){return g[6]?xO:QO}let c=u(e),d=c(e);s=new tr({props:{record:e[49]}});let m=!e[11]&&cm(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),z(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(f=[J(t,"click",h),J(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=u(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=cm(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),V(s),m&&m.d(),a=!1,$e(f)}}}function pm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=K("("),i=K(t),l=K(" of MAX "),s=K(n[4]),o=K(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function eM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function tM(n){let e,t,i=ue(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(u,c){w(u,e,c),z(t,e,null),k(e,i),k(e,l),w(u,s,c),o=!0,r||(a=J(l,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(u){o||(E(t.$$.fragment,u),o=!0)},o(u){A(t.$$.fragment,u),o=!1},d(u){u&&(v(e),v(s)),V(t),r=!1,a()}}}function hm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[nM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Es({props:s}),ee.push(()=>be(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function iM(n){let e,t,i,l,s,o=[],r=new Map,a,f,u,c,d,m,h,_,g,y,S,T;t=new Cs({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&rm(n),C=ue(n[8]);const O=P=>P[49].id;for(let P=0;P1&&mm(n);const R=[tM,eM],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),$&&$.c(),l=M(),s=b("div");for(let P=0;P1?L?L.p(P,q):(L=mm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let W=h;h=N(P),h===W?F[h].p(P,q):(le(),A(F[W],1,1,()=>{F[W]=null}),se(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;qCancel',t=M(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[28]),J(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function oM(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[sM],header:[lM],default:[iM]},$$scope:{ctx:n}};for(let a=0;at(26,m=we));const h=lt(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],O=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,O=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const we=j.toArray(g);if(!l||!we.length)return;t(24,R=!0);let Ye=[];const zt=we.slice(),dn=[];for(;zt.length>0;){const an=[];for(const qn of zt.splice(0,io))an.push(`id="${qn}"`);dn.push(ae.collection(l).getFullList({batch:io,filter:an.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(an=>{Ye=Ye.concat(...an)}),t(6,O=[]);for(const an of we){const qn=j.findByKey(Ye,"id",an);qn&&O.push(qn)}$.trim()||t(8,C=j.filterDuplicatesByKey(O.concat(C))),t(24,R=!1)}catch(an){an.isAbort||(ae.error(an),t(24,R=!1))}}async function q(we=!1){if(l){t(3,L=!0),we&&($.trim()?t(8,C=[]):t(8,C=j.toArray(O).slice()));try{const Ye=we?1:D+1,zt=j.getAllCollectionIdentifiers(s),dn=await ae.collection(l).getList(Ye,io,{filter:j.normalizeSearchFilter($,zt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(dn.items))),D=dn.page,t(23,I=dn.items.length),t(3,L=!1)}catch(Ye){Ye.isAbort||(ae.error(Ye),t(3,L=!1))}}}function H(we){i==1?t(6,O=[we]):f&&(j.pushOrReplaceByKey(O,we),t(6,O))}function W(we){j.removeByKey(O,"id",we.id),t(6,O)}function G(we){u(we)?W(we):H(we)}function U(){var we;i!=1?t(20,g=O.map(Ye=>Ye.id)):t(20,g=((we=O==null?void 0:O[0])==null?void 0:we.id)||""),h("save",O),N()}function Y(we){Ce.call(this,n,we)}const ie=()=>N(),te=()=>U(),pe=we=>t(2,$=we.detail),Ne=()=>T==null?void 0:T.show(),He=we=>T==null?void 0:T.show(we.id),Xe=we=>G(we),xe=(we,Ye)=>{(Ye.code==="Enter"||Ye.code==="Space")&&(Ye.preventDefault(),Ye.stopPropagation(),G(we))},Mt=()=>t(2,$=""),ft=()=>{a&&!L&&q()},ht=we=>W(we);function Gt(we){O=we,t(6,O)}function De(we){ee[we?"unshift":"push"](()=>{S=we,t(1,S)})}function Ae(we){Ce.call(this,n,we)}function ze(we){Ce.call(this,n,we)}function bt(we){ee[we?"unshift":"push"](()=>{T=we,t(7,T)})}const de=we=>{j.removeByKey(C,"id",we.detail.record.id),C.unshift(we.detail.record),t(8,C),H(we.detail.record)},ve=we=>{j.removeByKey(C,"id",we.detail.id),t(8,C),W(we.detail)};return n.$$set=we=>{e=Ie(Ie({},e),Yt(we)),t(19,d=Ge(e,c)),"value"in we&&t(20,g=we.value),"field"in we&&t(21,y=we.field)},n.$$.update=()=>{var we,Ye;n.$$.dirty[0]&2097152&&t(4,i=((we=y==null?void 0:y.options)==null?void 0:we.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(Ye=y==null?void 0:y.options)==null?void 0:Ye.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(zt=>zt.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==io),n.$$.dirty[0]&80&&t(10,f=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,u=function(zt){return j.findByKey(O,"id",zt.id)})},[N,S,$,L,i,s,O,T,C,u,f,o,a,r,q,H,W,G,U,d,g,y,F,I,R,l,m,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De,Ae,ze,bt,de,ve]}class aM extends ge{constructor(e){super(),_e(this,e,rM,oM,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function _m(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function gm(n,e,t){const i=n.slice();return i[26]=e[t],i}function bm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Ct(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function km(n){let e,t=n[5]&&ym(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=ym(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function ym(n){let e,t=ue(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fM(n){let e,t,i,l,s,o,r,a,f,u;i=new tr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,f||(u=[Se(Pe.call(null,o,"Remove")),J(o,"click",c)],f=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),f=!1,$e(u)}}}function wm(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[fM,({dragging:a,dragover:f})=>({24:a,25:f}),({dragging:a,dragover:f})=>(a?16777216:0)|(f?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Es({props:r}),ee.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[23]),f&128&&(u.disabled=!e[7]),f&587202576&&(u.$$scope={dirty:f,ctx:e}),!l&&f&16&&(l=!0,u.list=e[4],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function uM(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&bm(n),O=ue(n[4]);const D=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Un(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",f=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,u,R),w(L,c,R),k(c,d);for(let F=0;F({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new ce({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new aM({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,[a]){const f={};a&4&&(f.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(f.name=r[2].name),a&537919735&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a&1&&(u.value=r[0]),a&4&&(u.field=r[2]),i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const Sm=100;function dM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],f=!1,u,c=[];function d(){if(f)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,f=!1);return}t(5,f=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,Sm))N.push(`id="${P}"`);L.push(ae.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(Sm,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){ae.error(N)}t(5,f=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}vs(()=>{clearTimeout(u)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){ee[D?"unshift":"push"](()=>{o=D,t(1,o)})}const O=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,f=!0),clearTimeout(u),t(10,u=setTimeout(m,0)))},[s,o,l,r,a,f,c,i,h,_,u,g,y,S,T,$,C,O]}class pM extends ge{constructor(e){super(),_e(this,e,dM,cM,me,{field:2,value:0,picker:1})}}function mM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),v0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function hM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function _M(n){let e;function t(s,o){return s[1]?hM:mM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function gM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let bM=gM();function Nr(){return window&&window.tinymce?window.tinymce:null}function kM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:f=""}=e,{text:u=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=f,S=s;const T=lt();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(f),L.on(a,()=>{t(12,y=L.getContent()),y!==f&&(t(5,f=y),t(6,u=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Nr().init(I)}Ht(()=>(Nr()!==null?$():bM.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,L;try{g&&((I=g.dom)==null||I.unbind(document),(L=Nr())==null||L.remove(g))}catch{}}));function C(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function O(I){ee[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){ee[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,f=I.value),"text"in I&&t(6,u=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==f&&(g.setContent(f),t(6,u=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,f,u,s,o,r,a,g,y,S,C,O,D]}class Ja extends ge{constructor(e){super(),_e(this,e,kM,_M,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function $m(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Tm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Cm(n,e,t){const i=n.slice();return i[51]=e[t],i}function yM(n){let e,t,i=[],l=new Map,s,o,r,a,f,u,c,d,m,h,_,g=ue(n[7]);const y=S=>S[51].id;for(let S=0;SNew record',c=M(),B(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(u,"type","button"),p(u,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$file field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Om(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var f;t=b("button"),l=K(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((f=e[8])==null?void 0:f.id)==e[51].id),this.first=t},m(f,u){w(f,t,u),k(t,l),k(t,s),o||(r=J(t,"click",Be(a)),o=!0)},p(f,u){var c;e=f,u[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),u[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(f){f&&v(t),o=!1,r()}}}function wM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Mm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Mm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function SM(n){let e=[],t=new Map,i,l=ue(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function $M(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=ae.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=ae.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Dm(n){let e,t,i,l,s,o;function r(u,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(u[48])),t?TM:$M}let a=r(n,[-1,-1]),f=a(n);return{c(){e=b("button"),f.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(u,c){w(u,e,c),f.m(e,null),k(e,i),s||(o=[Se(l=Pe.call(null,e,n[48]+` -(record: `+n[44].id+")")),J(e,"click",Be(function(){Ct(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(u,c){n=u,a===(a=r(n,c))&&f?f.p(n,c):(f.d(1),f=a(n),f&&(f.c(),f.m(e,i))),l&&Ct(l.update)&&c[0]&32&&l.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(u){u&&v(e),f.d(),s=!1,$e(o)}}}function Em(n,e){let t,i,l=ue(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function CM(n){let e,t;function i(r,a){if(r[15])return SM;if(!r[6])return wM}let l=i(n),s=l&&l(n),o=n[6]&&Im();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Im(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function OM(n){let e,t,i,l;const s=[vM,yM],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function MM(n){let e,t;return{c(){e=b("h4"),t=K(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&v(e)}}}function Am(n){let e,t;return e=new ce({props:{class:"form-field file-picker-size-select",$$slots:{default:[DM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new hi({props:s}),ee.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function EM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Am(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=K(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=f=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),u=!0,c||(d=[J(e,"click",n[2]),J(o,"click",n[21])],c=!0)},p(_,g){var y;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Am(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(le(),A(m,1,1,()=>{m=null}),se()),(!u||g[0]&2)&&oe(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(E(m),u=!0)},o(_){A(m),u=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,$e(d)}}}function IM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[EM],header:[MM],default:[OM]},$$scope:{ctx:n}};for(let a=0;at(27,f=Ae));const u=lt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,O=[],D=[],I=[],L={},R={},F="";function N(){return W(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function H(){t(4,y="")}async function W(Ae=!1){if(L!=null&&L.id){t(6,C=!0),Ae&&q();try{const ze=Ae?1:T+1,bt=j.getAllCollectionIdentifiers(L);let de=j.normalizeSearchFilter(y,bt)||"";de&&(de+=" && "),de+="("+D.map(we=>`${we.name}:length>0`).join("||")+")";const ve=await ae.collection(L.id).getList(ze,Lm,{filter:de,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(ve.items))),T=ve.page,t(26,$=ve.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ae.error(ze),t(6,C=!1))}}}function G(){var ze,bt;let Ae=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const de of D)if(j.toArray(R.record[de.name]).includes(R.name)){Ae=Ae.concat(j.toArray((bt=de.options)==null?void 0:bt.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const de of Ae)I.push({label:`${de} thumb`,value:de});F&&!Ae.includes(F)&&t(12,F="")}function U(Ae){let ze=[];for(const bt of D){const de=j.toArray(Ae[bt.name]);for(const ve of de)h.includes(j.getFileType(ve))&&ze.push(ve)}return ze}function Y(Ae,ze){t(9,R={record:Ae,name:ze})}function ie(){o&&(u("submit",Object.assign({size:F},R)),P())}function te(Ae){F=Ae,t(12,F)}const pe=Ae=>{t(8,L=Ae)},Ne=Ae=>t(4,y=Ae.detail),He=()=>g==null?void 0:g.show(),Xe=()=>{s&&W()};function xe(Ae){ee[Ae?"unshift":"push"](()=>{_=Ae,t(3,_)})}function Mt(Ae){Ce.call(this,n,Ae)}function ft(Ae){Ce.call(this,n,Ae)}function ht(Ae){ee[Ae?"unshift":"push"](()=>{g=Ae,t(10,g)})}const Gt=Ae=>{j.removeByKey(S,"id",Ae.detail.record.id),S.unshift(Ae.detail.record),t(5,S);const ze=U(Ae.detail.record);ze.length>0&&Y(Ae.detail.record,ze[0])},De=Ae=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Ae.detail.id&&t(9,R={}),j.removeByKey(S,"id",Ae.detail.id),t(5,S)};return n.$$set=Ae=>{e=Ie(Ie({},e),Yt(Ae)),t(22,a=Ge(e,r)),"title"in Ae&&t(0,d=Ae.title),"submitText"in Ae&&t(1,m=Ae.submitText),"fileTypes"in Ae&&t(24,h=Ae.fileTypes)},n.$$.update=()=>{var Ae;n.$$.dirty[0]&134217728&&t(7,O=f.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(bt=>{var de,ve,we,Ye,zt;return bt.type==="file"&&!((de=bt.options)!=null&&de.protected)&&(!((we=(ve=bt.options)==null?void 0:ve.mimeTypes)!=null&&we.length)||!!((zt=(Ye=bt.options)==null?void 0:Ye.mimeTypes)!=null&&zt.find(dn=>dn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(D=(Ae=L==null?void 0:L.schema)==null?void 0:Ae.filter(ze=>{var bt;return ze.type==="file"&&!((bt=ze.options)!=null&&bt.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(H(),G()),n.$$.dirty[0]&512&&R!=null&&R.name&&G(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&W(!0),n.$$.dirty[0]&512&&t(16,i=(ze,bt)=>{var de;return(R==null?void 0:R.name)==bt&&((de=R==null?void 0:R.record)==null?void 0:de.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>U(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Lm),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,O,L,R,g,I,F,o,s,l,i,H,W,U,Y,ie,a,c,h,N,$,f,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt,De]}class LM extends ge{constructor(e){super(),_e(this,e,AM,IM,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function NM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function PM(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Ja({props:s}),ee.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FM(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m;const h=[PM,NM],_=[];function g(y,S){return y[4]?0:1}return u=g(n),c=_[u]=h[u](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),_[u].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&oe(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=u;u=g(y),u===T?_[u].p(y,S):(le(),A(_[T],1,1,()=>{_[T]=null}),se(),c=_[u],c?c.p(y,S):(c=_[u]=h[u](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(f),v(d)),_[u].d(y)}}}function RM(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[FM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new LM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function qM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,f=null;Ht(async()=>(typeof s>"u"&&t(0,s=""),f=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(f)}));function u(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ee[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,ae.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,u,c,d,m]}class jM extends ge{constructor(e){super(),_e(this,e,qM,RM,me,{field:1,value:0})}}function HM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BM(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[HM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[zM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[VM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=K(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(u,c){w(u,e,c),k(e,t),w(u,i,c),z(l,u,c),w(u,s,c),z(o,u,c),w(u,r,c),z(a,u,c),f=!0},p(u,[c]){(!f||c&4)&&oe(t,u[2]);const d={};c&8&&(d.class="form-field "+(u[3]?"required":"")),c&2&&(d.name=u[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&8&&(m.class="form-field "+(u[3]?"required":"")),c&2&&(m.name=u[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:u}),o.$set(m);const h={};c&8&&(h.class="form-field "+(u[3]?"required":"")),c&2&&(h.name=u[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:u}),a.$set(h)},i(u){f||(E(l.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),f=!0)},o(u){A(l.$$.fragment,u),A(o.$$.fragment,u),A(a.$$.fragment,u),f=!1},d(u){u&&(v(e),v(i),v(s),v(r)),V(l,u),V(o,u),V(a,u)}}}function UM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function f(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,f,u]}class Pr extends ge{constructor(e){super(),_e(this,e,UM,BM,me,{key:1,config:0,required:4,title:2})}}function WM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Display name"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","text"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].displayName),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].displayName&&re(s,f[0].displayName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function YM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].authUrl),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].authUrl&&re(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function KM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].tokenUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].tokenUrl&&re(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function JM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].userApiUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].userApiUrl&&re(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function ZM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[7]),Se(Pe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],f=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&256&&a!==(a=c[8])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function GM(n){let e,t,i,l,s,o,r,a,f,u,c,d;return e=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".displayName",$$slots:{default:[WM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".authUrl",$$slots:{default:[YM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[KM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[JM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ce({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[ZM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),i=b("div"),i.textContent="Endpoints",l=M(),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),B(c.$$.fragment),p(i,"class","section-title")},m(m,h){z(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),z(s,m,h),w(m,o,h),z(r,m,h),w(m,a,h),z(f,m,h),w(m,u,h),z(c,m,h),d=!0},p(m,[h]){const _={};h&4&&(_.class="form-field "+(m[2]?"required":"")),h&2&&(_.name=m[1]+".displayName"),h&773&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&4&&(g.class="form-field "+(m[2]?"required":"")),h&2&&(g.name=m[1]+".authUrl"),h&773&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&4&&(y.class="form-field "+(m[2]?"required":"")),h&2&&(y.name=m[1]+".tokenUrl"),h&773&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&4&&(S.class="form-field "+(m[2]?"required":"")),h&2&&(S.name=m[1]+".userApiUrl"),h&773&&(S.$$scope={dirty:h,ctx:m}),f.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&769&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(f.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(f.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(u)),V(e,m),V(s,m),V(r,m),V(f,m),V(c,m)}}}function XM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e;j.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC");function o(){s.displayName=this.value,t(0,s)}function r(){s.authUrl=this.value,t(0,s)}function a(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}function u(){s.pkce=this.checked,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=!!s.enabled)},[s,l,i,o,r,a,f,u]}class Fr extends ge{constructor(e){super(),_e(this,e,XM,GM,me,{key:1,config:0})}}function QM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[2]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&re(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function xM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[3]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&re(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function e8(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[QM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[xM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,[a]){const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".authUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".tokenUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function t8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class n8 extends ge{constructor(e){super(),_e(this,e,t8,e8,me,{key:1,config:0})}}function i8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[2]),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&4&&s.value!==f[2]&&re(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function l8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[3]),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&8&&s.value!==f[3]&&re(s,f[3])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function s8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[4]),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&16&&s.value!==f[4]&&re(s,f[4])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function o8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",bo),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[6]),f||(u=[Se(Pe.call(null,l,{text:`Max ${bo} seconds (~${bo/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function r8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Private key"),l=M(),s=b("textarea"),r=M(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&v(e),V(t),l=!1,$e(s)}}}function KO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,h="";function _(H){j.removeByValue(u,H),t(2,u)}function g(H){j.pushUnique(u,H),t(2,u)}function y(H){j.isEmpty(f[H])||f.splice(H,1),t(1,f)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function T(H){var G,U;H.preventDefault(),t(9,m=!1);const W=((G=H.dataTransfer)==null?void 0:G.files)||[];if(!(s||!W.length)){for(const Y of W){const me=l.length+f.length-u.length;if(((U=r.options)==null?void 0:U.maxSelect)<=me)break;f.push(Y)}t(1,f)}}zt(async()=>{t(10,h=await re.getAdminFileToken(o.collectionId))});const $=H=>_(H),C=H=>g(H);function O(H){a=H,t(0,a),t(6,i),t(4,r)}const D=H=>y(H);function I(H){f=H,t(1,f)}function L(H){te[H?"unshift":"push"](()=>{c=H,t(7,c)})}const R=()=>{for(let H of c.files)f.push(H);t(1,f),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(H){te[H?"unshift":"push"](()=>{d=H,t(8,d)})}const P=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=H=>{"record"in H&&t(3,o=H.record),"field"in H&&t(4,r=H.field),"value"in H&&t(0,a=H.value),"uploadedFiles"in H&&t(1,f=H.uploadedFiles),"deletedFileNames"in H&&t(2,u=H.deletedFileNames)},n.$$.update=()=>{var H,W;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=j.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=j.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((H=r.options)==null?void 0:H.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((W=r.options)==null?void 0:W.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&S()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,y,T,$,C,O,D,I,L,R,F,N,P,q]}class JO extends ge{constructor(e){super(),_e(this,e,KO,YO,pe,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function xp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function ZO(n,e){e=xp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=xp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function em(n,e,t){const i=n.slice();i[6]=e[t];const l=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=l,i}function tm(n,e,t){const i=n.slice();return i[10]=e[t],i}function nm(n){let e,t;return e=new Ka({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[10]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function im(n){let e=!j.isEmpty(n[10]),t,i,l=e&&nm(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&3&&(e=!j.isEmpty(s[10])),e?l?(l.p(s,o),o&3&&E(l,1)):(l=nm(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(ie(),A(l,1,1,()=>{l=null}),le())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function lm(n){let e,t,i=fe(n[7]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oA(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let _=0;_t(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.schema)||[];if(t(1,o=f.filter(u=>u.presentable&&u.type=="file").map(u=>u.name)),t(2,r=f.filter(u=>u.presentable&&u.type!="file").map(u=>u.name)),!o.length&&!r.length){const u=f.find(c=>{var d,m,h;return c.type=="file"&&((d=c.options)==null?void 0:d.maxSelect)==1&&((h=(m=c.options)==null?void 0:m.mimeTypes)==null?void 0:h.find(_=>_.startsWith("image/")))});u&&o.push(u.name)}}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l]}class tr extends ge{constructor(e){super(),_e(this,e,XO,GO,pe,{record:0})}}function sm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function om(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function rm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function am(n){let e,t=!n[13]&&fm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=fm(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function fm(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&um(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=um(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function QO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[Se(Pe.call(null,t,"Edit")),J(t,"keydown",Tn(n[27])),J(t,"click",Tn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,$e(l)}}}function dm(n,e){let t,i,l,s,o,r,a,f;function u(g,y){return g[6]?xO:QO}let c=u(e),d=c(e);s=new tr({props:{record:e[49]}});let m=!e[11]&&cm(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),z(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(f=[J(t,"click",h),J(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=u(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=cm(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),V(s),m&&m.d(),a=!1,$e(f)}}}function pm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=K("("),i=K(t),l=K(" of MAX "),s=K(n[4]),o=K(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function eM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function tM(n){let e,t,i=fe(n[6]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(u,c){w(u,e,c),z(t,e,null),k(e,i),k(e,l),w(u,s,c),o=!0,r||(a=J(l,"click",f),r=!0)},p(u,c){n=u;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(u){o||(E(t.$$.fragment,u),o=!0)},o(u){A(t.$$.fragment,u),o=!1},d(u){u&&(v(e),v(s)),V(t),r=!1,a()}}}function hm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[nM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Es({props:s}),te.push(()=>be(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function iM(n){let e,t,i,l,s,o=[],r=new Map,a,f,u,c,d,m,h,_,g,y,S,T;t=new Cs({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&rm(n),C=fe(n[8]);const O=P=>P[49].id;for(let P=0;P1&&mm(n);const R=[tM,eM],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),$&&$.c(),l=M(),s=b("div");for(let P=0;P1?L?L.p(P,q):(L=mm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let W=h;h=N(P),h===W?F[h].p(P,q):(ie(),A(F[W],1,1,()=>{F[W]=null}),le(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;qCancel',t=M(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[J(e,"click",n[28]),J(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,$e(s)}}}function oM(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[sM],header:[lM],default:[iM]},$$scope:{ctx:n}};for(let a=0;at(26,m=we));const h=lt(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],O=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,O=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const we=j.toArray(g);if(!l||!we.length)return;t(24,R=!0);let Ye=[];const Vt=we.slice(),dn=[];for(;Vt.length>0;){const an=[];for(const qn of Vt.splice(0,io))an.push(`id="${qn}"`);dn.push(re.collection(l).getFullList({batch:io,filter:an.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(an=>{Ye=Ye.concat(...an)}),t(6,O=[]);for(const an of we){const qn=j.findByKey(Ye,"id",an);qn&&O.push(qn)}$.trim()||t(8,C=j.filterDuplicatesByKey(O.concat(C))),t(24,R=!1)}catch(an){an.isAbort||(re.error(an),t(24,R=!1))}}async function q(we=!1){if(l){t(3,L=!0),we&&($.trim()?t(8,C=[]):t(8,C=j.toArray(O).slice()));try{const Ye=we?1:D+1,Vt=j.getAllCollectionIdentifiers(s),dn=await re.collection(l).getList(Ye,io,{filter:j.normalizeSearchFilter($,Vt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(dn.items))),D=dn.page,t(23,I=dn.items.length),t(3,L=!1)}catch(Ye){Ye.isAbort||(re.error(Ye),t(3,L=!1))}}}function H(we){i==1?t(6,O=[we]):f&&(j.pushOrReplaceByKey(O,we),t(6,O))}function W(we){j.removeByKey(O,"id",we.id),t(6,O)}function G(we){u(we)?W(we):H(we)}function U(){var we;i!=1?t(20,g=O.map(Ye=>Ye.id)):t(20,g=((we=O==null?void 0:O[0])==null?void 0:we.id)||""),h("save",O),N()}function Y(we){Ce.call(this,n,we)}const me=()=>N(),ee=()=>U(),ce=we=>t(2,$=we.detail),Oe=()=>T==null?void 0:T.show(),He=we=>T==null?void 0:T.show(we.id),Je=we=>G(we),xe=(we,Ye)=>{(Ye.code==="Enter"||Ye.code==="Space")&&(Ye.preventDefault(),Ye.stopPropagation(),G(we))},bt=()=>t(2,$=""),kt=()=>{a&&!L&&q()},yt=we=>W(we);function Ot(we){O=we,t(6,O)}function Ee(we){te[we?"unshift":"push"](()=>{S=we,t(1,S)})}function Le(we){Ce.call(this,n,we)}function ze(we){Ce.call(this,n,we)}function _t(we){te[we?"unshift":"push"](()=>{T=we,t(7,T)})}const de=we=>{j.removeByKey(C,"id",we.detail.record.id),C.unshift(we.detail.record),t(8,C),H(we.detail.record)},ve=we=>{j.removeByKey(C,"id",we.detail.id),t(8,C),W(we.detail)};return n.$$set=we=>{e=Ae(Ae({},e),Kt(we)),t(19,d=Xe(e,c)),"value"in we&&t(20,g=we.value),"field"in we&&t(21,y=we.field)},n.$$.update=()=>{var we,Ye;n.$$.dirty[0]&2097152&&t(4,i=((we=y==null?void 0:y.options)==null?void 0:we.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(Ye=y==null?void 0:y.options)==null?void 0:Ye.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Vt=>Vt.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==io),n.$$.dirty[0]&80&&t(10,f=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,u=function(Vt){return j.findByKey(O,"id",Vt.id)})},[N,S,$,L,i,s,O,T,C,u,f,o,a,r,q,H,W,G,U,d,g,y,F,I,R,l,m,Y,me,ee,ce,Oe,He,Je,xe,bt,kt,yt,Ot,Ee,Le,ze,_t,de,ve]}class aM extends ge{constructor(e){super(),_e(this,e,rM,oM,pe,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function _m(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function gm(n,e,t){const i=n.slice();return i[26]=e[t],i}function bm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=Se(t=Pe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Mt(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function km(n){let e,t=n[5]&&ym(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=ym(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function ym(n){let e,t=fe(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fM(n){let e,t,i,l,s,o,r,a,f,u;i=new tr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),z(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,f||(u=[Se(Pe.call(null,o,"Remove")),J(o,"click",c)],f=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),f=!1,$e(u)}}}function wm(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[fM,({dragging:a,dragover:f})=>({24:a,25:f}),({dragging:a,dragover:f})=>(a?16777216:0)|(f?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Es({props:r}),te.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&4&&(u.group=e[2].name+"_relation"),f&16&&(u.index=e[23]),f&128&&(u.disabled=!e[7]),f&587202576&&(u.$$scope={dirty:f,ctx:e}),!l&&f&16&&(l=!0,u.list=e[4],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function uM(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&bm(n),O=fe(n[4]);const D=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Un(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",f=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,u,R),w(L,c,R),k(c,d);for(let F=0;F({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new ue({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new aM({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,[a]){const f={};a&4&&(f.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(f.name=r[2].name),a&537919735&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a&1&&(u.value=r[0]),a&4&&(u.field=r[2]),i.$set(u)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const Sm=100;function dM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],f=!1,u,c=[];function d(){if(f)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,f=!1);return}t(5,f=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,Sm))N.push(`id="${P}"`);L.push(re.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(Sm,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){re.error(N)}t(5,f=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}vs(()=>{clearTimeout(u)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){te[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){te[D?"unshift":"push"](()=>{o=D,t(1,o)})}const O=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,f=!0),clearTimeout(u),t(10,u=setTimeout(m,0)))},[s,o,l,r,a,f,c,i,h,_,u,g,y,S,T,$,C,O]}class pM extends ge{constructor(e){super(),_e(this,e,dM,cM,pe,{field:2,value:0,picker:1})}}function mM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),v0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function hM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function _M(n){let e;function t(s,o){return s[1]?hM:mM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function gM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let bM=gM();function Nr(){return window&&window.tinymce?window.tinymce:null}function kM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:f=""}=e,{text:u=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=f,S=s;const T=lt();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(f),L.on(a,()=>{t(12,y=L.getContent()),y!==f&&(t(5,f=y),t(6,u=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Nr().init(I)}zt(()=>(Nr()!==null?$():bM.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,L;try{g&&((I=g.dom)==null||I.unbind(document),(L=Nr())==null||L.remove(g))}catch{}}));function C(I){te[I?"unshift":"push"](()=>{_=I,t(4,_)})}function O(I){te[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){te[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,f=I.value),"text"in I&&t(6,u=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==f&&(g.setContent(f),t(6,u=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,f,u,s,o,r,a,g,y,S,C,O,D]}class Ja extends ge{constructor(e){super(),_e(this,e,kM,_M,pe,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function $m(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Tm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Cm(n,e,t){const i=n.slice();return i[51]=e[t],i}function yM(n){let e,t,i=[],l=new Map,s,o,r,a,f,u,c,d,m,h,_,g=fe(n[7]);const y=S=>S[51].id;for(let S=0;SNew record',c=M(),B(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(u,"type","button"),p(u,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$file field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Om(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var f;t=b("button"),l=K(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((f=e[8])==null?void 0:f.id)==e[51].id),this.first=t},m(f,u){w(f,t,u),k(t,l),k(t,s),o||(r=J(t,"click",Be(a)),o=!0)},p(f,u){var c;e=f,u[0]&128&&i!==(i=e[51].name+"")&&se(l,i),u[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(f){f&&v(t),o=!1,r()}}}function wM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Mm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Mm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function SM(n){let e=[],t=new Map,i,l=fe(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",Be(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function $M(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=re.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=re.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Dm(n){let e,t,i,l,s,o;function r(u,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(u[48])),t?TM:$M}let a=r(n,[-1,-1]),f=a(n);return{c(){e=b("button"),f.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(u,c){w(u,e,c),f.m(e,null),k(e,i),s||(o=[Se(l=Pe.call(null,e,n[48]+` +(record: `+n[44].id+")")),J(e,"click",Be(function(){Mt(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(u,c){n=u,a===(a=r(n,c))&&f?f.p(n,c):(f.d(1),f=a(n),f&&(f.c(),f.m(e,i))),l&&Mt(l.update)&&c[0]&32&&l.update.call(null,n[48]+` +(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(u){u&&v(e),f.d(),s=!1,$e(o)}}}function Em(n,e){let t,i,l=fe(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function CM(n){let e,t;function i(r,a){if(r[15])return SM;if(!r[6])return wM}let l=i(n),s=l&&l(n),o=n[6]&&Im();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Im(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function OM(n){let e,t,i,l;const s=[vM,yM],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(ie(),A(o[u],1,1,()=>{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function MM(n){let e,t;return{c(){e=b("h4"),t=K(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&se(t,i[0])},d(i){i&&v(e)}}}function Am(n){let e,t;return e=new ue({props:{class:"form-field file-picker-size-select",$$slots:{default:[DM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new hi({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function EM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Am(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=K(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=f=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),u=!0,c||(d=[J(e,"click",n[2]),J(o,"click",n[21])],c=!0)},p(_,g){var y;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Am(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(ie(),A(m,1,1,()=>{m=null}),le()),(!u||g[0]&2)&&se(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(E(m),u=!0)},o(_){A(m),u=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,$e(d)}}}function IM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[EM],header:[MM],default:[OM]},$$scope:{ctx:n}};for(let a=0;at(27,f=Le));const u=lt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,O=[],D=[],I=[],L={},R={},F="";function N(){return W(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function H(){t(4,y="")}async function W(Le=!1){if(L!=null&&L.id){t(6,C=!0),Le&&q();try{const ze=Le?1:T+1,_t=j.getAllCollectionIdentifiers(L);let de=j.normalizeSearchFilter(y,_t)||"";de&&(de+=" && "),de+="("+D.map(we=>`${we.name}:length>0`).join("||")+")";const ve=await re.collection(L.id).getList(ze,Lm,{filter:de,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(ve.items))),T=ve.page,t(26,$=ve.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(re.error(ze),t(6,C=!1))}}}function G(){var ze,_t;let Le=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const de of D)if(j.toArray(R.record[de.name]).includes(R.name)){Le=Le.concat(j.toArray((_t=de.options)==null?void 0:_t.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const de of Le)I.push({label:`${de} thumb`,value:de});F&&!Le.includes(F)&&t(12,F="")}function U(Le){let ze=[];for(const _t of D){const de=j.toArray(Le[_t.name]);for(const ve of de)h.includes(j.getFileType(ve))&&ze.push(ve)}return ze}function Y(Le,ze){t(9,R={record:Le,name:ze})}function me(){o&&(u("submit",Object.assign({size:F},R)),P())}function ee(Le){F=Le,t(12,F)}const ce=Le=>{t(8,L=Le)},Oe=Le=>t(4,y=Le.detail),He=()=>g==null?void 0:g.show(),Je=()=>{s&&W()};function xe(Le){te[Le?"unshift":"push"](()=>{_=Le,t(3,_)})}function bt(Le){Ce.call(this,n,Le)}function kt(Le){Ce.call(this,n,Le)}function yt(Le){te[Le?"unshift":"push"](()=>{g=Le,t(10,g)})}const Ot=Le=>{j.removeByKey(S,"id",Le.detail.record.id),S.unshift(Le.detail.record),t(5,S);const ze=U(Le.detail.record);ze.length>0&&Y(Le.detail.record,ze[0])},Ee=Le=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Le.detail.id&&t(9,R={}),j.removeByKey(S,"id",Le.detail.id),t(5,S)};return n.$$set=Le=>{e=Ae(Ae({},e),Kt(Le)),t(22,a=Xe(e,r)),"title"in Le&&t(0,d=Le.title),"submitText"in Le&&t(1,m=Le.submitText),"fileTypes"in Le&&t(24,h=Le.fileTypes)},n.$$.update=()=>{var Le;n.$$.dirty[0]&134217728&&t(7,O=f.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(_t=>{var de,ve,we,Ye,Vt;return _t.type==="file"&&!((de=_t.options)!=null&&de.protected)&&(!((we=(ve=_t.options)==null?void 0:ve.mimeTypes)!=null&&we.length)||!!((Vt=(Ye=_t.options)==null?void 0:Ye.mimeTypes)!=null&&Vt.find(dn=>dn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(D=(Le=L==null?void 0:L.schema)==null?void 0:Le.filter(ze=>{var _t;return ze.type==="file"&&!((_t=ze.options)!=null&&_t.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(H(),G()),n.$$.dirty[0]&512&&R!=null&&R.name&&G(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&W(!0),n.$$.dirty[0]&512&&t(16,i=(ze,_t)=>{var de;return(R==null?void 0:R.name)==_t&&((de=R==null?void 0:R.record)==null?void 0:de.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>U(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Lm),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,O,L,R,g,I,F,o,s,l,i,H,W,U,Y,me,a,c,h,N,$,f,ee,ce,Oe,He,Je,xe,bt,kt,yt,Ot,Ee]}class LM extends ge{constructor(e){super(),_e(this,e,AM,IM,pe,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function NM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function PM(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Ja({props:s}),te.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FM(n){let e,t,i,l,s,o=n[1].name+"",r,a,f,u,c,d,m;const h=[PM,NM],_=[];function g(y,S){return y[4]?0:1}return u=g(n),c=_[u]=h[u](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=K(o),f=M(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,f,S),_[u].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&se(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=u;u=g(y),u===T?_[u].p(y,S):(ie(),A(_[T],1,1,()=>{_[T]=null}),le(),c=_[u],c?c.p(y,S):(c=_[u]=h[u](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(f),v(d)),_[u].d(y)}}}function RM(n){let e,t,i,l;e=new ue({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[FM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new LM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const f={};i.$set(f)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function qM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,f=null;zt(async()=>(typeof s>"u"&&t(0,s=""),f=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(f)}));function u(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){te[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,re.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,u,c,d,m]}class jM extends ge{constructor(e){super(),_e(this,e,qM,RM,pe,{field:1,value:0})}}function HM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].authUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].authUrl&&oe(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].tokenUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].tokenUrl&&oe(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].userApiUrl),r||(a=J(s,"input",n[7]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&8&&(s.required=f[3]),u&1&&s.value!==f[0].userApiUrl&&oe(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BM(n){let e,t,i,l,s,o,r,a,f;return l=new ue({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[HM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[zM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),a=new ue({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[VM,({uniqueId:u})=>({8:u}),({uniqueId:u})=>u?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=K(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(u,c){w(u,e,c),k(e,t),w(u,i,c),z(l,u,c),w(u,s,c),z(o,u,c),w(u,r,c),z(a,u,c),f=!0},p(u,[c]){(!f||c&4)&&se(t,u[2]);const d={};c&8&&(d.class="form-field "+(u[3]?"required":"")),c&2&&(d.name=u[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c&8&&(m.class="form-field "+(u[3]?"required":"")),c&2&&(m.name=u[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:u}),o.$set(m);const h={};c&8&&(h.class="form-field "+(u[3]?"required":"")),c&2&&(h.name=u[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:u}),a.$set(h)},i(u){f||(E(l.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),f=!0)},o(u){A(l.$$.fragment,u),A(o.$$.fragment,u),A(a.$$.fragment,u),f=!1},d(u){u&&(v(e),v(i),v(s),v(r)),V(l,u),V(o,u),V(a,u)}}}function UM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function f(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,f,u]}class Pr extends ge{constructor(e){super(),_e(this,e,UM,BM,pe,{key:1,config:0,required:4,title:2})}}function WM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Display name"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","text"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].displayName),r||(a=J(s,"input",n[3]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].displayName&&oe(s,f[0].displayName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function YM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].authUrl),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].authUrl&&oe(s,f[0].authUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function KM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].tokenUrl),r||(a=J(s,"input",n[5]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].tokenUrl&&oe(s,f[0].tokenUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function JM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].userApiUrl),r||(a=J(s,"input",n[6]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&4&&(s.required=f[2]),u&1&&s.value!==f[0].userApiUrl&&oe(s,f[0].userApiUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function ZM(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[7]),Se(Pe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],f=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&256&&a!==(a=c[8])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function GM(n){let e,t,i,l,s,o,r,a,f,u,c,d;return e=new ue({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".displayName",$$slots:{default:[WM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ue({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".authUrl",$$slots:{default:[YM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[KM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),f=new ue({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[JM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ue({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[ZM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),i=b("div"),i.textContent="Endpoints",l=M(),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),B(c.$$.fragment),p(i,"class","section-title")},m(m,h){z(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),z(s,m,h),w(m,o,h),z(r,m,h),w(m,a,h),z(f,m,h),w(m,u,h),z(c,m,h),d=!0},p(m,[h]){const _={};h&4&&(_.class="form-field "+(m[2]?"required":"")),h&2&&(_.name=m[1]+".displayName"),h&773&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&4&&(g.class="form-field "+(m[2]?"required":"")),h&2&&(g.name=m[1]+".authUrl"),h&773&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&4&&(y.class="form-field "+(m[2]?"required":"")),h&2&&(y.name=m[1]+".tokenUrl"),h&773&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&4&&(S.class="form-field "+(m[2]?"required":"")),h&2&&(S.name=m[1]+".userApiUrl"),h&773&&(S.$$scope={dirty:h,ctx:m}),f.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&769&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(f.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(f.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(u)),V(e,m),V(s,m),V(r,m),V(f,m),V(c,m)}}}function XM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e;j.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC");function o(){s.displayName=this.value,t(0,s)}function r(){s.authUrl=this.value,t(0,s)}function a(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}function u(){s.pkce=this.checked,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=!!s.enabled)},[s,l,i,o,r,a,f,u]}class Fr extends ge{constructor(e){super(),_e(this,e,XM,GM,pe,{key:1,config:0})}}function QM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Auth URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[0].authUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[2]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&oe(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function xM(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Token URL"),l=M(),s=b("input"),a=M(),f=b("div"),f.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(f,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[0].tokenUrl),w(d,a,m),w(d,f,m),u||(c=J(s,"input",n[3]),u=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&oe(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(f)),u=!1,c()}}}function e8(n){let e,t,i,l,s,o;return i=new ue({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[QM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ue({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[xM,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,[a]){const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".authUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".tokenUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function t8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class n8 extends ge{constructor(e){super(),_e(this,e,t8,e8,pe,{key:1,config:0})}}function i8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[2]),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&4&&s.value!==f[2]&&oe(s,f[2])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function l8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[3]),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&8&&s.value!==f[3]&&oe(s,f[3])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function s8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[4]),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&16&&s.value!==f[4]&&oe(s,f[4])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function o8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",bo),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[6]),f||(u=[Se(Pe.call(null,l,{text:`Max ${bo} seconds (~${bo/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],f=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&oe(r,c[6])},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function r8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Private key"),l=M(),s=b("textarea"),r=M(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[5]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[16]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&re(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function a8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return l=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[i8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[l8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[s8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[o8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[r8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),B(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(t,h),z(_,t,null),g=!0,y||(S=J(e,"submit",Be(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const O={};$&25165832&&(O.$$scope={dirty:$,ctx:T}),r.$set(O);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),u.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(l),V(r),V(u),V(m),V(_),y=!1,S()}}}function f8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function u8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function c8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[u8],header:[f8],default:[a8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const bo=15777e3;function d8(n,e,t){let i;const l=lt(),s="apple_secret_"+j.randomString(5);let o,r,a,f,u,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,f=R.keyId||""),t(5,u=R.privateKey||""),t(6,c=R.duration||bo),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await ae.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Lt("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ae.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){f=this.value,t(4,f)}function T(){c=this.value,t(6,c)}function $(){u=this.value,t(5,u)}const C=()=>_(),O=()=>!d;function D(R){ee[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Ce.call(this,n,R)}function L(R){Ce.call(this,n,R)}return t(8,i=!0),[h,o,r,a,f,u,c,d,i,s,_,m,g,y,S,T,$,C,O,D,I,L]}class p8 extends ge{constructor(e){super(),_e(this,e,d8,c8,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function m8(n){let e,t,i,l,s,o,r,a,f,u,c={};return r=new p8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),z(r,d,m),a=!0,f||(u=J(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),V(r,d),f=!1,u()}}}function h8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{var u;t(0,l.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",l)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class _8 extends ge{constructor(e){super(),_e(this,e,h8,m8,me,{key:1,config:0})}}const ko=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:_8},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:n8},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Pr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Pr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Pr,optionsComponentProps:{required:!0}},{key:"planningcenterAuth",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr}];function Nm(n,e,t){const i=n.slice();return i[9]=e[t],i}function g8(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function b8(n){let e,t=ue(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Pm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=K(r),f=M(),u=b("div"),c=K("ID: "),m=K(d),h=M(),_=b("button"),_.innerHTML='',g=M(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,f),k(e,u),k(u,c),k(u,m),k(e,h),k(e,_),k(e,g),y||(S=J(_,"click",T),y=!0)},p($,C){var O;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),C&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d($){$&&v(e),y=!1,S()}}}function y8(n){let e;function t(s,o){var r;return s[2]?k8:(r=s[0])!=null&&r.id&&s[1].length?b8:g8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function v8(n,e,t){const i=lt();let{record:l}=e,s=[],o=!1;function r(d){return ko.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function f(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ae.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ae.error(d)}t(2,o=!1)}function u(d){!(l!=null&&l.id)||!d||un(`Do you really want to unlink the ${a(d)} provider?`,()=>ae.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Lt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{ae.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,u,c]}class w8 extends ge{constructor(e){super(),_e(this,e,v8,y8,me,{record:0})}}function Fm(n,e,t){const i=n.slice();return i[71]=e[t],i[72]=e,i[73]=t,i}function Rm(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=M(),f=b("button"),f.innerHTML='',u=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(f,"type","button"),p(f,"class","close"),p(f,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,f),k(e,u),k(e,c),m=!0,h||(_=[J(r,"click",n[39]),Se(Pe.call(null,f,"Discard draft")),J(f,"click",Be(n[40]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=ma(e,et,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,$e(_)}}}function qm(n){let e,t,i;return t=new Gb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function S8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y=!n[6]&&qm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),y&&y.c(),f=M(),u=b("input"),p(t,"class",Un(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[74]),p(u,"type","text"),p(u,"id",c=n[74]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,f,T),w(S,u,T),re(u,n[3].id),h=!0,_||(g=J(u,"input",n[41]),_=!0)},p(S,T){(!h||T[2]&4096&&r!==(r=S[74]))&&p(e,"for",r),S[6]?y&&(le(),A(y,1,1,()=>{y=null}),se()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=qm(S),y.c(),E(y,1),y.m(f.parentNode,f)),(!h||T[2]&4096&&c!==(c=S[74]))&&p(u,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(u.readOnly=m),T[0]&8&&u.value!==S[3].id&&re(u,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(f),v(u)),y&&y.d(S),_=!1,g()}}}function jm(n){var f,u;let e,t,i,l,s;function o(c){n[42](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new P6({props:r}),ee.push(()=>be(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&Hm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ye()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Hm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Hm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $8(n){let e,t,i;function l(o){n[55](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new pM({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function T8(n){let e,t,i,l,s;function o(u){n[52](u,n[71])}function r(u){n[53](u,n[71])}function a(u){n[54](u,n[71])}let f={field:n[71],record:n[3]};return n[3][n[71].name]!==void 0&&(f.value=n[3][n[71].name]),n[4][n[71].name]!==void 0&&(f.uploadedFiles=n[4][n[71].name]),n[5][n[71].name]!==void 0&&(f.deletedFileNames=n[5][n[71].name]),e=new JO({props:f}),ee.push(()=>be(e,"value",o)),ee.push(()=>be(e,"uploadedFiles",r)),ee.push(()=>be(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(u,c){z(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[71]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[71].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[71].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[71].name],ke(()=>l=!1)),e.$set(d)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function C8(n){let e,t,i;function l(o){n[51](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new yO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O8(n){let e,t,i;function l(o){n[50](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new dO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M8(n){let e,t,i;function l(o){n[49](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new aO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D8(n){let e,t,i;function l(o){n[48](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new jM({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function E8(n){let e,t,i;function l(o){n[47](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new lO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function I8(n){let e,t,i;function l(o){n[46](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new eO({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function A8(n){let e,t,i;function l(o){n[45](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new G6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function L8(n){let e,t,i;function l(o){n[44](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new Y6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function N8(n){let e,t,i;function l(o){n[43](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new V6({props:s}),ee.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zm(n,e){let t,i,l,s,o;const r=[N8,L8,A8,I8,E8,D8,M8,O8,C8,T8,$8],a=[];function f(u,c){return u[71].type==="text"?0:u[71].type==="number"?1:u[71].type==="bool"?2:u[71].type==="email"?3:u[71].type==="url"?4:u[71].type==="editor"?5:u[71].type==="date"?6:u[71].type==="select"?7:u[71].type==="json"?8:u[71].type==="file"?9:u[71].type==="relation"?10:-1}return~(i=f(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,s,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(l&&(le(),A(a[d],1,1,()=>{a[d]=null}),se()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(u){o||(E(l),o=!0)},o(u){A(l),o=!1},d(u){u&&(v(t),v(s)),~i&&a[i].d(u)}}}function Vm(n){let e,t,i;return t=new w8({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===bs)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===bs)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function P8(n){var S;let e,t,i,l,s,o,r=[],a=new Map,f,u,c,d,m=!n[8]&&n[10]&&!n[7]&&Rm(n);l=new ce({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[S8,({uniqueId:T})=>({74:T}),({uniqueId:T})=>[0,0,T?4096:0]]},$$scope:{ctx:n}}});let h=n[14]&&jm(n),_=ue(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[71].name;for(let T=0;T<_.length;T+=1){let $=Fm(n,_,T),C=g($);a.set(C,r[T]=zm(C,$))}let y=n[14]&&!n[6]&&Vm(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=M(),B(l.$$.fragment),s=M(),h&&h.c(),o=M();for(let T=0;T{m=null}),se());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&12288&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=jm(T),h.c(),E(h,1),h.m(t,o)):h&&(le(),A(h,1,1,()=>{h=null}),se()),$[0]&57&&(_=ue(((O=T[0])==null?void 0:O.schema)||[]),le(),r=at(r,$,g,1,T,_,a,t,Et,zm,null,Fm),se()),(!u||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!u||$[0]&8192)&&x(t,"active",T[13]===Gi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=Vm(T),y.c(),E(y,1),y.m(e,null)):y&&(le(),A(y,1,1,()=>{y=null}),se())},i(T){if(!u){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),u=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;${d=null}),se()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Bm(h),d.c(),E(d,1),d.m(u.parentNode,u))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(f),v(u)),d&&d.d(h)}}}function R8(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function Bm(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[q8]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[0]&16388|f[2]&8192&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Wm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[34]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function q8(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Um(n),f=n[14]&&n[2].email&&Wm(n);return{c(){a&&a.c(),e=M(),f&&f.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable"),p(s,"role","menuitem")},m(u,c){a&&a.m(u,c),w(u,e,c),f&&f.m(u,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),o||(r=[J(i,"click",n[35]),J(s,"click",Tn(Be(n[36])))],o=!0)},p(u,c){u[14]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=Um(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[14]&&u[2].email?f?f.p(u,c):(f=Wm(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){u&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(u),f&&f.d(u),o=!1,$e(r)}}}function Ym(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Gi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===bs),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[J(t,"click",n[37]),J(l,"click",n[38])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Gi),a[0]&8192&&x(l,"active",r[13]===bs)},d(r){r&&v(e),s=!1,$e(o)}}}function j8(n){let e,t,i,l,s;const o=[R8,F8],r=[];function a(u,c){return u[7]?0:1}e=a(n),t=r[e]=o[e](n);let f=n[14]&&!n[6]&&Ym(n);return{c(){t.c(),i=M(),f&&f.c(),l=ye()},m(u,c){r[e].m(u,c),w(u,i,c),f&&f.m(u,c),w(u,l,c),s=!0},p(u,c){let d=e;e=a(u),e===d?r[e].p(u,c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),t=r[e],t?t.p(u,c):(t=r[e]=o[e](u),t.c()),E(t,1),t.m(i.parentNode,i)),u[14]&&!u[6]?f?f.p(u,c):(f=Ym(u),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(u){s||(E(t),s=!0)},o(u){A(t),s=!1},d(u){u&&(v(i),v(l)),r[e].d(u),f&&f.d(u)}}}function H8(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,f,u,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),u||(c=J(e,"click",n[32]),u=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&oe(a,r),m[0]&34816&&f!==(f=!d[15]||d[11])&&(s.disabled=f),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),u=!1,c()}}}function z8(n){let e,t,i={class:` +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[5]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[16]),f=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&oe(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function a8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return l=new ue({props:{class:"form-field required",name:"clientId",$$slots:{default:[i8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field required",name:"teamId",$$slots:{default:[l8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),u=new ue({props:{class:"form-field required",name:"keyId",$$slots:{default:[s8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new ue({props:{class:"form-field required",name:"duration",$$slots:{default:[o8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new ue({props:{class:"form-field required",name:"privateKey",$$slots:{default:[r8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),B(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(t,h),z(_,t,null),g=!0,y||(S=J(e,"submit",Be(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const O={};$&25165832&&(O.$$scope={dirty:$,ctx:T}),r.$set(O);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),u.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(u.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(u.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(l),V(r),V(u),V(m),V(_),y=!1,S()}}}function f8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function u8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function c8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[u8],header:[f8],default:[a8]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const bo=15777e3;function d8(n,e,t){let i;const l=lt(),s="apple_secret_"+j.randomString(5);let o,r,a,f,u,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,f=R.keyId||""),t(5,u=R.privateKey||""),t(6,c=R.duration||bo),Zt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await re.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Nt("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){re.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){f=this.value,t(4,f)}function T(){c=this.value,t(6,c)}function $(){u=this.value,t(5,u)}const C=()=>_(),O=()=>!d;function D(R){te[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Ce.call(this,n,R)}function L(R){Ce.call(this,n,R)}return t(8,i=!0),[h,o,r,a,f,u,c,d,i,s,_,m,g,y,S,T,$,C,O,D,I,L]}class p8 extends ge{constructor(e){super(),_e(this,e,d8,c8,pe,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function m8(n){let e,t,i,l,s,o,r,a,f,u,c={};return r=new p8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),z(r,d,m),a=!0,f||(u=J(e,"click",n[3]),f=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),V(r,d),f=!1,u()}}}function h8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(f){te[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{var u;t(0,l.clientSecret=((u=f.detail)==null?void 0:u.secret)||"",l)};return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class _8 extends ge{constructor(e){super(),_e(this,e,h8,m8,pe,{key:1,config:0})}}const ko=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:_8},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:n8},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Pr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Pr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Pr,optionsComponentProps:{required:!0}},{key:"planningcenterAuth",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr}];function Nm(n,e,t){const i=n.slice();return i[9]=e[t],i}function g8(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function b8(n){let e,t=fe(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Pm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,f,u,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=K(r),f=M(),u=b("div"),c=K("ID: "),m=K(d),h=M(),_=b("button"),_.innerHTML='',g=M(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(u,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,f),k(e,u),k(u,c),k(u,m),k(e,h),k(e,_),k(e,g),y||(S=J(_,"click",T),y=!0)},p($,C){var O;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),C&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d($){$&&v(e),y=!1,S()}}}function y8(n){let e;function t(s,o){var r;return s[2]?k8:(r=s[0])!=null&&r.id&&s[1].length?b8:g8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function v8(n,e,t){const i=lt();let{record:l}=e,s=[],o=!1;function r(d){return ko.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function f(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await re.collection(l.collectionId).listExternalAuths(l.id))}catch(d){re.error(d)}t(2,o=!1)}function u(d){!(l!=null&&l.id)||!d||un(`Do you really want to unlink the ${a(d)} provider?`,()=>re.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Nt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),f()}).catch(m=>{re.error(m)}))}f();const c=d=>u(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,u,c]}class w8 extends ge{constructor(e){super(),_e(this,e,v8,y8,pe,{record:0})}}function Fm(n,e,t){const i=n.slice();return i[71]=e[t],i[72]=e,i[73]=t,i}function Rm(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=M(),f=b("button"),f.innerHTML='',u=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(f,"type","button"),p(f,"class","close"),p(f,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,f),k(e,u),k(e,c),m=!0,h||(_=[J(r,"click",n[39]),Se(Pe.call(null,f,"Discard draft")),J(f,"click",Be(n[40]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=ma(e,et,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,$e(_)}}}function qm(n){let e,t,i;return t=new Gb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function S8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y=!n[6]&&qm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),y&&y.c(),f=M(),u=b("input"),p(t,"class",Un(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[74]),p(u,"type","text"),p(u,"id",c=n[74]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,f,T),w(S,u,T),oe(u,n[3].id),h=!0,_||(g=J(u,"input",n[41]),_=!0)},p(S,T){(!h||T[2]&4096&&r!==(r=S[74]))&&p(e,"for",r),S[6]?y&&(ie(),A(y,1,1,()=>{y=null}),le()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=qm(S),y.c(),E(y,1),y.m(f.parentNode,f)),(!h||T[2]&4096&&c!==(c=S[74]))&&p(u,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(u.readOnly=m),T[0]&8&&u.value!==S[3].id&&oe(u,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(f),v(u)),y&&y.d(S),_=!1,g()}}}function jm(n){var f,u;let e,t,i,l,s;function o(c){n[42](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new P6({props:r}),te.push(()=>be(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&Hm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ye()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Hm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Hm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $8(n){let e,t,i;function l(o){n[55](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new pM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function T8(n){let e,t,i,l,s;function o(u){n[52](u,n[71])}function r(u){n[53](u,n[71])}function a(u){n[54](u,n[71])}let f={field:n[71],record:n[3]};return n[3][n[71].name]!==void 0&&(f.value=n[3][n[71].name]),n[4][n[71].name]!==void 0&&(f.uploadedFiles=n[4][n[71].name]),n[5][n[71].name]!==void 0&&(f.deletedFileNames=n[5][n[71].name]),e=new JO({props:f}),te.push(()=>be(e,"value",o)),te.push(()=>be(e,"uploadedFiles",r)),te.push(()=>be(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(u,c){z(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[71]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[71].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[71].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[71].name],ke(()=>l=!1)),e.$set(d)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){A(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function C8(n){let e,t,i;function l(o){n[51](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new yO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O8(n){let e,t,i;function l(o){n[50](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new dO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M8(n){let e,t,i;function l(o){n[49](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new aO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D8(n){let e,t,i;function l(o){n[48](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new jM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function E8(n){let e,t,i;function l(o){n[47](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new lO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function I8(n){let e,t,i;function l(o){n[46](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new eO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function A8(n){let e,t,i;function l(o){n[45](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new G6({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function L8(n){let e,t,i;function l(o){n[44](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new Y6({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function N8(n){let e,t,i;function l(o){n[43](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new V6({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zm(n,e){let t,i,l,s,o;const r=[N8,L8,A8,I8,E8,D8,M8,O8,C8,T8,$8],a=[];function f(u,c){return u[71].type==="text"?0:u[71].type==="number"?1:u[71].type==="bool"?2:u[71].type==="email"?3:u[71].type==="url"?4:u[71].type==="editor"?5:u[71].type==="date"?6:u[71].type==="select"?7:u[71].type==="json"?8:u[71].type==="file"?9:u[71].type==="relation"?10:-1}return~(i=f(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(u,c){w(u,t,c),~i&&a[i].m(u,c),w(u,s,c),o=!0},p(u,c){e=u;let d=i;i=f(e),i===d?~i&&a[i].p(e,c):(l&&(ie(),A(a[d],1,1,()=>{a[d]=null}),le()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(u){o||(E(l),o=!0)},o(u){A(l),o=!1},d(u){u&&(v(t),v(s)),~i&&a[i].d(u)}}}function Vm(n){let e,t,i;return t=new w8({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===bs)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===bs)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function P8(n){var S;let e,t,i,l,s,o,r=[],a=new Map,f,u,c,d,m=!n[8]&&n[10]&&!n[7]&&Rm(n);l=new ue({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[S8,({uniqueId:T})=>({74:T}),({uniqueId:T})=>[0,0,T?4096:0]]},$$scope:{ctx:n}}});let h=n[14]&&jm(n),_=fe(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[71].name;for(let T=0;T<_.length;T+=1){let $=Fm(n,_,T),C=g($);a.set(C,r[T]=zm(C,$))}let y=n[14]&&!n[6]&&Vm(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=M(),B(l.$$.fragment),s=M(),h&&h.c(),o=M();for(let T=0;T{m=null}),le());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&12288&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=jm(T),h.c(),E(h,1),h.m(t,o)):h&&(ie(),A(h,1,1,()=>{h=null}),le()),$[0]&57&&(_=fe(((O=T[0])==null?void 0:O.schema)||[]),ie(),r=at(r,$,g,1,T,_,a,t,It,zm,null,Fm),le()),(!u||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!u||$[0]&8192)&&x(t,"active",T[13]===Gi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=Vm(T),y.c(),E(y,1),y.m(e,null)):y&&(ie(),A(y,1,1,()=>{y=null}),le())},i(T){if(!u){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),u=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;${d=null}),le()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Bm(h),d.c(),E(d,1),d.m(u.parentNode,u))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(f),v(u)),d&&d.d(h)}}}function R8(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function Bm(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[q8]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),k(i,l),k(i,s),z(o,i,null),r=!0},p(a,f){const u={};f[0]&16388|f[2]&8192&&(u.$$scope={dirty:f,ctx:a}),o.$set(u)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function Um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Wm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[34]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function q8(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Um(n),f=n[14]&&n[2].email&&Wm(n);return{c(){a&&a.c(),e=M(),f&&f.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable"),p(s,"role","menuitem")},m(u,c){a&&a.m(u,c),w(u,e,c),f&&f.m(u,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),o||(r=[J(i,"click",n[35]),J(s,"click",Tn(Be(n[36])))],o=!0)},p(u,c){u[14]&&!u[2].verified&&u[2].email?a?a.p(u,c):(a=Um(u),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),u[14]&&u[2].email?f?f.p(u,c):(f=Wm(u),f.c(),f.m(t.parentNode,t)):f&&(f.d(1),f=null)},d(u){u&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(u),f&&f.d(u),o=!1,$e(r)}}}function Ym(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Gi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===bs),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[J(t,"click",n[37]),J(l,"click",n[38])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Gi),a[0]&8192&&x(l,"active",r[13]===bs)},d(r){r&&v(e),s=!1,$e(o)}}}function j8(n){let e,t,i,l,s;const o=[R8,F8],r=[];function a(u,c){return u[7]?0:1}e=a(n),t=r[e]=o[e](n);let f=n[14]&&!n[6]&&Ym(n);return{c(){t.c(),i=M(),f&&f.c(),l=ye()},m(u,c){r[e].m(u,c),w(u,i,c),f&&f.m(u,c),w(u,l,c),s=!0},p(u,c){let d=e;e=a(u),e===d?r[e].p(u,c):(ie(),A(r[d],1,1,()=>{r[d]=null}),le(),t=r[e],t?t.p(u,c):(t=r[e]=o[e](u),t.c()),E(t,1),t.m(i.parentNode,i)),u[14]&&!u[6]?f?f.p(u,c):(f=Ym(u),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(u){s||(E(t),s=!0)},o(u){A(t),s=!1},d(u){u&&(v(i),v(l)),r[e].d(u),f&&f.d(u)}}}function H8(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,f,u,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),u||(c=J(e,"click",n[32]),u=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&se(a,r),m[0]&34816&&f!==(f=!d[15]||d[11])&&(s.disabled=f),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),u=!1,c()}}}function z8(n){let e,t,i={class:` record-panel `+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[14]&&!n[6]?"colored-header":"")+` - `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[56],$$slots:{footer:[H8],header:[j8],default:[P8]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[57](e),e.$on("hide",n[58]),e.$on("show",n[59]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[56],$$slots:{footer:[H8],header:[j8],default:[P8]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[57](e),e.$on("hide",n[58]),e.$on("show",n[59]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` record-panel `+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(l[14]&&!l[6]?"colored-header":"")+` - `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[56]),s[0]&60925|s[2]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[57](null),V(e,l)}}}const Gi="form",bs="providers";function V8(n,e,t){let i,l,s,o,r;const a=lt(),f="record_"+j.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Gi,O=!0,D=!0,I=u;function L(he){return q(he),t(12,g=!0),t(13,C=Gi),c==null?void 0:c.show()}function R(){return c==null?void 0:c.hide()}function F(){t(12,g=!1),R()}function N(){t(30,I=u),c!=null&&c.isActive()&&(U(JSON.stringify(m)),F())}async function P(he){if(he&&typeof he=="string"){try{return await ae.collection(u.id).getOne(he)}catch(Oe){Oe.isAbort||(F(),console.warn("resolveModel:",Oe),ii(`Unable to load record with id "${he}"`))}return null}return he}async function q(he){t(7,D=!0),Jt({}),t(4,y={}),t(5,S={}),t(2,d=typeof he=="string"?{id:he,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:he||{}),t(3,m=structuredClone(d)),t(2,d=await P(he)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,h=G()),!h||ie(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function H(he){var _t,Kt;Jt({}),t(2,d=he||{}),t(4,y={}),t(5,S={});const Oe=((Kt=(_t=u==null?void 0:u.schema)==null?void 0:_t.filter(ut=>ut.type!="file"))==null?void 0:Kt.map(ut=>ut.name))||[];for(let ut in he)Oe.includes(ut)||t(3,m[ut]=he[ut],m);await Qt(),t(28,T=JSON.stringify(m)),te()}function W(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function G(he){try{const Oe=window.localStorage.getItem(W());if(Oe)return JSON.parse(Oe)}catch{}return he}function U(he){try{window.localStorage.setItem(W(),he)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem(W())}}function Y(){h&&(t(3,m=h),t(10,h=null))}function ie(he,Oe){var Z;const _t=structuredClone(he||{}),Kt=structuredClone(Oe||{}),ut=(Z=u==null?void 0:u.schema)==null?void 0:Z.filter(X=>X.type==="file");for(let X of ut)delete _t[X.name],delete Kt[X.name];const oi=["expand","password","passwordConfirm"];for(let X of oi)delete _t[X],delete Kt[X];return JSON.stringify(_t)==JSON.stringify(Kt)}function te(){t(10,h=null),window.localStorage.removeItem(W())}async function pe(he=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Oe=He();let _t;O?_t=await ae.collection(u.id).create(Oe):_t=await ae.collection(u.id).update(m.id,Oe),Lt(O?"Successfully created record.":"Successfully updated record."),te(),he?F():H(_t),a("save",{isNew:O,record:_t})}catch(Oe){ae.error(Oe)}t(11,_=!1)}}function Ne(){d!=null&&d.id&&un("Do you really want to delete the selected record?",()=>ae.collection(d.collectionId).delete(d.id).then(()=>{R(),Lt("Successfully deleted record."),a("delete",d)}).catch(he=>{ae.error(he)}))}function He(){const he=structuredClone(m||{}),Oe=new FormData,_t={id:he.id},Kt={};for(const ut of(u==null?void 0:u.schema)||[])_t[ut.name]=!0,ut.type=="json"&&(Kt[ut.name]=!0);i&&(_t.username=!0,_t.email=!0,_t.emailVisibility=!0,_t.password=!0,_t.passwordConfirm=!0,_t.verified=!0);for(const ut in he)if(_t[ut]){if(typeof he[ut]>"u"&&(he[ut]=null),Kt[ut]&&he[ut]!=="")try{JSON.parse(he[ut])}catch(oi){const Z={};throw Z[ut]={code:"invalid_json",message:oi.toString()},new gn({status:400,response:{data:Z}})}j.addValueToFormData(Oe,ut,he[ut])}for(const ut in y){const oi=j.toArray(y[ut]);for(const Z of oi)Oe.append(ut,Z)}for(const ut in S){const oi=j.toArray(S[ut]);for(const Z of oi)Oe.append(ut+"."+Z,"")}return Oe}function Xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent verification email to ${d.email}?`,()=>ae.collection(u.id).requestVerification(d.email).then(()=>{Lt(`Successfully sent verification email to ${d.email}.`)}).catch(he=>{ae.error(he)}))}function xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent password reset email to ${d.email}?`,()=>ae.collection(u.id).requestPasswordReset(d.email).then(()=>{Lt(`Successfully sent password reset email to ${d.email}.`)}).catch(he=>{ae.error(he)}))}function Mt(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{ft()}):ft()}async function ft(){let he=d?structuredClone(d):null;if(he){he.id="",he.created="",he.updated="";const Oe=(u==null?void 0:u.schema)||[];for(const _t of Oe)_t.type==="file"&&delete he[_t.name]}te(),L(he),await Qt(),t(28,T="")}function ht(he){(he.ctrlKey||he.metaKey)&&he.code=="KeyS"&&(he.preventDefault(),he.stopPropagation(),pe(!1))}const Gt=()=>R(),De=()=>Xe(),Ae=()=>xe(),ze=()=>Mt(),bt=()=>Ne(),de=()=>t(13,C=Gi),ve=()=>t(13,C=bs),we=()=>Y(),Ye=()=>te();function zt(){m.id=this.value,t(3,m)}function dn(he){m=he,t(3,m)}function an(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function qn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Li(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function ol(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function gi(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Ee(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Nt(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Ni(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Kn(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function rl(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}function Rl(he,Oe){n.$$.not_equal(y[Oe.name],he)&&(y[Oe.name]=he,t(4,y))}function bi(he,Oe){n.$$.not_equal(S[Oe.name],he)&&(S[Oe.name]=he,t(5,S))}function al(he,Oe){n.$$.not_equal(m[Oe.name],he)&&(m[Oe.name]=he,t(3,m))}const fl=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{F()}),!1):(Jt({}),te(),!0);function kt(he){ee[he?"unshift":"push"](()=>{c=he,t(9,c)})}function rt(he){Ce.call(this,n,he)}function Mn(he){Ce.call(this,n,he)}return n.$$set=he=>{"collection"in he&&t(0,u=he.collection)},n.$$.update=()=>{var he;n.$$.dirty[0]&1&&t(14,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((he=u==null?void 0:u.schema)!=null&&he.find(Oe=>Oe.type==="editor"))),n.$$.dirty[0]&48&&t(31,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&805306368|n.$$.dirty[1]&1&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(O||o)),n.$$.dirty[0]&536871040&&(D||U($)),n.$$.dirty[0]&1073741825&&u&&(I==null?void 0:I.id)!=(u==null?void 0:u.id)&&N()},[u,R,d,m,y,S,O,D,o,c,h,_,g,C,i,r,l,f,F,Y,te,pe,Ne,Xe,xe,Mt,ht,L,T,$,I,s,Gt,De,Ae,ze,bt,de,ve,we,Ye,zt,dn,an,qn,Li,ol,gi,Ee,Nt,Ni,Kn,rl,Rl,bi,al,fl,kt,rt,Mn]}class Za extends ge{constructor(e){super(),_e(this,e,V8,z8,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function B8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U8(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("div"),t=b("div"),i=K(n[2]),l=M(),s=b("div"),o=K(n[1]),r=K(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(f=Se(Pe.call(null,e,n[3])),a=!0)},p(u,c){c&4&&oe(i,u[2]),c&2&&oe(o,u[1])},d(u){u&&v(e),a=!1,f()}}}function W8(n){let e;function t(s,o){return s[0]?U8:B8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function Y8(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class el extends ge{constructor(e){super(),_e(this,e,Y8,W8,me,{date:0})}}function Km(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Jm(n,e,t){const i=n.slice();return i[13]=e[t],i}function Zm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Gm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function K8(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function J8(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function Z8(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function G8(n){let e,t;return{c(){e=b("div"),t=K(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&oe(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function X8(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function Q8(n){let e,t=[],i=new Map,l,s,o=ue(n[16].slice(0,n[17]));const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Qm();return{c(){var f;e=b("div");for(let u=0;uf[17]?a||(a=Qm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||u&2)&&x(e,"multiple",((c=f[1].options)==null?void 0:c.maxSelect)!=1)},i(f){if(!s){for(let u=0;un[11]&&th();return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),k(e,l),f&&f.m(e,null),s=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),E(i,1),i.m(e,l)),u[9].length>u[11]?f||(f=th(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(e),r[t].d(),f&&f.d()}}}function eD(n){let e,t=[],i=new Map,l=ue(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function iD(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=K(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[Se(Pe.call(null,e,"Open in new tab")),J(e,"click",Tn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function lD(n){let e,t;return{c(){e=b("span"),t=K(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&oe(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function sD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function oD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function rD(n){let e,t,i,l;const s=[pD,dD],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(le(),A(o[u],1,1,()=>{o[u]=null}),se(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Xm(n,e){let t,i,l;return i=new Ka({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function Qm(n){let e;return{c(){e=K("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function aD(n){let e,t=ue(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&ih(n);return{c(){e=b("span"),i=K(t),l=M(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&oe(i,t),a[5].length>500?r?(r.p(a,f),f&8&&E(r,1)):(r=ih(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function pD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&oe(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ih(n){let e,t;return e=new sl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mD(n){let e,t,i,l,s;const o=[rD,oD,sD,lD,iD,nD,tD,eD,x8,Q8,X8,G8],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(u[3])),e?1:u[1].type==="bool"?2:u[1].type==="number"?3:u[1].type==="url"?4:u[1].type==="editor"?5:u[1].type==="date"?6:u[1].type==="select"?7:u[1].type==="relation"?8:u[1].type==="file"?9:u[2]?10:11)}function f(u,c){return c===0?Z8(u):c===8?J8(u):c===9?K8(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),l=ye()},m(u,c){r[t].m(u,c),w(u,l,c),s=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(le(),A(r[d],1,1,()=>{r[d]=null}),se(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(l),r[t].d(u)}}}function hD(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ce.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class xb extends ge{constructor(e){super(),_e(this,e,hD,mD,me,{record:0,field:1,short:2})}}function lh(n,e,t){const i=n.slice();return i[13]=e[t],i}function sh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new xb({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=K(i),s=M(),o=b("td"),B(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(e,s),k(e,o),z(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[13].name+"")&&oe(l,i);const c={};u&1&&(c.field=f[13]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(E(r.$$.fragment,f),a=!0)},o(f){A(r.$$.fragment,f),a=!1},d(f){f&&v(e),V(r)}}}function oh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function rh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function _D(n){var O;let e,t,i,l,s,o,r,a,f,u,c=(n[3].id||"...")+"",d,m,h,_,g;a=new sl({props:{value:n[3].id}});let y=ue((O=n[0])==null?void 0:O.schema),S=[];for(let D=0;DA(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&oh(n),C=n[3].updated&&rh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("span"),d=K(c),m=M();for(let D=0;D{$=null}),se()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=rh(D),C.c(),E(C,1),C.m(t,null)):C&&(le(),A(C,1,1,()=>{C=null}),se()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function kD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[bD],header:[gD],default:[_D]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function yD(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return u(g),s==null?void 0:s.show()}function f(){return t(4,r=!1),s==null?void 0:s.hide()}async function u(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await ae.collection(l.id).getOne(g)}catch(y){y.isAbort||(f(),console.warn("resolveModel:",y),ii(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>f();function m(g){ee[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ce.call(this,n,g)}function _(g){Ce.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,f,s,o,r,i,a,d,m,h,_]}class vD extends ge{constructor(e){super(),_e(this,e,yD,kD,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function ah(n,e,t){const i=n.slice();return i[63]=e[t],i}function fh(n,e,t){const i=n.slice();return i[66]=e[t],i}function uh(n,e,t){const i=n.slice();return i[66]=e[t],i}function ch(n,e,t){const i=n.slice();return i[59]=e[t],i}function dh(n){let e;function t(s,o){return s[13]?SD:wD}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function wD(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[32]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function SD(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ph(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[$D]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $D(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&hh(n),r=i&&_h(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){f[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,f),f[0]&32&&E(o,1)):(o=hh(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(le(),A(o,1,1,()=>{o=null}),se()),f[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=_h(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(le(),A(r,1,1,()=>{r=null}),se())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function hh(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[TD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function TD(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _h(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[CD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CD(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OD(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=K(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,f){f[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[66].name+"")&&oe(r,o)},d(a){a&&v(e)}}}function gh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[OD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Sn({props:r}),ee.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[66].type+" col-field-"+e[66].name),f[0]&524288&&(u.name=e[66].name),f[0]&524288|f[2]&512&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.sort=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function bh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[MD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function MD(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[DD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),ee.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function DD(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function vh(n){let e;function t(s,o){return s[13]?ID:ED}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ED(n){let e,t,i,l;function s(a,f){var u;if((u=a[1])!=null&&u.length)return LD;if(!a[10])return AD}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function ID(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function wh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[J(i,"change",c),J(t,"click",Tn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,$e(u)}}}function Sh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&$h(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=K(r),f=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),z(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&oe(a,r),d[9]?c?c.p(d,m):(c=$h(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function $h(n){let e;function t(s,o){return s[63].verified?PD:ND}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ND(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function PD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Th(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Ch(n),o=i&&Oh(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Ch(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Oh(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Ch(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?RD:FD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function FD(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&oe(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function RD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Oh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?jD:qD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function qD(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&oe(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function jD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Mh(n,e){let t,i,l,s;return i=new xb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function Dh(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Eh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Ih(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&wh(e),T=l&&Sh(e),$=e[9]&&Th(e),C=ue(e[19]);const O=F=>F[66].name;for(let F=0;F',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P{T=null}),se()),e[9]?$?$.p(e,N):($=Th(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=ue(e[19]),le(),r=at(r,N,O,1,e,C,a,t,Et,Mh,f,fh),se()),N[0]&288&&(u=e[8]&&!e[5].includes("@created")),u?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Dh(e),D.c(),E(D,1),D.m(t,c)):D&&(le(),A(D,1,1,()=>{D=null}),se()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Eh(e),I.c(),E(I,1),I.m(t,m)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(F){if(!_){E(T);for(let N=0;NU[66].name;for(let U=0;UU[10]?U[63]:U[63].id;for(let U=0;U{D=null}),se()),U[9]?I?(I.p(U,Y),Y[0]&512&&E(I,1)):(I=mh(U),I.c(),E(I,1),I.m(i,r)):I&&(le(),A(I,1,1,()=>{I=null}),se()),Y[0]&524289&&(L=ue(U[19]),le(),a=at(a,Y,R,1,U,L,f,i,Et,gh,u,uh),se()),Y[0]&288&&(c=U[8]&&!U[5].includes("@created")),c?F?(F.p(U,Y),Y[0]&288&&E(F,1)):(F=bh(U),F.c(),E(F,1),F.m(i,d)):F&&(le(),A(F,1,1,()=>{F=null}),se()),Y[0]&160&&(m=U[7]&&!U[5].includes("@updated")),m?N?(N.p(U,Y),Y[0]&160&&E(N,1)):(N=kh(U),N.c(),E(N,1),N.m(i,h)):N&&(le(),A(N,1,1,()=>{N=null}),se()),U[16].length?P?P.p(U,Y):(P=yh(U),P.c(),P.m(_,null)):P&&(P.d(1),P=null),Y[0]&9971642&&(q=ue(U[3]),le(),S=at(S,Y,H,1,U,q,T,y,Et,Ih,$,ah),se(),!q.length&&W?W.p(U,Y):q.length?W&&(W.d(1),W=null):(W=vh(U),W.c(),W.m(y,$))),U[3].length&&U[18]?G?G.p(U,Y):(G=Ah(U),G.c(),G.m(y,null)):G&&(G.d(1),G=null),(!C||Y[0]&8192)&&x(e,"table-loading",U[13])},i(U){if(!C){E(D),E(I);for(let Y=0;Y({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function VD(n){let e,t,i=[],l=new Map,s,o,r=ue(n[16]);const a=f=>f[59].id+f[59].name;for(let f=0;f{i=null}),se())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ph(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[6]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[47]),J(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&oe(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&oe(a,r),(!g||$[0]&16384)&&x(u,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function UD(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[BD],default:[HD]},$$scope:{ctx:n}};e=new Qo({props:s}),n[46](e);let o=n[6]&&Ph(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ye()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const f={};a[0]&1030075|a[2]&512&&(f.$$scope={dirty:a,ctx:r}),e.$set(f),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=Ph(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(le(),A(o,1,1,()=>{o=null}),se())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const WD=/^([\+\-])?(\w+)$/,Fh=40;function YD(n,e,t){let i,l,s,o,r,a,f,u,c,d,m,h;We(n,Rn,Ee=>t(53,h=Ee));const _=lt();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,O=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function H(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function W(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Ee=localStorage.getItem(q);Ee&&t(5,N=JSON.parse(Ee)||[])}catch{}}function G(Ee){return!!$.find(Nt=>Nt.id)}async function U(){const Ee=C;for(let Nt=1;Nt<=Ee;Nt++)(Nt===1||f)&&await Y(Nt,!1)}async function Y(Ee=1,Nt=!0){var al,fl,kt;if(!(g!=null&&g.id))return;t(13,I=!0);let Ni=y;const Kn=Ni.match(WD),rl=Kn?r.find(rt=>rt.name===Kn[2]):null;if(Kn&&rl){const rt=((kt=(fl=(al=h==null?void 0:h.find(he=>{var Oe;return he.id==((Oe=rl.options)==null?void 0:Oe.collectionId)}))==null?void 0:al.schema)==null?void 0:fl.filter(he=>he.presentable))==null?void 0:kt.map(he=>he.name))||[],Mn=[];for(const he of rt)Mn.push((Kn[1]||"")+Kn[2]+"."+he);Mn.length>0&&(Ni=Mn.join(","))}const Rl=j.getAllCollectionIdentifiers(g),bi=o.map(rt=>rt.name+":excerpt(200)").concat(r.map(rt=>"expand."+rt.name+".*:excerpt(200)"));return bi.length&&bi.unshift("*"),ae.collection(g.id).getList(Ee,Fh,{sort:Ni,skipTotal:1,filter:j.normalizeSearchFilter(S,Rl),expand:r.map(rt=>rt.name).join(","),fields:bi.join(","),requestKey:"records_list"}).then(async rt=>{var Mn;if(Ee<=1&&ie(),t(13,I=!1),t(12,C=rt.page),t(28,O=rt.items.length),_("load",$.concat(rt.items)),o.length)for(let he of rt.items)he._partial=!0;if(Nt){const he=++R;for(;(Mn=rt.items)!=null&&Mn.length&&R==he;){const Oe=rt.items.splice(0,20);for(let _t of Oe)j.pushOrReplaceByKey($,_t);t(3,$),await j.yieldToMain()}}else{for(let he of rt.items)j.pushOrReplaceByKey($,he);t(3,$)}}).catch(rt=>{rt!=null&&rt.isAbort||(t(13,I=!1),console.warn(rt),ie(),ae.error(rt,!S||(rt==null?void 0:rt.status)!=400))})}function ie(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,O=0),t(4,D={})}function te(){c?pe():Ne()}function pe(){t(4,D={})}function Ne(){for(const Ee of $)t(4,D[Ee.id]=Ee,D);t(4,D)}function He(Ee){D[Ee.id]?delete D[Ee.id]:t(4,D[Ee.id]=Ee,D),t(4,D)}function Xe(){un(`Do you really want to delete the selected ${u===1?"record":"records"}?`,xe)}async function xe(){if(L||!u||!(g!=null&&g.id))return;let Ee=[];for(const Nt of Object.keys(D))Ee.push(ae.collection(g.id).delete(Nt));return t(14,L=!0),Promise.all(Ee).then(()=>{Lt(`Successfully deleted the selected ${u===1?"record":"records"}.`),_("delete",D),pe()}).catch(Nt=>{ae.error(Nt)}).finally(()=>(t(14,L=!1),U()))}function Mt(Ee){Ce.call(this,n,Ee)}const ft=(Ee,Nt)=>{Nt.target.checked?j.removeByValue(N,Ee.id):j.pushUnique(N,Ee.id),t(5,N)},ht=()=>te();function Gt(Ee){y=Ee,t(0,y)}function De(Ee){y=Ee,t(0,y)}function Ae(Ee){y=Ee,t(0,y)}function ze(Ee){y=Ee,t(0,y)}function bt(Ee){y=Ee,t(0,y)}function de(Ee){y=Ee,t(0,y)}function ve(Ee){ee[Ee?"unshift":"push"](()=>{F=Ee,t(15,F)})}const we=Ee=>He(Ee),Ye=Ee=>_("select",Ee),zt=(Ee,Nt)=>{Nt.code==="Enter"&&(Nt.preventDefault(),_("select",Ee))},dn=()=>t(1,S=""),an=()=>_("new"),qn=()=>Y(C+1);function Li(Ee){ee[Ee?"unshift":"push"](()=>{T=Ee,t(11,T)})}const ol=()=>pe(),gi=()=>Xe();return n.$$set=Ee=>{"collection"in Ee&&t(25,g=Ee.collection),"sort"in Ee&&t(0,y=Ee.sort),"filter"in Ee&&t(1,S=Ee.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",W(),ie()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ee=>Ee.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ee=>Ee.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ee=>!N.includes(Ee.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&Y(1),n.$$.dirty[0]&268435456&&t(18,f=O>=Fh),n.$$.dirty[0]&16&&t(6,u=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&u===$.length),n.$$.dirty[0]&32&&N!==-1&&H(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ee=>({id:Ee.id,name:Ee.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,Y,$,D,N,u,m,d,l,i,T,C,I,L,F,P,c,f,a,_,te,pe,He,Xe,g,G,U,O,s,Mt,ft,ht,Gt,De,Ae,ze,bt,de,ve,we,Ye,zt,dn,an,qn,Li,ol,gi]}class KD extends ge{constructor(e){super(),_e(this,e,YD,UD,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function JD(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=K(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[f]){f&5&&s!==(s=(a[2]?"...":a[0])+"")&&oe(o,s),f&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function ZD(n,e,t){const i=lt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function f(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const u=j.getAllCollectionIdentifiers(l),c=await ae.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,u),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(u){u!=null&&u.isAbort||(t(2,a=!1),console.warn(u))}}}return n.$$set=u=>{"collection"in u&&t(3,l=u.collection),"filter"in u&&t(4,s=u.filter),"totalCount"in u&&t(0,o=u.totalCount),"class"in u&&t(1,r=u.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&f()},[o,r,a,l,s,f]}class GD extends ge{constructor(e){super(),_e(this,e,ZD,JD,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function XD(n){let e,t,i,l;return e=new p6({}),i=new bn({props:{class:"flex-content",$$slots:{footer:[tE],default:[eE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function QD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[sE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Rh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function qh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eE(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F=!n[12]&&Rh(n);c=new Xo({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&qh(n);y=new Cs({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(W){n[26](W)}function q(W){n[27](W)}let H={collection:n[2]};return n[0]!==void 0&&(H.filter=n[0]),n[1]!==void 0&&(H.sort=n[1]),C=new KD({props:H}),n[25](C),ee.push(()=>be(C,"filter",P)),ee.push(()=>be(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=K(o),a=M(),f=b("div"),F&&F.c(),u=M(),B(c.$$.fragment),d=M(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=M(),N&&N.c(),g=M(),B(y.$$.fragment),S=M(),T=b("div"),$=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(W,G){w(W,e,G),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,f),F&&F.m(f,null),k(f,u),z(c,f,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(W,g,G),z(y,W,G),w(W,S,G),w(W,T,G),w(W,$,G),z(C,W,G),I=!0,L||(R=J(h,"click",n[22]),L=!0)},p(W,G){(!I||G[0]&4)&&o!==(o=W[2].name+"")&&oe(r,o),W[12]?F&&(F.d(1),F=null):F?F.p(W,G):(F=Rh(W),F.c(),F.m(f,u)),W[2].type!=="view"?N?N.p(W,G):(N=qh(W),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const U={};G[0]&1&&(U.value=W[0]),G[0]&4&&(U.autocompleteCollection=W[2]),y.$set(U);const Y={};G[0]&4&&(Y.collection=W[2]),!O&&G[0]&1&&(O=!0,Y.filter=W[0],ke(()=>O=!1)),!D&&G[0]&2&&(D=!0,Y.sort=W[1],ke(()=>D=!1)),C.$set(Y)},i(W){I||(E(c.$$.fragment,W),E(y.$$.fragment,W),E(C.$$.fragment,W),I=!0)},o(W){A(c.$$.fragment,W),A(y.$$.fragment,W),A(C.$$.fragment,W),I=!1},d(W){W&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),V(c),N&&N.d(),V(y,W),n[25](null),V(C,W),L=!1,R()}}}function tE(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new GD({props:s}),n[18](e),ee.push(()=>be(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function nE(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function iE(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function lE(n){let e,t,i;function l(r,a){return r[12]?iE:nE}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function sE(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oE(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[xD,QD,XD],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ya({props:_}),n[31](l);let g={};o=new v6({props:g}),n[32](o);let y={collection:n[2]};a=new Za({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new vD({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),z(l,T,$),w(T,s,$),z(o,T,$),w(T,r,$),z(a,T,$),w(T,f,$),z(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(le(),A(m[C],1,1,()=>{m[C]=null}),se(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const O={};l.$set(O);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),V(l,T),n[32](null),V(o,T),n[33](null),V(a,T),n[37](null),V(u,T)}}}function rE(n,e,t){let i,l,s,o,r,a,f;We(n,Yn,De=>t(2,l=De)),We(n,It,De=>t(39,s=De)),We(n,Oo,De=>t(3,o=De)),We(n,zo,De=>t(16,r=De)),We(n,Rn,De=>t(11,a=De)),We(n,Xi,De=>t(12,f=De));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;X1(T);async function C(De){await Qt(),(l==null?void 0:l.type)==="view"?h.show(De):m==null||m.show(De)}function O(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D(),c==null||c.forceHide(),d==null||d.hide()}async function D(){if(!S)return;const De=j.getAllCollectionIdentifiers(l),Ae=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Ae.filter(ze=>De.includes(ze)).length!=Ae.length&&(De.includes("created")?t(1,S="-created"):t(1,S=""))}function I(De={}){const Ae=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},De);j.replaceHashQueryParams(Ae)}const L=()=>c==null?void 0:c.show();function R(De){ee[De?"unshift":"push"](()=>{g=De,t(9,g)})}function F(De){$=De,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),H=()=>m==null?void 0:m.show(),W=De=>t(0,y=De.detail);function G(De){ee[De?"unshift":"push"](()=>{_=De,t(8,_)})}function U(De){y=De,t(0,y)}function Y(De){S=De,t(1,S)}const ie=De=>{I({recordId:De.detail.id});let Ae=De.detail._partial?De.detail.id:De.detail;l.type==="view"?h==null||h.show(Ae):m==null||m.show(Ae)},te=()=>{g==null||g.reload()},pe=()=>m==null?void 0:m.show();function Ne(De){ee[De?"unshift":"push"](()=>{c=De,t(4,c)})}function He(De){ee[De?"unshift":"push"](()=>{d=De,t(5,d)})}function Xe(De){ee[De?"unshift":"push"](()=>{m=De,t(6,m)})}const xe=()=>{I({recordId:null})},Mt=De=>{y?g==null||g.reload():De.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},ft=De=>{(!y||_!=null&&_.hasRecord(De.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function ht(De){ee[De?"unshift":"push"](()=>{h=De,t(7,h)})}const Gt=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&av(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&O(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(It,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,q,H,W,G,U,Y,ie,te,pe,Ne,He,Xe,xe,Mt,ft,ht,Gt]}class aE extends ge{constructor(e){super(),_e(this,e,rE,oE,me,{},null,[-1,-1])}}function jh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=M(),i=b("a"),i.innerHTML=' Export collections',l=M(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(Ln.call(null,i,{path:"/settings/export-collections/?.*"})),Se(ln.call(null,i)),Se(Ln.call(null,s,{path:"/settings/import-collections/?.*"})),Se(ln.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function fE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O=!n[0]&&jh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',f=M(),u=b("a"),u.innerHTML=' Backups',c=M(),O&&O.c(),d=M(),m=b("div"),m.textContent="Authentication",h=M(),_=b("a"),_.innerHTML=' Auth providers',g=M(),y=b("a"),y.innerHTML=' Token options',S=M(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),O&&O.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[Se(Ln.call(null,l,{path:"/settings"})),Se(ln.call(null,l)),Se(Ln.call(null,o,{path:"/settings/mail/?.*"})),Se(ln.call(null,o)),Se(Ln.call(null,a,{path:"/settings/storage/?.*"})),Se(ln.call(null,a)),Se(Ln.call(null,u,{path:"/settings/backups/?.*"})),Se(ln.call(null,u)),Se(Ln.call(null,_,{path:"/settings/auth-providers/?.*"})),Se(ln.call(null,_)),Se(Ln.call(null,y,{path:"/settings/tokens/?.*"})),Se(ln.call(null,y)),Se(Ln.call(null,T,{path:"/settings/admins/?.*"})),Se(ln.call(null,T))],$=!0)},p(D,I){D[0]?O&&(O.d(1),O=null):O||(O=jh(),O.c(),O.m(e,d))},d(D){D&&v(e),O&&O.d(),$=!1,$e(C)}}}function uE(n){let e,t;return e=new Bb({props:{class:"settings-sidebar",$$slots:{default:[fE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cE(n,e,t){let i;return We(n,Xi,l=>t(0,i=l)),[i]}class _i extends ge{constructor(e){super(),_e(this,e,cE,uE,me,{})}}function Hh(n,e,t){const i=n.slice();return i[31]=e[t],i}function zh(n){let e,t;return e=new ce({props:{class:"form-field readonly",name:"id",$$slots:{default:[dE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Gb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),f=M(),u=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),z(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),V(a)}}}function Vh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function pE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[3]),f||(u=J(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function Bh(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[mE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Uh(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[hE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[_E,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(t,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(t,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function hE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),re(r,n[9]),w(_,f,g),w(_,u,g),z(c,u,null),d=!0,m||(h=J(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&re(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function _E(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[10]),f||(u=J(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&re(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function gE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&zh(n),_=ue([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=Vh(Hh(n,_,T));a=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[pE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Bh(n),S=(n[5]||n[4])&&Uh(n);return{c(){e=b("form"),h&&h.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=M(),B(a.$$.fragment),f=M(),y&&y.c(),u=M(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),z(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=J(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(le(),A(h,1,1,()=>{h=null}),se()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=zh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=ue([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const D=Hh(T,_,O);g[O]?g[O].p(D,$):(g[O]=Vh(D),g[O].c(),g[O].m(o,null))}for(;O<10;O+=1)g[O].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(le(),A(y,1,1,()=>{y=null}),se()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Bh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Uh(T),S.c(),E(S,1),S.m(e,null)):S&&(le(),A(S,1,1,()=>{S=null}),se())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),ot(g,T),V(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function bE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&oe(i,t)},d(l){l&&v(e)}}}function Wh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[kE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(t,"aria-hidden","true"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"aria-label","More admin options"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),z(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),V(o)}}}function kE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function yE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Wh(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=J(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(le(),A(m,1,1,()=>{m=null}),se()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Wh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&oe(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function vE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[yE],header:[bE],default:[gE]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function wE(n,e,t){let i,l;const s=lt(),o="admin_"+j.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Jt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let U;i?U=ae.admins.create(G):U=ae.admins.update(a.id,G),U.then(async Y=>{var ie;t(8,u=!1),y(),Lt(i?"Successfully created admin.":"Successfully updated admin."),((ie=ae.authStore.model)==null?void 0:ie.id)===Y.id&&ae.authStore.save(ae.authStore.token,Y),s("save",Y)}).catch(Y=>{ae.error(Y)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&un("Do you really want to delete the selected admin?",()=>ae.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Lt("Successfully deleted admin."),s("delete",a)}).catch(G=>{ae.error(G)}))}const O=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(G){ee[G?"unshift":"push"](()=>{r=G,t(6,r)})}function H(G){Ce.call(this,n,G)}function W(G){Ce.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,O,D,I,L,R,F,N,P,q,H,W]}class SE extends ge{constructor(e){super(),_e(this,e,wE,vE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Yh(n,e,t){const i=n.slice();return i[24]=e[t],i}function $E(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kh(n){let e;function t(s,o){return s[5]?DE:ME}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ME(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Jh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Jh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function DE(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Zh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,O,D,I,L,R,F,N,P,q,H,W,G;u=new sl({props:{value:e[24].id}});let U=e[24].id===e[7].id&&Zh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Y(){return e[15](e[24])}function ie(...te){return e[16](e[24],...te)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),f=b("div"),B(u.$$.fragment),c=M(),d=b("span"),h=K(m),_=M(),U&&U.c(),g=M(),y=b("td"),S=b("span"),$=K(T),O=M(),D=b("td"),B(I.$$.fragment),L=M(),R=b("td"),B(F.$$.fragment),N=M(),P=b("td"),P.innerHTML='',q=M(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,pe){w(te,t,pe),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),z(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),U&&U.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,O),k(t,D),z(I,D,null),k(t,L),k(t,R),z(F,R,null),k(t,N),k(t,P),k(t,q),H=!0,W||(G=[J(t,"click",Y),J(t,"keydown",ie)],W=!0)},p(te,pe){e=te,(!H||pe&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Ne={};pe&16&&(Ne.value=e[24].id),u.$set(Ne),(!H||pe&16)&&m!==(m=e[24].id+"")&&oe(h,m),e[24].id===e[7].id?U||(U=Zh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!H||pe&16)&&T!==(T=e[24].email+"")&&oe($,T),(!H||pe&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};pe&16&&(He.date=e[24].created),I.$set(He);const Xe={};pe&16&&(Xe.date=e[24].updated),F.$set(Xe)},i(te){H||(E(u.$$.fragment,te),E(I.$$.fragment,te),E(F.$$.fragment,te),H=!0)},o(te){A(u.$$.fragment,te),A(I.$$.fragment,te),A(F.$$.fragment,te),H=!1},d(te){te&&v(t),V(u),U&&U.d(),V(I),V(F),W=!1,$e(G)}}}function EE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],O=new Map,D;function I(Y){n[11](Y)}let L={class:"col-type-text",name:"id",$$slots:{default:[$E]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Sn({props:L}),ee.push(()=>be(o,"sort",I));function R(Y){n[12](Y)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[TE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new Sn({props:F}),ee.push(()=>be(f,"sort",R));function N(Y){n[13](Y)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[CE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new Sn({props:P}),ee.push(()=>be(d,"sort",N));function q(Y){n[14](Y)}let H={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[OE]},$$scope:{ctx:n}};n[2]!==void 0&&(H.sort=n[2]),_=new Sn({props:H}),ee.push(()=>be(_,"sort",q));let W=ue(n[4]);const G=Y=>Y[24].id;for(let Y=0;Yr=!1)),o.$set(te);const pe={};ie&134217728&&(pe.$$scope={dirty:ie,ctx:Y}),!u&&ie&4&&(u=!0,pe.sort=Y[2],ke(()=>u=!1)),f.$set(pe);const Ne={};ie&134217728&&(Ne.$$scope={dirty:ie,ctx:Y}),!m&&ie&4&&(m=!0,Ne.sort=Y[2],ke(()=>m=!1)),d.$set(Ne);const He={};ie&134217728&&(He.$$scope={dirty:ie,ctx:Y}),!g&&ie&4&&(g=!0,He.sort=Y[2],ke(()=>g=!1)),_.$set(He),ie&186&&(W=ue(Y[4]),le(),C=at(C,ie,G,1,Y,W,O,$,Et,Gh,null,Yh),se(),!W.length&&U?U.p(Y,ie):W.length?U&&(U.d(1),U=null):(U=Kh(Y),U.c(),U.m($,null))),(!D||ie&32)&&x(e,"table-loading",Y[5])},i(Y){if(!D){E(o.$$.fragment,Y),E(f.$$.fragment,Y),E(d.$$.fragment,Y),E(_.$$.fragment,Y);for(let ie=0;ie New admin',h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=M(),B(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),z(a,e,null),k(e,f),k(e,u),k(e,c),k(e,d),k(d,m),w(D,h,I),z(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),z(T,D,I),$=!0,C||(O=J(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&oe(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),V(a),V(_,D),V(T,D),C=!1,O()}}}function AE(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=K("Total found: "),l=K(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&oe(l,i)},d(s){s&&v(e)}}}function LE(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{footer:[AE],default:[IE]},$$scope:{ctx:n}}});let r={};return s=new SE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function NE(n,e,t){let i,l,s;We(n,zo,F=>t(21,i=F)),We(n,It,F=>t(6,l=F)),We(n,Oa,F=>t(7,s=F)),xt(It,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],f=!1,u=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,f=!0),t(4,a=[]);const F=j.normalizeSearchFilter(u,["id","email","created","updated"]);return ae.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,f=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,f=!1),console.warn(N),m(),ae.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,u=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),O=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,u="");function I(F){ee[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();tl("/settings/admins?"+F),d()}},[d,u,c,r,a,f,l,s,h,_,g,y,S,T,$,C,O,D,I,L,R]}class PE extends ge{constructor(e){super(),_e(this,e,NE,LE,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function FE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0]),s.focus(),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&1&&s.value!==f[0]&&re(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RE(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),f=b("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[1]),w(d,r,m),w(d,a,m),k(a,f),u||(c=[J(s,"input",n[5]),Se(ln.call(null,f))],u=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&re(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),u=!1,$e(c)}}}function qE(n){let e,t,i,l,s,o,r,a,f,u,c;return l=new ce({props:{class:"form-field required",name:"identity",$$slots:{default:[FE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[RE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),k(e,a),f=!0,u||(c=J(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),V(o),u=!1,c()}}}function jE(n){let e,t;return e=new Q1({props:{$$slots:{default:[qE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function HE(n,e,t){let i;We(n,zo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ae.admins.authWithPassword(s,o).then(()=>{Ta(),tl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class zE extends ge{constructor(e){super(),_e(this,e,HE,jE,me,{})}}function VE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new ce({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[UE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[WE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[YE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Xh(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("div"),c=b("div"),d=M(),$&&$.c(),m=M(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,O){w(C,e,O),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),z(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=J(h,"click",n[12]),S=!0)},p(C,O){const D={};O&786433&&(D.$$scope={dirty:O,ctx:C}),i.$set(D);const I={};O&786433&&(I.$$scope={dirty:O,ctx:C}),o.$set(I);const L={};O&786433&&(L.$$scope={dirty:O,ctx:C}),a.$set(L),C[3]?$?$.p(C,O):($=Xh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||O&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||O&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),V(i),V(o),V(a),$&&$.d(),S=!1,T()}}}function BE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function UE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appName),r||(a=J(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&re(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function WE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.appUrl),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&re(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function YE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[10]),Se(Pe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function Xh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function KE(n){let e,t,i,l,s,o,r,a,f;const u=[BE,VE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=J(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(le(),A(c[_],1,1,()=>{c[_]=null}),se(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function JE(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[KE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function ZE(n,e,t){let i,l,s,o;We(n,Xi,C=>t(13,l=C)),We(n,Do,C=>t(14,s=C)),We(n,It,C=>t(15,o=C)),xt(It,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await ae.settings.getAll()||{};h(C)}catch(C){ae.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await ae.settings.update(j.filterRedactedProps(a));h(C),Lt("Successfully saved application settings.")}catch(C){ae.error(C)}t(2,u=!1)}}function h(C={}){var O,D;xt(Do,s=(O=C==null?void 0:C.meta)==null?void 0:O.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class GE extends ge{constructor(e){super(),_e(this,e,ZE,JE,me,{})}}function XE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),l.autofocus&&l.focus(),s||(o=[Se(Pe.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],s=!0)},p(f,u){ni(l,a=pt(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&(v(e),v(i),v(l)),s=!1,$e(o)}}}function xE(n){let e;function t(s,o){return s[3]?QE:XE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function eI(n,e,t){const i=["value","mask"];let l=Ge(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const u=()=>f();function c(m){ee[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ie(Ie({},e),Yt(m)),t(5,l=Ge(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,f,l,u,c,d]}class Ga extends ge{constructor(e){super(),_e(this,e,eI,xE,me,{value:0,mask:1})}}function tI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("label"),t=K("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: + `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[56]),s[0]&60925|s[2]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[57](null),V(e,l)}}}const Gi="form",bs="providers";function V8(n,e,t){let i,l,s,o,r;const a=lt(),f="record_"+j.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Gi,O=!0,D=!0,I=u;function L(he){return q(he),t(12,g=!0),t(13,C=Gi),c==null?void 0:c.show()}function R(){return c==null?void 0:c.hide()}function F(){t(12,g=!1),R()}function N(){t(30,I=u),c!=null&&c.isActive()&&(U(JSON.stringify(m)),F())}async function P(he){if(he&&typeof he=="string"){try{return await re.collection(u.id).getOne(he)}catch(Me){Me.isAbort||(F(),console.warn("resolveModel:",Me),ii(`Unable to load record with id "${he}"`))}return null}return he}async function q(he){t(7,D=!0),Zt({}),t(4,y={}),t(5,S={}),t(2,d=typeof he=="string"?{id:he,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:he||{}),t(3,m=structuredClone(d)),t(2,d=await P(he)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,h=G()),!h||me(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function H(he){var mt,Jt;Zt({}),t(2,d=he||{}),t(4,y={}),t(5,S={});const Me=((Jt=(mt=u==null?void 0:u.schema)==null?void 0:mt.filter(ft=>ft.type!="file"))==null?void 0:Jt.map(ft=>ft.name))||[];for(let ft in he)Me.includes(ft)||t(3,m[ft]=he[ft],m);await Qt(),t(28,T=JSON.stringify(m)),ee()}function W(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function G(he){try{const Me=window.localStorage.getItem(W());if(Me)return JSON.parse(Me)}catch{}return he}function U(he){try{window.localStorage.setItem(W(),he)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(W())}}function Y(){h&&(t(3,m=h),t(10,h=null))}function me(he,Me){var Z;const mt=structuredClone(he||{}),Jt=structuredClone(Me||{}),ft=(Z=u==null?void 0:u.schema)==null?void 0:Z.filter(X=>X.type==="file");for(let X of ft)delete mt[X.name],delete Jt[X.name];const oi=["expand","password","passwordConfirm"];for(let X of oi)delete mt[X],delete Jt[X];return JSON.stringify(mt)==JSON.stringify(Jt)}function ee(){t(10,h=null),window.localStorage.removeItem(W())}async function ce(he=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Me=He();let mt;O?mt=await re.collection(u.id).create(Me):mt=await re.collection(u.id).update(m.id,Me),Nt(O?"Successfully created record.":"Successfully updated record."),ee(),he?F():H(mt),a("save",{isNew:O,record:mt})}catch(Me){re.error(Me)}t(11,_=!1)}}function Oe(){d!=null&&d.id&&un("Do you really want to delete the selected record?",()=>re.collection(d.collectionId).delete(d.id).then(()=>{R(),Nt("Successfully deleted record."),a("delete",d)}).catch(he=>{re.error(he)}))}function He(){const he=structuredClone(m||{}),Me=new FormData,mt={id:he.id},Jt={};for(const ft of(u==null?void 0:u.schema)||[])mt[ft.name]=!0,ft.type=="json"&&(Jt[ft.name]=!0);i&&(mt.username=!0,mt.email=!0,mt.emailVisibility=!0,mt.password=!0,mt.passwordConfirm=!0,mt.verified=!0);for(const ft in he)if(mt[ft]){if(typeof he[ft]>"u"&&(he[ft]=null),Jt[ft]&&he[ft]!=="")try{JSON.parse(he[ft])}catch(oi){const Z={};throw Z[ft]={code:"invalid_json",message:oi.toString()},new gn({status:400,response:{data:Z}})}j.addValueToFormData(Me,ft,he[ft])}for(const ft in y){const oi=j.toArray(y[ft]);for(const Z of oi)Me.append(ft,Z)}for(const ft in S){const oi=j.toArray(S[ft]);for(const Z of oi)Me.append(ft+"."+Z,"")}return Me}function Je(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent verification email to ${d.email}?`,()=>re.collection(u.id).requestVerification(d.email).then(()=>{Nt(`Successfully sent verification email to ${d.email}.`)}).catch(he=>{re.error(he)}))}function xe(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent password reset email to ${d.email}?`,()=>re.collection(u.id).requestPasswordReset(d.email).then(()=>{Nt(`Successfully sent password reset email to ${d.email}.`)}).catch(he=>{re.error(he)}))}function bt(){o?un("You have unsaved changes. Do you really want to discard them?",()=>{kt()}):kt()}async function kt(){let he=d?structuredClone(d):null;if(he){he.id="",he.created="",he.updated="";const Me=(u==null?void 0:u.schema)||[];for(const mt of Me)mt.type==="file"&&delete he[mt.name]}ee(),L(he),await Qt(),t(28,T="")}function yt(he){(he.ctrlKey||he.metaKey)&&he.code=="KeyS"&&(he.preventDefault(),he.stopPropagation(),ce(!1))}const Ot=()=>R(),Ee=()=>Je(),Le=()=>xe(),ze=()=>bt(),_t=()=>Oe(),de=()=>t(13,C=Gi),ve=()=>t(13,C=bs),we=()=>Y(),Ye=()=>ee();function Vt(){m.id=this.value,t(3,m)}function dn(he){m=he,t(3,m)}function an(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function qn(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Li(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function ol(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function gi(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Ie(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Pt(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Ni(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Kn(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function rl(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Rl(he,Me){n.$$.not_equal(y[Me.name],he)&&(y[Me.name]=he,t(4,y))}function bi(he,Me){n.$$.not_equal(S[Me.name],he)&&(S[Me.name]=he,t(5,S))}function al(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}const fl=()=>o&&g?(un("You have unsaved changes. Do you really want to close the panel?",()=>{F()}),!1):(Zt({}),ee(),!0);function gt(he){te[he?"unshift":"push"](()=>{c=he,t(9,c)})}function rt(he){Ce.call(this,n,he)}function Mn(he){Ce.call(this,n,he)}return n.$$set=he=>{"collection"in he&&t(0,u=he.collection)},n.$$.update=()=>{var he;n.$$.dirty[0]&1&&t(14,i=(u==null?void 0:u.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((he=u==null?void 0:u.schema)!=null&&he.find(Me=>Me.type==="editor"))),n.$$.dirty[0]&48&&t(31,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&805306368|n.$$.dirty[1]&1&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(O||o)),n.$$.dirty[0]&536871040&&(D||U($)),n.$$.dirty[0]&1073741825&&u&&(I==null?void 0:I.id)!=(u==null?void 0:u.id)&&N()},[u,R,d,m,y,S,O,D,o,c,h,_,g,C,i,r,l,f,F,Y,ee,ce,Oe,Je,xe,bt,yt,L,T,$,I,s,Ot,Ee,Le,ze,_t,de,ve,we,Ye,Vt,dn,an,qn,Li,ol,gi,Ie,Pt,Ni,Kn,rl,Rl,bi,al,fl,gt,rt,Mn]}class Za extends ge{constructor(e){super(),_e(this,e,V8,z8,pe,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function B8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function U8(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("div"),t=b("div"),i=K(n[2]),l=M(),s=b("div"),o=K(n[1]),r=K(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(u,c){w(u,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(f=Se(Pe.call(null,e,n[3])),a=!0)},p(u,c){c&4&&se(i,u[2]),c&2&&se(o,u[1])},d(u){u&&v(e),a=!1,f()}}}function W8(n){let e;function t(s,o){return s[0]?U8:B8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function Y8(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class el extends ge{constructor(e){super(),_e(this,e,Y8,W8,pe,{date:0})}}function Km(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Jm(n,e,t){const i=n.slice();return i[13]=e[t],i}function Zm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Gm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function K8(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function J8(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function Z8(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function G8(n){let e,t;return{c(){e=b("div"),t=K(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function X8(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&se(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function Q8(n){let e,t=[],i=new Map,l,s,o=fe(n[16].slice(0,n[17]));const r=f=>f[8]+f[18];for(let f=0;fn[17]&&Qm();return{c(){var f;e=b("div");for(let u=0;uf[17]?a||(a=Qm(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||u&2)&&x(e,"multiple",((c=f[1].options)==null?void 0:c.maxSelect)!=1)},i(f){if(!s){for(let u=0;un[11]&&th();return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),p(e,"class","inline-flex")},m(u,c){w(u,e,c),r[t].m(e,null),k(e,l),f&&f.m(e,null),s=!0},p(u,c){let d=t;t=a(u),t===d?r[t].p(u,c):(ie(),A(r[d],1,1,()=>{r[d]=null}),le(),i=r[t],i?i.p(u,c):(i=r[t]=o[t](u),i.c()),E(i,1),i.m(e,l)),u[9].length>u[11]?f||(f=th(),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(e),r[t].d(),f&&f.d()}}}function eD(n){let e,t=[],i=new Map,l=fe(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function iD(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=K(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[Se(Pe.call(null,e,"Open in new tab")),J(e,"click",Tn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,$e(s)}}}function lD(n){let e,t;return{c(){e=b("span"),t=K(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function sD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function oD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function rD(n){let e,t,i,l;const s=[pD,dD],o=[];function r(a,f){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(ie(),A(o[u],1,1,()=>{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Xm(n,e){let t,i,l;return i=new Ka({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function Qm(n){let e;return{c(){e=K("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function aD(n){let e,t=fe(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&ih(n);return{c(){e=b("span"),i=K(t),l=M(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,f){w(a,e,f),k(e,i),w(a,l,f),r&&r.m(a,f),w(a,s,f),o=!0},p(a,f){(!o||f&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,f),f&8&&E(r,1)):(r=ih(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function pD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ih(n){let e,t;return e=new sl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mD(n){let e,t,i,l,s;const o=[rD,oD,sD,lD,iD,nD,tD,eD,x8,Q8,X8,G8],r=[];function a(u,c){return c&8&&(e=null),u[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(u[3])),e?1:u[1].type==="bool"?2:u[1].type==="number"?3:u[1].type==="url"?4:u[1].type==="editor"?5:u[1].type==="date"?6:u[1].type==="select"?7:u[1].type==="relation"?8:u[1].type==="file"?9:u[2]?10:11)}function f(u,c){return c===0?Z8(u):c===8?J8(u):c===9?K8(u):u}return t=a(n,-1),i=r[t]=o[t](f(n,t)),{c(){i.c(),l=ye()},m(u,c){r[t].m(u,c),w(u,l,c),s=!0},p(u,[c]){let d=t;t=a(u,c),t===d?r[t].p(f(u,t),c):(ie(),A(r[d],1,1,()=>{r[d]=null}),le(),i=r[t],i?i.p(f(u,t),c):(i=r[t]=o[t](f(u,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(u){s||(E(i),s=!0)},o(u){A(i),s=!1},d(u){u&&v(l),r[t].d(u)}}}function hD(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ce.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class xb extends ge{constructor(e){super(),_e(this,e,hD,mD,pe,{record:0,field:1,short:2})}}function lh(n,e,t){const i=n.slice();return i[13]=e[t],i}function sh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new xb({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=K(i),s=M(),o=b("td"),B(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(e,s),k(e,o),z(r,o,null),a=!0},p(f,u){(!a||u&1)&&i!==(i=f[13].name+"")&&se(l,i);const c={};u&1&&(c.field=f[13]),u&8&&(c.record=f[3]),r.$set(c)},i(f){a||(E(r.$$.fragment,f),a=!0)},o(f){A(r.$$.fragment,f),a=!1},d(f){f&&v(e),V(r)}}}function oh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].created),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function rh(n){let e,t,i,l,s,o;return s=new el({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),z(s,l,null),o=!0},p(r,a){const f={};a&8&&(f.date=r[3].updated),s.$set(f)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function _D(n){var O;let e,t,i,l,s,o,r,a,f,u,c=(n[3].id||"...")+"",d,m,h,_,g;a=new sl({props:{value:n[3].id}});let y=fe((O=n[0])==null?void 0:O.schema),S=[];for(let D=0;DA(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&oh(n),C=n[3].updated&&rh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),f=M(),u=b("span"),d=K(c),m=M();for(let D=0;D{$=null}),le()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=rh(D),C.c(),E(C,1),C.m(t,null)):C&&(ie(),A(C,1,1,()=>{C=null}),le()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;IClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function kD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[bD],header:[gD],default:[_D]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function yD(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return u(g),s==null?void 0:s.show()}function f(){return t(4,r=!1),s==null?void 0:s.hide()}async function u(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await re.collection(l.id).getOne(g)}catch(y){y.isAbort||(f(),console.warn("resolveModel:",y),ii(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>f();function m(g){te[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ce.call(this,n,g)}function _(g){Ce.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,f,s,o,r,i,a,d,m,h,_]}class vD extends ge{constructor(e){super(),_e(this,e,yD,kD,pe,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function ah(n,e,t){const i=n.slice();return i[63]=e[t],i}function fh(n,e,t){const i=n.slice();return i[66]=e[t],i}function uh(n,e,t){const i=n.slice();return i[66]=e[t],i}function ch(n,e,t){const i=n.slice();return i[59]=e[t],i}function dh(n){let e;function t(s,o){return s[13]?SD:wD}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function wD(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=J(t,"change",n[32]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function SD(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ph(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[$D]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $D(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&hh(n),r=i&&_h(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ye()},m(a,f){o&&o.m(a,f),w(a,t,f),r&&r.m(a,f),w(a,l,f),s=!0},p(a,f){f[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,f),f[0]&32&&E(o,1)):(o=hh(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(ie(),A(o,1,1,()=>{o=null}),le()),f[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,f),f[0]&32&&E(r,1)):(r=_h(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function hh(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[TD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function TD(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _h(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[CD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CD(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OD(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=K(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,f){f[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),f[0]&524288&&o!==(o=a[66].name+"")&&se(r,o)},d(a){a&&v(e)}}}function gh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[OD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Sn({props:r}),te.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f[0]&524288&&(u.class="col-type-"+e[66].type+" col-field-"+e[66].name),f[0]&524288&&(u.name=e[66].name),f[0]&524288|f[2]&512&&(u.$$scope={dirty:f,ctx:e}),!l&&f[0]&1&&(l=!0,u.sort=e[0],ke(()=>l=!1)),i.$set(u)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function bh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[MD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function MD(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[DD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function DD(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function vh(n){let e;function t(s,o){return s[13]?ID:ED}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ED(n){let e,t,i,l;function s(a,f){var u;if((u=a[1])!=null&&u.length)return LD;if(!a[10])return AD}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,f){o===(o=s(a))&&r?r.p(a,f):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function ID(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function wh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[J(i,"change",c),J(t,"click",Tn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,$e(u)}}}function Sh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&$h(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=K(r),f=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),z(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&se(a,r),d[9]?c?c.p(d,m):(c=$h(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function $h(n){let e;function t(s,o){return s[63].verified?PD:ND}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ND(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function PD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=Se(Pe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Th(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Ch(n),o=i&&Oh(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Ch(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Oh(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Ch(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?RD:FD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function FD(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&se(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function RD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Oh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?jD:qD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function qD(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=K(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&se(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function jD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Mh(n,e){let t,i,l,s;return i=new xb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function Dh(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Eh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Ih(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&wh(e),T=l&&Sh(e),$=e[9]&&Th(e),C=fe(e[19]);const O=F=>F[66].name;for(let F=0;F',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P{T=null}),le()),e[9]?$?$.p(e,N):($=Th(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=fe(e[19]),ie(),r=at(r,N,O,1,e,C,a,t,It,Mh,f,fh),le()),N[0]&288&&(u=e[8]&&!e[5].includes("@created")),u?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Dh(e),D.c(),E(D,1),D.m(t,c)):D&&(ie(),A(D,1,1,()=>{D=null}),le()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Eh(e),I.c(),E(I,1),I.m(t,m)):I&&(ie(),A(I,1,1,()=>{I=null}),le())},i(F){if(!_){E(T);for(let N=0;NU[66].name;for(let U=0;UU[10]?U[63]:U[63].id;for(let U=0;U{D=null}),le()),U[9]?I?(I.p(U,Y),Y[0]&512&&E(I,1)):(I=mh(U),I.c(),E(I,1),I.m(i,r)):I&&(ie(),A(I,1,1,()=>{I=null}),le()),Y[0]&524289&&(L=fe(U[19]),ie(),a=at(a,Y,R,1,U,L,f,i,It,gh,u,uh),le()),Y[0]&288&&(c=U[8]&&!U[5].includes("@created")),c?F?(F.p(U,Y),Y[0]&288&&E(F,1)):(F=bh(U),F.c(),E(F,1),F.m(i,d)):F&&(ie(),A(F,1,1,()=>{F=null}),le()),Y[0]&160&&(m=U[7]&&!U[5].includes("@updated")),m?N?(N.p(U,Y),Y[0]&160&&E(N,1)):(N=kh(U),N.c(),E(N,1),N.m(i,h)):N&&(ie(),A(N,1,1,()=>{N=null}),le()),U[16].length?P?P.p(U,Y):(P=yh(U),P.c(),P.m(_,null)):P&&(P.d(1),P=null),Y[0]&9971642&&(q=fe(U[3]),ie(),S=at(S,Y,H,1,U,q,T,y,It,Ih,$,ah),le(),!q.length&&W?W.p(U,Y):q.length?W&&(W.d(1),W=null):(W=vh(U),W.c(),W.m(y,$))),U[3].length&&U[18]?G?G.p(U,Y):(G=Ah(U),G.c(),G.m(y,null)):G&&(G.d(1),G=null),(!C||Y[0]&8192)&&x(e,"table-loading",U[13])},i(U){if(!C){E(D),E(I);for(let Y=0;Y({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function VD(n){let e,t,i=[],l=new Map,s,o,r=fe(n[16]);const a=f=>f[59].id+f[59].name;for(let f=0;f{i=null}),le())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Ph(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,f,u,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=K("Selected "),l=b("strong"),s=K(n[6]),o=M(),a=K(r),f=M(),u=b("button"),u.innerHTML='Reset',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(u,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,f),k(e,u),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[J(u,"click",n[47]),J(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&se(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&se(a,r),(!g||$[0]&16384)&&x(u,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,$e(S)}}}function UD(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[BD],default:[HD]},$$scope:{ctx:n}};e=new Qo({props:s}),n[46](e);let o=n[6]&&Ph(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ye()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const f={};a[0]&1030075|a[2]&512&&(f.$$scope={dirty:a,ctx:r}),e.$set(f),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=Ph(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(ie(),A(o,1,1,()=>{o=null}),le())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const WD=/^([\+\-])?(\w+)$/,Fh=40;function YD(n,e,t){let i,l,s,o,r,a,f,u,c,d,m,h;We(n,Rn,Ie=>t(53,h=Ie));const _=lt();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,O=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function H(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function W(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Ie=localStorage.getItem(q);Ie&&t(5,N=JSON.parse(Ie)||[])}catch{}}function G(Ie){return!!$.find(Pt=>Pt.id)}async function U(){const Ie=C;for(let Pt=1;Pt<=Ie;Pt++)(Pt===1||f)&&await Y(Pt,!1)}async function Y(Ie=1,Pt=!0){var al,fl,gt;if(!(g!=null&&g.id))return;t(13,I=!0);let Ni=y;const Kn=Ni.match(WD),rl=Kn?r.find(rt=>rt.name===Kn[2]):null;if(Kn&&rl){const rt=((gt=(fl=(al=h==null?void 0:h.find(he=>{var Me;return he.id==((Me=rl.options)==null?void 0:Me.collectionId)}))==null?void 0:al.schema)==null?void 0:fl.filter(he=>he.presentable))==null?void 0:gt.map(he=>he.name))||[],Mn=[];for(const he of rt)Mn.push((Kn[1]||"")+Kn[2]+"."+he);Mn.length>0&&(Ni=Mn.join(","))}const Rl=j.getAllCollectionIdentifiers(g),bi=o.map(rt=>rt.name+":excerpt(200)").concat(r.map(rt=>"expand."+rt.name+".*:excerpt(200)"));return bi.length&&bi.unshift("*"),re.collection(g.id).getList(Ie,Fh,{sort:Ni,skipTotal:1,filter:j.normalizeSearchFilter(S,Rl),expand:r.map(rt=>rt.name).join(","),fields:bi.join(","),requestKey:"records_list"}).then(async rt=>{var Mn;if(Ie<=1&&me(),t(13,I=!1),t(12,C=rt.page),t(28,O=rt.items.length),_("load",$.concat(rt.items)),o.length)for(let he of rt.items)he._partial=!0;if(Pt){const he=++R;for(;(Mn=rt.items)!=null&&Mn.length&&R==he;){const Me=rt.items.splice(0,20);for(let mt of Me)j.pushOrReplaceByKey($,mt);t(3,$),await j.yieldToMain()}}else{for(let he of rt.items)j.pushOrReplaceByKey($,he);t(3,$)}}).catch(rt=>{rt!=null&&rt.isAbort||(t(13,I=!1),console.warn(rt),me(),re.error(rt,!S||(rt==null?void 0:rt.status)!=400))})}function me(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,O=0),t(4,D={})}function ee(){c?ce():Oe()}function ce(){t(4,D={})}function Oe(){for(const Ie of $)t(4,D[Ie.id]=Ie,D);t(4,D)}function He(Ie){D[Ie.id]?delete D[Ie.id]:t(4,D[Ie.id]=Ie,D),t(4,D)}function Je(){un(`Do you really want to delete the selected ${u===1?"record":"records"}?`,xe)}async function xe(){if(L||!u||!(g!=null&&g.id))return;let Ie=[];for(const Pt of Object.keys(D))Ie.push(re.collection(g.id).delete(Pt));return t(14,L=!0),Promise.all(Ie).then(()=>{Nt(`Successfully deleted the selected ${u===1?"record":"records"}.`),_("delete",D),ce()}).catch(Pt=>{re.error(Pt)}).finally(()=>(t(14,L=!1),U()))}function bt(Ie){Ce.call(this,n,Ie)}const kt=(Ie,Pt)=>{Pt.target.checked?j.removeByValue(N,Ie.id):j.pushUnique(N,Ie.id),t(5,N)},yt=()=>ee();function Ot(Ie){y=Ie,t(0,y)}function Ee(Ie){y=Ie,t(0,y)}function Le(Ie){y=Ie,t(0,y)}function ze(Ie){y=Ie,t(0,y)}function _t(Ie){y=Ie,t(0,y)}function de(Ie){y=Ie,t(0,y)}function ve(Ie){te[Ie?"unshift":"push"](()=>{F=Ie,t(15,F)})}const we=Ie=>He(Ie),Ye=Ie=>_("select",Ie),Vt=(Ie,Pt)=>{Pt.code==="Enter"&&(Pt.preventDefault(),_("select",Ie))},dn=()=>t(1,S=""),an=()=>_("new"),qn=()=>Y(C+1);function Li(Ie){te[Ie?"unshift":"push"](()=>{T=Ie,t(11,T)})}const ol=()=>ce(),gi=()=>Je();return n.$$set=Ie=>{"collection"in Ie&&t(25,g=Ie.collection),"sort"in Ie&&t(0,y=Ie.sort),"filter"in Ie&&t(1,S=Ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",W(),me()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ie=>Ie.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ie=>Ie.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ie=>!N.includes(Ie.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&Y(1),n.$$.dirty[0]&268435456&&t(18,f=O>=Fh),n.$$.dirty[0]&16&&t(6,u=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&u===$.length),n.$$.dirty[0]&32&&N!==-1&&H(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ie=>({id:Ie.id,name:Ie.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,Y,$,D,N,u,m,d,l,i,T,C,I,L,F,P,c,f,a,_,ee,ce,He,Je,g,G,U,O,s,bt,kt,yt,Ot,Ee,Le,ze,_t,de,ve,we,Ye,Vt,dn,an,qn,Li,ol,gi]}class KD extends ge{constructor(e){super(),_e(this,e,YD,UD,pe,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function JD(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=K(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,f){w(a,e,f),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[f]){f&5&&s!==(s=(a[2]?"...":a[0])+"")&&se(o,s),f&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function ZD(n,e,t){const i=lt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function f(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const u=j.getAllCollectionIdentifiers(l),c=await re.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,u),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(u){u!=null&&u.isAbort||(t(2,a=!1),console.warn(u))}}}return n.$$set=u=>{"collection"in u&&t(3,l=u.collection),"filter"in u&&t(4,s=u.filter),"totalCount"in u&&t(0,o=u.totalCount),"class"in u&&t(1,r=u.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&f()},[o,r,a,l,s,f]}class GD extends ge{constructor(e){super(),_e(this,e,ZD,JD,pe,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function XD(n){let e,t,i,l;return e=new p6({}),i=new bn({props:{class:"flex-content",$$slots:{footer:[tE],default:[eE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function QD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xD(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[sE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Rh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[Se(Pe.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,$e(i)}}}function qh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eE(n){let e,t,i,l,s,o=n[2].name+"",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F=!n[12]&&Rh(n);c=new Xo({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&qh(n);y=new Cs({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(W){n[26](W)}function q(W){n[27](W)}let H={collection:n[2]};return n[0]!==void 0&&(H.filter=n[0]),n[1]!==void 0&&(H.sort=n[1]),C=new KD({props:H}),n[25](C),te.push(()=>be(C,"filter",P)),te.push(()=>be(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=K(o),a=M(),f=b("div"),F&&F.c(),u=M(),B(c.$$.fragment),d=M(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',_=M(),N&&N.c(),g=M(),B(y.$$.fragment),S=M(),T=b("div"),$=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(W,G){w(W,e,G),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,f),F&&F.m(f,null),k(f,u),z(c,f,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(W,g,G),z(y,W,G),w(W,S,G),w(W,T,G),w(W,$,G),z(C,W,G),I=!0,L||(R=J(h,"click",n[22]),L=!0)},p(W,G){(!I||G[0]&4)&&o!==(o=W[2].name+"")&&se(r,o),W[12]?F&&(F.d(1),F=null):F?F.p(W,G):(F=Rh(W),F.c(),F.m(f,u)),W[2].type!=="view"?N?N.p(W,G):(N=qh(W),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const U={};G[0]&1&&(U.value=W[0]),G[0]&4&&(U.autocompleteCollection=W[2]),y.$set(U);const Y={};G[0]&4&&(Y.collection=W[2]),!O&&G[0]&1&&(O=!0,Y.filter=W[0],ke(()=>O=!1)),!D&&G[0]&2&&(D=!0,Y.sort=W[1],ke(()=>D=!1)),C.$set(Y)},i(W){I||(E(c.$$.fragment,W),E(y.$$.fragment,W),E(C.$$.fragment,W),I=!0)},o(W){A(c.$$.fragment,W),A(y.$$.fragment,W),A(C.$$.fragment,W),I=!1},d(W){W&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),V(c),N&&N.d(),V(y,W),n[25](null),V(C,W),L=!1,R()}}}function tE(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new GD({props:s}),n[18](e),te.push(()=>be(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function nE(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=J(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function iE(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function lE(n){let e,t,i;function l(r,a){return r[12]?iE:nE}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function sE(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oE(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[xD,QD,XD],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ya({props:_}),n[31](l);let g={};o=new v6({props:g}),n[32](o);let y={collection:n[2]};a=new Za({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new vD({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),z(l,T,$),w(T,s,$),z(o,T,$),w(T,r,$),z(a,T,$),w(T,f,$),z(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(ie(),A(m[C],1,1,()=>{m[C]=null}),le(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const O={};l.$set(O);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),V(l,T),n[32](null),V(o,T),n[33](null),V(a,T),n[37](null),V(u,T)}}}function rE(n,e,t){let i,l,s,o,r,a,f;We(n,Yn,Ee=>t(2,l=Ee)),We(n,At,Ee=>t(39,s=Ee)),We(n,Oo,Ee=>t(3,o=Ee)),We(n,zo,Ee=>t(16,r=Ee)),We(n,Rn,Ee=>t(11,a=Ee)),We(n,Xi,Ee=>t(12,f=Ee));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;X1(T);async function C(Ee){await Qt(),(l==null?void 0:l.type)==="view"?h.show(Ee):m==null||m.show(Ee)}function O(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D(),c==null||c.forceHide(),d==null||d.hide()}async function D(){if(!S)return;const Ee=j.getAllCollectionIdentifiers(l),Le=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Le.filter(ze=>Ee.includes(ze)).length!=Le.length&&(Ee.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Ee={}){const Le=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Ee);j.replaceHashQueryParams(Le)}const L=()=>c==null?void 0:c.show();function R(Ee){te[Ee?"unshift":"push"](()=>{g=Ee,t(9,g)})}function F(Ee){$=Ee,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),H=()=>m==null?void 0:m.show(),W=Ee=>t(0,y=Ee.detail);function G(Ee){te[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function U(Ee){y=Ee,t(0,y)}function Y(Ee){S=Ee,t(1,S)}const me=Ee=>{I({recordId:Ee.detail.id});let Le=Ee.detail._partial?Ee.detail.id:Ee.detail;l.type==="view"?h==null||h.show(Le):m==null||m.show(Le)},ee=()=>{g==null||g.reload()},ce=()=>m==null?void 0:m.show();function Oe(Ee){te[Ee?"unshift":"push"](()=>{c=Ee,t(4,c)})}function He(Ee){te[Ee?"unshift":"push"](()=>{d=Ee,t(5,d)})}function Je(Ee){te[Ee?"unshift":"push"](()=>{m=Ee,t(6,m)})}const xe=()=>{I({recordId:null})},bt=Ee=>{y?g==null||g.reload():Ee.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},kt=Ee=>{(!y||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function yt(Ee){te[Ee?"unshift":"push"](()=>{h=Ee,t(7,h)})}const Ot=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&av(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&O(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(At,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,q,H,W,G,U,Y,me,ee,ce,Oe,He,Je,xe,bt,kt,yt,Ot]}class aE extends ge{constructor(e){super(),_e(this,e,rE,oE,pe,{},null,[-1,-1])}}function jh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=M(),i=b("a"),i.innerHTML=' Export collections',l=M(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(Ln.call(null,i,{path:"/settings/export-collections/?.*"})),Se(ln.call(null,i)),Se(Ln.call(null,s,{path:"/settings/import-collections/?.*"})),Se(ln.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function fE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O=!n[0]&&jh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',f=M(),u=b("a"),u.innerHTML=' Backups',c=M(),O&&O.c(),d=M(),m=b("div"),m.textContent="Authentication",h=M(),_=b("a"),_.innerHTML=' Auth providers',g=M(),y=b("a"),y.innerHTML=' Token options',S=M(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),O&&O.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[Se(Ln.call(null,l,{path:"/settings"})),Se(ln.call(null,l)),Se(Ln.call(null,o,{path:"/settings/mail/?.*"})),Se(ln.call(null,o)),Se(Ln.call(null,a,{path:"/settings/storage/?.*"})),Se(ln.call(null,a)),Se(Ln.call(null,u,{path:"/settings/backups/?.*"})),Se(ln.call(null,u)),Se(Ln.call(null,_,{path:"/settings/auth-providers/?.*"})),Se(ln.call(null,_)),Se(Ln.call(null,y,{path:"/settings/tokens/?.*"})),Se(ln.call(null,y)),Se(Ln.call(null,T,{path:"/settings/admins/?.*"})),Se(ln.call(null,T))],$=!0)},p(D,I){D[0]?O&&(O.d(1),O=null):O||(O=jh(),O.c(),O.m(e,d))},d(D){D&&v(e),O&&O.d(),$=!1,$e(C)}}}function uE(n){let e,t;return e=new Bb({props:{class:"settings-sidebar",$$slots:{default:[fE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cE(n,e,t){let i;return We(n,Xi,l=>t(0,i=l)),[i]}class _i extends ge{constructor(e){super(),_e(this,e,cE,uE,pe,{})}}function Hh(n,e,t){const i=n.slice();return i[31]=e[t],i}function zh(n){let e,t;return e=new ue({props:{class:"form-field readonly",name:"id",$$slots:{default:[dE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Gb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),f=M(),u=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),z(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),V(a)}}}function Vh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=J(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function pE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[3]),f||(u=J(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&oe(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function Bh(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle",$$slots:{default:[mE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Uh(n){let e,t,i,l,s,o,r,a,f;return l=new ue({props:{class:"form-field required",name:"password",$$slots:{default:[hE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[_E,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(t,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(t,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function hE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Xb({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),f=M(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),oe(r,n[9]),w(_,f,g),w(_,u,g),z(c,u,null),d=!0,m||(h=J(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&oe(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function _E(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[10]),f||(u=J(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&oe(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function gE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&zh(n),_=fe([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=Vh(Hh(n,_,T));a=new ue({props:{class:"form-field required",name:"email",$$slots:{default:[pE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Bh(n),S=(n[5]||n[4])&&Uh(n);return{c(){e=b("form"),h&&h.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=M(),B(a.$$.fragment),f=M(),y&&y.c(),u=M(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),z(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=J(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(ie(),A(h,1,1,()=>{h=null}),le()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=zh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=fe([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const D=Hh(T,_,O);g[O]?g[O].p(D,$):(g[O]=Vh(D),g[O].c(),g[O].m(o,null))}for(;O<10;O+=1)g[O].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(ie(),A(y,1,1,()=>{y=null}),le()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Bh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Uh(T),S.c(),E(S,1),S.m(e,null)):S&&(ie(),A(S,1,1,()=>{S=null}),le())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),ot(g,T),V(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function bE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=K(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&se(i,t)},d(l){l&&v(e)}}}function Wh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[kE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(t,"aria-hidden","true"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"aria-label","More admin options"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),z(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),V(o)}}}function kE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function yE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Wh(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=K(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=J(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(ie(),A(m,1,1,()=>{m=null}),le()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Wh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&se(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function vE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[yE],header:[bE],default:[gE]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function wE(n,e,t){let i,l;const s=lt(),o="admin_"+j.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Zt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let U;i?U=re.admins.create(G):U=re.admins.update(a.id,G),U.then(async Y=>{var me;t(8,u=!1),y(),Nt(i?"Successfully created admin.":"Successfully updated admin."),((me=re.authStore.model)==null?void 0:me.id)===Y.id&&re.authStore.save(re.authStore.token,Y),s("save",Y)}).catch(Y=>{re.error(Y)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&un("Do you really want to delete the selected admin?",()=>re.admins.delete(a.id).then(()=>{t(8,u=!1),y(),Nt("Successfully deleted admin."),s("delete",a)}).catch(G=>{re.error(G)}))}const O=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function q(G){te[G?"unshift":"push"](()=>{r=G,t(6,r)})}function H(G){Ce.call(this,n,G)}function W(G){Ce.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,O,D,I,L,R,F,N,P,q,H,W]}class SE extends ge{constructor(e){super(),_e(this,e,wE,vE,pe,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Yh(n,e,t){const i=n.slice();return i[24]=e[t],i}function $E(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kh(n){let e;function t(s,o){return s[5]?DE:ME}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ME(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Jh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Jh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function DE(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Zh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Gh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,O,D,I,L,R,F,N,P,q,H,W,G;u=new sl({props:{value:e[24].id}});let U=e[24].id===e[7].id&&Zh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Y(){return e[15](e[24])}function me(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),f=b("div"),B(u.$$.fragment),c=M(),d=b("span"),h=K(m),_=M(),U&&U.c(),g=M(),y=b("td"),S=b("span"),$=K(T),O=M(),D=b("td"),B(I.$$.fragment),L=M(),R=b("td"),B(F.$$.fragment),N=M(),P=b("td"),P.innerHTML='',q=M(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,ce){w(ee,t,ce),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),z(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),U&&U.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,O),k(t,D),z(I,D,null),k(t,L),k(t,R),z(F,R,null),k(t,N),k(t,P),k(t,q),H=!0,W||(G=[J(t,"click",Y),J(t,"keydown",me)],W=!0)},p(ee,ce){e=ee,(!H||ce&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Oe={};ce&16&&(Oe.value=e[24].id),u.$set(Oe),(!H||ce&16)&&m!==(m=e[24].id+"")&&se(h,m),e[24].id===e[7].id?U||(U=Zh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!H||ce&16)&&T!==(T=e[24].email+"")&&se($,T),(!H||ce&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};ce&16&&(He.date=e[24].created),I.$set(He);const Je={};ce&16&&(Je.date=e[24].updated),F.$set(Je)},i(ee){H||(E(u.$$.fragment,ee),E(I.$$.fragment,ee),E(F.$$.fragment,ee),H=!0)},o(ee){A(u.$$.fragment,ee),A(I.$$.fragment,ee),A(F.$$.fragment,ee),H=!1},d(ee){ee&&v(t),V(u),U&&U.d(),V(I),V(F),W=!1,$e(G)}}}function EE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],O=new Map,D;function I(Y){n[11](Y)}let L={class:"col-type-text",name:"id",$$slots:{default:[$E]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Sn({props:L}),te.push(()=>be(o,"sort",I));function R(Y){n[12](Y)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[TE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new Sn({props:F}),te.push(()=>be(f,"sort",R));function N(Y){n[13](Y)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[CE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new Sn({props:P}),te.push(()=>be(d,"sort",N));function q(Y){n[14](Y)}let H={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[OE]},$$scope:{ctx:n}};n[2]!==void 0&&(H.sort=n[2]),_=new Sn({props:H}),te.push(()=>be(_,"sort",q));let W=fe(n[4]);const G=Y=>Y[24].id;for(let Y=0;Yr=!1)),o.$set(ee);const ce={};me&134217728&&(ce.$$scope={dirty:me,ctx:Y}),!u&&me&4&&(u=!0,ce.sort=Y[2],ke(()=>u=!1)),f.$set(ce);const Oe={};me&134217728&&(Oe.$$scope={dirty:me,ctx:Y}),!m&&me&4&&(m=!0,Oe.sort=Y[2],ke(()=>m=!1)),d.$set(Oe);const He={};me&134217728&&(He.$$scope={dirty:me,ctx:Y}),!g&&me&4&&(g=!0,He.sort=Y[2],ke(()=>g=!1)),_.$set(He),me&186&&(W=fe(Y[4]),ie(),C=at(C,me,G,1,Y,W,O,$,It,Gh,null,Yh),le(),!W.length&&U?U.p(Y,me):W.length?U&&(U.d(1),U=null):(U=Kh(Y),U.c(),U.m($,null))),(!D||me&32)&&x(e,"table-loading",Y[5])},i(Y){if(!D){E(o.$$.fragment,Y),E(f.$$.fragment,Y),E(d.$$.fragment,Y),E(_.$$.fragment,Y);for(let me=0;me New admin',h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=M(),B(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),z(a,e,null),k(e,f),k(e,u),k(e,c),k(e,d),k(d,m),w(D,h,I),z(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),z(T,D,I),$=!0,C||(O=J(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&se(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),V(a),V(_,D),V(T,D),C=!1,O()}}}function AE(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=K("Total found: "),l=K(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&se(l,i)},d(s){s&&v(e)}}}function LE(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{footer:[AE],default:[IE]},$$scope:{ctx:n}}});let r={};return s=new SE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,[f]){const u={};f&134217982&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function NE(n,e,t){let i,l,s;We(n,zo,F=>t(21,i=F)),We(n,At,F=>t(6,l=F)),We(n,Oa,F=>t(7,s=F)),xt(At,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],f=!1,u=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,f=!0),t(4,a=[]);const F=j.normalizeSearchFilter(u,["id","email","created","updated"]);return re.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,f=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,f=!1),console.warn(N),m(),re.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,u=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),O=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,u="");function I(F){te[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&u!==-1){const F=new URLSearchParams({filter:u,sort:c}).toString();tl("/settings/admins?"+F),d()}},[d,u,c,r,a,f,l,s,h,_,g,y,S,T,$,C,O,D,I,L,R]}class PE extends ge{constructor(e){super(),_e(this,e,NE,LE,pe,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function FE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0]),s.focus(),r||(a=J(s,"input",n[4]),r=!0)},p(f,u){u&256&&i!==(i=f[8])&&p(e,"for",i),u&256&&o!==(o=f[8])&&p(s,"id",o),u&1&&s.value!==f[0]&&oe(s,f[0])},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function RE(n){let e,t,i,l,s,o,r,a,f,u,c;return{c(){e=b("label"),t=K("Password"),l=M(),s=b("input"),r=M(),a=b("div"),f=b("a"),f.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[1]),w(d,r,m),w(d,a,m),k(a,f),u||(c=[J(s,"input",n[5]),Se(ln.call(null,f))],u=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&oe(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),u=!1,$e(c)}}}function qE(n){let e,t,i,l,s,o,r,a,f,u,c;return l=new ue({props:{class:"form-field required",name:"identity",$$slots:{default:[FE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field required",name:"password",$$slots:{default:[RE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),k(e,a),f=!0,u||(c=J(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),V(o),u=!1,c()}}}function jE(n){let e,t;return e=new Q1({props:{$$slots:{default:[qE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function HE(n,e,t){let i;We(n,zo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),re.admins.authWithPassword(s,o).then(()=>{Ta(),tl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class zE extends ge{constructor(e){super(),_e(this,e,HE,jE,pe,{})}}function VE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new ue({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[UE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[WE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new ue({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[YE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Xh(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),u=b("div"),c=b("div"),d=M(),$&&$.c(),m=M(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,O){w(C,e,O),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),z(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=J(h,"click",n[12]),S=!0)},p(C,O){const D={};O&786433&&(D.$$scope={dirty:O,ctx:C}),i.$set(D);const I={};O&786433&&(I.$$scope={dirty:O,ctx:C}),o.$set(I);const L={};O&786433&&(L.$$scope={dirty:O,ctx:C}),a.$set(L),C[3]?$?$.p(C,O):($=Xh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||O&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||O&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),V(i),V(o),V(a),$&&$.d(),S=!1,T()}}}function BE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function UE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].meta.appName),r||(a=J(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&oe(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function WE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].meta.appUrl),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&oe(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function YE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[10]),Se(Pe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function Xh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function KE(n){let e,t,i,l,s,o,r,a,f;const u=[BE,VE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=J(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(ie(),A(c[_],1,1,()=>{c[_]=null}),le(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function JE(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[KE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function ZE(n,e,t){let i,l,s,o;We(n,Xi,C=>t(13,l=C)),We(n,Do,C=>t(14,s=C)),We(n,At,C=>t(15,o=C)),xt(At,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await re.settings.getAll()||{};h(C)}catch(C){re.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await re.settings.update(j.filterRedactedProps(a));h(C),Nt("Successfully saved application settings.")}catch(C){re.error(C)}t(2,u=!1)}}function h(C={}){var O,D;xt(Do,s=(O=C==null?void 0:C.meta)==null?void 0:O.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class GE extends ge{constructor(e){super(),_e(this,e,ZE,JE,pe,{})}}function XE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),l.autofocus&&l.focus(),s||(o=[Se(Pe.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],s=!0)},p(f,u){ni(l,a=dt(r,[{readOnly:!0},{type:"text"},u&2&&{placeholder:f[1]},u&32&&f[5]]))},d(f){f&&(v(e),v(i),v(l)),s=!1,$e(o)}}}function xE(n){let e;function t(s,o){return s[3]?QE:XE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function eI(n,e,t){const i=["value","mask"];let l=Xe(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function f(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const u=()=>f();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ae(Ae({},e),Kt(m)),t(5,l=Xe(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,f,l,u,c,d]}class Ga extends ge{constructor(e){super(),_e(this,e,eI,xE,pe,{value:0,mask:1})}}function tI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;return{c(){e=b("label"),t=K("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=K(`, - `),d=b("button"),d.textContent="{APP_URL} ",m=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),re(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),h||(_=[J(s,"input",n[13]),J(u,"click",n[14]),J(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&re(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,$e(_)}}}function nI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y;return{c(){e=b("label"),t=K("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: + `),d=b("button"),d.textContent="{APP_URL} ",m=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),oe(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),h||(_=[J(s,"input",n[13]),J(u,"click",n[14]),J(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&oe(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,$e(_)}}}function nI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y;return{c(){e=b("label"),t=K("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),f=K(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=K(`, `),d=b("button"),d.textContent="{APP_URL} ",m=K(`, - `),h=b("button"),h.textContent="{TOKEN} ",_=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),re(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[J(s,"input",n[16]),J(u,"click",n[17]),J(d,"click",n[18]),J(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&re(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,$e(y)}}}function iI(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),re(e,n[0].body),i||(l=J(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&re(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function lI(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Dt(o,r(n)),ee.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){le();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),se()}o?(e=Dt(o,r(a)),ee.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function sI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;const C=[lI,iI],O=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=O[s]=C[s](n),{c(){e=b("label"),t=K("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),f=K(`Available placeholder parameters: + `),h=b("button"),h.textContent="{TOKEN} ",_=K("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),oe(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[J(s,"input",n[16]),J(u,"click",n[17]),J(d,"click",n[18]),J(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&oe(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,$e(y)}}}function iI(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),oe(e,n[0].body),i||(l=J(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&oe(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function lI(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Et(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),le()}o?(e=Et(o,r(a)),te.push(()=>be(e,"value",s)),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function sI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;const C=[lI,iI],O=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=O[s]=C[s](n),{c(){e=b("label"),t=K("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),f=K(`Available placeholder parameters: `),u=b("button"),u.textContent="{APP_NAME} ",c=K(`, `),d=b("button"),d.textContent="{APP_URL} ",m=K(`, `),h=b("button"),h.textContent="{TOKEN} ",_=K(`, - `),g=b("button"),g.textContent="{ACTION_URL} ",y=K("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[J(u,"click",n[22]),J(d,"click",n[23]),J(h,"click",n[24]),J(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(le(),A(O[R],1,1,()=>{O[R]=null}),se(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function oI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[tI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[nI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[sI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function rI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&oe(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Qh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(le(),A(u,1,1,()=>{u=null}),se())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function aI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[rI],default:[oI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-iXaWdysu.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),Co(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){ee[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ie(Ie({},e),Yt(Y)),t(8,s=Ge(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Xa extends ge{constructor(e){super(),_e(this,e,fI,aI,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function e_(n,e,t){const i=n.slice();return i[21]=e[t],i}function t_(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=k0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,re(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function uI(n){let e=[],t=new Map,i,l=ue(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[cI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function pI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function hI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mI],header:[pI],default:[dI]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Rr="last_email_test",n_="email_test_request";function _I(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Rr)),t(2,f=I||o[0].value),Jt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{ae.cancelRequest(n_),ii("Test email send timeout.")},3e4);try{await ae.settings.testEmail(a,f,{$cancelKey:n_}),Lt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),ae.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){ee[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class gI extends ge{constructor(e){super(),_e(this,e,_I,hI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function bI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&i_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&l_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&s_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[wI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&o_(n);function L(N,P){return N[5]?LI:AI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(le(),A(C,1,1,()=>{C=null}),se()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=i_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(le(),A(O,1,1,()=>{O=null}),se()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=l_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(le(),A(D,1,1,()=>{D=null}),se()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=s_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=o_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(le(),A(I,1,1,()=>{I=null}),se()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function kI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&re(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&re(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function i_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function s_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Xa({props:s}),ee.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[SI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$I,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[TI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[CI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?MI:OI}let O=C(n),D=O(n),I=n[4]&&r_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=r_(L),I.c(),E(I,1),I.m(e,null)):I&&(le(),A(I,1,1,()=>{I=null}),se())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function SI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&re(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&re(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function TI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&re(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function OI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function MI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[EI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[II,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function DI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function EI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),ee.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function II(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),re(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&re(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function AI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function NI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[kI,bI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&oe(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function PI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}});let r={};return s=new gI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function FI(n,e,t){let i,l,s;We(n,It,te=>t(6,s=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(It,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const te=await ae.settings.getAll()||{};g(te)}catch(te){ae.error(te)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const te=await ae.settings.update(j.filterRedactedProps(u));g(te),Jt({}),Lt("Successfully saved mail settings.")}catch(te){ae.error(te)}t(3,d=!1)}}function g(te={}){t(0,u={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(te){n.$$.not_equal(u.meta.verificationTemplate,te)&&(u.meta.verificationTemplate=te,t(0,u))}function C(te){n.$$.not_equal(u.meta.resetPasswordTemplate,te)&&(u.meta.resetPasswordTemplate=te,t(0,u))}function O(te){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,te)&&(u.meta.confirmEmailChangeTemplate=te,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(te){n.$$.not_equal(u.smtp.password,te)&&(u.smtp.password=te,t(0,u))}const N=()=>{t(4,m=!m)};function P(te){n.$$.not_equal(u.smtp.tls,te)&&(u.smtp.tls=te,t(0,u))}function q(te){n.$$.not_equal(u.smtp.authMethod,te)&&(u.smtp.authMethod=te,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function ie(te){ee[te?"unshift":"push"](()=>{a=te,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,ie]}class RI extends ge{constructor(e){super(),_e(this,e,FI,PI,me,{},null,[-1,-1])}}const qI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),a_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function jI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&oe(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function f_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[VI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[BI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[UI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[WI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function HI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&re(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&re(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&re(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&re(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function UI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function WI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function YI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[jI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=wt(o,n,n[15],a_);let a=n[0].enabled&&f_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&$t(r,o,f,f[15],s?St(o,f[15],u,qI):Tt(f[15]),a_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=f_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(le(),A(a,1,1,()=>{a=null}),se())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const qr="s3_test_request";function KI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;ae.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{ae.cancelRequest(qr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await ae.settings.testS3(f,{$cancelKey:qr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}Ht(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class e0 extends ge{constructor(e){super(),_e(this,e,KI,YI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function JI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[GI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new e0({props:$}),ee.push(()=>be(e,"config",y)),ee.push(()=>be(e,"isTesting",S)),ee.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&c_(n),O=n[6]&&d_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=c_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=d_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function ZI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function u_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually + `),g=b("button"),g.textContent="{ACTION_URL} ",y=K("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,f),k(a,u),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[J(u,"click",n[22]),J(d,"click",n[23]),J(h,"click",n[24]),J(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(ie(),A(O[R],1,1,()=>{O[R]=null}),le(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,$e($)}}}function oI(n){let e,t,i,l,s,o;return e=new ue({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[tI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ue({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[nI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ue({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[sI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Se(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function rI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Qh();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=K(n[2]),o=M(),r=b("div"),a=M(),u&&u.c(),f=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),u&&u.m(c,d),w(c,f,d)},p(c,d){d[0]&4&&se(s,c[2]),c[6]?u?d[0]&64&&E(u,1):(u=Qh(),u.c(),E(u,1),u.m(f.parentNode,f)):u&&(ie(),A(u,1,1,()=>{u=null}),le())},d(c){c&&(v(e),v(o),v(r),v(a),v(f)),u&&u.d(c)}}}function aI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[rI],default:[oI]},$$scope:{ctx:n}};for(let s=0;st(12,o=Y));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=xh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:Y}=await import("./CodeEditor-CiCm0ZL1.js");return{default:Y}},__vite__mapDeps([2,1]),import.meta.url)).default),xh=c,t(5,d=!1))}function y(Y){j.copyToClipboard(Y),Co(`Copied ${Y} to clipboard`,2e3)}g();function S(){f.subject=this.value,t(0,f)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){f.actionUrl=this.value,t(0,f)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(Y){n.$$.not_equal(f.body,Y)&&(f.body=Y,t(0,f))}function R(){f.body=this.value,t(0,f)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function H(Y){te[Y?"unshift":"push"](()=>{u=Y,t(3,u)})}function W(Y){Ce.call(this,n,Y)}function G(Y){Ce.call(this,n,Y)}function U(Y){Ce.call(this,n,Y)}return n.$$set=Y=>{e=Ae(Ae({},e),Kt(Y)),t(8,s=Xe(e,l)),"key"in Y&&t(1,r=Y.key),"title"in Y&&t(2,a=Y.title),"config"in Y&&t(0,f=Y.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(f.enabled||li(r))},[f,r,a,u,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U]}class Xa extends ge{constructor(e){super(),_e(this,e,fI,aI,pe,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function e_(n,e,t){const i=n.slice();return i[21]=e[t],i}function t_(n,e){let t,i,l,s,o,r=e[21].label+"",a,f,u,c,d,m;return c=k0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=K(r),u=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,oe(i,i.__value),p(o,"for",f=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,u),d||(m=J(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&f!==(f=e[20]+e[21].value)&&p(o,"for",f)},d(h){h&&v(t),c.r(),d=!1,m()}}}function uI(n){let e=[],t=new Map,i,l=fe(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ue({props:{class:"form-field required m-0",name:"email",$$slots:{default:[cI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,f){w(a,e,f),z(t,e,null),k(e,i),z(l,e,null),s=!0,o||(r=J(e,"submit",Be(n[13])),o=!0)},p(a,f){const u={};f&17825796&&(u.$$scope={dirty:f,ctx:a}),t.$set(u);const c={};f&17825794&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function pI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=J(e,"click",n[0]),f=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),f=!1,u()}}}function hI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mI],header:[pI],default:[dI]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Rr="last_email_test",n_="email_test_request";function _I(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),f=o[0].value,u=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(Rr)),t(2,f=I||o[0].value),Zt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||u)){t(4,u=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{re.cancelRequest(n_),ii("Test email send timeout.")},3e4);try{await re.settings.testEmail(a,f,{$cancelKey:n_}),Nt("Successfully sent test email."),l("submit"),t(4,u=!1),await Qt(),m()}catch(D){t(4,u=!1),re.error(D)}clearTimeout(c)}}const _=[[]];function g(){f=this.__value,t(2,f)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!u;function $(D){te[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!f)},[m,a,f,r,u,i,s,o,h,d,g,_,y,S,T,$,C,O]}class gI extends ge{constructor(e){super(),_e(this,e,_I,hI,pe,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function bI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;i=new ue({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&i_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&l_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&s_(n);h=new ue({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[wI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&o_(n);function L(N,P){return N[5]?LI:AI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),f=M(),O&&O.c(),u=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),B(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,f),O&&O.m(a,null),k(a,u),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),z(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const H={};P[0]&1|P[1]&24&&(H.$$scope={dirty:P,ctx:N}),o.$set(H),N[0].meta.verificationTemplate.hidden?C&&(ie(),A(C,1,1,()=>{C=null}),le()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=i_(N),C.c(),E(C,1),C.m(a,f)),N[0].meta.resetPasswordTemplate.hidden?O&&(ie(),A(O,1,1,()=>{O=null}),le()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=l_(N),O.c(),E(O,1),O.m(a,u)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(ie(),A(D,1,1,()=>{D=null}),le()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=s_(N),D.c(),E(D,1),D.m(a,null));const W={};P[0]&1|P[1]&24&&(W.$$scope={dirty:P,ctx:N}),h.$set(W),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=o_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(ie(),A(I,1,1,()=>{I=null}),le()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),V(i),V(o),C&&C.d(),O&&O.d(),D&&D.d(),V(h,N),I&&I.d(N),F.d()}}}function kI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].meta.senderName),r||(a=J(s,"input",n[13]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderName&&oe(s,f[0].meta.senderName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].meta.senderAddress),r||(a=J(s,"input",n[14]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].meta.senderAddress&&oe(s,f[0].meta.senderAddress)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function i_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new Xa({props:s}),te.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new Xa({props:s}),te.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function s_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new Xa({props:s}),te.push(()=>be(e,"config",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[18]),Se(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],f=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function o_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$;l=new ue({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[SI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$I,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),u=new ue({props:{class:"form-field",name:"smtp.username",$$slots:{default:[TI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ue({props:{class:"form-field",name:"smtp.password",$$slots:{default:[CI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?MI:OI}let O=C(n),D=O(n),I=n[4]&&r_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),f=b("div"),B(u.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(f,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),k(t,a),k(t,f),z(u,f,null),k(t,c),k(t,d),z(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=J(_,"click",Be(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),u.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=r_(L),I.c(),E(I,1),I.m(e,null)):I&&(ie(),A(I,1,1,()=>{I=null}),le())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(u.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(u.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(u),V(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function SI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].smtp.host),r||(a=J(s,"input",n[19]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.host&&oe(s,f[0].smtp.host)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].smtp.port),r||(a=J(s,"input",n[20]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&it(s.value)!==f[0].smtp.port&&oe(s,f[0].smtp.port)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function TI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].smtp.username),r||(a=J(s,"input",n[21]),r=!0)},p(f,u){u[1]&8&&i!==(i=f[34])&&p(e,"for",i),u[1]&8&&o!==(o=f[34])&&p(s,"id",o),u[0]&1&&s.value!==f[0].smtp.username&&oe(s,f[0].smtp.username)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function CI(n){let e,t,i,l,s,o,r;function a(u){n[22](u)}let f={id:n[34]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),s=new Ga({props:f}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.value=u[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function OI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function MI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function r_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return i=new ue({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[EI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),f=new ue({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[II,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),f.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(f.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),V(i),V(o),V(f),h&&d&&d.end()}}}function DI(n){let e,t,i,l,s,o,r;function a(u){n[24](u)}let f={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),s=new hi({props:f}),te.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function EI(n){let e,t,i,l,s,o,r;function a(u){n[25](u)}let f={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(f.keyOfSelected=n[0].smtp.authMethod),s=new hi({props:f}),te.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=K("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c[1]&8&&i!==(i=u[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=u[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=u[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function II(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[0].smtp.localName),f||(u=[Se(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),J(r,"input",n[26])],f=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&oe(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),f=!1,$e(u)}}}function AI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=[J(e,"click",n[27]),J(l,"click",n[28])],r=!0)},p(f,u){u[0]&8&&(e.disabled=f[3]),u[0]&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u[0]&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,$e(a)}}}function NI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[kI,bI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[6]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&se(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(ie(),A(S[O],1,1,()=>{S[O]=null}),le(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function PI(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}});let r={};return s=new gI({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&127|f[1]&16&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function FI(n,e,t){let i,l,s;We(n,At,ee=>t(6,s=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(At,s="Mail settings",s);let a,f={},u={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const ee=await re.settings.getAll()||{};g(ee)}catch(ee){re.error(ee)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const ee=await re.settings.update(j.filterRedactedProps(u));g(ee),Zt({}),Nt("Successfully saved mail settings.")}catch(ee){re.error(ee)}t(3,d=!1)}}function g(ee={}){t(0,u={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),u.smtp.authMethod||t(0,u.smtp.authMethod=r[0].value,u),t(11,f=JSON.parse(JSON.stringify(u)))}function y(){t(0,u=JSON.parse(JSON.stringify(f||{})))}function S(){u.meta.senderName=this.value,t(0,u)}function T(){u.meta.senderAddress=this.value,t(0,u)}function $(ee){n.$$.not_equal(u.meta.verificationTemplate,ee)&&(u.meta.verificationTemplate=ee,t(0,u))}function C(ee){n.$$.not_equal(u.meta.resetPasswordTemplate,ee)&&(u.meta.resetPasswordTemplate=ee,t(0,u))}function O(ee){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ee)&&(u.meta.confirmEmailChangeTemplate=ee,t(0,u))}function D(){u.smtp.enabled=this.checked,t(0,u)}function I(){u.smtp.host=this.value,t(0,u)}function L(){u.smtp.port=it(this.value),t(0,u)}function R(){u.smtp.username=this.value,t(0,u)}function F(ee){n.$$.not_equal(u.smtp.password,ee)&&(u.smtp.password=ee,t(0,u))}const N=()=>{t(4,m=!m)};function P(ee){n.$$.not_equal(u.smtp.tls,ee)&&(u.smtp.tls=ee,t(0,u))}function q(ee){n.$$.not_equal(u.smtp.authMethod,ee)&&(u.smtp.authMethod=ee,t(0,u))}function H(){u.smtp.localName=this.value,t(0,u)}const W=()=>y(),G=()=>_(),U=()=>a==null?void 0:a.show(),Y=()=>_();function me(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(f)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(u))},[u,a,c,d,m,l,s,o,r,_,y,f,i,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G,U,Y,me]}class RI extends ge{constructor(e){super(),_e(this,e,FI,PI,pe,{},null,[-1,-1])}}const qI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),a_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function jI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[0].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[8]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&1&&(e.checked=f[0].enabled),u&16&&se(s,f[4]),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function f_(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ue({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[HI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ue({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),f=new ue({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[VI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ue({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[BI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ue({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[UI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ue({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[WI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(f.$$.fragment),u=M(),c=b("div"),B(d.$$.fragment),m=M(),h=b("div"),B(_.$$.fragment),g=M(),y=b("div"),B(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),k(e,a),z(f,a,null),k(e,u),k(e,c),z(d,c,null),k(e,m),k(e,h),z(_,h,null),k(e,g),k(e,y),z(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),f.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(f.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(f.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),V(i),V(o),V(f),V(d),V(_),V(S),D&&C&&C.end()}}}function HI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].endpoint),r||(a=J(s,"input",n[9]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].endpoint&&oe(s,f[0].endpoint)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].bucket),r||(a=J(s,"input",n[10]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].bucket&&oe(s,f[0].bucket)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function VI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].region),r||(a=J(s,"input",n[11]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].region&&oe(s,f[0].region)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function BI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[0].accessKey),r||(a=J(s,"input",n[12]),r=!0)},p(f,u){u&1048576&&i!==(i=f[20])&&p(e,"for",i),u&1048576&&o!==(o=f[20])&&p(s,"id",o),u&1&&s.value!==f[0].accessKey&&oe(s,f[0].accessKey)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function UI(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),s=new Ga({props:f}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),!o&&c&1&&(o=!0,d.value=u[0].secret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function WI(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[J(e,"change",n[14]),Se(Pe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],f=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,$e(u)}}}function YI(n){let e,t,i,l,s;e=new ue({props:{class:"form-field form-field-toggle",$$slots:{default:[jI,({uniqueId:f})=>({20:f}),({uniqueId:f})=>f?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=St(o,n,n[15],a_);let a=n[0].enabled&&f_(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(f,u){z(e,f,u),w(f,t,u),r&&r.m(f,u),w(f,i,u),a&&a.m(f,u),w(f,l,u),s=!0},p(f,[u]){const c={};u&1081361&&(c.$$scope={dirty:u,ctx:f}),e.$set(c),r&&r.p&&(!s||u&32775)&&Tt(r,o,f,f[15],s?$t(o,f[15],u,qI):Ct(f[15]),a_),f[0].enabled?a?(a.p(f,u),u&1&&E(a,1)):(a=f_(f),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(ie(),A(a,1,1,()=>{a=null}),le())},i(f){s||(E(e.$$.fragment,f),E(r,f),E(a),s=!0)},o(f){A(e.$$.fragment,f),A(r,f),A(a),s=!1},d(f){f&&(v(t),v(i),v(l)),V(e,f),r&&r.d(f),a&&a.d(f)}}}const qr="s3_test_request";function KI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:f="storage"}=e,{testError:u=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,u=null),!o.enabled)return t(2,c=!1),u;re.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{re.cancelRequest(qr),t(1,u=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await re.settings.testS3(f,{$cancelKey:qr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,u=D),t(2,c=!1),clearTimeout(d)),u}zt(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,f=D.testFilesystem),"testError"in D&&t(1,u=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,u,c,r,a,s,f,i,g,y,S,T,$,C,O,l]}class e0 extends ge{constructor(e){super(),_e(this,e,KI,YI,pe,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function JI(n){var D;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[GI]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new e0({props:$}),te.push(()=>be(e,"config",y)),te.push(()=>be(e,"isTesting",S)),te.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&c_(n),O=n[6]&&d_(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),f=M(),O&&O.c(),u=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){z(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,f),O&&O.m(o,null),k(o,u),k(o,c),k(c,d),h=!0,_||(g=J(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=c_(I),C.c(),C.m(o,f)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=d_(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),V(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function ZI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function u_(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",f,u,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=K(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),f=K(a),u=K(` to the @@ -127,26 +127,26 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),y=b("a"),y.textContent=`rclone `,S=K(`, `),T=b("a"),T.textContent=`s5cmd - `,$=K(", etc."),C=M(),O=b("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(O,"class","clearfix m-t-base")},m(R,F){w(R,e,F),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(r,f),k(s,u),k(s,c),k(c,m),k(s,h),k(s,_),k(s,g),k(s,y),k(s,S),k(s,T),k(s,$),k(e,C),k(e,O),I=!0},p(R,F){var N;(!I||F&1)&&a!==(a=(N=R[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&oe(f,a),(!I||F&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(R){I||(R&&Ke(()=>{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function GI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&u_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=u_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(le(),A(t,1,1,()=>{t=null}),se())},d(l){l&&v(e),t&&t.d(l)}}}function c_(n){let e;function t(s,o){return s[4]?xI:s[5]?QI:XI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function XI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function QI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function xI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function d_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function eA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[ZI,JI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

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

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

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[16])),_=!0)},p($,C){(!h||C&128)&&oe(o,$[7]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function tA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[eA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const nA="s3_test_request";function iA(n,e,t){let i,l,s;We(n,It,O=>t(7,s=O)),xt(It,s="Files storage",s);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await ae.settings.getAll()||{};h(O)}catch(O){ae.error(O)}t(2,a=!1)}async function m(){if(!(f||!l)){t(3,f=!0);try{ae.cancelRequest(nA);const O=await ae.settings.update(j.filterRedactedProps(r));Jt({}),await h(O),Ta(),c?rv("Successfully saved but failed to establish S3 connection."):Lt("Successfully saved files storage settings.")}catch(O){ae.error(O)}t(3,f=!1)}}async function h(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){u=O,t(4,u)}function S(O){c=O,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,f,u,c,l,s,m,_,i,g,y,S,T,$,C]}class lA extends ge{constructor(e){super(),_e(this,e,iA,tA,me,{})}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&2&&(e.checked=f[1].enabled),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function oA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),re(s,n[1].clientId),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&1048576&&i!==(i=u[20])&&p(e,"for",i),c&1048576&&o!==(o=u[20])&&p(s,"id",o),c&2&&r!==(r=u[1].enabled)&&(s.required=r),c&2&&s.value!==u[1].clientId&&re(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function rA(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(f.value=n[1].clientSecret),s=new Ga({props:f}),ee.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),c&2&&(d.required=u[1].enabled),!o&&c&2&&(o=!0,d.value=u[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function p_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(f){n[14](f)}var r=n[3].optionsComponent;function a(f,u){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(f,u){w(f,e,u),t&&z(t,e,null),l=!0},p(f,u){if(u&8&&r!==(r=f[3].optionsComponent)){if(t){le();const c=t;A(c.$$.fragment,1,0,()=>{V(c,1)}),se()}r?(t=Dt(r,a(f,u)),ee.push(()=>be(t,"config",o)),B(t.$$.fragment),E(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=u&8?pt(s,[{key:f[3].key},Ot(f[3].optionsComponentProps||{})]):{};!i&&u&2&&(i=!0,c.config=f[1],ke(()=>i=!1)),t.$set(c)}},i(f){l||(t&&E(t.$$.fragment,f),l=!0)},o(f){t&&A(t.$$.fragment,f),l=!1},d(f){f&&v(e),t&&V(t)}}}function aA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ce({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[sA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[oA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[rA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&p_(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(t,l),k(t,s),k(e,o),z(r,e,null),k(e,a),z(f,e,null),k(e,u),h&&h.m(e,null),c=!0,d||(m=[J(s,"click",n[8]),J(e,"submit",Be(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=p_(_),h.c(),E(h,1),h.m(e,null)):h&&(le(),A(h,1,1,()=>{h=null}),se())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(f.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(f.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),V(i),V(r),V(f),h&&h.d(),d=!1,$e(m)}}}function fA(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=K(t),l=K(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&oe(i,t)},d(s){s&&v(e)}}}function uA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function cA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[uA],header:[fA],default:[aA]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function dA(n,e,t){let i;const l=lt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},f=!1,u="";function c(D,I){Jt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,u=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,f=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await ae.settings.update(D);Jt({}),Lt("Successfully updated provider settings."),l("submit",I),d()}catch(D){ae.error(D)}t(4,f=!1)}function h(){var D;for(let I in a)t(1,a[I]=j.zeroValue(a[I]),a);(D=r.key)!=null&&D.startsWith("oidc")?t(1,a.pkce=!1,a):t(1,a.pkce=null,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){ee[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,s,m,h,c,u,_,g,y,S,T,$,C,O]}class pA extends ge{constructor(e){super(),_e(this,e,dA,cA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function m_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function h_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mA(n){let e,t,i,l,s=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&m_(n),O=n[0].enabled&&h_(),D={};return y=new pA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=K(s),r=M(),a=b("em"),f=K("("),c=K(u),d=K(")"),m=M(),O&&O.c(),h=M(),_=b("button"),_.innerHTML='',g=M(),B(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,f),k(a,c),k(a,d),k(e,m),O&&O.m(e,null),k(e,h),k(e,_),w(I,g,L),z(y,I,L),S=!0,T||($=J(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=m_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&oe(o,s),(!S||L&2)&&u!==(u=I[1].key.slice(0,-4)+"")&&oe(c,u),I[0].enabled?O||(O=h_(),O.c(),O.m(e,h)):O&&(O.d(1),O=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),O&&O.d(),n[4](null),V(y,I),T=!1,$()}}}function hA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0,pkce:l.clientId?l.pkce:null}))};function r(f){ee[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{f.detail[i.key]&&t(0,l=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class t0 extends ge{constructor(e){super(),_e(this,e,hA,mA,me,{provider:1,config:0})}}function __(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function g_(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function _A(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,f,u=ue(n[3]);const c=_=>_[9].key;for(let _=0;_0&&n[2].length>0&&k_(),m=ue(n[2]);const h=_=>_[9].key;for(let _=0;_0&&_[2].length>0?d||(d=k_(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=ue(_[2]),le(),r=at(r,g,h,1,_,m,a,o,Et,y_,null,__),se())},i(_){if(!f){for(let g=0;gbe(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!l&&u&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function k_(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function y_(n,e){let t,i,l,s,o;function r(f){e[6](f,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new t0({props:a}),ee.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!l&&u&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function bA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;const _=[gA,_A],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("div"),u=b("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","m-b-base"),p(f,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,f),k(f,u),k(f,c),g[d].m(f,null),h=!0},p(S,T){(!h||T&16)&&oe(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(le(),A(g[$],1,1,()=>{g[$]=null}),se(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(f,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function kA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[bA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function yA(n,e,t){let i,l,s;We(n,It,d=>t(4,s=d)),xt(It,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ae.settings.getAll()||{};f(d)}catch(d){ae.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of ko)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function u(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=ko.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=ko.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,u,c]}class vA extends ge{constructor(e){super(),_e(this,e,yA,kA,me,{})}}function wA(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=K(n[3]),i=K(" duration (in seconds)"),s=M(),o=b("input"),a=M(),f=b("div"),u=b("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),x(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),re(o,n[0]),w(m,a,h),w(m,f,h),k(f,u),c||(d=[J(o,"input",n[4]),J(u,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&it(o.value)!==m[0]&&re(o,m[0]),h&2&&x(u,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(f)),c=!1,$e(d)}}}function SA(n){let e,t;return e=new ce({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[wA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $A(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=it(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,l=f.label),"duration"in f&&t(0,s=f.duration),"secret"in f&&t(1,o=f.secret)},[s,o,i,l,r,a]}class n0 extends ge{constructor(e){super(),_e(this,e,$A,SA,me,{key:2,label:3,duration:0,secret:1})}}function v_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function w_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function TA(n){let e,t,i=[],l=new Map,s,o,r,a,f,u=[],c=new Map,d,m,h,_,g,y,S,T,$,C,O,D=ue(n[5]);const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nbe(i,"duration",r)),ee.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function $_(n,e){let t,i,l,s,o;function r(u){e[13](u,e[19])}function a(u){e[14](u,e[19])}let f={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(f.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(f.secret=e[0][e[19].key].secret),i=new n0({props:f}),ee.push(()=>be(i,"duration",r)),ee.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function T_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function OA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[CA,TA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content m-b-sm txt-xl"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[7])),_=!0)},p($,C){(!h||C&16)&&oe(o,$[4]);let O=d;d=T($),d===O?S[d].p($,C):(le(),A(S[O],1,1,()=>{S[O]=null}),se(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function MA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[OA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function DA(n,e,t){let i,l,s;We(n,It,O=>t(4,s=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(It,s="Token options",s);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const O=await ae.settings.getAll()||{};h(O)}catch(O){ae.error(O)}t(1,u=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const O=await ae.settings.update(j.filterRedactedProps(f));h(O),Lt("Successfully saved tokens options.")}catch(O){ae.error(O)}t(2,c=!1)}}function h(O){var I;O=O||{},t(0,f={});const D=o.concat(r);for(const L of D)t(0,f[L.key]={duration:((I=O[L.key])==null?void 0:I.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function g(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function y(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}function S(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function T(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(f))},[f,u,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class EA extends ge{constructor(e){super(),_e(this,e,DA,MA,me,{})}}function C_(n,e,t){const i=n.slice();return i[22]=e[t],i}function IA(n){let e,t,i,l,s,o,r,a=[],f=new Map,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F,N;o=new ce({props:{class:"form-field",$$slots:{default:[LA,({uniqueId:H})=>({12:H}),({uniqueId:H})=>H?4096:0]},$$scope:{ctx:n}}});let P=ue(n[0]);const q=H=>H[22].id;for(let H=0;HBelow you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=M(),i=b("div"),l=b("div"),s=b("div"),B(o.$$.fragment),r=M();for(let H=0;H({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),l=M(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),z(i,t,null),k(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function PA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[AA,IA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y&128)&&oe(o,g[7]);let S=u;u=_(g),u===S?h[u].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function FA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function RA(n,e,t){let i,l,s,o;We(n,It,L=>t(7,o=L)),xt(It,o="Export collections",o);const r="export_"+j.randomString(5);let a,f=[],u={},c=!1;d();async function d(){t(4,c=!0);try{t(0,f=await ae.collections.getFullList({batch:100,$cancelKey:r})),t(0,f=j.sortCollections(f));for(let L of f)delete L.created,delete L.updated;y()}catch(L){ae.error(L)}t(4,c=!1)}function m(){j.downloadJson(Object.values(u),"pb_schema")}function h(){j.copyToClipboard(i),Co("The configuration was copied to your clipboard!",3e3)}function _(){s?g():y()}function g(){t(1,u={})}function y(){t(1,u={});for(const L of f)t(1,u[L.id]=L,u)}function S(L){u[L.id]?delete u[L.id]:t(1,u[L.id]=L,u),t(1,u)}const T=()=>_(),$=L=>S(L),C=()=>h();function O(L){ee[L?"unshift":"push"](()=>{a=L,t(3,a)})}const D=L=>{if(L.ctrlKey&&L.code==="KeyA"){L.preventDefault();const R=window.getSelection(),F=document.createRange();F.selectNodeContents(a),R.removeAllRanges(),R.addRange(F)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(u),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(u).length),n.$$.dirty&5&&t(5,s=f.length&&l===f.length)},[f,u,l,a,c,s,i,o,m,h,_,S,r,T,$,C,O,D,I]}class qA extends ge{constructor(e){super(),_e(this,e,RA,FA,me,{})}}function M_(n,e,t){const i=n.slice();return i[14]=e[t],i}function D_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function E_(n,e,t){const i=n.slice();return i[14]=e[t],i}function I_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function A_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function N_(n,e,t){const i=n.slice();return i[30]=e[t],i}function jA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&P_(),a=n[0].name!==n[1].name&&F_(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=K(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(f,u){f[9]?r||(r=P_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].name!==f[1].name?a?a.p(f,u):(a=F_(f),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[0]&2&&s!==(s=f[1].name+"")&&oe(o,s)},d(f){f&&v(e),r&&r.d(),a&&a.d()}}}function HA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&1&&l!==(l=((f=r[0])==null?void 0:f.name)+"")&&oe(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function zA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&2&&l!==(l=((f=r[1])==null?void 0:f.name)+"")&&oe(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function P_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function F_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=K(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&oe(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function R_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,f,u,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=K(r),f=M(),u=b("td"),c=b("pre"),m=K(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&hn((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(u,"class","svelte-lmkr38"),x(u,"changed-new-col",!n[5]&&hn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(u,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",hn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,u),k(u,c),k(c,m)},p(g,y){var S,T,$,C,O,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&oe(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&hn((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&oe(m,d),y[0]&2083&&x(u,"changed-new-col",!g[5]&&hn((O=g[0])==null?void 0:O[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(u,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",hn((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function q_(n){let e,t=ue(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let $=0;$!["schema","created","updated"].includes(y));function _(){t(4,u=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,u=u.concat(f.filter(y=>!u.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=f.filter(y=>!u.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=u.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=u.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,s,l,h,g]}class UA extends ge{constructor(e){super(),_e(this,e,BA,VA,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Y_(n,e,t){const i=n.slice();return i[17]=e[t],i}function K_(n){let e,t;return e=new UA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function WA(n){let e,t,i=ue(n[2]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function GI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&u_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=u_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(ie(),A(t,1,1,()=>{t=null}),le())},d(l){l&&v(e),t&&t.d(l)}}}function c_(n){let e;function t(s,o){return s[4]?xI:s[5]?QI:XI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function XI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function QI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Mt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function xI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function d_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function eA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[ZI,JI],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

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

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

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[16])),_=!0)},p($,C){(!h||C&128)&&se(o,$[7]);let O=d;d=T($),d===O?S[d].p($,C):(ie(),A(S[O],1,1,()=>{S[O]=null}),le(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function tA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[eA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const nA="s3_test_request";function iA(n,e,t){let i,l,s;We(n,At,O=>t(7,s=O)),xt(At,s="Files storage",s);let o={},r={},a=!1,f=!1,u=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await re.settings.getAll()||{};h(O)}catch(O){re.error(O)}t(2,a=!1)}async function m(){if(!(f||!l)){t(3,f=!0);try{re.cancelRequest(nA);const O=await re.settings.update(j.filterRedactedProps(r));Zt({}),await h(O),Ta(),c?rv("Successfully saved but failed to establish S3 connection."):Nt("Successfully saved files storage settings.")}catch(O){re.error(O)}t(3,f=!1)}}async function h(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){u=O,t(4,u)}function S(O){c=O,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,f,u,c,l,s,m,_,i,g,y,S,T,$,C]}class lA extends ge{constructor(e){super(),_e(this,e,iA,tA,pe,{})}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(f,u){w(f,e,u),e.checked=n[1].enabled,w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[11]),r=!0)},p(f,u){u&1048576&&t!==(t=f[20])&&p(e,"id",t),u&2&&(e.checked=f[1].enabled),u&1048576&&o!==(o=f[20])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function oA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("label"),t=K("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(u,c){w(u,e,c),k(e,t),w(u,l,c),w(u,s,c),oe(s,n[1].clientId),a||(f=J(s,"input",n[12]),a=!0)},p(u,c){c&1048576&&i!==(i=u[20])&&p(e,"for",i),c&1048576&&o!==(o=u[20])&&p(s,"id",o),c&2&&r!==(r=u[1].enabled)&&(s.required=r),c&2&&s.value!==u[1].clientId&&oe(s,u[1].clientId)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function rA(n){let e,t,i,l,s,o,r;function a(u){n[13](u)}let f={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(f.value=n[1].clientSecret),s=new Ga({props:f}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=K("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(u,c){w(u,e,c),k(e,t),w(u,l,c),z(s,u,c),r=!0},p(u,c){(!r||c&1048576&&i!==(i=u[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=u[20]),c&2&&(d.required=u[1].enabled),!o&&c&2&&(o=!0,d.value=u[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(u){r||(E(s.$$.fragment,u),r=!0)},o(u){A(s.$$.fragment,u),r=!1},d(u){u&&(v(e),v(l)),V(s,u)}}}function p_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(f){n[14](f)}var r=n[3].optionsComponent;function a(f,u){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(f,u){w(f,e,u),t&&z(t,e,null),l=!0},p(f,u){if(u&8&&r!==(r=f[3].optionsComponent)){if(t){ie();const c=t;A(c.$$.fragment,1,0,()=>{V(c,1)}),le()}r?(t=Et(r,a(f,u)),te.push(()=>be(t,"config",o)),B(t.$$.fragment),E(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=u&8?dt(s,[{key:f[3].key},Dt(f[3].optionsComponentProps||{})]):{};!i&&u&2&&(i=!0,c.config=f[1],ke(()=>i=!1)),t.$set(c)}},i(f){l||(t&&E(t.$$.fragment,f),l=!0)},o(f){t&&A(t.$$.fragment,f),l=!1},d(f){f&&v(e),t&&V(t)}}}function aA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new ue({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[sA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[oA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),f=new ue({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[rA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&p_(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(f.$$.fragment),u=M(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),z(i,t,null),k(t,l),k(t,s),k(e,o),z(r,e,null),k(e,a),z(f,e,null),k(e,u),h&&h.m(e,null),c=!0,d||(m=[J(s,"click",n[8]),J(e,"submit",Be(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=p_(_),h.c(),E(h,1),h.m(e,null)):h&&(ie(),A(h,1,1,()=>{h=null}),le())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(f.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(f.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),V(i),V(r),V(f),h&&h.d(),d=!1,$e(m)}}}function fA(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=K(t),l=K(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&se(i,t)},d(s){s&&v(e)}}}function uA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function cA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[uA],header:[fA],default:[aA]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function dA(n,e,t){let i;const l=lt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},f=!1,u="";function c(D,I){Zt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,u=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,f=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await re.settings.update(D);Zt({}),Nt("Successfully updated provider settings."),l("submit",I),d()}catch(D){re.error(D)}t(4,f=!1)}function h(){var D;for(let I in a)t(1,a[I]=j.zeroValue(a[I]),a);(D=r.key)!=null&&D.startsWith("oidc")?t(1,a.pkce=!1,a):t(1,a.pkce=null,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){te[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=u)},[d,a,o,r,f,i,s,m,h,c,u,_,g,y,S,T,$,C,O]}class pA extends ge{constructor(e){super(),_e(this,e,dA,cA,pe,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function m_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function h_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mA(n){let e,t,i,l,s=n[1].title+"",o,r,a,f,u=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&m_(n),O=n[0].enabled&&h_(),D={};return y=new pA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=K(s),r=M(),a=b("em"),f=K("("),c=K(u),d=K(")"),m=M(),O&&O.c(),h=M(),_=b("button"),_.innerHTML='',g=M(),B(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,f),k(a,c),k(a,d),k(e,m),O&&O.m(e,null),k(e,h),k(e,_),w(I,g,L),z(y,I,L),S=!0,T||($=J(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=m_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&se(o,s),(!S||L&2)&&u!==(u=I[1].key.slice(0,-4)+"")&&se(c,u),I[0].enabled?O||(O=h_(),O.c(),O.m(e,h)):O&&(O.d(1),O=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),O&&O.d(),n[4](null),V(y,I),T=!1,$()}}}function hA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0,pkce:l.clientId?l.pkce:null}))};function r(f){te[f?"unshift":"push"](()=>{s=f,t(2,s)})}const a=f=>{f.detail[i.key]&&t(0,l=f.detail[i.key])};return n.$$set=f=>{"provider"in f&&t(1,i=f.provider),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a]}class t0 extends ge{constructor(e){super(),_e(this,e,hA,mA,pe,{provider:1,config:0})}}function __(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function g_(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function _A(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,f,u=fe(n[3]);const c=_=>_[9].key;for(let _=0;_0&&n[2].length>0&&k_(),m=fe(n[2]);const h=_=>_[9].key;for(let _=0;_0&&_[2].length>0?d||(d=k_(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=fe(_[2]),ie(),r=at(r,g,h,1,_,m,a,o,It,y_,null,__),le())},i(_){if(!f){for(let g=0;gbe(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&8&&(c.provider=e[9]),!l&&u&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function k_(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function y_(n,e){let t,i,l,s,o;function r(f){e[6](f,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new t0({props:a}),te.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(f,u){w(f,t,u),z(i,t,null),k(t,s),o=!0},p(f,u){e=f;const c={};u&4&&(c.provider=e[9]),!l&&u&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i)}}}function bA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;const _=[gA,_A],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("div"),u=b("h6"),u.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","m-b-base"),p(f,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,f),k(f,u),k(f,c),g[d].m(f,null),h=!0},p(S,T){(!h||T&16)&&se(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(ie(),A(g[$],1,1,()=>{g[$]=null}),le(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(f,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function kA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[bA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function yA(n,e,t){let i,l,s;We(n,At,d=>t(4,s=d)),xt(At,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await re.settings.getAll()||{};f(d)}catch(d){re.error(d)}t(1,o=!1)}function f(d){d=d||{},t(0,r={});for(const m of ko)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function u(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=ko.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=ko.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,u,c]}class vA extends ge{constructor(e){super(),_e(this,e,yA,kA,pe,{})}}function wA(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=K(n[3]),i=K(" duration (in seconds)"),s=M(),o=b("input"),a=M(),f=b("div"),u=b("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(u,"class","link-primary"),x(u,"txt-success",!!n[1]),p(f,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),oe(o,n[0]),w(m,a,h),w(m,f,h),k(f,u),c||(d=[J(o,"input",n[4]),J(u,"click",n[5])],c=!0)},p(m,h){h&8&&se(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&it(o.value)!==m[0]&&oe(o,m[0]),h&2&&x(u,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(f)),c=!1,$e(d)}}}function SA(n){let e,t;return e=new ue({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[wA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $A(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=it(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=f=>{"key"in f&&t(2,i=f.key),"label"in f&&t(3,l=f.label),"duration"in f&&t(0,s=f.duration),"secret"in f&&t(1,o=f.secret)},[s,o,i,l,r,a]}class n0 extends ge{constructor(e){super(),_e(this,e,$A,SA,pe,{key:2,label:3,duration:0,secret:1})}}function v_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function w_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function TA(n){let e,t,i=[],l=new Map,s,o,r,a,f,u=[],c=new Map,d,m,h,_,g,y,S,T,$,C,O,D=fe(n[5]);const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nbe(i,"duration",r)),te.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function $_(n,e){let t,i,l,s,o;function r(u){e[13](u,e[19])}function a(u){e[14](u,e[19])}let f={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(f.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(f.secret=e[0][e[19].key].secret),i=new n0({props:f}),te.push(()=>be(i,"duration",r)),te.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(u,c){w(u,t,c),z(i,u,c),o=!0},p(u,c){e=u;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i,u)}}}function T_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=J(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function OA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const y=[CA,TA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[4]),r=M(),a=b("div"),f=b("form"),u=b("div"),u.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content m-b-sm txt-xl"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,f),k(f,u),k(f,c),S[d].m(f,null),h=!0,_||(g=J(f,"submit",Be(n[7])),_=!0)},p($,C){(!h||C&16)&&se(o,$[4]);let O=d;d=T($),d===O?S[d].p($,C):(ie(),A(S[O],1,1,()=>{S[O]=null}),le(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(f,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function MA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[OA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function DA(n,e,t){let i,l,s;We(n,At,O=>t(4,s=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(At,s="Token options",s);let a={},f={},u=!1,c=!1;d();async function d(){t(1,u=!0);try{const O=await re.settings.getAll()||{};h(O)}catch(O){re.error(O)}t(1,u=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const O=await re.settings.update(j.filterRedactedProps(f));h(O),Nt("Successfully saved tokens options.")}catch(O){re.error(O)}t(2,c=!1)}}function h(O){var I;O=O||{},t(0,f={});const D=o.concat(r);for(const L of D)t(0,f[L.key]={duration:((I=O[L.key])==null?void 0:I.duration)||0},f);t(9,a=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(a||{})))}function g(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function y(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}function S(O,D){n.$$.not_equal(f[D.key].duration,O)&&(f[D.key].duration=O,t(0,f))}function T(O,D){n.$$.not_equal(f[D.key].secret,O)&&(f[D.key].secret=O,t(0,f))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(f))},[f,u,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class EA extends ge{constructor(e){super(),_e(this,e,DA,MA,pe,{})}}function C_(n,e,t){const i=n.slice();return i[22]=e[t],i}function IA(n){let e,t,i,l,s,o,r,a=[],f=new Map,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F,N;o=new ue({props:{class:"form-field",$$slots:{default:[LA,({uniqueId:H})=>({12:H}),({uniqueId:H})=>H?4096:0]},$$scope:{ctx:n}}});let P=fe(n[0]);const q=H=>H[22].id;for(let H=0;HBelow you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=M(),i=b("div"),l=b("div"),s=b("div"),B(o.$$.fragment),r=M();for(let H=0;H({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),l=M(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),z(i,t,null),k(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function PA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[AA,IA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[7]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y&128)&&se(o,g[7]);let S=u;u=_(g),u===S?h[u].p(g,y):(ie(),A(h[S],1,1,()=>{h[S]=null}),le(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function FA(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function RA(n,e,t){let i,l,s,o;We(n,At,L=>t(7,o=L)),xt(At,o="Export collections",o);const r="export_"+j.randomString(5);let a,f=[],u={},c=!1;d();async function d(){t(4,c=!0);try{t(0,f=await re.collections.getFullList({batch:100,$cancelKey:r})),t(0,f=j.sortCollections(f));for(let L of f)delete L.created,delete L.updated;y()}catch(L){re.error(L)}t(4,c=!1)}function m(){j.downloadJson(Object.values(u),"pb_schema")}function h(){j.copyToClipboard(i),Co("The configuration was copied to your clipboard!",3e3)}function _(){s?g():y()}function g(){t(1,u={})}function y(){t(1,u={});for(const L of f)t(1,u[L.id]=L,u)}function S(L){u[L.id]?delete u[L.id]:t(1,u[L.id]=L,u),t(1,u)}const T=()=>_(),$=L=>S(L),C=()=>h();function O(L){te[L?"unshift":"push"](()=>{a=L,t(3,a)})}const D=L=>{if(L.ctrlKey&&L.code==="KeyA"){L.preventDefault();const R=window.getSelection(),F=document.createRange();F.selectNodeContents(a),R.removeAllRanges(),R.addRange(F)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(u),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(u).length),n.$$.dirty&5&&t(5,s=f.length&&l===f.length)},[f,u,l,a,c,s,i,o,m,h,_,S,r,T,$,C,O,D,I]}class qA extends ge{constructor(e){super(),_e(this,e,RA,FA,pe,{})}}function M_(n,e,t){const i=n.slice();return i[14]=e[t],i}function D_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function E_(n,e,t){const i=n.slice();return i[14]=e[t],i}function I_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function A_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function N_(n,e,t){const i=n.slice();return i[30]=e[t],i}function jA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&P_(),a=n[0].name!==n[1].name&&F_(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=K(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(f,u){w(f,e,u),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(f,u){f[9]?r||(r=P_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].name!==f[1].name?a?a.p(f,u):(a=F_(f),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[0]&2&&s!==(s=f[1].name+"")&&se(o,s)},d(f){f&&v(e),r&&r.d(),a&&a.d()}}}function HA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&1&&l!==(l=((f=r[0])==null?void 0:f.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function zA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=K(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var f;a[0]&2&&l!==(l=((f=r[1])==null?void 0:f.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function P_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function F_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=K(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function R_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,f,u,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=K(r),f=M(),u=b("td"),c=b("pre"),m=K(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&hn((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(u,"class","svelte-lmkr38"),x(u,"changed-new-col",!n[5]&&hn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(u,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",hn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,u),k(u,c),k(c,m)},p(g,y){var S,T,$,C,O,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&se(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&hn((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&se(m,d),y[0]&2083&&x(u,"changed-new-col",!g[5]&&hn((O=g[0])==null?void 0:O[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(u,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",hn((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function q_(n){let e,t=fe(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let $=0;$!["schema","created","updated"].includes(y));function _(){t(4,u=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,u=u.concat(f.filter(y=>!u.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=f.filter(y=>!u.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=u.filter(y=>f.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=u.filter(y=>!f.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,f,u,i,c,d,m,s,l,h,g]}class UA extends ge{constructor(e){super(),_e(this,e,BA,VA,pe,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Y_(n,e,t){const i=n.slice();return i[17]=e[t],i}function K_(n){let e,t;return e=new UA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function WA(n){let e,t,i=fe(n[2]),l=[];for(let o=0;oA(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await ae.collections.import(o,a),Lt("Successfully imported collections configuration."),i("submit")}catch($){ae.error($)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function y($){ee[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,y,S,T]}class GA extends ge{constructor(e){super(),_e(this,e,ZA,JA,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function J_(n,e,t){const i=n.slice();return i[33]=e[t],i}function Z_(n,e,t){const i=n.slice();return i[36]=e[t],i}function G_(n,e,t){const i=n.slice();return i[33]=e[t],i}function XA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[xA,({uniqueId:H})=>({41:H}),({uniqueId:H})=>[0,H?1024:0]]},$$scope:{ctx:n}}});let L=n[1].length&&Q_(n),R=!1,F=n[6]&&n[1].length&&!n[7]&&x_(),N=n[6]&&n[1].length&&n[7]&&eg(n),P=n[13].length&&cg(n),q=!!n[0]&&dg(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=K(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),f=M(),L&&L.c(),u=M(),c=M(),F&&F.c(),d=M(),N&&N.c(),m=M(),P&&P.c(),h=M(),_=b("div"),q&&q.c(),g=M(),y=b("div"),S=M(),T=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p($,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-expanded btn-warning m-l-auto"),T.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(H,W){w(H,e,W),n[21](e),w(H,t,W),w(H,i,W),k(i,l),k(l,s),k(l,o),w(H,r,W),z(a,H,W),w(H,f,W),L&&L.m(H,W),w(H,u,W),w(H,c,W),F&&F.m(H,W),w(H,d,W),N&&N.m(H,W),w(H,m,W),P&&P.m(H,W),w(H,h,W),w(H,_,W),q&&q.m(_,null),k(_,g),k(_,y),k(_,S),k(_,T),k(T,$),O=!0,D||(I=[J(e,"change",n[22]),J(o,"click",n[23]),J(T,"click",n[19])],D=!0)},p(H,W){(!O||W[0]&4096)&&x(o,"btn-loading",H[12]);const G={};W[0]&64&&(G.class="form-field "+(H[6]?"":"field-error")),W[0]&65|W[1]&3072&&(G.$$scope={dirty:W,ctx:H}),a.$set(G),H[1].length?L?(L.p(H,W),W[0]&2&&E(L,1)):(L=Q_(H),L.c(),E(L,1),L.m(u.parentNode,u)):L&&(le(),A(L,1,1,()=>{L=null}),se()),H[6]&&H[1].length&&!H[7]?F||(F=x_(),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),H[6]&&H[1].length&&H[7]?N?N.p(H,W):(N=eg(H),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),H[13].length?P?P.p(H,W):(P=cg(H),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),H[0]?q?q.p(H,W):(q=dg(H),q.c(),q.m(_,g)):q&&(q.d(1),q=null),(!O||W[0]&16384&&C!==(C=!H[14]))&&(T.disabled=C)},i(H){O||(E(a.$$.fragment,H),E(L),E(R),O=!0)},o(H){A(a.$$.fragment,H),A(L),A(R),O=!1},d(H){H&&(v(e),v(t),v(i),v(r),v(f),v(u),v(c),v(d),v(m),v(h),v(_)),n[21](null),V(a,H),L&&L.d(H),F&&F.d(H),N&&N.d(H),P&&P.d(H),q&&q.d(),D=!1,$e(I)}}}function QA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function X_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&X_();return{c(){e=b("label"),t=K("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ye(),p(e,"for",i=n[41]),p(e,"class","p-b-10"),p(s,"id",o=n[41]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),re(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=J(s,"input",n[24]),f=!0)},p(d,m){m[1]&1024&&i!==(i=d[41])&&p(e,"for",i),m[1]&1024&&o!==(o=d[41])&&p(s,"id",o),m[0]&1&&re(s,d[0]),d[0]&&!d[6]?c||(c=X_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),f=!1,u()}}}function Q_(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[e7,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&3072&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function e7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[41]),e.disabled=i=!n[6],p(s,"for",r=n[41])},m(u,c){w(u,e,c),e.checked=n[5],w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[25]),a=!0)},p(u,c){c[1]&1024&&t!==(t=u[41])&&p(e,"id",t),c[0]&64&&i!==(i=!u[6])&&(e.disabled=i),c[0]&32&&(e.checked=u[5]),c[1]&1024&&r!==(r=u[41])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function eg(n){let e,t,i,l,s,o=n[9].length&&tg(n),r=n[3].length&&lg(n),a=n[8].length&&ag(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),o&&o.m(i,null),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=tg(f),o.c(),o.m(i,l)):o&&(o.d(1),o=null),f[3].length?r?r.p(f,u):(r=lg(f),r.c(),r.m(i,s)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=ag(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function tg(n){let e=[],t=new Map,i,l=ue(n[9]);const s=o=>o[33].id;for(let o=0;oo[36].old.id+o[36].new.id;for(let o=0;oo[33].id;for(let o=0;o',i=M(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await re.collections.import(o,a),Nt("Successfully imported collections configuration."),i("submit")}catch($){re.error($)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function y($){te[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,y,S,T]}class GA extends ge{constructor(e){super(),_e(this,e,ZA,JA,pe,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function J_(n,e,t){const i=n.slice();return i[34]=e[t],i}function Z_(n,e,t){const i=n.slice();return i[37]=e[t],i}function G_(n,e,t){const i=n.slice();return i[34]=e[t],i}function XA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I;a=new ue({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[xA,({uniqueId:H})=>({42:H}),({uniqueId:H})=>[0,H?2048:0]]},$$scope:{ctx:n}}});let L=n[1].length&&Q_(n),R=!1,F=n[6]&&n[1].length&&!n[7]&&x_(),N=n[6]&&n[1].length&&n[7]&&eg(n),P=n[13].length&&cg(n),q=!!n[0]&&dg(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=K(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),f=M(),L&&L.c(),u=M(),c=M(),F&&F.c(),d=M(),N&&N.c(),m=M(),P&&P.c(),h=M(),_=b("div"),q&&q.c(),g=M(),y=b("div"),S=M(),T=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p($,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-expanded btn-warning m-l-auto"),T.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(H,W){w(H,e,W),n[22](e),w(H,t,W),w(H,i,W),k(i,l),k(l,s),k(l,o),w(H,r,W),z(a,H,W),w(H,f,W),L&&L.m(H,W),w(H,u,W),w(H,c,W),F&&F.m(H,W),w(H,d,W),N&&N.m(H,W),w(H,m,W),P&&P.m(H,W),w(H,h,W),w(H,_,W),q&&q.m(_,null),k(_,g),k(_,y),k(_,S),k(_,T),k(T,$),O=!0,D||(I=[J(e,"change",n[23]),J(o,"click",n[24]),J(T,"click",n[20])],D=!0)},p(H,W){(!O||W[0]&4096)&&x(o,"btn-loading",H[12]);const G={};W[0]&64&&(G.class="form-field "+(H[6]?"":"field-error")),W[0]&65|W[1]&6144&&(G.$$scope={dirty:W,ctx:H}),a.$set(G),H[1].length?L?(L.p(H,W),W[0]&2&&E(L,1)):(L=Q_(H),L.c(),E(L,1),L.m(u.parentNode,u)):L&&(ie(),A(L,1,1,()=>{L=null}),le()),H[6]&&H[1].length&&!H[7]?F||(F=x_(),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),H[6]&&H[1].length&&H[7]?N?N.p(H,W):(N=eg(H),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),H[13].length?P?P.p(H,W):(P=cg(H),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),H[0]?q?q.p(H,W):(q=dg(H),q.c(),q.m(_,g)):q&&(q.d(1),q=null),(!O||W[0]&16384&&C!==(C=!H[14]))&&(T.disabled=C)},i(H){O||(E(a.$$.fragment,H),E(L),E(R),O=!0)},o(H){A(a.$$.fragment,H),A(L),A(R),O=!1},d(H){H&&(v(e),v(t),v(i),v(r),v(f),v(u),v(c),v(d),v(m),v(h),v(_)),n[22](null),V(a,H),L&&L.d(H),F&&F.d(H),N&&N.d(H),P&&P.d(H),q&&q.d(),D=!1,$e(I)}}}function QA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function X_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&X_();return{c(){e=b("label"),t=K("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ye(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),f||(u=J(s,"input",n[25]),f=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&oe(s,d[0]),d[0]&&!d[6]?c||(c=X_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),f=!1,u()}}}function Q_(n){let e,t;return e=new ue({props:{class:"form-field form-field-toggle",$$slots:{default:[e7,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function e7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=M(),s=b("label"),o=K("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(u,c){w(u,e,c),e.checked=n[5],w(u,l,c),w(u,s,c),k(s,o),a||(f=J(e,"change",n[26]),a=!0)},p(u,c){c[1]&2048&&t!==(t=u[42])&&p(e,"id",t),c[0]&64&&i!==(i=!u[6])&&(e.disabled=i),c[0]&32&&(e.checked=u[5]),c[1]&2048&&r!==(r=u[42])&&p(s,"for",r)},d(u){u&&(v(e),v(l),v(s)),a=!1,f()}}}function x_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function eg(n){let e,t,i,l,s,o=n[9].length&&tg(n),r=n[3].length&&lg(n),a=n[8].length&&ag(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(f,u){w(f,e,u),w(f,t,u),w(f,i,u),o&&o.m(i,null),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(f,u){f[9].length?o?o.p(f,u):(o=tg(f),o.c(),o.m(i,l)):o&&(o.d(1),o=null),f[3].length?r?r.p(f,u):(r=lg(f),r.c(),r.m(i,s)):r&&(r.d(1),r=null),f[8].length?a?a.p(f,u):(a=ag(f),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(f){f&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function tg(n){let e=[],t=new Map,i,l=fe(n[9]);const s=o=>o[34].id;for(let o=0;oo[37].old.id+o[37].new.id;for(let o=0;oo[34].id;for(let o=0;o',i=M(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=J(o,"click",n[27]),r=!0)},p:Q,d(f){f&&v(e),r=!1,a()}}}function dg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[28]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function t7(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[QA,XA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[15]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y[0]&32768)&&oe(o,g[15]);let S=u;u=_(g),u===S?h[u].p(g,y):(le(),A(h[S],1,1,()=>{h[S]=null}),se(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function n7(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[t7]},$$scope:{ctx:n}}});let r={};return s=new GA({props:r}),n[29](s),s.$on("submit",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&63487|f[1]&2048&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[29](null),V(s,a)}}}function i7(n,e,t){let i,l,s,o,r,a,f;We(n,It,ie=>t(15,f=ie)),xt(It,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1,T=!1;$();async function $(){t(4,S=!0);try{t(20,_=await ae.collections.getFullList(200));for(let ie of _)delete ie.created,delete ie.updated}catch(ie){ae.error(ie)}t(4,S=!1)}function C(){if(t(3,y=[]),!!i)for(let ie of h){const te=j.findByKey(_,"id",ie.id);!(te!=null&&te.id)||!j.hasCollectionChanges(te,ie,g)||y.push({new:ie,old:te})}}function O(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let ie of h)delete ie.created,delete ie.updated,ie.schema=j.filterDuplicatesByKey(ie.schema)}function D(){var ie,te;for(let pe of h){const Ne=j.findByKey(_,"name",pe.name)||j.findByKey(_,"id",pe.id);if(!Ne)continue;const He=pe.id,Xe=Ne.id;pe.id=Xe;const xe=Array.isArray(Ne.schema)?Ne.schema:[],Mt=Array.isArray(pe.schema)?pe.schema:[];for(const ft of Mt){const ht=j.findByKey(xe,"name",ft.name);ht&&ht.id&&(ft.id=ht.id)}for(let ft of h)if(Array.isArray(ft.schema))for(let ht of ft.schema)(ie=ht.options)!=null&&ie.collectionId&&((te=ht.options)==null?void 0:te.collectionId)===He&&(ht.options.collectionId=Xe)}t(0,d=JSON.stringify(h,null,4))}function I(ie){t(12,m=!0);const te=new FileReader;te.onload=async pe=>{t(12,m=!1),t(10,u.value="",u),t(0,d=pe.target.result),await Qt(),h.length||(ii("Invalid collections configuration."),L())},te.onerror=pe=>{console.warn(pe),ii("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},te.readAsText(ie)}function L(){t(0,d=""),t(10,u.value="",u),Jt({})}function R(){const ie=T?j.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,ie,g)}function F(ie){ee[ie?"unshift":"push"](()=>{u=ie,t(10,u)})}const N=()=>{u.files.length&&I(u.files[0])},P=()=>{u.click()};function q(){d=this.value,t(0,d)}function H(){T=this.checked,t(5,T)}function W(){g=this.checked,t(2,g)}const G=()=>D(),U=()=>L();function Y(ie){ee[ie?"unshift":"push"](()=>{c=ie,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==null&&O(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ie=>!!ie.id&&!!ie.name).length),n.$$.dirty[0]&1048678&&t(9,l=_.filter(ie=>i&&!T&&g&&!j.findByKey(h,"id",ie.id))),n.$$.dirty[0]&1048642&&t(8,s=h.filter(ie=>i&&!j.findByKey(_,"id",ie.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&C(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&1048578&&t(13,a=h.filter(ie=>{let te=j.findByKey(_,"name",ie.name)||j.findByKey(_,"id",ie.id);if(!te)return!1;if(te.id!=ie.id)return!0;const pe=Array.isArray(te.schema)?te.schema:[],Ne=Array.isArray(ie.schema)?ie.schema:[];for(const He of Ne){if(j.findByKey(pe,"id",He.id))continue;const xe=j.findByKey(pe,"name",He.name);if(xe&&He.id!=xe.id)return!0}return!1}))},[d,h,g,y,S,T,i,o,s,l,u,c,m,a,r,f,D,I,L,R,_,F,N,P,q,H,W,G,U,Y]}class l7 extends ge{constructor(e){super(),_e(this,e,i7,n7,me,{},null,[-1,-1])}}function s7(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),re(s,n[2]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[7]),f=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&re(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function o7(n){let e,t,i,l,s,o,r;return l=new ce({props:{class:"form-field m-0",name:"name",$$slots:{default:[s7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + to.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(f,u){w(f,e,u),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=J(o,"click",n[28]),r=!0)},p:Q,d(f){f&&v(e),r=!1,a()}}}function dg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=J(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function t7(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[QA,XA],h=[];function _(g,y){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[15]),r=M(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,f),h[u].m(f,null),d=!0},p(g,y){(!d||y[0]&32768)&&se(o,g[15]);let S=u;u=_(g),u===S?h[u].p(g,y):(ie(),A(h[S],1,1,()=>{h[S]=null}),le(),c=h[u],c?c.p(g,y):(c=h[u]=m[u](g),c.c()),E(c,1),c.m(f,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[u].d()}}}function n7(n){let e,t,i,l,s,o;e=new _i({}),i=new bn({props:{$$slots:{default:[t7]},$$scope:{ctx:n}}});let r={};return s=new GA({props:r}),n[30](s),s.$on("submit",n[31]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,f){z(e,a,f),w(a,t,f),z(i,a,f),w(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&63487|f[1]&4096&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[30](null),V(s,a)}}}function i7(n,e,t){let i,l,s,o,r,a,f;We(n,At,ee=>t(15,f=ee)),xt(At,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1,T=!1;$();async function $(){t(4,S=!0);try{t(21,_=await re.collections.getFullList(200));for(let ee of _)delete ee.created,delete ee.updated}catch(ee){re.error(ee)}t(4,S=!1)}function C(){if(t(3,y=[]),!!i)for(let ee of h){const ce=j.findByKey(_,"id",ee.id);!(ce!=null&&ce.id)||!j.hasCollectionChanges(ce,ee,g)||y.push({new:ee,old:ce})}}function O(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let ee of h)delete ee.created,delete ee.updated,ee.schema=j.filterDuplicatesByKey(ee.schema)}function D(){var ee,ce;for(let Oe of h){const He=j.findByKey(_,"name",Oe.name)||j.findByKey(_,"id",Oe.id);if(!He)continue;const Je=Oe.id,xe=He.id;Oe.id=xe;const bt=Array.isArray(He.schema)?He.schema:[],kt=Array.isArray(Oe.schema)?Oe.schema:[];for(const yt of kt){const Ot=j.findByKey(bt,"name",yt.name);Ot&&Ot.id&&(yt.id=Ot.id)}for(let yt of h)if(Array.isArray(yt.schema))for(let Ot of yt.schema)(ee=Ot.options)!=null&&ee.collectionId&&((ce=Ot.options)==null?void 0:ce.collectionId)===Je&&(Ot.options.collectionId=xe)}t(0,d=JSON.stringify(h,null,4))}function I(ee){t(12,m=!0);const ce=new FileReader;ce.onload=async Oe=>{t(12,m=!1),t(10,u.value="",u),t(0,d=Oe.target.result),await Qt(),h.length||(ii("Invalid collections configuration."),L())},ce.onerror=Oe=>{console.warn(Oe),ii("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},ce.readAsText(ee)}function L(){t(0,d=""),t(10,u.value="",u),Zt({})}function R(){const ee=T?j.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,ee,g)}function F(ee){te[ee?"unshift":"push"](()=>{u=ee,t(10,u)})}const N=()=>{u.files.length&&I(u.files[0])},P=()=>{u.click()};function q(){d=this.value,t(0,d)}function H(){T=this.checked,t(5,T)}function W(){g=this.checked,t(2,g)}const G=()=>D(),U=()=>L();function Y(ee){te[ee?"unshift":"push"](()=>{c=ee,t(11,c)})}const me=()=>{L(),$()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==null&&O(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ee=>!!ee.id&&!!ee.name).length),n.$$.dirty[0]&2097254&&t(9,l=_.filter(ee=>i&&!T&&g&&!j.findByKey(h,"id",ee.id))),n.$$.dirty[0]&2097218&&t(8,s=h.filter(ee=>i&&!j.findByKey(_,"id",ee.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&C(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&2097154&&t(13,a=h.filter(ee=>{let ce=j.findByKey(_,"name",ee.name)||j.findByKey(_,"id",ee.id);if(!ce)return!1;if(ce.id!=ee.id)return!0;const Oe=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(ee.schema)?ee.schema:[];for(const Je of He){if(j.findByKey(Oe,"id",Je.id))continue;const bt=j.findByKey(Oe,"name",Je.name);if(bt&&Je.id!=bt.id)return!0}return!1}))},[d,h,g,y,S,T,i,o,s,l,u,c,m,a,r,f,$,D,I,L,R,_,F,N,P,q,H,W,G,U,Y,me]}class l7 extends ge{constructor(e){super(),_e(this,e,i7,n7,pe,{},null,[-1,-1])}}function s7(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=K("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[2]),w(c,r,d),w(c,a,d),f||(u=J(s,"input",n[7]),f=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&oe(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function o7(n){let e,t,i,l,s,o,r;return l=new ue({props:{class:"form-field m-0",name:"name",$$slots:{default:[s7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

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

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

    Please proceed with caution and use it only with trusted backups!

    Backup restore is experimental and works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from + separately since they are not locally stored and will not be included in the final backup!

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

    Please proceed with caution and use it only with trusted backups!

    Backup restore is experimental and works only on UNIX based systems.

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

    This means that on success all of your data (including app settings, users, admins, etc.) will be replaced with the ones from the backup.

    Nothing will happen if the backup is invalid or incompatible (ex. missing data.db file).

    `,t=M(),i=b("div"),l=K(`Type the backup name `),s=b("div"),o=b("span"),r=K(n[1]),a=M(),B(f.$$.fragment),u=K(` - to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),z(f,s,null),k(i,u),w(y,c,S),w(y,d,S),z(m,d,null),h=!0,_||(g=J(d,"submit",Be(n[7])),_=!0)},p(y,S){(!h||S&2)&&oe(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(f.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(f.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),V(f),V(m),_=!1,g()}}}function m7(n){let e,t,i,l;return{c(){e=b("h4"),t=K("Restore "),i=b("strong"),l=K(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&v(e)}}}function h7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function _7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[h7],header:[m7],default:[p7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function g7(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,f=null;function u(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await ae.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(f),T!=null&&T.isAbort||(t(4,a=!1),ii(((S=T.response)==null?void 0:S.message)||T.message))}}}vs(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){ee[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ce.call(this,n,S)}function y(S){Ce.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,y]}class b7 extends ge{constructor(e){super(),_e(this,e,g7,_7,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function pg(n,e,t){const i=n.slice();return i[22]=e[t],i}function mg(n,e,t){const i=n.slice();return i[19]=e[t],i}function k7(n){let e=[],t=new Map,i,l,s=ue(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _g(n,e){let t,i,l,s,o,r=e[22].key+"",a,f,u,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G;function U(){return e[10](e[22])}function Y(){return e[11](e[22])}function ie(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=K(r),u=M(),c=b("span"),d=K("("),h=K(m),_=K(")"),g=M(),y=b("div"),S=b("button"),T=b("i"),C=M(),O=b("button"),D=b("i"),L=M(),R=b("button"),F=b("i"),P=M(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",f=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=I=e[6][e[22].key],p(O,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(te,pe){w(te,t,pe),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,O),k(O,D),k(y,L),k(y,R),k(R,F),k(t,P),H=!0,W||(G=[Se(Pe.call(null,S,"Download")),J(S,"click",Be(U)),Se(Pe.call(null,O,"Restore")),J(O,"click",Be(Y)),Se(Pe.call(null,R,"Delete")),J(R,"click",Be(ie))],W=!0)},p(te,pe){e=te,(!H||pe&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!H||pe&8&&f!==(f=e[22].key))&&p(o,"title",f),(!H||pe&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&oe(h,m),(!H||pe&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!H||pe&40)&&x(S,"btn-loading",e[5][e[22].key]),(!H||pe&72&&I!==(I=e[6][e[22].key]))&&(O.disabled=I),(!H||pe&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!H||pe&72)&&x(R,"btn-loading",e[6][e[22].key])},i(te){H||(te&&Ke(()=>{H&&(q||(q=Fe(t,et,{duration:150},!0)),q.run(1))}),H=!0)},o(te){te&&(q||(q=Fe(t,et,{duration:150},!1)),q.run(0)),H=!1},d(te){te&&v(t),te&&q&&q.end(),W=!1,$e(G)}}}function gg(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function v7(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function w7(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function S7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;const g=[y7,k7],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?w7:v7}let $=T(n),C=$(n),O={};u=new c7({props:O}),n[14](u),u.$on("submit",n[15]);let D={};return d=new b7({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),f=M(),B(u.$$.fragment),c=M(),B(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,f,L),z(u,I,L),w(I,c,L),z(d,I,L),m=!0,h||(_=J(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(le(),A(y[R],1,1,()=>{y[R]=null}),se(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};u.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(u.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(u.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(f),v(c)),y[i].d(),C.d(),n[14](null),V(u,I),n[16](null),V(d,I),h=!1,_()}}}function $7(n,e,t){let i,l,s=[],o=!1,r={},a={},f=!0;u(),h();async function u(){t(4,o=!0);try{t(3,s=await ae.backups.getFullList()),s.sort((O,D)=>O.modifiedD.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(ae.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const D=await ae.getAdminFileToken(),I=ae.backups.getDownloadUrl(D,O);j.download(I)}catch(D){D.isAbort||ae.error(D)}delete r[O],t(5,r)}}function d(O){un(`Do you really want to delete ${O}?`,()=>m(O))}async function m(O){if(!a[O]){t(6,a[O]=!0,a);try{await ae.backups.delete(O),j.removeByKey(s,"name",O),u(),Lt(`Successfully deleted ${O}.`)}catch(D){D.isAbort||ae.error(D)}delete a[O],t(6,a)}}async function h(){var O;try{const D=await ae.health.check({$autoCancel:!1}),I=f;t(7,f=((O=D==null?void 0:D.data)==null?void 0:O.canBackup)||!1),I!=f&&f&&u()}catch{}}Ht(()=>{let O=setInterval(()=>{h()},3e3);return()=>{clearInterval(O)}});const _=O=>c(O.key),g=O=>l.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function T(O){ee[O?"unshift":"push"](()=>{i=O,t(1,i)})}const $=()=>{u()};function C(O){ee[O?"unshift":"push"](()=>{l=O,t(2,l)})}return[u,i,l,s,o,r,a,f,c,d,_,g,y,S,T,$,C]}class T7 extends ge{constructor(e){super(),_e(this,e,$7,S7,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function C7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,f){w(a,e,f),k(e,t),w(a,l,f),w(a,s,f),n[5](s),o||(r=[Se(Pe.call(null,e,"Upload backup")),J(e,"click",n[4]),J(s,"change",n[3])],o=!0)},p(a,[f]){f&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),f&5&&x(e,"btn-loading",a[2]),f&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,$e(r)}}}const bg="upload_backup";function O7(n,e,t){const i=lt();let{class:l=""}=e,s,o=!1;async function r(u){var d,m,h,_,g;if(o||!((m=(d=u==null?void 0:u.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",u.target.files[0]);try{await ae.backups.upload(c,{requestKey:bg}),t(2,o=!1),i("success"),Lt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ii(y.response.data.file.message):ae.error(y))}}vs(()=>{ae.cancelRequest(bg)});const a=()=>s==null?void 0:s.click();function f(u){ee[u?"unshift":"push"](()=>{s=u,t(1,s)})}return n.$$set=u=>{"class"in u&&t(0,l=u.class)},[l,s,o,r,a,f]}class M7 extends ge{constructor(e){super(),_e(this,e,O7,C7,me,{class:0})}}function D7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function E7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function kg(n){var H,W,G;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D;t=new ce({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[I7,({uniqueId:U})=>({31:U}),({uniqueId:U})=>[0,U?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&yg(n);function L(U){n[24](U)}function R(U){n[25](U)}function F(U){n[26](U)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(H=n[0].backups)==null?void 0:H.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new e0({props:N}),ee.push(()=>be(r,"config",L)),ee.push(()=>be(r,"isTesting",R)),ee.push(()=>be(r,"testError",F));let P=((G=(W=n[1].backups)==null?void 0:W.s3)==null?void 0:G.enabled)&&!n[9]&&!n[5]&&vg(n),q=n[9]&&wg(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),I&&I.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),h=M(),P&&P.c(),_=M(),q&&q.c(),g=M(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(U,Y){w(U,e,Y),z(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),z(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,O||(D=[J(y,"click",n[28]),J(e,"submit",Be(n[11]))],O=!0)},p(U,Y){var pe,Ne,He;const ie={};Y[0]&4|Y[1]&3&&(ie.$$scope={dirty:Y,ctx:U}),t.$set(ie),U[2]?I?(I.p(U,Y),Y[0]&4&&E(I,1)):(I=yg(U),I.c(),E(I,1),I.m(e,l)):I&&(le(),A(I,1,1,()=>{I=null}),se());const te={};Y[0]&1&&(te.originalConfig=(pe=U[0].backups)==null?void 0:pe.s3),!a&&Y[0]&2&&(a=!0,te.config=U[1].backups.s3,ke(()=>a=!1)),!f&&Y[0]&128&&(f=!0,te.isTesting=U[7],ke(()=>f=!1)),!u&&Y[0]&256&&(u=!0,te.testError=U[8],ke(()=>u=!1)),r.$set(te),(He=(Ne=U[1].backups)==null?void 0:Ne.s3)!=null&&He.enabled&&!U[9]&&!U[5]?P?P.p(U,Y):(P=vg(U),P.c(),P.m(d,_)):P&&(P.d(1),P=null),U[9]?q?q.p(U,Y):(q=wg(U),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||Y[0]&544&&T!==(T=!U[9]||U[5]))&&(y.disabled=T),(!C||Y[0]&32)&&x(y,"btn-loading",U[5])},i(U){C||(E(t.$$.fragment,U),E(I),E(r.$$.fragment,U),U&&Ke(()=>{C&&($||($=Fe(e,et,{duration:150},!0)),$.run(1))}),C=!0)},o(U){A(t.$$.fragment,U),A(I),A(r.$$.fragment,U),U&&($||($=Fe(e,et,{duration:150},!1)),$.run(0)),C=!1},d(U){U&&v(e),V(t),I&&I.d(),V(r),P&&P.d(),q&&q.d(),U&&$&&$.end(),O=!1,$e(D)}}}function I7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[17]),r=!0)},p(f,u){u[1]&1&&t!==(t=f[31])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&1&&o!==(o=f[31])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function yg(n){let e,t,i,l,s,o,r,a,f;return l=new ce({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[L7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[N7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function A7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[19]),J(i,"click",n[20]),J(s,"click",n[21]),J(r,"click",n[22])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function L7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[A7]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=K("Cron expression"),l=M(),s=b("input"),a=M(),f=b("div"),u=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=b("p"),T=K(`Supports numeric list, steps, ranges or + to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),z(f,s,null),k(i,u),w(y,c,S),w(y,d,S),z(m,d,null),h=!0,_||(g=J(d,"submit",Be(n[7])),_=!0)},p(y,S){(!h||S&2)&&se(r,y[1]);const T={};S&2&&(T.value=y[1]),f.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(f.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(f.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),V(f),V(m),_=!1,g()}}}function m7(n){let e,t,i,l;return{c(){e=b("h4"),t=K("Restore "),i=b("strong"),l=K(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&se(l,s[1])},d(s){s&&v(e)}}}function h7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=K("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&x(l,"btn-loading",f[4])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function _7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[h7],header:[m7],default:[p7]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function g7(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,f=null;function u(S){Zt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await re.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(f),T!=null&&T.isAbort||(t(4,a=!1),ii(((S=T.response)==null?void 0:S.message)||T.message))}}}vs(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ce.call(this,n,S)}function y(S){Ce.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,y]}class b7 extends ge{constructor(e){super(),_e(this,e,g7,_7,pe,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function pg(n,e,t){const i=n.slice();return i[22]=e[t],i}function mg(n,e,t){const i=n.slice();return i[19]=e[t],i}function k7(n){let e=[],t=new Map,i,l,s=fe(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _g(n,e){let t,i,l,s,o,r=e[22].key+"",a,f,u,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,O,D,I,L,R,F,N,P,q,H,W,G;function U(){return e[10](e[22])}function Y(){return e[11](e[22])}function me(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=K(r),u=M(),c=b("span"),d=K("("),h=K(m),_=K(")"),g=M(),y=b("div"),S=b("button"),T=b("i"),C=M(),O=b("button"),D=b("i"),L=M(),R=b("button"),F=b("i"),P=M(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",f=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=I=e[6][e[22].key],p(O,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,ce){w(ee,t,ce),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,O),k(O,D),k(y,L),k(y,R),k(R,F),k(t,P),H=!0,W||(G=[Se(Pe.call(null,S,"Download")),J(S,"click",Be(U)),Se(Pe.call(null,O,"Restore")),J(O,"click",Be(Y)),Se(Pe.call(null,R,"Delete")),J(R,"click",Be(me))],W=!0)},p(ee,ce){e=ee,(!H||ce&8)&&r!==(r=e[22].key+"")&&se(a,r),(!H||ce&8&&f!==(f=e[22].key))&&p(o,"title",f),(!H||ce&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&se(h,m),(!H||ce&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!H||ce&40)&&x(S,"btn-loading",e[5][e[22].key]),(!H||ce&72&&I!==(I=e[6][e[22].key]))&&(O.disabled=I),(!H||ce&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!H||ce&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ee){H||(ee&&Ke(()=>{H&&(q||(q=Fe(t,et,{duration:150},!0)),q.run(1))}),H=!0)},o(ee){ee&&(q||(q=Fe(t,et,{duration:150},!1)),q.run(0)),H=!1},d(ee){ee&&v(t),ee&&q&&q.end(),W=!1,$e(G)}}}function gg(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function v7(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function w7(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function S7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_;const g=[y7,k7],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?w7:v7}let $=T(n),C=$(n),O={};u=new c7({props:O}),n[14](u),u.$on("submit",n[15]);let D={};return d=new b7({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),f=M(),B(u.$$.fragment),c=M(),B(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,f,L),z(u,I,L),w(I,c,L),z(d,I,L),m=!0,h||(_=J(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(ie(),A(y[R],1,1,()=>{y[R]=null}),le(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};u.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(u.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(u.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(f),v(c)),y[i].d(),C.d(),n[14](null),V(u,I),n[16](null),V(d,I),h=!1,_()}}}function $7(n,e,t){let i,l,s=[],o=!1,r={},a={},f=!0;u(),h();async function u(){t(4,o=!0);try{t(3,s=await re.backups.getFullList()),s.sort((O,D)=>O.modifiedD.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(re.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const D=await re.getAdminFileToken(),I=re.backups.getDownloadUrl(D,O);j.download(I)}catch(D){D.isAbort||re.error(D)}delete r[O],t(5,r)}}function d(O){un(`Do you really want to delete ${O}?`,()=>m(O))}async function m(O){if(!a[O]){t(6,a[O]=!0,a);try{await re.backups.delete(O),j.removeByKey(s,"name",O),u(),Nt(`Successfully deleted ${O}.`)}catch(D){D.isAbort||re.error(D)}delete a[O],t(6,a)}}async function h(){var O;try{const D=await re.health.check({$autoCancel:!1}),I=f;t(7,f=((O=D==null?void 0:D.data)==null?void 0:O.canBackup)||!1),I!=f&&f&&u()}catch{}}zt(()=>{let O=setInterval(()=>{h()},3e3);return()=>{clearInterval(O)}});const _=O=>c(O.key),g=O=>l.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function T(O){te[O?"unshift":"push"](()=>{i=O,t(1,i)})}const $=()=>{u()};function C(O){te[O?"unshift":"push"](()=>{l=O,t(2,l)})}return[u,i,l,s,o,r,a,f,c,d,_,g,y,S,T,$,C]}class T7 extends ge{constructor(e){super(),_e(this,e,$7,S7,pe,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function C7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,f){w(a,e,f),k(e,t),w(a,l,f),w(a,s,f),n[5](s),o||(r=[Se(Pe.call(null,e,"Upload backup")),J(e,"click",n[4]),J(s,"change",n[3])],o=!0)},p(a,[f]){f&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),f&5&&x(e,"btn-loading",a[2]),f&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,$e(r)}}}const bg="upload_backup";function O7(n,e,t){const i=lt();let{class:l=""}=e,s,o=!1;async function r(u){var d,m,h,_,g;if(o||!((m=(d=u==null?void 0:u.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",u.target.files[0]);try{await re.backups.upload(c,{requestKey:bg}),t(2,o=!1),i("success"),Nt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ii(y.response.data.file.message):re.error(y))}}vs(()=>{re.cancelRequest(bg)});const a=()=>s==null?void 0:s.click();function f(u){te[u?"unshift":"push"](()=>{s=u,t(1,s)})}return n.$$set=u=>{"class"in u&&t(0,l=u.class)},[l,s,o,r,a,f]}class M7 extends ge{constructor(e){super(),_e(this,e,O7,C7,pe,{class:0})}}function D7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function E7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function kg(n){var H,W,G;let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D;t=new ue({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[I7,({uniqueId:U})=>({31:U}),({uniqueId:U})=>[0,U?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&yg(n);function L(U){n[24](U)}function R(U){n[25](U)}function F(U){n[26](U)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(H=n[0].backups)==null?void 0:H.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new e0({props:N}),te.push(()=>be(r,"config",L)),te.push(()=>be(r,"isTesting",R)),te.push(()=>be(r,"testError",F));let P=((G=(W=n[1].backups)==null?void 0:W.s3)==null?void 0:G.enabled)&&!n[9]&&!n[5]&&vg(n),q=n[9]&&wg(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),I&&I.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),h=M(),P&&P.c(),_=M(),q&&q.c(),g=M(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(U,Y){w(U,e,Y),z(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),z(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,O||(D=[J(y,"click",n[28]),J(e,"submit",Be(n[11]))],O=!0)},p(U,Y){var ce,Oe,He;const me={};Y[0]&4|Y[1]&3&&(me.$$scope={dirty:Y,ctx:U}),t.$set(me),U[2]?I?(I.p(U,Y),Y[0]&4&&E(I,1)):(I=yg(U),I.c(),E(I,1),I.m(e,l)):I&&(ie(),A(I,1,1,()=>{I=null}),le());const ee={};Y[0]&1&&(ee.originalConfig=(ce=U[0].backups)==null?void 0:ce.s3),!a&&Y[0]&2&&(a=!0,ee.config=U[1].backups.s3,ke(()=>a=!1)),!f&&Y[0]&128&&(f=!0,ee.isTesting=U[7],ke(()=>f=!1)),!u&&Y[0]&256&&(u=!0,ee.testError=U[8],ke(()=>u=!1)),r.$set(ee),(He=(Oe=U[1].backups)==null?void 0:Oe.s3)!=null&&He.enabled&&!U[9]&&!U[5]?P?P.p(U,Y):(P=vg(U),P.c(),P.m(d,_)):P&&(P.d(1),P=null),U[9]?q?q.p(U,Y):(q=wg(U),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||Y[0]&544&&T!==(T=!U[9]||U[5]))&&(y.disabled=T),(!C||Y[0]&32)&&x(y,"btn-loading",U[5])},i(U){C||(E(t.$$.fragment,U),E(I),E(r.$$.fragment,U),U&&Ke(()=>{C&&($||($=Fe(e,et,{duration:150},!0)),$.run(1))}),C=!0)},o(U){A(t.$$.fragment,U),A(I),A(r.$$.fragment,U),U&&($||($=Fe(e,et,{duration:150},!1)),$.run(0)),C=!1},d(U){U&&v(e),V(t),I&&I.d(),V(r),P&&P.d(),q&&q.d(),U&&$&&$.end(),O=!1,$e(D)}}}function I7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=K("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=J(e,"change",n[17]),r=!0)},p(f,u){u[1]&1&&t!==(t=f[31])&&p(e,"id",t),u[0]&4&&(e.checked=f[2]),u[1]&1&&o!==(o=f[31])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function yg(n){let e,t,i,l,s,o,r,a,f;return l=new ue({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[L7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),r=new ue({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[N7,({uniqueId:u})=>({31:u}),({uniqueId:u})=>[0,u?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ke(()=>{f&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function A7(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(u,c){w(u,e,c),w(u,t,c),w(u,i,c),w(u,l,c),w(u,s,c),w(u,o,c),w(u,r,c),a||(f=[J(e,"click",n[19]),J(i,"click",n[20]),J(s,"click",n[21]),J(r,"click",n[22])],a=!0)},p:Q,d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,$e(f)}}}function L7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[A7]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=K("Cron expression"),l=M(),s=b("input"),a=M(),f=b("div"),u=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),h=M(),B(_.$$.fragment),g=M(),y=b("div"),S=b("p"),T=K(`Supports numeric list, steps, ranges or `),$=b("span"),$.textContent="macros",C=K(`. `),O=b("br"),D=K(` - The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((N=(F=n[0])==null?void 0:F.backups)!=null&&N.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(u,"type","button"),p(u,"class","btn btn-sm btn-outline p-r-0"),p(f,"class","form-field-addon"),p($,"class","link-primary"),p(y,"class","help-block")},m(F,N){var P,q;w(F,e,N),k(e,t),w(F,l,N),w(F,s,N),re(s,n[1].backups.cron),w(F,a,N),w(F,f,N),k(f,u),k(u,c),k(u,d),k(u,m),k(u,h),z(_,u,null),w(F,g,N),w(F,y,N),k(y,S),k(S,T),k(S,$),k(S,C),k(S,O),k(S,D),I=!0,(q=(P=n[0])==null?void 0:P.backups)!=null&&q.cron||s.focus(),L||(R=[J(s,"input",n[18]),Se(Pe.call(null,$,`@yearly + The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((N=(F=n[0])==null?void 0:F.backups)!=null&&N.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(u,"type","button"),p(u,"class","btn btn-sm btn-outline p-r-0"),p(f,"class","form-field-addon"),p($,"class","link-primary"),p(y,"class","help-block")},m(F,N){var P,q;w(F,e,N),k(e,t),w(F,l,N),w(F,s,N),oe(s,n[1].backups.cron),w(F,a,N),w(F,f,N),k(f,u),k(u,c),k(u,d),k(u,m),k(u,h),z(_,u,null),w(F,g,N),w(F,y,N),k(y,S),k(S,T),k(S,$),k(S,C),k(S,O),k(S,D),I=!0,(q=(P=n[0])==null?void 0:P.backups)!=null&&q.cron||s.focus(),L||(R=[J(s,"input",n[18]),Se(Pe.call(null,$,`@yearly @annually @monthly @weekly @daily @midnight -@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&re(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function N7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),re(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&re(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vg(n){let e;function t(s,o){return s[7]?R7:s[8]?F7:P7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function P7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function F7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ct(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function R7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function q7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new M7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new T7({props:N}),n[15](y);function P(G,U){return G[6]?E7:D7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&kg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&oe(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=kg(G),W.c(),E(W,1),W.m(f,null)):W&&(le(),A(W,1,1,()=>{W=null}),se())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function j7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function H7(n,e,t){let i,l;We(n,It,U=>t(10,l=U)),xt(It,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await ae.settings.getAll()||{};y(U)}catch(U){ae.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await ae.settings.update(j.filterRedactedProps(r));await T(),y(U),Lt("Successfully saved application settings.")}catch(U){ae.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){ee[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class z7 extends ge{constructor(e){super(),_e(this,e,H7,j7,me,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],V7={"/login":At({component:zE,conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":At({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-CLtpG3X-.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-B5V9k9ND.js"),[],import.meta.url),conditions:Pt.concat([n=>!ae.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":At({component:aE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":At({component:r$,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":At({component:GE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":At({component:PE,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":At({component:RI,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":At({component:lA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":At({component:vA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":At({component:EA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":At({component:qA,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":At({component:l7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":At({component:z7,conditions:Pt.concat([n=>ae.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-B1PSZ-qj.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-B1PSZ-qj.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CQyCw5g4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CQyCw5g4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B4LDtp4c.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":At({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-B4LDtp4c.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-DFTUTq4C.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":At({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-tMl3bsYz.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":At({component:Lv,userData:{showAppSidebar:!1}})};function B7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Go}=i;return{delay:u,duration:Ct(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function Sg(n,e,t){const i=n.slice();return i[2]=e[t],i}function U7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Y7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function K7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $g(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?K7:O[2].type==="success"?Y7:O[2].type==="warning"?W7:U7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){C0(t),h(),Ng(t,m)},a(){h(),h=T0(t,m,B7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Rg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ma(t,fs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function J7(n){let e,t=[],i=new Map,l,s=ue(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J1(s)]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,me,{})}}function X7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&v(e)}}}function Q7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function x7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[Q7],header:[X7]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function eL(n,e,t){let i;We(n,Ua,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){ee[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Ub()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class tL extends ge{constructor(e){super(),_e(this,e,eL,x7,me,{})}}function Tg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(ln.call(null,t)),Se(ln.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(ln.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(ln.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function nL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(ln.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function Cg(n){let e,t,i;return t=new Ja({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function iL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Tg(n);o=new H0({props:{routes:V7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new G7({}),u=new tL({});let _=n[1]&&!n[2]&&Cg(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Tg(y),h.c(),E(h,1),h.m(i,l)):h&&(le(),A(h,1,1,()=>{h=null}),se()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=Cg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(le(),A(_,1,1,()=>{_=null}),se())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function lL(n,e,t){let i,l,s,o;We(n,Xi,_=>t(10,i=_)),We(n,Do,_=>t(3,l=_)),We(n,Oa,_=>t(0,s=_)),We(n,It,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(It,o="",o),Jt({}),Ub())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await ae.settings.getAll({$cancelKey:"initialAppSettings"});xt(Do,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ae.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class sL extends ge{constructor(e){super(),_e(this,e,lL,iL,me,{})}}new sL({target:document.getElementById("app")});export{$e as A,Lt as B,j as C,tl as D,ye as E,Q1 as F,Vo as G,oo as H,Ht as I,We as J,Rn as K,lt as L,ee as M,Hb as N,ue as O,at as P,Ai as Q,Et as R,ge as S,ot as T,v0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,le as k,ln as l,z as m,se as n,v as o,ae as p,ce as q,x as r,me as s,E as t,J as u,Be as v,K as w,oe as x,Q as y,re as z}; +@hourly`))],L=!0)},p(F,N){var q,H;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((H=(q=F[0])==null?void 0:q.backups)!=null&&H.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&oe(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(f),v(g),v(y)),V(_),L=!1,$e(R)}}}function N7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=K("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),oe(s,n[1].backups.cronMaxKeep),r||(a=J(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&it(s.value)!==f[1].backups.cronMaxKeep&&oe(s,f[1].backups.cronMaxKeep)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function vg(n){let e;function t(s,o){return s[7]?R7:s[8]?F7:P7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function P7(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function F7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=Se(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Mt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function R7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=J(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function q7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new M7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new T7({props:N}),n[15](y);function P(G,U){return G[6]?E7:D7}let q=P(n),H=q(n),W=n[6]&&!n[4]&&kg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=K(n[10]),r=M(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),h=M(),B(_.$$.fragment),g=M(),B(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),H.c(),I=M(),W&&W.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(u,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(G,U){w(G,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(G,r,U),w(G,a,U),k(a,f),k(f,u),k(u,c),k(u,d),z(m,u,null),k(u,h),z(_,u,null),k(f,g),z(y,f,null),k(f,S),k(f,T),k(f,$),k(f,C),k(C,O),k(C,D),H.m(C,null),k(f,I),W&&W.m(f,null),L=!0,R||(F=[J(C,"click",n[16]),J(f,"submit",Be(n[11]))],R=!0)},p(G,U){(!L||U[0]&1024)&&se(o,G[10]);const Y={};y.$set(Y),q!==(q=P(G))&&(H.d(1),H=q(G),H&&(H.c(),H.m(C,null))),(!L||U[0]&16)&&(C.disabled=G[4]),(!L||U[0]&16)&&x(C,"btn-loading",G[4]),G[6]&&!G[4]?W?(W.p(G,U),U[0]&80&&E(W,1)):(W=kg(G),W.c(),E(W,1),W.m(f,null)):W&&(ie(),A(W,1,1,()=>{W=null}),le())},i(G){L||(E(m.$$.fragment,G),E(_.$$.fragment,G),E(y.$$.fragment,G),E(W),L=!0)},o(G){A(m.$$.fragment,G),A(_.$$.fragment,G),A(y.$$.fragment,G),A(W),L=!1},d(G){G&&(v(e),v(r),v(a)),V(m),V(_),n[15](null),V(y),H.d(),W&&W.d(),R=!1,$e(F)}}}function j7(n){let e,t,i,l;return e=new _i({}),i=new bn({props:{$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function H7(n,e,t){let i,l;We(n,At,U=>t(10,l=U)),xt(At,l="Backups",l);let s,o={},r={},a=!1,f=!1,u="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const U=await re.settings.getAll()||{};y(U)}catch(U){re.error(U)}t(4,a=!1)}async function g(){if(!(f||!i)){t(5,f=!0);try{const U=await re.settings.update(j.filterRedactedProps(r));await T(),y(U),Nt("Successfully saved application settings.")}catch(U){re.error(U)}t(5,f=!1)}}function y(U={}){t(1,r={backups:(U==null?void 0:U.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(U){te[U?"unshift":"push"](()=>{s=U,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(U){n.$$.not_equal(r.backups.s3,U)&&(r.backups.s3=U,t(1,r),t(2,c))}function q(U){m=U,t(7,m)}function H(U){h=U,t(8,h)}const W=()=>S(),G=()=>g();return n.$$.update=()=>{var U;n.$$.dirty[0]&1&&t(14,u=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(U=r==null?void 0:r.backups)!=null&&U.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=u!=JSON.stringify(r))},[o,r,c,s,a,f,d,m,h,i,l,g,S,T,u,$,C,O,D,I,L,R,F,N,P,q,H,W,G]}class z7 extends ge{constructor(e){super(),_e(this,e,H7,j7,pe,{},null,[-1,-1])}}const Ft=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?tl("/"):!0}],V7={"/login":Lt({component:zE,conditions:Ft.concat([n=>!re.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Lt({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-BF8cSSXp.js"),[],import.meta.url),conditions:Ft.concat([n=>!re.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Lt({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-DZiKZ2vT.js"),[],import.meta.url),conditions:Ft.concat([n=>!re.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Lt({component:aE,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Lt({component:r$,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Lt({component:GE,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Lt({component:PE,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Lt({component:RI,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Lt({component:lA,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Lt({component:vA,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Lt({component:EA,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Lt({component:qA,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Lt({component:l7,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Lt({component:z7,conditions:Ft.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Lt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-DvKofdMx.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Lt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-DvKofdMx.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Lt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CjJgsihN.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Lt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-CjJgsihN.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Lt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-BzuoVpAs.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Lt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-BzuoVpAs.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Lt({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-BZv-iZYo.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Lt({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-DGb-fGnZ.js"),[],import.meta.url),conditions:Ft,userData:{showAppSidebar:!1}}),"*":Lt({component:Lv,userData:{showAppSidebar:!1}})};function B7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),f=e.top+e.height*r/t.height-(t.top+r),{delay:u=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Go}=i;return{delay:u,duration:Mt(c)?c(Math.sqrt(a*a+f*f)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*f,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function Sg(n,e,t){const i=n.slice();return i[2]=e[t],i}function U7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Y7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function K7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $g(n,e){let t,i,l,s,o=e[2].message+"",r,a,f,u,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?K7:O[2].type==="success"?Y7:O[2].type==="warning"?W7:U7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=K(o),a=M(),f=b("button"),f.innerHTML='',u=M(),p(i,"class","icon"),p(s,"class","content"),p(f,"type","button"),p(f,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,f),k(t,u),_=!0,g||(y=J(f,"click",Be(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&se(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){C0(t),h(),Ng(t,m)},a(){h(),h=T0(t,m,B7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=Rg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ma(t,fs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function J7(n){let e,t=[],i=new Map,l,s=fe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J1(s)]}class G7 extends ge{constructor(e){super(),_e(this,e,Z7,J7,pe,{})}}function X7(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=K(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&se(i,t)},d(s){s&&v(e)}}}function Q7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,f){w(a,e,f),k(e,t),w(a,i,f),w(a,l,f),k(l,s),e.focus(),o||(r=[J(e,"click",n[4]),J(l,"click",n[5])],o=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(l.disabled=a[2]),f&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,$e(r)}}}function x7(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[Q7],header:[X7]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function eL(n,e,t){let i;We(n,Ua,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function f(c){te[c?"unshift":"push"](()=>{l=c,t(0,l)})}const u=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Ub()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,f,u]}class tL extends ge{constructor(e){super(),_e(this,e,eL,x7,pe,{})}}function Tg(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),f=b("a"),f.innerHTML='',u=M(),c=b("div"),d=b("img"),h=M(),B(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(f,"href","/settings"),p(f,"class","menu-item"),p(f,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,f),k(e,u),k(e,c),k(c,d),k(c,h),z(_,c,null),g=!0,y||(S=[Se(ln.call(null,t)),Se(ln.call(null,s)),Se(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),Se(Pe.call(null,s,{text:"Collections",position:"right"})),Se(ln.call(null,r)),Se(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),Se(Pe.call(null,r,{text:"Logs",position:"right"})),Se(ln.call(null,f)),Se(Ln.call(null,f,{path:"/settings/?.*",className:"current-route"})),Se(Pe.call(null,f,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),V(_),y=!1,$e(S)}}}function nL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[Se(ln.call(null,e)),J(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,$e(r)}}}function Cg(n){let e,t,i;return t=new Ja({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function iL(n){var g;let e,t,i,l,s,o,r,a,f,u,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Tg(n);o=new H0({props:{routes:V7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new G7({}),u=new tL({});let _=n[1]&&!n[2]&&Cg(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),f=M(),B(u.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),z(o,s,null),k(s,r),z(a,s,null),w(y,f,S),z(u,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Tg(y),h.c(),E(h,1),h.m(i,l)):h&&(ie(),A(h,1,1,()=>{h=null}),le()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=Cg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(ie(),A(_,1,1,()=>{_=null}),le())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(u.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(u.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(f),v(c),v(d)),h&&h.d(),V(o),V(a),V(u,y),_&&_.d(y)}}}function lL(n,e,t){let i,l,s,o;We(n,Xi,_=>t(10,i=_)),We(n,Do,_=>t(3,l=_)),We(n,Oa,_=>t(0,s=_)),We(n,At,_=>t(4,o=_));let r,a=!1,f=!1;function u(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(At,o="",o),Zt({}),Ub())}function c(){tl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await re.settings.getAll({$cancelKey:"initialAppSettings"});xt(Do,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Xi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){re.logout()}const h=()=>{t(2,f=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,f,l,o,u,c,m,h]}class sL extends ge{constructor(e){super(),_e(this,e,lL,iL,pe,{})}}new sL({target:document.getElementById("app")});export{$e as A,Nt as B,j as C,tl as D,ye as E,Q1 as F,Vo as G,oo as H,zt as I,We as J,Rn as K,lt as L,te as M,Hb as N,fe as O,at as P,Ai as Q,It as R,ge as S,ot as T,v0 as U,A as a,M as b,B as c,V as d,b as e,p as f,w as g,k as h,_e as i,Se as j,ie as k,ln as l,z as m,le as n,v as o,re as p,ue as q,x as r,pe as s,E as t,J as u,Be as v,K as w,se as x,Q as y,oe as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 22db412ace..7ba12dfe5c 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -47,7 +47,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/src/components/settings/PageImportCollections.svelte b/ui/src/components/settings/PageImportCollections.svelte index 5564f48eec..dc705d97d7 100644 --- a/ui/src/components/settings/PageImportCollections.svelte +++ b/ui/src/components/settings/PageImportCollections.svelte @@ -430,7 +430,13 @@
    - + { + clear(); + loadOldCollections(); + }} +/>